@farm.js/core 0.1.71 → 0.1.73

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 (256) hide show
  1. package/dist/{agent-mcp-handler-VIT4GOSR.mjs → agent-mcp-handler-RK7LDYEL.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-VBCA3WZ6.cjs} +6 -6
  3. package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-D_gHjCAE.d.ts} +2 -2
  4. package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-PvEf-1mi.d.mts} +2 -2
  5. package/dist/agent-runtime.d.mts +4 -4
  6. package/dist/agent-runtime.d.ts +4 -4
  7. package/dist/{analyzer-VK3BAOFI.mjs → analyzer-MFYCJT75.mjs} +2 -2
  8. package/dist/analyzer-V5ZMRIIY.cjs +16 -0
  9. package/dist/api/node.d.mts +6 -6
  10. package/dist/api/node.d.ts +6 -6
  11. package/dist/api/route-manager.cjs +7 -6
  12. package/dist/api/route-manager.d.mts +8 -8
  13. package/dist/api/route-manager.d.ts +8 -8
  14. package/dist/api/route-manager.mjs +6 -5
  15. package/dist/api/runtime.d.mts +5 -5
  16. package/dist/api/runtime.d.ts +5 -5
  17. package/dist/api.cjs +8 -7
  18. package/dist/api.d.mts +9 -9
  19. package/dist/api.d.ts +9 -9
  20. package/dist/api.mjs +7 -6
  21. package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-BpVTg43i.d.ts} +1 -1
  22. package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-CN7cEWHX.d.mts} +1 -1
  23. package/dist/app-markdown.cjs +4 -4
  24. package/dist/app-markdown.d.mts +5 -5
  25. package/dist/app-markdown.d.ts +5 -5
  26. package/dist/app-markdown.mjs +3 -3
  27. package/dist/{app.d-D-5UNrFd.d.mts → app.d-BFWzAdTe.d.mts} +54 -6
  28. package/dist/{app.d-BeK6bb1c.d.ts → app.d-DO4PTCWm.d.ts} +54 -6
  29. package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
  30. package/dist/{chunk-IYDJNCR7.mjs → chunk-462MUII7.mjs} +10 -5
  31. package/dist/{chunk-MWUDEYBI.mjs → chunk-4CTCSKAF.mjs} +1 -1
  32. package/dist/{chunk-SXMWVP2L.cjs → chunk-4YHGQDTT.cjs} +12 -12
  33. package/dist/{chunk-YCNHUIPR.cjs → chunk-4Z3YLMSW.cjs} +10 -10
  34. package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
  35. package/dist/{chunk-O32QPFVV.cjs → chunk-5PDMBWAF.cjs} +5 -5
  36. package/dist/{chunk-IGXS54GC.mjs → chunk-6O6PAZZR.mjs} +1 -1
  37. package/dist/{chunk-LXEJNWF5.mjs → chunk-73K53YPP.mjs} +2 -2
  38. package/dist/{chunk-2CQC5CMD.mjs → chunk-7GMBETHM.mjs} +1 -1
  39. package/dist/{chunk-W2T6NDNP.mjs → chunk-B67CW2LM.mjs} +2 -2
  40. package/dist/{chunk-CSQPMV3Q.cjs → chunk-CLEWORVY.cjs} +6 -6
  41. package/dist/{chunk-KPJYBSHL.mjs → chunk-CPMME66W.mjs} +149 -22
  42. package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
  43. package/dist/{chunk-4OD2LXF2.mjs → chunk-CYRIIVD4.mjs} +26 -15
  44. package/dist/{chunk-DPIGYXSV.mjs → chunk-FRO4BB2T.mjs} +1 -1
  45. package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
  46. package/dist/{chunk-N3XO5AL5.cjs → chunk-GPO3LJDJ.cjs} +2 -2
  47. package/dist/{chunk-MITIAOUQ.mjs → chunk-GZOKWJIW.mjs} +4 -4
  48. package/dist/{chunk-NAXKOTPP.cjs → chunk-HFUOLILA.cjs} +21 -21
  49. package/dist/{chunk-C2JOS77Z.cjs → chunk-HGB4PM2C.cjs} +178 -51
  50. package/dist/{chunk-2IFT2CSA.cjs → chunk-HTXKSREF.cjs} +515 -151
  51. package/dist/{chunk-Z3GPAFIA.mjs → chunk-HY6IVQ54.mjs} +1 -1
  52. package/dist/{chunk-X7LGLF33.mjs → chunk-IBVN7SW5.mjs} +480 -116
  53. package/dist/{chunk-DPYBVVL3.cjs → chunk-ILQ5DKYF.cjs} +2 -2
  54. package/dist/{chunk-V25GSH43.mjs → chunk-IXZSBO76.mjs} +1 -1
  55. package/dist/{chunk-RJUCNO7R.mjs → chunk-JMOCMXTQ.mjs} +1 -1
  56. package/dist/{chunk-UISZLYKY.cjs → chunk-KDOZORJD.cjs} +52 -41
  57. package/dist/{chunk-PLXD2MJV.cjs → chunk-KTDG4THT.cjs} +2 -2
  58. package/dist/{chunk-L6E4SHUB.cjs → chunk-LGR7565L.cjs} +6 -6
  59. package/dist/chunk-LRPPXKCX.mjs +58 -0
  60. package/dist/{chunk-GUU3IZSM.mjs → chunk-MJEKMT6B.mjs} +324 -148
  61. package/dist/chunk-NDOE76QC.cjs +58 -0
  62. package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
  63. package/dist/{chunk-REP6HWJN.mjs → chunk-OBYM5S5G.mjs} +2 -2
  64. package/dist/{chunk-ZUVAGMQ5.cjs → chunk-ODBM54RT.cjs} +7 -7
  65. package/dist/{chunk-J5ASGNKF.mjs → chunk-OIP62QEL.mjs} +1 -1
  66. package/dist/{chunk-KEB7AGS6.cjs → chunk-OXNZUCHN.cjs} +16 -11
  67. package/dist/{chunk-2MR4MABG.cjs → chunk-PXAHSCR6.cjs} +58 -8
  68. package/dist/{chunk-7BUE2GM6.mjs → chunk-QGCSUC5O.mjs} +174 -81
  69. package/dist/{chunk-VXB5CMNC.cjs → chunk-QKEZLYON.cjs} +2 -2
  70. package/dist/{chunk-UQUOSNRN.mjs → chunk-REK6HZSU.mjs} +470 -267
  71. package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
  72. package/dist/{chunk-3BQ7QHUH.cjs → chunk-ROCF6UQD.cjs} +17 -8
  73. package/dist/{chunk-KQAB5LML.mjs → chunk-SUQACHER.mjs} +2 -2
  74. package/dist/{chunk-NA77GEIU.mjs → chunk-SVQX5HYW.mjs} +53 -3
  75. package/dist/{chunk-KWST2O22.cjs → chunk-TAU3OF5B.cjs} +611 -435
  76. package/dist/{chunk-ZPUAOKHV.cjs → chunk-TDCP3Z4T.cjs} +3 -3
  77. package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
  78. package/dist/{chunk-TP4RAV7Y.cjs → chunk-TU6VAH4V.cjs} +8 -8
  79. package/dist/{chunk-MEJCP2LX.cjs → chunk-UVQRMUAR.cjs} +1 -1
  80. package/dist/{chunk-JMFTKNBA.mjs → chunk-UVZMSRHF.mjs} +2 -2
  81. package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
  82. package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
  83. package/dist/{chunk-GF22VGMS.cjs → chunk-VPETSSWN.cjs} +2 -2
  84. package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
  85. package/dist/{chunk-AYVGD3PK.mjs → chunk-XI3OXOMK.mjs} +1 -1
  86. package/dist/{chunk-7OHJWFLB.cjs → chunk-XUSJVHHD.cjs} +466 -373
  87. package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
  88. package/dist/{chunk-JVA4PIYN.cjs → chunk-YZK64PZT.cjs} +635 -432
  89. package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
  90. package/dist/{chunk-QUFENL7Q.mjs → chunk-Z3IN6GEX.mjs} +16 -7
  91. package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
  92. package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
  93. package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-C71rMuHF.d.mts} +2 -2
  94. package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-sF-Znk0j.d.ts} +2 -2
  95. package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-B-Gd9mWR.d.mts} +5 -4
  96. package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-MFibjgBg.d.ts} +5 -4
  97. package/dist/client-plugins.d.mts +4 -4
  98. package/dist/client-plugins.d.ts +4 -4
  99. package/dist/client.cjs +1 -1
  100. package/dist/client.d.mts +9 -9
  101. package/dist/client.d.ts +9 -9
  102. package/dist/client.mjs +1 -1
  103. package/dist/config.d.mts +4 -4
  104. package/dist/config.d.ts +4 -4
  105. package/dist/desktop.d.mts +5 -5
  106. package/dist/desktop.d.ts +5 -5
  107. package/dist/{devtools-O5625KCK.cjs → devtools-6K4QXFRL.cjs} +7 -7
  108. package/dist/{devtools-6MXPFPNJ.mjs → devtools-TDIJ6HVC.mjs} +6 -6
  109. package/dist/docs.cjs +10 -10
  110. package/dist/docs.d.mts +5 -5
  111. package/dist/docs.d.ts +5 -5
  112. package/dist/docs.mjs +9 -9
  113. package/dist/environment/vite.cjs +3 -3
  114. package/dist/environment/vite.mjs +2 -2
  115. package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-BUxGJTsj.d.mts} +2 -2
  116. package/dist/{headers.d-DalIGbVO.d.ts → headers.d-uQ6BR59u.d.ts} +2 -2
  117. package/dist/i18n/client.cjs +3 -2
  118. package/dist/i18n/client.d.mts +2 -2
  119. package/dist/i18n/client.d.ts +2 -2
  120. package/dist/i18n/client.mjs +2 -1
  121. package/dist/i18n/index.cjs +3 -2
  122. package/dist/i18n/index.d.mts +3 -3
  123. package/dist/i18n/index.d.ts +3 -3
  124. package/dist/i18n/index.mjs +2 -1
  125. package/dist/i18n/server.cjs +6 -5
  126. package/dist/i18n/server.d.mts +5 -5
  127. package/dist/i18n/server.d.ts +5 -5
  128. package/dist/i18n/server.mjs +5 -4
  129. package/dist/index.cjs +32 -30
  130. package/dist/{index.d-BcA-secm.d.ts → index.d-BCGfxCXY.d.ts} +1 -1
  131. package/dist/{index.d-DDHHAv7j.d.mts → index.d-CuWOJ-un.d.mts} +1 -1
  132. package/dist/index.d.mts +24 -24
  133. package/dist/index.d.ts +24 -24
  134. package/dist/index.mjs +31 -29
  135. package/dist/integrations/orm.d.mts +4 -4
  136. package/dist/integrations/orm.d.ts +4 -4
  137. package/dist/integrations.d.mts +4 -4
  138. package/dist/integrations.d.ts +4 -4
  139. package/dist/internal/app-markdown-runtime.cjs +3 -3
  140. package/dist/internal/app-markdown-runtime.d.mts +5 -5
  141. package/dist/internal/app-markdown-runtime.d.ts +5 -5
  142. package/dist/internal/app-markdown-runtime.mjs +2 -2
  143. package/dist/internal/build-runtime.cjs +29 -29
  144. package/dist/internal/build-runtime.d.mts +6 -6
  145. package/dist/internal/build-runtime.d.ts +6 -6
  146. package/dist/internal/build-runtime.mjs +28 -28
  147. package/dist/internal/cli-runtime.cjs +12 -12
  148. package/dist/internal/cli-runtime.mjs +11 -11
  149. package/dist/internal/client-error-overlay.cjs +4 -4
  150. package/dist/internal/client-error-overlay.mjs +1 -1
  151. package/dist/internal/client-runtime.cjs +2 -2
  152. package/dist/internal/client-runtime.d.mts +7 -7
  153. package/dist/internal/client-runtime.d.ts +7 -7
  154. package/dist/internal/client-runtime.mjs +3 -3
  155. package/dist/internal/compression-runtime.d.mts +4 -4
  156. package/dist/internal/compression-runtime.d.ts +4 -4
  157. package/dist/internal/config-runtime.cjs +8 -8
  158. package/dist/internal/config-runtime.d.mts +7 -7
  159. package/dist/internal/config-runtime.d.ts +7 -7
  160. package/dist/internal/config-runtime.mjs +7 -7
  161. package/dist/internal/infra-analytics-runtime.cjs +10 -10
  162. package/dist/internal/infra-analytics-runtime.mjs +8 -8
  163. package/dist/internal/native-server-fns.cjs +4 -4
  164. package/dist/internal/native-server-fns.mjs +3 -3
  165. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  166. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  167. package/dist/internal/production-runtime.cjs +19 -19
  168. package/dist/internal/production-runtime.d.mts +37 -25
  169. package/dist/internal/production-runtime.d.ts +37 -25
  170. package/dist/internal/production-runtime.mjs +18 -18
  171. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  172. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  173. package/dist/markdown.cjs +2 -2
  174. package/dist/markdown.d.mts +4 -4
  175. package/dist/markdown.d.ts +4 -4
  176. package/dist/markdown.mjs +1 -1
  177. package/dist/middleware.cjs +3 -3
  178. package/dist/middleware.d.mts +5 -5
  179. package/dist/middleware.d.ts +5 -5
  180. package/dist/middleware.mjs +2 -2
  181. package/dist/mobile.d.mts +3 -3
  182. package/dist/mobile.d.ts +3 -3
  183. package/dist/{mount.d-C1PONsEe.d.mts → mount.d-BIYmcGGg.d.mts} +1 -1
  184. package/dist/{mount.d-D3JOux2V.d.ts → mount.d-q8k0cJV0.d.ts} +1 -1
  185. package/dist/{native-tree-L2IIEBXH.mjs → native-tree-OYGKP2NZ.mjs} +2 -2
  186. package/dist/{native-tree-GF4BH33L.cjs → native-tree-R6CQMDTI.cjs} +3 -3
  187. package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-Btfs6Uoa.d.ts} +1 -1
  188. package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-CYBUupsv.d.mts} +1 -1
  189. package/dist/navigation.d.mts +7 -7
  190. package/dist/navigation.d.ts +7 -7
  191. package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.mts} +27 -3
  192. package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.ts} +27 -3
  193. package/dist/observability.d.mts +1 -1
  194. package/dist/observability.d.ts +1 -1
  195. package/dist/plugin.cjs +21 -21
  196. package/dist/plugin.d.mts +7 -7
  197. package/dist/plugin.d.ts +7 -7
  198. package/dist/plugin.mjs +20 -20
  199. package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
  200. package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
  201. package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-0FHusf1D.d.ts} +1 -1
  202. package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-BlyxqKMu.d.mts} +1 -1
  203. package/dist/renderer-client.cjs +3 -2
  204. package/dist/renderer-client.d.mts +7 -7
  205. package/dist/renderer-client.d.ts +7 -7
  206. package/dist/renderer-client.mjs +2 -1
  207. package/dist/{request.d-DRUbOmYD.d.ts → request.d-CPdVjssg.d.ts} +1 -1
  208. package/dist/{request.d-D-F7o7tb.d.mts → request.d-CX-gks1l.d.mts} +1 -1
  209. package/dist/request.d.mts +5 -5
  210. package/dist/request.d.ts +5 -5
  211. package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
  212. package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
  213. package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-CcvZ_4N2.d.mts} +1 -1
  214. package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-DcOoSNoG.d.ts} +1 -1
  215. package/dist/{router.d-BYmDeDlp.d.mts → router.d-C8RHma4A.d.mts} +1 -1
  216. package/dist/{router.d-B6sesMRD.d.ts → router.d-D2QnK8cM.d.ts} +1 -1
  217. package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
  218. package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
  219. package/dist/routes.d.mts +4 -4
  220. package/dist/routes.d.ts +4 -4
  221. package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
  222. package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
  223. package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-LC2FBZAR.mjs} +7 -7
  224. package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-NTAM65NT.cjs} +8 -8
  225. package/dist/{runtime-DP5DYGW5.mjs → runtime-MWAC7NWR.mjs} +7 -7
  226. package/dist/{runtime-WA2Q4SLG.cjs → runtime-U4PAMTVH.cjs} +9 -9
  227. package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-1l_1bLrL.d.ts} +1 -1
  228. package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BQUHHq8M.d.mts} +1 -1
  229. package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
  230. package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
  231. package/dist/server-plugins.d.mts +6 -6
  232. package/dist/server-plugins.d.ts +6 -6
  233. package/dist/server.cjs +43 -41
  234. package/dist/server.d.mts +15 -15
  235. package/dist/server.d.ts +15 -15
  236. package/dist/server.mjs +26 -24
  237. package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-BJtXNeqo.d.ts} +3 -3
  238. package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BzPdi48R.d.mts} +3 -3
  239. package/dist/testing.cjs +6 -5
  240. package/dist/testing.d.mts +4 -4
  241. package/dist/testing.d.ts +4 -4
  242. package/dist/testing.mjs +6 -5
  243. package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
  244. package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
  245. package/dist/{utils.d-DxMzteqE.d.mts → utils.d-B4ZW-6z6.d.mts} +1 -1
  246. package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DquC6qxy.d.ts} +1 -1
  247. package/dist/version.cjs +2 -2
  248. package/dist/version.mjs +1 -1
  249. package/dist/vite.cjs +23 -21
  250. package/dist/vite.d.mts +18 -9
  251. package/dist/vite.d.ts +18 -9
  252. package/dist/vite.mjs +22 -20
  253. package/package.json +1 -1
  254. package/dist/analyzer-LPIVRSTJ.cjs +0 -16
  255. package/dist/chunk-V3UOEWCB.cjs +0 -46
  256. package/dist/chunk-VE3FWJBO.mjs +0 -46
@@ -9,7 +9,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
12
+ var _chunkCLEWORVYcjs = require('./chunk-CLEWORVY.cjs');
13
13
 
14
14
 
15
15
  var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
@@ -39,18 +39,21 @@ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
39
39
 
40
40
 
41
41
 
42
- var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
43
42
 
44
43
 
45
- var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
46
44
 
45
+ var _chunkPXAHSCR6cjs = require('./chunk-PXAHSCR6.cjs');
47
46
 
48
47
 
48
+ var _chunk4YHGQDTTcjs = require('./chunk-4YHGQDTT.cjs');
49
49
 
50
50
 
51
51
 
52
52
 
53
- var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
53
+
54
+
55
+
56
+ var _chunkTU6VAH4Vcjs = require('./chunk-TU6VAH4V.cjs');
54
57
 
55
58
 
56
59
 
@@ -76,7 +79,12 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
76
79
 
77
80
 
78
81
 
79
- var _chunk2IFT2CSAcjs = require('./chunk-2IFT2CSA.cjs');
82
+
83
+
84
+
85
+
86
+
87
+ var _chunkHTXKSREFcjs = require('./chunk-HTXKSREF.cjs');
80
88
 
81
89
 
82
90
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
@@ -103,7 +111,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
103
111
 
104
112
 
105
113
 
106
- var _chunkZUVAGMQ5cjs = require('./chunk-ZUVAGMQ5.cjs');
114
+ var _chunkODBM54RTcjs = require('./chunk-ODBM54RT.cjs');
107
115
 
108
116
 
109
117
 
@@ -113,7 +121,7 @@ var _chunkZUVAGMQ5cjs = require('./chunk-ZUVAGMQ5.cjs');
113
121
 
114
122
 
115
123
 
116
- var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
124
+ var _chunk5PDMBWAFcjs = require('./chunk-5PDMBWAF.cjs');
117
125
 
118
126
 
119
127
 
@@ -154,10 +162,10 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
154
162
 
155
163
 
156
164
 
157
- var _chunkN3XO5AL5cjs = require('./chunk-N3XO5AL5.cjs');
165
+ var _chunkGPO3LJDJcjs = require('./chunk-GPO3LJDJ.cjs');
158
166
 
159
167
 
160
- var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
168
+ var _chunkLGR7565Lcjs = require('./chunk-LGR7565L.cjs');
161
169
 
162
170
 
163
171
 
@@ -170,7 +178,7 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
170
178
 
171
179
 
172
180
 
173
- var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
181
+ var _chunkHGB4PM2Ccjs = require('./chunk-HGB4PM2C.cjs');
174
182
 
175
183
 
176
184
  var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
@@ -208,7 +216,7 @@ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
208
216
 
209
217
 
210
218
 
211
- var _chunk2AM26UGIcjs = require('./chunk-2AM26UGI.cjs');
219
+ var _chunkNLBK37HIcjs = require('./chunk-NLBK37HI.cjs');
212
220
 
213
221
 
214
222
 
@@ -243,7 +251,7 @@ var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
243
251
  var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
244
252
 
245
253
 
246
- var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
254
+ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
247
255
 
248
256
 
249
257
 
@@ -278,18 +286,14 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
278
286
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
279
287
 
280
288
 
281
- var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
282
-
283
-
284
-
285
- var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
289
+ var _chunkUVQRMUARcjs = require('./chunk-UVQRMUAR.cjs');
286
290
 
287
291
 
288
292
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
289
293
 
290
294
 
291
295
 
292
- var _chunkY2SZVIVHcjs = require('./chunk-Y2SZVIVH.cjs');
296
+ var _chunkGPICBTDVcjs = require('./chunk-GPICBTDV.cjs');
293
297
 
294
298
 
295
299
  var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
@@ -315,6 +319,10 @@ var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
315
319
  var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
316
320
 
317
321
 
322
+
323
+ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
324
+
325
+
318
326
  var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
319
327
 
320
328
 
@@ -445,6 +453,8 @@ function getRouteSpecificity(entry) {
445
453
  function compareRouteEntries(left, right) {
446
454
  return _chunkYTVSWXEZcjs.compareRouteSpecificity.call(void 0, getRouteSpecificity(left), getRouteSpecificity(right));
447
455
  }
456
+ var PLAN_SOURCE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
457
+ var NODE_MODULES_SEGMENT = `${path3.default.sep}node_modules${path3.default.sep}`;
448
458
  var RouteManager = class _RouteManager {
449
459
  constructor(config, viteServer) {
450
460
  this.routes = /* @__PURE__ */ new Map();
@@ -460,9 +470,17 @@ var RouteManager = class _RouteManager {
460
470
  this.redirects = /* @__PURE__ */ new Map();
461
471
  this.programmaticPages = /* @__PURE__ */ new Map();
462
472
  this.programmaticLayouts = /* @__PURE__ */ new Map();
463
- this.programmaticClientRoutes = _chunk2IFT2CSAcjs.mergeProgrammaticClientRoutes.call(void 0, []);
473
+ this.programmaticClientRoutes = _chunkHTXKSREFcjs.mergeProgrammaticClientRoutes.call(void 0, []);
464
474
  this.discovery = Promise.resolve();
465
475
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
476
+ // Each route module's hydration plan from the last plan, with the source files it read, so a dev
477
+ // replan recomputes only the modules that read an edited file. Every replan used to read and
478
+ // walk every route's import graph again, seconds on a large app, before an edit could update.
479
+ this.ownerPlans = /* @__PURE__ */ new Map();
480
+ this.sourceChangeTracking = false;
481
+ this.linkedSources = /* @__PURE__ */ new Map();
482
+ // Source files edited since the last plan; null when the next plan must recompute every module.
483
+ this.editedSources = null;
466
484
  this.config = config;
467
485
  this.viteServer = viteServer;
468
486
  if (viteServer) _chunkE7QOEV5Zcjs.trackProgrammaticRouteSources.call(void 0, );
@@ -509,7 +527,7 @@ var RouteManager = class _RouteManager {
509
527
  await this.discoverFileRoutes(source);
510
528
  await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
511
529
  }
512
- this.programmaticClientRoutes = _chunk2IFT2CSAcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
530
+ this.programmaticClientRoutes = _chunkHTXKSREFcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
513
531
  for (const slot of this.routeSlots.values()) {
514
532
  if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
515
533
  throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
@@ -528,8 +546,8 @@ var RouteManager = class _RouteManager {
528
546
  )
529
547
  );
530
548
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
531
- (left, right) => _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
532
- ).map((entry) => ({ entry, groupScope: _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
549
+ (left, right) => _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
550
+ ).map((entry) => ({ entry, groupScope: _chunkPXAHSCR6cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
533
551
  for (const slot of this.routeSlots.values()) {
534
552
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
535
553
  this.routeSlotOwnerSegments.set(
@@ -778,10 +796,88 @@ var RouteManager = class _RouteManager {
778
796
  return this.clientManifestCache.manifest;
779
797
  }
780
798
  const cacheFile = this.packageClientBoundaryCacheFile;
781
- return cacheFile ? _chunk2IFT2CSAcjs.runWithPackageClientBoundaryCacheFile.call(void 0,
782
- cacheFile,
783
- () => this.computeClientManifest(normalizedProjectRoot)
784
- ) : this.computeClientManifest(normalizedProjectRoot);
799
+ const compute = () => _chunkHTXKSREFcjs.withFarmSourceSnapshot.call(void 0,
800
+ () => this.computeClientManifest(normalizedProjectRoot),
801
+ this.sourceSnapshot
802
+ );
803
+ return cacheFile ? _chunkHTXKSREFcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
804
+ }
805
+ /**
806
+ * @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
807
+ * reuse the plan of each route module that read none of the edited files. Without tracking,
808
+ * every plan recomputes every module.
809
+ */
810
+ trackSourceChanges() {
811
+ this.sourceChangeTracking = true;
812
+ _nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkHTXKSREFcjs.FarmSourceSnapshotStore)())));
813
+ }
814
+ /**
815
+ * @internal A watched file changed. An edit to a script narrows the next replan to the route
816
+ * modules that read it; a script added or removed (where an import may now resolve), or a
817
+ * changed JSON file (a package manifest or tsconfig paths), replans everything. Other files
818
+ * (stylesheets, Markdown, assets) are not read by plans.
819
+ */
820
+ noteSourceChange(file, event) {
821
+ if (file.endsWith(".d.ts")) return;
822
+ if (PLAN_SOURCE.test(file)) {
823
+ if (event === "update") {
824
+ _optionalChain([this, 'access', _6 => _6.editedSources, 'optionalAccess', _7 => _7.add, 'call', _8 => _8(path3.default.resolve(file))]);
825
+ return;
826
+ }
827
+ } else if (!/\.jsonc?$/.test(file)) {
828
+ return;
829
+ }
830
+ this.editedSources = null;
831
+ _optionalChain([this, 'access', _9 => _9.sourceSnapshot, 'optionalAccess', _10 => _10.clear, 'call', _11 => _11()]);
832
+ this.linkedSources.clear();
833
+ }
834
+ /**
835
+ * @internal Whether an edit to `file` leaves the current plan as it is: a client module the
836
+ * last plan read whose directive, island and hydrate exports, export shape and imports the edit
837
+ * kept. The next replan reads it again (the watcher reported it).
838
+ */
839
+ isEditPlanNeutral(file) {
840
+ if (!this.sourceChangeTracking || !this.editedSources || !this.clientManifestCache) {
841
+ return false;
842
+ }
843
+ const previous = _optionalChain([this, 'access', _12 => _12.sourceSnapshot, 'optionalAccess', _13 => _13.peekSource, 'call', _14 => _14(path3.default.resolve(file))]);
844
+ return previous !== void 0 && _chunkHTXKSREFcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
845
+ }
846
+ /**
847
+ * A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
848
+ * Callers get a copy, since the route budget rewrites a plan's fields in place.
849
+ */
850
+ planRouteModule(key, edited, compute) {
851
+ const previous = this.ownerPlans.get(key);
852
+ if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
853
+ return { ...previous.plan };
854
+ }
855
+ const { result, files } = _chunkHTXKSREFcjs.traceFarmSourceReads.call(void 0, compute);
856
+ const sources = /* @__PURE__ */ new Set();
857
+ for (const file of files) {
858
+ const source = this.planSourcePath(file);
859
+ if (source) sources.add(source);
860
+ }
861
+ this.ownerPlans.set(key, { plan: result, files: sources });
862
+ return { ...result };
863
+ }
864
+ /**
865
+ * The path the watcher reports for a file a plan read: itself, or the real path of a workspace
866
+ * package's source read through its `node_modules` link. Null for an installed package's file.
867
+ */
868
+ planSourcePath(file) {
869
+ if (!file.includes(NODE_MODULES_SEGMENT)) return file;
870
+ let source = this.linkedSources.get(file);
871
+ if (source === void 0) {
872
+ try {
873
+ const real = _fs.realpathSync.call(void 0, file);
874
+ source = real.includes(NODE_MODULES_SEGMENT) ? null : real;
875
+ } catch (e) {
876
+ source = null;
877
+ }
878
+ this.linkedSources.set(file, source);
879
+ }
880
+ return source;
785
881
  }
786
882
  /**
787
883
  * @internal Keep package client-boundary inspections in `file` between plans, as the dev server
@@ -790,6 +886,15 @@ var RouteManager = class _RouteManager {
790
886
  usePackageClientBoundaryCacheFile(file) {
791
887
  this.packageClientBoundaryCacheFile = file;
792
888
  }
889
+ /**
890
+ * @internal Run `operation` (synchronous) with the package inspections of the latest plan, as
891
+ * the dev server's transforms and renders inspect the packages a module imports. Without a cache
892
+ * file (outside the dev server), it runs as it is.
893
+ */
894
+ inspectPackages(operation) {
895
+ const file = this.packageClientBoundaryCacheFile;
896
+ return file ? _chunkHTXKSREFcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
897
+ }
793
898
  computeClientManifest(normalizedProjectRoot) {
794
899
  const toUrlPath = (absolutePath) => {
795
900
  const rootRelative = _chunkQMNWKQL4cjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
@@ -806,79 +911,102 @@ var RouteManager = class _RouteManager {
806
911
  const unsupportedIntegrationProvider = integrationProviders.find(
807
912
  (provider) => provider.supportsIsolatedHydration !== true
808
913
  );
809
- if (_optionalChain([this, 'access', _6 => _6.config, 'access', _7 => _7.experimental, 'optionalAccess', _8 => _8.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _9 => _9.config, 'access', _10 => _10.experimental, 'optionalAccess', _11 => _11.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
914
+ if (_optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
810
915
  _chunkQMNWKQL4cjs.logger.warn(
811
916
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
812
917
  );
813
918
  }
814
- const isolatedMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
815
- _optionalChain([this, 'access', _12 => _12.config, 'access', _13 => _13.experimental, 'optionalAccess', _14 => _14.isolatedClientHydration]),
919
+ const isolatedMode = _chunkHTXKSREFcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
920
+ _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]),
816
921
  {
817
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
922
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) === "rsc",
818
923
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
819
924
  }
820
925
  );
821
- const planOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
926
+ const planOptions = _chunkHTXKSREFcjs.getFarmClientHydrationPlanOptions.call(void 0,
822
927
  this.config.renderer,
823
928
  Boolean(unsupportedIntegrationProvider)
824
929
  );
825
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
930
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.serverComponents])) === "islands";
931
+ const changed = _optionalChain([this, 'access', _30 => _30.sourceSnapshot, 'optionalAccess', _31 => _31.refresh, 'call', _32 => _32(_nullishCoalesce(this.editedSources, () => ( [])))]);
932
+ let edited = null;
933
+ if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
934
+ edited = /* @__PURE__ */ new Set();
935
+ for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
936
+ if (_chunkHTXKSREFcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
937
+ const source = this.planSourcePath(file);
938
+ if (source) edited.add(source);
939
+ }
940
+ }
941
+ if (!edited) this.ownerPlans.clear();
826
942
  const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
827
943
  entry,
828
- metadata: _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0,
829
- entry.modulePath,
830
- normalizedProjectRoot,
831
- isolatedMode,
832
- islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
944
+ metadata: this.planRouteModule(
945
+ `layout:${entry.modulePath}`,
946
+ edited,
947
+ () => _chunkHTXKSREFcjs.getClientModuleHydrationPlan.call(void 0,
948
+ entry.modulePath,
949
+ normalizedProjectRoot,
950
+ isolatedMode,
951
+ islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
952
+ )
833
953
  )
834
954
  }));
835
- const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
955
+ const markdownComponentsPlan = _chunkHTXKSREFcjs.createMarkdownPageHydrationPlanner.call(void 0,
836
956
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
837
957
  normalizedProjectRoot,
838
958
  isolatedMode,
839
959
  { ...planOptions, packageReferences: islandsMode }
840
960
  );
961
+ let markdownPlan;
962
+ const markdownPagePlan = () => ({
963
+ ..._nullishCoalesce(markdownPlan, () => ( (markdownPlan = this.planRouteModule("markdown", edited, markdownComponentsPlan))))
964
+ });
841
965
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
842
966
  entry,
843
- metadata: _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
844
- ...planOptions,
845
- serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
846
- })
967
+ metadata: _chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
968
+ `page:${entry.modulePath}`,
969
+ edited,
970
+ () => _chunkHTXKSREFcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
971
+ ...planOptions,
972
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _33 => _33.config, 'access', _34 => _34.experimental, 'optionalAccess', _35 => _35.serverComponents])) === "islands"
973
+ })
974
+ )
847
975
  }));
848
976
  const markdownFallback = routeEntries.find(
849
- ({ entry, metadata }) => _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
977
+ ({ entry, metadata }) => _chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
850
978
  );
851
979
  if (markdownFallback) {
852
980
  _chunkQMNWKQL4cjs.logger.warn(
853
981
  `[Farm.js] client components in Markdown pages stay static: ${markdownFallback.metadata.fallbackReason}.`
854
982
  );
855
983
  }
856
- const markdownStaticPackages = _optionalChain([routeEntries, 'access', _24 => _24.find, 'call', _25 => _25(
857
- ({ entry, metadata }) => _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
858
- ), 'optionalAccess', _26 => _26.metadata, 'access', _27 => _27.staticPackageBoundaries]);
984
+ const markdownStaticPackages = _optionalChain([routeEntries, 'access', _36 => _36.find, 'call', _37 => _37(
985
+ ({ entry, metadata }) => _chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
986
+ ), 'optionalAccess', _38 => _38.metadata, 'access', _39 => _39.staticPackageBoundaries]);
859
987
  if (markdownStaticPackages) {
860
988
  _chunkQMNWKQL4cjs.logger.info(
861
989
  `[Farm.js] Markdown pages render client components from ${markdownStaticPackages.join(", ")} as static HTML: package client components cannot be isolated yet.`
862
990
  );
863
991
  }
864
992
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
865
- if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
993
+ if (_chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
866
994
  _chunkQMNWKQL4cjs.logger.info(
867
995
  `[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
868
996
  );
869
997
  }
870
- _chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
998
+ _chunkHTXKSREFcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
871
999
  layoutEntries.map(({ entry, metadata }) => ({
872
1000
  pattern: entry.pattern,
873
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
1001
+ depth: _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
874
1002
  metadata
875
1003
  })),
876
1004
  routeEntries.map(({ entry, metadata }) => ({
877
1005
  pattern: getRouteEntryDirectory(entry),
878
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
1006
+ depth: _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
879
1007
  metadata
880
1008
  })),
881
- _chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
1009
+ _chunkPXAHSCR6cjs.routeBoundaryCoversDirectory,
882
1010
  { serverOwners: islandsMode }
883
1011
  );
884
1012
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
@@ -898,7 +1026,7 @@ var RouteManager = class _RouteManager {
898
1026
  const routes = routeEntries.map(({ entry, metadata }) => {
899
1027
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
900
1028
  const layoutShouldHydrate = layoutEntries.some(
901
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk2MR4MABGcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
1029
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkPXAHSCR6cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
902
1030
  );
903
1031
  return {
904
1032
  pattern: entry.pattern,
@@ -914,15 +1042,15 @@ var RouteManager = class _RouteManager {
914
1042
  modulePath: toUrlPath(boundary.modulePath)
915
1043
  }))
916
1044
  } : {},
917
- ..._chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
918
- renderPlan: _chunk2MR4MABGcjs.createFarmRouteRenderPlan.call(void 0, {
1045
+ ..._chunkHTXKSREFcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
1046
+ renderPlan: _chunkPXAHSCR6cjs.createFarmRouteRenderPlan.call(void 0, {
919
1047
  pageShouldHydrate: metadata.shouldHydrate,
920
1048
  layoutShouldHydrate,
921
1049
  islandStrategy: metadata.islandStrategy
922
1050
  }),
923
1051
  suppressedAsyncHydration: metadata.suppressedAsyncHydration,
924
1052
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {},
925
- search: _chunkE7QOEV5Zcjs.getProgrammaticRouteSearchClientOptions.call(void 0, _optionalChain([programmaticPage, 'optionalAccess', _28 => _28.search])),
1053
+ search: _chunkE7QOEV5Zcjs.getProgrammaticRouteSearchClientOptions.call(void 0, _optionalChain([programmaticPage, 'optionalAccess', _40 => _40.search])),
926
1054
  segments: entry.route.segments.map((seg) => ({
927
1055
  segment: seg.segment,
928
1056
  isDynamic: seg.isDynamic,
@@ -931,7 +1059,7 @@ var RouteManager = class _RouteManager {
931
1059
  }))
932
1060
  };
933
1061
  });
934
- const treeLayoutPatterns = islandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
1062
+ const treeLayoutPatterns = islandsMode ? _chunkPXAHSCR6cjs.getFarmServerTreeLayoutPatterns.call(void 0,
935
1063
  layoutEntries.map(({ entry, metadata }) => ({
936
1064
  pattern: entry.pattern,
937
1065
  shouldHydrate: metadata.shouldHydrate,
@@ -956,7 +1084,7 @@ var RouteManager = class _RouteManager {
956
1084
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
957
1085
  }));
958
1086
  const slots = Array.from(this.routeSlots.values()).map((entry) => {
959
- const metadata = _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
1087
+ const metadata = _chunkHTXKSREFcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
960
1088
  return {
961
1089
  name: entry.name,
962
1090
  ownerPattern: entry.ownerPattern,
@@ -972,7 +1100,7 @@ var RouteManager = class _RouteManager {
972
1100
  };
973
1101
  });
974
1102
  const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
975
- metadata: _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0,
1103
+ metadata: _chunkHTXKSREFcjs.getClientModuleHydrationPlan.call(void 0,
976
1104
  entry.modulePath,
977
1105
  normalizedProjectRoot,
978
1106
  isolatedMode,
@@ -1000,6 +1128,7 @@ var RouteManager = class _RouteManager {
1000
1128
  _chunkQMNWKQL4cjs.logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
1001
1129
  }
1002
1130
  const manifest = { routes, layouts, slots };
1131
+ this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
1003
1132
  this.clientManifestCache = {
1004
1133
  projectRoot: normalizedProjectRoot,
1005
1134
  manifest,
@@ -1036,7 +1165,7 @@ var RouteManager = class _RouteManager {
1036
1165
  getIsolatedClientBoundaryModules(projectRoot = this.config.root) {
1037
1166
  const normalizedProjectRoot = path3.default.resolve(projectRoot);
1038
1167
  this.generateClientManifest(normalizedProjectRoot);
1039
- return _nullishCoalesce(_optionalChain([this, 'access', _29 => _29.clientManifestCache, 'optionalAccess', _30 => _30.isolatedClientBoundaryModules]), () => ( /* @__PURE__ */ new Set()));
1168
+ return _nullishCoalesce(_optionalChain([this, 'access', _41 => _41.clientManifestCache, 'optionalAccess', _42 => _42.isolatedClientBoundaryModules]), () => ( /* @__PURE__ */ new Set()));
1040
1169
  }
1041
1170
  /**
1042
1171
  * @internal Islands-mode pages with a client component that cannot become an island. Hydrating
@@ -1044,7 +1173,7 @@ var RouteManager = class _RouteManager {
1044
1173
  */
1045
1174
  getIslandsErrors(projectRoot = this.config.root) {
1046
1175
  this.generateClientManifest(path3.default.resolve(projectRoot));
1047
- return _nullishCoalesce(_optionalChain([this, 'access', _31 => _31.clientManifestCache, 'optionalAccess', _32 => _32.islandsErrors]), () => ( []));
1176
+ return _nullishCoalesce(_optionalChain([this, 'access', _43 => _43.clientManifestCache, 'optionalAccess', _44 => _44.islandsErrors]), () => ( []));
1048
1177
  }
1049
1178
  /**
1050
1179
  * Invalidate build-time route metadata after a page or layout changes in dev.
@@ -1063,12 +1192,12 @@ var RouteManager = class _RouteManager {
1063
1192
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
1064
1193
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
1065
1194
  }
1066
- if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1195
+ if (_chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1067
1196
  const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
1068
1197
  const viteServer = this.viteServer;
1069
- return await _chunkN3XO5AL5cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1198
+ return await _chunkGPO3LJDJcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1070
1199
  // Loaded on render: the route runtime manifest only reads metadata and rendering config.
1071
- components: () => _chunkN3XO5AL5cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1200
+ components: () => _chunkGPO3LJDJcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1072
1201
  root: this.config.root,
1073
1202
  loadModule: viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
1074
1203
  }),
@@ -1120,7 +1249,7 @@ var RouteManager = class _RouteManager {
1120
1249
  */
1121
1250
  createRoutePattern(route) {
1122
1251
  if (route.segments.length === 0) return "/";
1123
- return "/" + route.segments.map(_chunk2MR4MABGcjs.formatRouteSegment).join("/");
1252
+ return "/" + route.segments.map(_chunkPXAHSCR6cjs.formatRouteSegment).join("/");
1124
1253
  }
1125
1254
  registerPageRoute(entry) {
1126
1255
  _chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -1171,8 +1300,8 @@ var RouteManager = class _RouteManager {
1171
1300
  }
1172
1301
  }
1173
1302
  for (const [pattern, group] of canonicalPageGroups) {
1174
- const componentFiles = group.files.filter((file) => !_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, file));
1175
- const markdownFiles = group.files.filter(_chunkL6E4SHUBcjs.isFarmMarkdownPageFile);
1303
+ const componentFiles = group.files.filter((file) => !_chunkLGR7565Lcjs.isFarmMarkdownPageFile.call(void 0, file));
1304
+ const markdownFiles = group.files.filter(_chunkLGR7565Lcjs.isFarmMarkdownPageFile);
1176
1305
  if (componentFiles.length > 1) {
1177
1306
  throw new Error(
1178
1307
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
@@ -1189,7 +1318,7 @@ var RouteManager = class _RouteManager {
1189
1318
  if (!primaryFile) continue;
1190
1319
  const modulePath = path3.default.join(appDir, primaryFile);
1191
1320
  const existing = this.routes.get(pattern);
1192
- if (_optionalChain([existing, 'optionalAccess', _33 => _33.sourceRoot]) === source.root) {
1321
+ if (_optionalChain([existing, 'optionalAccess', _45 => _45.sourceRoot]) === source.root) {
1193
1322
  throw new Error(
1194
1323
  `Duplicate page route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1195
1324
  );
@@ -1214,9 +1343,9 @@ var RouteManager = class _RouteManager {
1214
1343
  for (const file of files) {
1215
1344
  const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1216
1345
  const modulePath = path3.default.join(appDir, file);
1217
- const pattern = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
1346
+ const pattern = _chunkPXAHSCR6cjs.createRouteDirectoryPattern.call(void 0, route);
1218
1347
  const existing = target.get(pattern);
1219
- if (_optionalChain([existing, 'optionalAccess', _34 => _34.sourceRoot]) === source.root) {
1348
+ if (_optionalChain([existing, 'optionalAccess', _46 => _46.sourceRoot]) === source.root) {
1220
1349
  throw new Error(
1221
1350
  `Duplicate ${kind} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1222
1351
  );
@@ -1236,10 +1365,10 @@ var RouteManager = class _RouteManager {
1236
1365
  const modulePath = path3.default.join(appDir, file);
1237
1366
  const pattern = this.createRoutePattern(slot.route);
1238
1367
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
1239
- const ownerDirectory = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1368
+ const ownerDirectory = _chunkPXAHSCR6cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1240
1369
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
1241
1370
  const existing = this.routeSlots.get(key);
1242
- if (_optionalChain([existing, 'optionalAccess', _35 => _35.sourceRoot]) === source.root) {
1371
+ if (_optionalChain([existing, 'optionalAccess', _47 => _47.sourceRoot]) === source.root) {
1243
1372
  throw new Error(
1244
1373
  `Duplicate route slot "${slot.name}" for "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1245
1374
  );
@@ -1268,7 +1397,7 @@ var RouteManager = class _RouteManager {
1268
1397
  const key = `${kind}:${pattern}`;
1269
1398
  const existing = this.metadataImages.get(key);
1270
1399
  const sourceType = isStaticMetadataImageFile(file) ? "static" : "module";
1271
- if (_optionalChain([existing, 'optionalAccess', _36 => _36.sourceRoot]) === source.root) {
1400
+ if (_optionalChain([existing, 'optionalAccess', _48 => _48.sourceRoot]) === source.root) {
1272
1401
  throw new Error(
1273
1402
  `Duplicate ${fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one static image or module per route segment.`
1274
1403
  );
@@ -1296,7 +1425,7 @@ var RouteManager = class _RouteManager {
1296
1425
  const pattern = this.createRoutePattern(route);
1297
1426
  const key = `${descriptor.kind}:${pattern}`;
1298
1427
  const existing = this.metadataRoutes.get(key);
1299
- if (_optionalChain([existing, 'optionalAccess', _37 => _37.sourceRoot]) === source.root) {
1428
+ if (_optionalChain([existing, 'optionalAccess', _49 => _49.sourceRoot]) === source.root) {
1300
1429
  throw new Error(
1301
1430
  `Duplicate ${descriptor.fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one .ts or .js metadata route per segment.`
1302
1431
  );
@@ -1318,11 +1447,11 @@ var RouteManager = class _RouteManager {
1318
1447
  srcDir: source.srcDir,
1319
1448
  loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
1320
1449
  });
1321
- const graph = this.viteServer ? _chunk2IFT2CSAcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1450
+ const graph = this.viteServer ? _chunkHTXKSREFcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1322
1451
  for (const { filePath, manifest } of manifests) {
1323
1452
  if (graph) {
1324
1453
  clientRoutes.push(
1325
- _chunk2IFT2CSAcjs.resolveProgrammaticClientRoutes.call(void 0, {
1454
+ _chunkHTXKSREFcjs.resolveProgrammaticClientRoutes.call(void 0, {
1326
1455
  graph,
1327
1456
  routesFile: toRealPath(filePath),
1328
1457
  routes: manifest.routes,
@@ -1335,7 +1464,7 @@ var RouteManager = class _RouteManager {
1335
1464
  const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
1336
1465
  const pattern = this.createRoutePattern(route);
1337
1466
  const existing = this.routes.get(pattern);
1338
- if (_optionalChain([existing, 'optionalAccess', _38 => _38.sourceRoot]) === source.root) {
1467
+ if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
1339
1468
  throw new Error(
1340
1469
  `Duplicate page route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
1341
1470
  );
@@ -1353,9 +1482,9 @@ var RouteManager = class _RouteManager {
1353
1482
  }
1354
1483
  if (definition.kind === "layout") {
1355
1484
  const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
1356
- const pattern = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
1485
+ const pattern = _chunkPXAHSCR6cjs.createRouteDirectoryPattern.call(void 0, route);
1357
1486
  const existing = this.layouts.get(pattern);
1358
- if (_optionalChain([existing, 'optionalAccess', _39 => _39.sourceRoot]) === source.root) {
1487
+ if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
1359
1488
  throw new Error(
1360
1489
  `Duplicate layout route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
1361
1490
  );
@@ -1384,7 +1513,7 @@ var RouteManager = class _RouteManager {
1384
1513
  }
1385
1514
  async loadProgrammaticRoutesModule(filePath) {
1386
1515
  if (this.viteServer) {
1387
- const viteRoot = _optionalChain([this, 'access', _40 => _40.viteServer, 'access', _41 => _41.config, 'optionalAccess', _42 => _42.root]) || this.config.root || process.cwd();
1516
+ const viteRoot = _optionalChain([this, 'access', _52 => _52.viteServer, 'access', _53 => _53.config, 'optionalAccess', _54 => _54.root]) || this.config.root || process.cwd();
1388
1517
  return await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, filePath, viteRoot));
1389
1518
  }
1390
1519
  return await import(
@@ -1400,7 +1529,7 @@ var RouteManager = class _RouteManager {
1400
1529
  const matchingLayouts = [];
1401
1530
  for (const { entry, groupScope } of this.orderedLayouts) {
1402
1531
  if (!_chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
1403
- if (groupScope !== null && !_chunk2MR4MABGcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1532
+ if (groupScope !== null && !_chunkPXAHSCR6cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1404
1533
  continue;
1405
1534
  }
1406
1535
  matchingLayouts.push(entry);
@@ -1481,14 +1610,14 @@ var RouteManager = class _RouteManager {
1481
1610
  let page = route;
1482
1611
  for (const boundaryEntry of boundaries.values()) {
1483
1612
  if (!_chunkQMNWKQL4cjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
1484
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1613
+ const groupScope = _chunkPXAHSCR6cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1485
1614
  if (groupScope !== null) {
1486
1615
  if (page === void 0) page = this.matchPageRoute(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath));
1487
- if (!_chunk2MR4MABGcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1616
+ if (!_chunkPXAHSCR6cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1488
1617
  }
1489
1618
  const depth = boundaryEntry.route.segments.length;
1490
- const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _43 => _43.route, 'access', _44 => _44.segments, 'access', _45 => _45.length]), () => ( -1));
1491
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1619
+ const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _55 => _55.route, 'access', _56 => _56.segments, 'access', _57 => _57.length]), () => ( -1));
1620
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkPXAHSCR6cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1492
1621
  bestMatch = boundaryEntry;
1493
1622
  }
1494
1623
  }
@@ -1538,7 +1667,7 @@ var RouteManager = class _RouteManager {
1538
1667
  }));
1539
1668
  const i18n = this.getI18nConfig();
1540
1669
  const docsAdapterRoutes = this.getDocsAdapterRoutes();
1541
- const result = await _chunkCSQPMV3Qcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1670
+ const result = await _chunkCLEWORVYcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1542
1671
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
1543
1672
  ...docsAdapterRoutes ? { docsAdapterRoutes } : {}
1544
1673
  });
@@ -1585,9 +1714,9 @@ var RouteManager = class _RouteManager {
1585
1714
  async isRouteSSG(modulePath) {
1586
1715
  try {
1587
1716
  const mod = await this.loadRouteModule(modulePath);
1588
- const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1717
+ const rendering = await _chunkCLEWORVYcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1589
1718
  return rendering.ssg;
1590
- } catch (e) {
1719
+ } catch (e2) {
1591
1720
  return false;
1592
1721
  }
1593
1722
  }
@@ -1597,9 +1726,9 @@ var RouteManager = class _RouteManager {
1597
1726
  async hasRouteISR(modulePath) {
1598
1727
  try {
1599
1728
  const mod = await this.loadRouteModule(modulePath);
1600
- const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1729
+ const rendering = await _chunkCLEWORVYcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1601
1730
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
1602
- } catch (e2) {
1731
+ } catch (e3) {
1603
1732
  return false;
1604
1733
  }
1605
1734
  }
@@ -1609,15 +1738,15 @@ var RouteManager = class _RouteManager {
1609
1738
  async getRouteRevalidateInterval(modulePath) {
1610
1739
  try {
1611
1740
  const mod = await this.loadRouteModule(modulePath);
1612
- const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1741
+ const rendering = await _chunkCLEWORVYcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1613
1742
  return rendering.revalidate;
1614
- } catch (e3) {
1743
+ } catch (e4) {
1615
1744
  return void 0;
1616
1745
  }
1617
1746
  }
1618
1747
  };
1619
1748
  function getPageDirectoryField(route, pattern) {
1620
- const directory = _chunk2MR4MABGcjs.createRouteDirectoryPattern.call(void 0, route);
1749
+ const directory = _chunkPXAHSCR6cjs.createRouteDirectoryPattern.call(void 0, route);
1621
1750
  return directory === pattern ? {} : { directory };
1622
1751
  }
1623
1752
  function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
@@ -1697,18 +1826,70 @@ function replaceAll(input, search, replacement) {
1697
1826
  async function safeGlobFiles(pattern, cwd) {
1698
1827
  try {
1699
1828
  return await _chunkQMNWKQL4cjs.globFiles.call(void 0, pattern, cwd);
1700
- } catch (e4) {
1829
+ } catch (e5) {
1701
1830
  return [];
1702
1831
  }
1703
1832
  }
1704
1833
  function toRealPath(filePath) {
1705
1834
  try {
1706
1835
  return _fs.realpathSync.call(void 0, filePath);
1707
- } catch (e5) {
1836
+ } catch (e6) {
1708
1837
  return filePath;
1709
1838
  }
1710
1839
  }
1711
1840
 
1841
+ // src/server/dev-client-manifest.ts
1842
+ var FARM_DEV_CLIENT_MANIFEST_MODULE = "/@farm/manifest";
1843
+ function createFarmDevClientManifest(manifest, options) {
1844
+ const { boot } = options;
1845
+ const layoutPatterns = boot ? new Set(boot.layoutPatterns) : void 0;
1846
+ const owners = boot ? /* @__PURE__ */ new Set([...boot.routePattern ? [boot.routePattern] : [], ...boot.layoutPatterns]) : void 0;
1847
+ const clientManifest = {
1848
+ clientEntry: "/@farm/client.js",
1849
+ routes: {},
1850
+ layouts: {},
1851
+ slots: [],
1852
+ sharedAssets: options.sharedAssets,
1853
+ ...boot ? { module: FARM_DEV_CLIENT_MANIFEST_MODULE } : {}
1854
+ };
1855
+ for (const route of manifest.routes) {
1856
+ if (boot && route.pattern !== boot.routePattern && !route.search) continue;
1857
+ clientManifest.routes[route.pattern] = {
1858
+ modulePath: route.modulePath,
1859
+ pattern: route.pattern,
1860
+ ...route.directory ? { directory: route.directory } : {},
1861
+ segments: route.segments,
1862
+ search: route.search,
1863
+ isClientComponent: route.isClientComponent,
1864
+ shouldHydrate: route.shouldHydrate,
1865
+ islandStrategy: route.islandStrategy,
1866
+ renderPlan: route.renderPlan,
1867
+ preloads: [route.modulePath],
1868
+ assets: []
1869
+ };
1870
+ }
1871
+ for (const layout of manifest.layouts) {
1872
+ if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
1873
+ const groupScope = _chunkPXAHSCR6cjs.getRouteGroupScope.call(void 0, layout.pattern);
1874
+ clientManifest.layouts[layout.pattern] = {
1875
+ modulePath: layout.modulePath,
1876
+ pattern: layout.pattern,
1877
+ ...groupScope ? { urlPattern: _chunkPXAHSCR6cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
1878
+ shouldHydrate: layout.shouldHydrate,
1879
+ islandStrategy: layout.islandStrategy,
1880
+ // Islands mode: rebuilt from its server tree, so its module is never preloaded.
1881
+ ...layout.serverTree ? { serverTree: true } : {},
1882
+ preloads: layout.serverTree ? [] : [layout.modulePath],
1883
+ assets: []
1884
+ };
1885
+ }
1886
+ for (const slot of _nullishCoalesce(manifest.slots, () => ( []))) {
1887
+ if (owners && !owners.has(slot.ownerPattern)) continue;
1888
+ clientManifest.slots.push({ ...slot, preloads: [slot.modulePath], assets: [] });
1889
+ }
1890
+ return clientManifest;
1891
+ }
1892
+
1712
1893
  // src/server/dev-styles.ts
1713
1894
 
1714
1895
 
@@ -1796,7 +1977,7 @@ function farmFontImportsPlugin(options = {}) {
1796
1977
  return;
1797
1978
  }
1798
1979
  const resource = registry.getDevResource(pathname);
1799
- if (!_optionalChain([resource, 'optionalAccess', _46 => _46.bytes])) {
1980
+ if (!_optionalChain([resource, 'optionalAccess', _58 => _58.bytes])) {
1800
1981
  next();
1801
1982
  return;
1802
1983
  }
@@ -2078,7 +2259,7 @@ ${FONT_SECTION_END}
2078
2259
  let url;
2079
2260
  try {
2080
2261
  url = new URL(input.source);
2081
- } catch (e6) {
2262
+ } catch (e7) {
2082
2263
  throw fontError(input.moduleId, `remoteFont() source must be an absolute HTTPS URL`);
2083
2264
  }
2084
2265
  if (url.protocol !== "https:") {
@@ -2314,7 +2495,7 @@ function readFontOptions(code, id, call) {
2314
2495
  const declaration = call.ancestors.at(-2);
2315
2496
  const statement = call.ancestors.at(-3);
2316
2497
  const statementParent = call.ancestors.at(-4);
2317
- const isModuleScope = _optionalChain([declaration, 'optionalAccess', _47 => _47.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _48 => _48.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _49 => _49.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _50 => _50.type]) === "Program");
2498
+ const isModuleScope = _optionalChain([declaration, 'optionalAccess', _59 => _59.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _60 => _60.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _61 => _61.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _62 => _62.type]) === "Program");
2318
2499
  if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
2319
2500
  throw fontError(id, `${call.kind}() must be declared directly at module scope`);
2320
2501
  }
@@ -2522,7 +2703,7 @@ function resolveLocalFontPath(source, importer, root) {
2522
2703
  }
2523
2704
  try {
2524
2705
  return _module.createRequire.call(void 0, _url.pathToFileURL.call(void 0, importer)).resolve(source);
2525
- } catch (e7) {
2706
+ } catch (e8) {
2526
2707
  const segments = source.replace(/\\/g, "/").split("/");
2527
2708
  if (segments.includes("..")) return path3.default.resolve(root, source);
2528
2709
  let current = path3.default.dirname(importer);
@@ -2855,7 +3036,7 @@ function parseFarmIslandSource(file, code) {
2855
3036
  function modifiedAt(file) {
2856
3037
  try {
2857
3038
  return fs.default.statSync(file).mtimeMs;
2858
- } catch (e8) {
3039
+ } catch (e9) {
2859
3040
  return -1;
2860
3041
  }
2861
3042
  }
@@ -2869,13 +3050,13 @@ function inferFarmIslandStrategy(filePath, root) {
2869
3050
  let code;
2870
3051
  try {
2871
3052
  code = fs.default.readFileSync(file, "utf8");
2872
- } catch (e9) {
3053
+ } catch (e10) {
2873
3054
  return { strategy: null, files: [file], reason: `${path3.default.basename(file)} could not be read` };
2874
3055
  }
2875
3056
  const result = _compiler.inferStrategy.call(void 0, file, code, {
2876
3057
  parse: parseFarmIslandSource,
2877
3058
  resolve: (specifier, importer) => {
2878
- const resolved = _chunk2IFT2CSAcjs.resolveImportedModule.call(void 0, importer, specifier, root);
3059
+ const resolved = _chunkHTXKSREFcjs.resolveImportedModule.call(void 0, importer, specifier, root);
2879
3060
  return resolved.local ? resolved.path : null;
2880
3061
  }
2881
3062
  });
@@ -2885,11 +3066,32 @@ function inferFarmIslandStrategy(filePath, root) {
2885
3066
  });
2886
3067
  return result;
2887
3068
  }
3069
+ var routeRootInferences = /* @__PURE__ */ new Map();
3070
+ function invalidateFarmRouteRootInferences() {
3071
+ routeRootInferences.clear();
3072
+ }
2888
3073
  function inferFarmRouteRootStrategy(owners, root) {
3074
+ const key = [_nullishCoalesce(root, () => ( "")), ...owners.map((owner) => path3.default.resolve(owner))].join("\n");
3075
+ const cached = routeRootInferences.get(key);
3076
+ if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
3077
+ return cached.result;
3078
+ }
3079
+ const { result, files } = _chunkHTXKSREFcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
3080
+ const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
3081
+ routeRootInferences.set(key, {
3082
+ stamps: [...read].map((file) => [file, modifiedAt(file)]),
3083
+ result
3084
+ });
3085
+ return result;
3086
+ }
3087
+ function isInstalledPackageFile(file) {
3088
+ return file.split(path3.default.sep).includes("node_modules");
3089
+ }
3090
+ function inferRouteRoot(owners, root) {
2889
3091
  const files = [];
2890
3092
  const modules = [];
2891
3093
  for (const owner of owners) {
2892
- const rendered = _chunk2IFT2CSAcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
3094
+ const rendered = _chunkHTXKSREFcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
2893
3095
  if (!rendered) {
2894
3096
  return {
2895
3097
  strategy: null,
@@ -2903,9 +3105,9 @@ function inferFarmRouteRootStrategy(owners, root) {
2903
3105
  let source = null;
2904
3106
  try {
2905
3107
  source = fs.default.readFileSync(module, "utf8");
2906
- } catch (e10) {
3108
+ } catch (e11) {
2907
3109
  }
2908
- if (_chunk2IFT2CSAcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
3110
+ if (_chunkHTXKSREFcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
2909
3111
  }
2910
3112
  for (const module of modules) {
2911
3113
  const result = inferFarmIslandStrategy(module, root);
@@ -2917,7 +3119,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2917
3119
  function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
2918
3120
  const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
2919
3121
  const onRoute = layouts.filter(
2920
- (layout) => _chunk2MR4MABGcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
3122
+ (layout) => _chunkPXAHSCR6cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
2921
3123
  );
2922
3124
  const declared = [
2923
3125
  ...page.islandStrategy ? [page.islandStrategy] : [],
@@ -2950,7 +3152,7 @@ var _stream = require('stream');
2950
3152
 
2951
3153
  function resolveFarmNotFoundComponentPath(config, appDirs) {
2952
3154
  const extensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
2953
- const configuredPath = _optionalChain([config, 'access', _51 => _51.notFound, 'optionalAccess', _52 => _52.component, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
3155
+ const configuredPath = _optionalChain([config, 'access', _63 => _63.notFound, 'optionalAccess', _64 => _64.component, 'optionalAccess', _65 => _65.trim, 'call', _66 => _66()]);
2954
3156
  if (configuredPath) {
2955
3157
  const componentPath = path3.default.isAbsolute(configuredPath) ? path3.default.normalize(configuredPath) : path3.default.resolve(config.root, configuredPath);
2956
3158
  if (!extensions.some((extension) => componentPath.endsWith(extension))) {
@@ -2988,11 +3190,11 @@ function getFarmLayoutKey(pattern, params) {
2988
3190
  );
2989
3191
  }
2990
3192
  function countFarmKeptLayouts(layoutsHeader, layouts, params) {
2991
- const chain = _chunk2MR4MABGcjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
3193
+ const chain = _chunkPXAHSCR6cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
2992
3194
  if (chain.length === 0) return 0;
2993
3195
  const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
2994
- if (chain[0] === keys[0]) return _chunk2MR4MABGcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
2995
- return keys.length > 1 ? 1 + _chunk2MR4MABGcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
3196
+ if (chain[0] === keys[0]) return _chunkPXAHSCR6cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
3197
+ return keys.length > 1 ? 1 + _chunkPXAHSCR6cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
2996
3198
  }
2997
3199
  function createFarmFlushToken() {
2998
3200
  const bytes = new Uint8Array(16);
@@ -3179,7 +3381,7 @@ function normalizeStackPath(value) {
3179
3381
  const withoutQuery = value.replace(/[?#].*$/, "");
3180
3382
  try {
3181
3383
  return withoutQuery.startsWith("file://") ? _url.fileURLToPath.call(void 0, withoutQuery) : withoutQuery;
3182
- } catch (e11) {
3384
+ } catch (e12) {
3183
3385
  return void 0;
3184
3386
  }
3185
3387
  }
@@ -3223,7 +3425,7 @@ function createSourceFrame(location) {
3223
3425
  column: location.column,
3224
3426
  lines
3225
3427
  };
3226
- } catch (e12) {
3428
+ } catch (e13) {
3227
3429
  return void 0;
3228
3430
  }
3229
3431
  }
@@ -3247,7 +3449,7 @@ function createDefaultErrorDiagnostics(error, root) {
3247
3449
  function canBootFarmIslandsClient(config) {
3248
3450
  const docs = config.docs;
3249
3451
  const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
3250
- return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" && !docsEnabled && _chunkDMXMIE2Ccjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMXMIE2Ccjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
3452
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands" && !docsEnabled && _chunkDMXMIE2Ccjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMXMIE2Ccjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
3251
3453
  }
3252
3454
 
3253
3455
  // src/server/renderer.ts
@@ -3326,7 +3528,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
3326
3528
  function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
3327
3529
  if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
3328
3530
  warnedSuppressedAsyncHydrationModules.add(modulePath);
3329
- _chunkQMNWKQL4cjs.logger.warn(_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3531
+ _chunkQMNWKQL4cjs.logger.warn(_chunkHTXKSREFcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3330
3532
  }
3331
3533
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
3332
3534
  var documentLayouts = /* @__PURE__ */ new WeakMap();
@@ -3363,7 +3565,7 @@ function appendResponseHeader(res, name, value) {
3363
3565
  }
3364
3566
  }
3365
3567
  function requestHeader(req, name) {
3366
- const value = _optionalChain([req, 'access', _57 => _57.headers, 'optionalAccess', _58 => _58[name]]);
3568
+ const value = _optionalChain([req, 'access', _69 => _69.headers, 'optionalAccess', _70 => _70[name]]);
3367
3569
  return Array.isArray(value) ? value[0] : value;
3368
3570
  }
3369
3571
  function appendResponseVary(res, value) {
@@ -3377,7 +3579,7 @@ function appendResponseVary(res, value) {
3377
3579
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
3378
3580
  if (snapshot.routing === "none") return "";
3379
3581
  const url = new URL(requestPath, "http://farm.local");
3380
- return _chunk2MR4MABGcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3582
+ return _chunkPXAHSCR6cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3381
3583
  }
3382
3584
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
3383
3585
  function createPPRRefreshScript() {
@@ -3472,12 +3674,12 @@ async function parseRouteModuleProps(routeModule, input) {
3472
3674
  }
3473
3675
  const schemas = routeModule.__farmRouteSchemas;
3474
3676
  const params = parseRouteModuleSchema(
3475
- _optionalChain([schemas, 'optionalAccess', _59 => _59.params]),
3677
+ _optionalChain([schemas, 'optionalAccess', _71 => _71.params]),
3476
3678
  input.props.params,
3477
3679
  "params",
3478
3680
  input.routePath
3479
3681
  );
3480
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _60 => _60.search]), input.search, "search", input.routePath);
3682
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _72 => _72.search]), input.search, "search", input.routePath);
3481
3683
  return {
3482
3684
  ...input.props,
3483
3685
  params,
@@ -3511,7 +3713,7 @@ function readAppPackageIdentity(root) {
3511
3713
  return JSON.parse(
3512
3714
  fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
3513
3715
  );
3514
- } catch (e13) {
3716
+ } catch (e14) {
3515
3717
  return {};
3516
3718
  }
3517
3719
  }
@@ -3535,7 +3737,7 @@ var ServerRenderer = class {
3535
3737
  } else {
3536
3738
  _chunkXGJVRPYLcjs.uninstallFarmIslandValues.call(void 0, );
3537
3739
  }
3538
- if (_optionalChain([this, 'access', _61 => _61.config, 'access', _62 => _62.notFound, 'optionalAccess', _63 => _63.component, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()])) {
3740
+ if (_optionalChain([this, 'access', _73 => _73.config, 'access', _74 => _74.notFound, 'optionalAccess', _75 => _75.component, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()])) {
3539
3741
  resolveFarmNotFoundComponentPath(this.config, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config));
3540
3742
  }
3541
3743
  const loaded = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
@@ -3560,7 +3762,7 @@ var ServerRenderer = class {
3560
3762
  "node"
3561
3763
  );
3562
3764
  this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
3563
- _optionalChain([this, 'access', _66 => _66.routeManager, 'access', _67 => _67.setRendererRuntime, 'optionalCall', _68 => _68(this.rendererRuntime)]);
3765
+ _optionalChain([this, 'access', _78 => _78.routeManager, 'access', _79 => _79.setRendererRuntime, 'optionalCall', _80 => _80(this.rendererRuntime)]);
3564
3766
  await this.applyRendererAppSetup();
3565
3767
  }
3566
3768
  /**
@@ -3617,7 +3819,7 @@ var ServerRenderer = class {
3617
3819
  /// Stylesheets the app imported through JS (fontsource packages, component
3618
3820
  /// CSS) that the document must link alongside globals.css — see #658.
3619
3821
  collectDevStyleHrefs() {
3620
- const graph = _optionalChain([this, 'access', _69 => _69.viteServer, 'optionalAccess', _70 => _70.moduleGraph]);
3822
+ const graph = _optionalChain([this, 'access', _81 => _81.viteServer, 'optionalAccess', _82 => _82.moduleGraph]);
3621
3823
  if (!graph) return [];
3622
3824
  return collectDevStylesheetUrls(
3623
3825
  graph.idToModuleMap.values(),
@@ -3630,6 +3832,32 @@ var ServerRenderer = class {
3630
3832
  (href) => `<link rel="stylesheet" href="${escapeHtmlAttribute2(href)}">`
3631
3833
  );
3632
3834
  }
3835
+ /**
3836
+ * The client manifest a development document inlines: the entries its page reads before the
3837
+ * first navigation. Inlining every route made each document grow with the app (about 650 KB at
3838
+ * 1,000 routes); the client imports the whole manifest only when a navigation needs it.
3839
+ */
3840
+ createDevBootClientManifest(req, options) {
3841
+ const layouts = req.__FARM_LAYOUTS__ || [];
3842
+ return createFarmDevClientManifest(
3843
+ _nullishCoalesce(options.routeManifest, () => ( this.routeManager.generateClientManifest(this.config.root))),
3844
+ {
3845
+ sharedAssets: [
3846
+ ...this.devGlobalStylesheetAssets(),
3847
+ ...this.collectDevStyleHrefs().map((href) => ({
3848
+ tag: "link",
3849
+ attrs: { rel: "stylesheet", href }
3850
+ }))
3851
+ ],
3852
+ boot: {
3853
+ routePattern: options.clientRoutePattern,
3854
+ layoutPatterns: layouts.flatMap(
3855
+ (layout) => typeof layout.pattern === "string" ? [layout.pattern] : []
3856
+ )
3857
+ }
3858
+ }
3859
+ );
3860
+ }
3633
3861
  /**
3634
3862
  * A layout's boundary. Islands mode keys it (the pattern with its params, as the production
3635
3863
  * server does), so a navigation can name the layouts the browser shows; a layout the browser
@@ -3642,7 +3870,7 @@ var ServerRenderer = class {
3642
3870
  "data-farm-layout-boundary": "true",
3643
3871
  "data-farm-layout-pattern": pattern,
3644
3872
  ...segment ? { "data-farm-layout-key": segment.key } : {},
3645
- ..._optionalChain([segment, 'optionalAccess', _71 => _71.kept]) ? { "data-farm-layout-kept": "true" } : {},
3873
+ ..._optionalChain([segment, 'optionalAccess', _83 => _83.kept]) ? { "data-farm-layout-kept": "true" } : {},
3646
3874
  style: { display: "contents" }
3647
3875
  },
3648
3876
  layoutElement
@@ -3658,6 +3886,11 @@ var ServerRenderer = class {
3658
3886
  return this.rendererRuntime.wrapClientGraph(element);
3659
3887
  }
3660
3888
  /** The page a hydrating layout keeps as server HTML: islands again, or a server tree. */
3889
+ /** The route root's strategy, inspecting packages with the dev server's latest plan's cache. */
3890
+ resolveRouteRootStrategy(...args) {
3891
+ const resolve3 = () => resolveFarmRouteRootStrategy(...args);
3892
+ return typeof this.routeManager.inspectPackages === "function" ? this.routeManager.inspectPackages(resolve3) : resolve3();
3893
+ }
3661
3894
  async isolateServerPage(element, serverTree) {
3662
3895
  if (islands && this.islandValues()) {
3663
3896
  const runtime = islands;
@@ -3733,11 +3966,15 @@ var ServerRenderer = class {
3733
3966
  );
3734
3967
  return { html: rendered.html, head: rendered.head || "" };
3735
3968
  }
3736
- return { html: await this.renderElementToCompleteHTML(element, options), head: "" };
3969
+ const { head, body } = _chunkPXAHSCR6cjs.takeFarmHoistedHead.call(void 0,
3970
+ await this.renderElementToCompleteHTML(element, options),
3971
+ true
3972
+ );
3973
+ return { html: body, head };
3737
3974
  }
3738
3975
  /** Islands mode sends large prop values once, keyed by content (RFC 0003). */
3739
3976
  islandValues() {
3740
- return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _72 => _72.config, 'access', _73 => _73.experimental, 'optionalAccess', _74 => _74.serverComponents])) === "islands";
3977
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _84 => _84.config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.serverComponents])) === "islands";
3741
3978
  }
3742
3979
  /**
3743
3980
  * Render the route tree used by client navigation without producing a second
@@ -3814,7 +4051,7 @@ var ServerRenderer = class {
3814
4051
  async runWithRequestContext(request2, fn) {
3815
4052
  return _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0,
3816
4053
  request2,
3817
- () => _optionalChain([this, 'access', _75 => _75.i18nRuntime, 'optionalAccess', _76 => _76.config, 'access', _77 => _77.enabled]) ? _chunk2AM26UGIcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
4054
+ () => _optionalChain([this, 'access', _87 => _87.i18nRuntime, 'optionalAccess', _88 => _88.config, 'access', _89 => _89.enabled]) ? _chunkNLBK37HIcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
3818
4055
  redirect: false
3819
4056
  }) : fn()
3820
4057
  );
@@ -3845,7 +4082,7 @@ var ServerRenderer = class {
3845
4082
  * Check if a path should be served from SSG cache
3846
4083
  */
3847
4084
  async shouldServeSSG(pathname) {
3848
- const ssgPage = _chunkCSQPMV3Qcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
4085
+ const ssgPage = _chunkCLEWORVYcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
3849
4086
  if (!ssgPage) return null;
3850
4087
  const cached = await this.getCachedSSGPage(pathname);
3851
4088
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -3893,7 +4130,11 @@ var ServerRenderer = class {
3893
4130
  key,
3894
4131
  { html },
3895
4132
  {
3896
- paths: [options.pathname],
4133
+ // revalidatePath() takes the route path (`/pricing`), as the docs show, while the shell
4134
+ // answers the public one (`/console/fr/pricing`): either clears it, as in production.
4135
+ paths: [
4136
+ .../* @__PURE__ */ new Set([options.pathname, this.routeManager.toRoutePathname(options.pathname)])
4137
+ ],
3897
4138
  tags: ["ppr"],
3898
4139
  revalidate: _nullishCoalesce(options.revalidate, () => ( false))
3899
4140
  }
@@ -3962,7 +4203,7 @@ var ServerRenderer = class {
3962
4203
  setImmediate(async () => {
3963
4204
  try {
3964
4205
  const mod = await this.routeManager.loadRouteModule(page.filePath);
3965
- if (!_optionalChain([mod, 'optionalAccess', _78 => _78.default])) return;
4206
+ if (!_optionalChain([mod, 'optionalAccess', _90 => _90.default])) return;
3966
4207
  const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
3967
4208
  const layoutModules = await Promise.all(
3968
4209
  layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
@@ -3976,7 +4217,7 @@ var ServerRenderer = class {
3976
4217
  };
3977
4218
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
3978
4219
  const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
3979
- (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _79 => _79.pattern])
4220
+ (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _91 => _91.pattern])
3980
4221
  ), () => ( {
3981
4222
  shouldHydrate: false,
3982
4223
  islandStrategy: null
@@ -4086,18 +4327,18 @@ var ServerRenderer = class {
4086
4327
  res.setHeader(header.key, header.value);
4087
4328
  }
4088
4329
  const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4089
- trustProxy: _optionalChain([this, 'access', _80 => _80.config, 'access', _81 => _81.server, 'optionalAccess', _82 => _82.trustProxy])
4330
+ trustProxy: _optionalChain([this, 'access', _92 => _92.config, 'access', _93 => _93.server, 'optionalAccess', _94 => _94.trustProxy])
4090
4331
  });
4091
4332
  const runtime = this.i18nRuntime;
4092
- if (_optionalChain([runtime, 'optionalAccess', _83 => _83.config, 'access', _84 => _84.enabled])) {
4333
+ if (_optionalChain([runtime, 'optionalAccess', _95 => _95.config, 'access', _96 => _96.enabled])) {
4093
4334
  const resolution = runtime.resolveRequest(request2);
4094
- const varyHeaders = _chunkY2SZVIVHcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4335
+ const varyHeaders = _chunkGPICBTDVcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4095
4336
  for (const header of varyHeaders) appendResponseVary(res, header);
4096
4337
  if (resolution.persist) {
4097
4338
  appendResponseHeader(
4098
4339
  res,
4099
4340
  "Set-Cookie",
4100
- _chunkY2SZVIVHcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
4341
+ _chunkGPICBTDVcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
4101
4342
  );
4102
4343
  }
4103
4344
  if (resolution.redirect && (request2.method === "GET" || request2.method === "HEAD")) {
@@ -4135,7 +4376,7 @@ var ServerRenderer = class {
4135
4376
  });
4136
4377
  };
4137
4378
  try {
4138
- const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _85 => _85.config, 'access', _86 => _86.server, 'optionalAccess', _87 => _87.trustProxy]) });
4379
+ const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.server, 'optionalAccess', _99 => _99.trustProxy]) });
4139
4380
  pathname = url.pathname;
4140
4381
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
4141
4382
  searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -4205,7 +4446,7 @@ var ServerRenderer = class {
4205
4446
  layouts = match.layouts;
4206
4447
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
4207
4448
  if (!route) {
4208
- if (_chunkTP4RAV7Ycjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4449
+ if (_chunkTU6VAH4Vcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4209
4450
  await this.renderDefaultMCP(req, res);
4210
4451
  completeRender(res.statusCode || 200, pathname);
4211
4452
  return;
@@ -4222,13 +4463,13 @@ var ServerRenderer = class {
4222
4463
  params
4223
4464
  });
4224
4465
  let actionRequest;
4225
- if (req.method === "POST" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _88 => _88.config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.serverComponents])) === "islands") {
4466
+ if (req.method === "POST" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _100 => _100.config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) === "islands") {
4226
4467
  await Promise.all([
4227
4468
  this.routeManager.loadRouteModule(route.modulePath),
4228
4469
  ...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
4229
4470
  ]);
4230
4471
  actionRequest = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4231
- trustProxy: _optionalChain([this, 'access', _91 => _91.config, 'access', _92 => _92.server, 'optionalAccess', _93 => _93.trustProxy])
4472
+ trustProxy: _optionalChain([this, 'access', _103 => _103.config, 'access', _104 => _104.server, 'optionalAccess', _105 => _105.trustProxy])
4232
4473
  });
4233
4474
  const formActionRequest = actionRequest;
4234
4475
  const actionResponse = await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0,
@@ -4260,7 +4501,7 @@ var ServerRenderer = class {
4260
4501
  exposedOnly: true
4261
4502
  });
4262
4503
  const currentRequest = _nullishCoalesce(actionRequest, () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4263
- trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy])
4504
+ trustProxy: _optionalChain([this, 'access', _106 => _106.config, 'access', _107 => _107.server, 'optionalAccess', _108 => _108.trustProxy])
4264
4505
  })));
4265
4506
  const routeContext = await this.resolveRouteContext({
4266
4507
  request: currentRequest,
@@ -4302,11 +4543,11 @@ var ServerRenderer = class {
4302
4543
  searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
4303
4544
  error
4304
4545
  };
4305
- if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _97 => _97.notFound])) {
4546
+ if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _109 => _109.notFound])) {
4306
4547
  res.statusCode = 404;
4307
4548
  PageComponent = programmaticRouteComponents.notFound;
4308
4549
  pageProps = routeStateProps;
4309
- } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _98 => _98.error])) {
4550
+ } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _110 => _110.error])) {
4310
4551
  res.statusCode = 500;
4311
4552
  PageComponent = programmaticRouteComponents.error;
4312
4553
  pageProps = routeStateProps;
@@ -4314,21 +4555,21 @@ var ServerRenderer = class {
4314
4555
  throw error;
4315
4556
  }
4316
4557
  }
4317
- const renderingConfig = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0,
4558
+ const renderingConfig = await _chunkCLEWORVYcjs.resolveRouteRenderingConfigFromFile.call(void 0,
4318
4559
  routeModule,
4319
4560
  route.modulePath,
4320
- { experimentalPPR: _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.ppr]) === true }
4561
+ { experimentalPPR: _optionalChain([this, 'access', _111 => _111.config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.ppr]) === true }
4321
4562
  );
4322
4563
  const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
4323
4564
  const islandsNavigationRequest = Boolean(
4324
4565
  islands && this.islandValues() && (requestHeader(req, "f-layouts") || requestHeader(req, "f-stream"))
4325
4566
  );
4326
4567
  const canCachePPRShell = renderingConfig.ppr && !pprBypassReason && !islandsNavigationRequest;
4327
- const pprI18nSnapshot = canCachePPRShell ? _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
4568
+ const pprI18nSnapshot = canCachePPRShell ? _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
4328
4569
  const pprShellOptions = canCachePPRShell ? {
4329
4570
  pathname,
4330
4571
  search: url.search,
4331
- locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _102 => _102.locale]), () => ( "")),
4572
+ locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _114 => _114.locale]), () => ( "")),
4332
4573
  origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
4333
4574
  revalidate: renderingConfig.revalidate
4334
4575
  } : void 0;
@@ -4400,7 +4641,7 @@ var ServerRenderer = class {
4400
4641
  const routeManifestEntry = routeManifest.routes.find(
4401
4642
  (entry) => entry.pattern === route.pattern
4402
4643
  );
4403
- const moduleMetadata = routeManifestEntry || _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4644
+ const moduleMetadata = routeManifestEntry || _chunkHTXKSREFcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4404
4645
  const isClientComponent = moduleMetadata.isClientComponent;
4405
4646
  const renderedRouteSlots = await Promise.all(
4406
4647
  routeSlots.map(async (slot) => {
@@ -4451,20 +4692,20 @@ var ServerRenderer = class {
4451
4692
  if (moduleMetadata.suppressedAsyncHydration) {
4452
4693
  warnSuppressedAsyncHydrationOnce(
4453
4694
  route.modulePath,
4454
- _optionalChain([routeManifestEntry, 'optionalAccess', _103 => _103.suppressedAsyncHydrationReason])
4695
+ _optionalChain([routeManifestEntry, 'optionalAccess', _115 => _115.suppressedAsyncHydrationReason])
4455
4696
  );
4456
4697
  }
4457
4698
  const layoutHydrationMetadata = layouts.map((layout) => {
4458
4699
  const manifestEntry = routeManifest.layouts.find(
4459
4700
  (entry) => entry.pattern === layout.pattern
4460
4701
  );
4461
- if (_optionalChain([manifestEntry, 'optionalAccess', _104 => _104.suppressedAsyncHydration])) {
4702
+ if (_optionalChain([manifestEntry, 'optionalAccess', _116 => _116.suppressedAsyncHydration])) {
4462
4703
  warnSuppressedAsyncHydrationOnce(
4463
4704
  layout.modulePath,
4464
4705
  manifestEntry.suppressedAsyncHydrationReason
4465
4706
  );
4466
4707
  }
4467
- if (typeof _optionalChain([manifestEntry, 'optionalAccess', _105 => _105.shouldHydrate]) === "boolean") {
4708
+ if (typeof _optionalChain([manifestEntry, 'optionalAccess', _117 => _117.shouldHydrate]) === "boolean") {
4468
4709
  return {
4469
4710
  isClientComponent: manifestEntry.isClientComponent === true,
4470
4711
  shouldHydrate: manifestEntry.shouldHydrate,
@@ -4485,11 +4726,11 @@ var ServerRenderer = class {
4485
4726
  const clientLayouts = layouts.map((layout, index) => ({
4486
4727
  pattern: layout.pattern,
4487
4728
  modulePath: _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
4488
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _106 => _106[index], 'optionalAccess', _107 => _107.shouldHydrate]) === true,
4489
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _108 => _108[index], 'optionalAccess', _109 => _109.islandStrategy]), () => ( null)),
4490
- ..._optionalChain([layoutHydrationMetadata, 'access', _110 => _110[index], 'optionalAccess', _111 => _111.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4729
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.shouldHydrate]) === true,
4730
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _120 => _120[index], 'optionalAccess', _121 => _121.islandStrategy]), () => ( null)),
4731
+ ..._optionalChain([layoutHydrationMetadata, 'access', _122 => _122[index], 'optionalAccess', _123 => _123.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4491
4732
  // Islands mode: the browser rebuilds this layout from its tree, not its module.
4492
- ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _112 => _112[index], 'optionalAccess', _113 => _113.serverTree]) === true ? { serverTree: true } : {}
4733
+ ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _124 => _124[index], 'optionalAccess', _125 => _125.serverTree]) === true ? { serverTree: true } : {}
4493
4734
  }));
4494
4735
  const hydrationStrategies = [
4495
4736
  ...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
@@ -4497,15 +4738,15 @@ var ServerRenderer = class {
4497
4738
  (metadata) => metadata.shouldHydrate && metadata.islandStrategy ? [metadata.islandStrategy] : []
4498
4739
  )
4499
4740
  ];
4500
- const hydrationIslandStrategy = this.islandValues() ? resolveFarmRouteRootStrategy(
4741
+ const hydrationIslandStrategy = this.islandValues() ? this.resolveRouteRootStrategy(
4501
4742
  route,
4502
4743
  { shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
4503
4744
  layouts.map((layout, index) => ({
4504
4745
  pattern: layout.pattern,
4505
4746
  modulePath: layout.modulePath,
4506
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _114 => _114[index], 'optionalAccess', _115 => _115.shouldHydrate]) === true,
4507
- hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _116 => _116[index], 'optionalAccess', _117 => _117.hasIsolatedClientBoundaries]) === true,
4508
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.islandStrategy]), () => ( null))
4747
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _126 => _126[index], 'optionalAccess', _127 => _127.shouldHydrate]) === true,
4748
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _128 => _128[index], 'optionalAccess', _129 => _129.hasIsolatedClientBoundaries]) === true,
4749
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _130 => _130[index], 'optionalAccess', _131 => _131.islandStrategy]), () => ( null))
4509
4750
  })),
4510
4751
  this.config.root || process.cwd(),
4511
4752
  true
@@ -4513,7 +4754,7 @@ var ServerRenderer = class {
4513
4754
  const hasHydratableRouteSlots = renderedRouteSlots.some(
4514
4755
  (slot) => slot.isClientComponent || slot.shouldHydrate
4515
4756
  );
4516
- const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _120 => _120.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4757
+ const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _132 => _132.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4517
4758
  req.__FARM_PAGE_PATH__ = route.modulePath;
4518
4759
  req.__FARM_ROUTE__ = pathname;
4519
4760
  req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
@@ -4526,7 +4767,7 @@ var ServerRenderer = class {
4526
4767
  req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
4527
4768
  req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
4528
4769
  req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
4529
- req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _121 => _121.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4770
+ req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _133 => _133.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4530
4771
  req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
4531
4772
  name: slot.name,
4532
4773
  ownerPattern: slot.ownerPattern,
@@ -4598,7 +4839,7 @@ var ServerRenderer = class {
4598
4839
  } else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
4599
4840
  pageElement = await this.isolateServerPage(
4600
4841
  pageElement,
4601
- _optionalChain([routeManifestEntry, 'optionalAccess', _122 => _122.serverTree]) === true
4842
+ _optionalChain([routeManifestEntry, 'optionalAccess', _134 => _134.serverTree]) === true
4602
4843
  );
4603
4844
  }
4604
4845
  pageElement = this.createPageBoundary(pageElement, {
@@ -4612,7 +4853,7 @@ var ServerRenderer = class {
4612
4853
  if (keptLayouts > 0) {
4613
4854
  let keptElement = null;
4614
4855
  for (let i = keptLayouts - 1; i >= 0; i--) {
4615
- const KeptLayout = _optionalChain([layoutModules, 'access', _123 => _123[i], 'optionalAccess', _124 => _124.default]);
4856
+ const KeptLayout = _optionalChain([layoutModules, 'access', _135 => _135[i], 'optionalAccess', _136 => _136.default]);
4616
4857
  if (KeptLayout) {
4617
4858
  keptElement = this.rendererRuntime.createElement(KeptLayout, {
4618
4859
  children: keptElement,
@@ -4625,7 +4866,7 @@ var ServerRenderer = class {
4625
4866
  await this.wrapWithIntegrationProviders(keptElement),
4626
4867
  { rejectLateErrors: true }
4627
4868
  );
4628
- } catch (e14) {
4869
+ } catch (e15) {
4629
4870
  keptLayouts = 0;
4630
4871
  }
4631
4872
  }
@@ -4661,7 +4902,7 @@ var ServerRenderer = class {
4661
4902
  );
4662
4903
  slotProps[slot.name] = slotElement;
4663
4904
  }
4664
- wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _125 => _125[i], 'optionalAccess', _126 => _126.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4905
+ wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _137 => _137[i], 'optionalAccess', _138 => _138.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4665
4906
  LayoutComponent,
4666
4907
  { params },
4667
4908
  { children: wrappedElement, ...slotProps },
@@ -4711,6 +4952,7 @@ var ServerRenderer = class {
4711
4952
  {
4712
4953
  responseHeaders: pprHeaders,
4713
4954
  routeManifest,
4955
+ clientRoutePattern: route.pattern,
4714
4956
  captureStaticShell: Boolean(pprShellOptions),
4715
4957
  observabilityRoute: pathname,
4716
4958
  onSuspenseHoleDetected: pprShellOptions ? () => _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
@@ -4759,7 +5001,7 @@ var ServerRenderer = class {
4759
5001
  }
4760
5002
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
4761
5003
  const redirect = _chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error);
4762
- const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
5004
+ const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
4763
5005
  const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
4764
5006
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4765
5007
  type: "route.redirect",
@@ -4796,7 +5038,7 @@ var ServerRenderer = class {
4796
5038
  }
4797
5039
  }
4798
5040
  emitFarmRenderError(req, pathname, error);
4799
- const errorStatus = _chunk2MR4MABGcjs.resolveDefaultErrorStatus.call(void 0, error);
5041
+ const errorStatus = _chunkPXAHSCR6cjs.resolveDefaultErrorStatus.call(void 0, error);
4800
5042
  if (pprRefreshRoute) {
4801
5043
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4802
5044
  type: "ppr.refresh.error",
@@ -4840,7 +5082,7 @@ var ServerRenderer = class {
4840
5082
  const rendererCapabilities = _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
4841
5083
  if (!rendererCapabilities.functionComponents) {
4842
5084
  throw new Error(
4843
- `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _127 => _127.config, 'access', _128 => _128.renderer, 'optionalAccess', _129 => _129.name]), () => ( "the configured renderer"))}\` cannot.`
5085
+ `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.renderer, 'optionalAccess', _141 => _141.name]), () => ( "the configured renderer"))}\` cannot.`
4844
5086
  );
4845
5087
  }
4846
5088
  if (provider.type === "clerk" && !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) {
@@ -4879,7 +5121,7 @@ var ServerRenderer = class {
4879
5121
  }
4880
5122
  if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
4881
5123
  _nullishCoalesce(providerSourceModule, () => ( "")),
4882
- _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _130 => _130.config, 'access', _131 => _131.renderer, 'optionalAccess', _132 => _132.componentExtensions]))
5124
+ _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.renderer, 'optionalAccess', _144 => _144.componentExtensions]))
4883
5125
  )) {
4884
5126
  ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
4885
5127
  }
@@ -4930,7 +5172,7 @@ var ServerRenderer = class {
4930
5172
  manifestMatch.metadata,
4931
5173
  manifestMatch.params
4932
5174
  );
4933
- const snapshot2 = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
5175
+ const snapshot2 = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
4934
5176
  const localizedHref = snapshot2 ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
4935
5177
  metadata.manifest = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
4936
5178
  }
@@ -4941,14 +5183,14 @@ var ServerRenderer = class {
4941
5183
  metadata = _chunk6IOZPJ3Icjs.addMetadataImageReference.call(void 0, metadata, reference);
4942
5184
  }
4943
5185
  }
4944
- const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
5186
+ const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
4945
5187
  const publicPathname = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
4946
5188
  snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
4947
5189
  this.config.basePath
4948
5190
  );
4949
5191
  metadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
4950
5192
  metadata,
4951
- _chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
5193
+ _chunkHGB4PM2Ccjs.getFarmMarkdownAlternatePath.call(void 0, _chunkHGB4PM2Ccjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
4952
5194
  routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
4953
5195
  })
4954
5196
  );
@@ -4958,7 +5200,7 @@ var ServerRenderer = class {
4958
5200
  const match = this.routeManager.getMatchingMetadataImage(pathname, kind);
4959
5201
  if (!match) return null;
4960
5202
  const rawHref = this.routeManager.resolveMetadataImagePath(match.image, match.params);
4961
- const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
5203
+ const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
4962
5204
  const localizedHref = snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
4963
5205
  const href = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
4964
5206
  const reference = {
@@ -5008,7 +5250,7 @@ var ServerRenderer = class {
5008
5250
  );
5009
5251
  }
5010
5252
  const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5011
- trustProxy: _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.server, 'optionalAccess', _135 => _135.trustProxy])
5253
+ trustProxy: _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.server, 'optionalAccess', _147 => _147.trustProxy])
5012
5254
  });
5013
5255
  const url = new URL(request2.url);
5014
5256
  const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
@@ -5022,11 +5264,11 @@ var ServerRenderer = class {
5022
5264
  path: match.routePath,
5023
5265
  ...llmsContext
5024
5266
  }) : routeModule.default;
5025
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkO32QPFVVcjs.renderFarmLlmsFullTxt.call(void 0, value, {
5267
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunk5PDMBWAFcjs.renderFarmLlmsFullTxt.call(void 0, value, {
5026
5268
  origin: await this.getAgentOrigin(request2),
5027
5269
  readMarkdown: llmsContext.markdown
5028
5270
  }) : value;
5029
- const response = _chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5271
+ const response = _chunkPXAHSCR6cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5030
5272
  method,
5031
5273
  request: request2
5032
5274
  });
@@ -5044,7 +5286,7 @@ var ServerRenderer = class {
5044
5286
  }
5045
5287
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
5046
5288
  getGeneratedLlmsKind(pathname) {
5047
- const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.agent, 'optionalAccess', _138 => _138.llmsTxt]));
5289
+ const config = _chunk5PDMBWAFcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.llmsTxt]));
5048
5290
  if (!config.enabled) return null;
5049
5291
  if (pathname === "/llms.txt") return "llms";
5050
5292
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
@@ -5052,17 +5294,17 @@ var ServerRenderer = class {
5052
5294
  async renderGeneratedLlmsTxt(req, res, kind) {
5053
5295
  try {
5054
5296
  const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5055
- trustProxy: _optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.server, 'optionalAccess', _141 => _141.trustProxy])
5297
+ trustProxy: _optionalChain([this, 'access', _151 => _151.config, 'access', _152 => _152.server, 'optionalAccess', _153 => _153.trustProxy])
5056
5298
  });
5057
- const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt]));
5299
+ const config = _chunk5PDMBWAFcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _154 => _154.config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.llmsTxt]));
5058
5300
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
5059
- const body = kind === "llms-full" ? await _chunkO32QPFVVcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5301
+ const body = kind === "llms-full" ? await _chunk5PDMBWAFcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5060
5302
  origin: await this.getAgentOrigin(request2),
5061
5303
  readMarkdown: context.markdown
5062
5304
  }) : context.defaults;
5063
5305
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5064
5306
  res,
5065
- _chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0,
5307
+ _chunkPXAHSCR6cjs.createFarmMetadataRouteResponse.call(void 0,
5066
5308
  kind,
5067
5309
  body,
5068
5310
  { revalidate: config.revalidate },
@@ -5081,23 +5323,23 @@ var ServerRenderer = class {
5081
5323
  }
5082
5324
  }
5083
5325
  getAgentCrawlers() {
5084
- return _chunkZUVAGMQ5cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.agent, 'optionalAccess', _147 => _147.crawlers]));
5326
+ return _chunkODBM54RTcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.crawlers]));
5085
5327
  }
5086
5328
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
5087
5329
  async renderGeneratedRobotsTxt(req, res) {
5088
5330
  try {
5089
- const sitemapPath = _optionalChain([this, 'access', _148 => _148.routeManager, 'access', _149 => _149.matchMetadataRoute, 'call', _150 => _150("/sitemap.xml"), 'optionalAccess', _151 => _151.metadata, 'access', _152 => _152.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5331
+ const sitemapPath = _optionalChain([this, 'access', _160 => _160.routeManager, 'access', _161 => _161.matchMetadataRoute, 'call', _162 => _162("/sitemap.xml"), 'optionalAccess', _163 => _163.metadata, 'access', _164 => _164.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5090
5332
  const rootLayout = this.routeManager.getLayouts().get("/");
5091
5333
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5092
- const robots = _chunkZUVAGMQ5cjs.createFarmAgentRobots.call(void 0, {
5334
+ const robots = _chunkODBM54RTcjs.createFarmAgentRobots.call(void 0, {
5093
5335
  crawlers: this.getAgentCrawlers(),
5094
5336
  sitemapPath,
5095
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _153 => _153.metadataBase]),
5337
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _165 => _165.metadataBase]),
5096
5338
  basePath: this.config.basePath
5097
5339
  });
5098
5340
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5099
5341
  res,
5100
- _chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5342
+ _chunkPXAHSCR6cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5101
5343
  );
5102
5344
  } catch (error) {
5103
5345
  _chunkQMNWKQL4cjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -5111,13 +5353,13 @@ var ServerRenderer = class {
5111
5353
  }
5112
5354
  }
5113
5355
  getAgentSitemap() {
5114
- return _chunkZUVAGMQ5cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _154 => _154.config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.sitemap]));
5356
+ return _chunkODBM54RTcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _166 => _166.config, 'access', _167 => _167.agent, 'optionalAccess', _168 => _168.sitemap]));
5115
5357
  }
5116
5358
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
5117
5359
  async renderGeneratedSitemap(req, res) {
5118
5360
  try {
5119
5361
  const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5120
- trustProxy: _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.server, 'optionalAccess', _159 => _159.trustProxy])
5362
+ trustProxy: _optionalChain([this, 'access', _169 => _169.config, 'access', _170 => _170.server, 'optionalAccess', _171 => _171.trustProxy])
5121
5363
  });
5122
5364
  const sources = await Promise.all(
5123
5365
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5128,26 +5370,26 @@ var ServerRenderer = class {
5128
5370
  }),
5129
5371
  fs5.promises.stat(route.modulePath).catch(() => void 0)
5130
5372
  ]);
5131
- if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _160 => _160.metadata]))) return null;
5132
- return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _161 => _161.mtime, 'access', _162 => _162.toISOString, 'call', _163 => _163()]) };
5373
+ if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _172 => _172.metadata]))) return null;
5374
+ return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _173 => _173.mtime, 'access', _174 => _174.toISOString, 'call', _175 => _175()]) };
5133
5375
  })
5134
5376
  );
5135
5377
  const rootLayout = this.routeManager.getLayouts().get("/");
5136
5378
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5137
- const sitemap = _chunkZUVAGMQ5cjs.createFarmDefaultSitemap.call(void 0,
5379
+ const sitemap = _chunkODBM54RTcjs.createFarmDefaultSitemap.call(void 0,
5138
5380
  sources.filter((source) => source !== null),
5139
5381
  {
5140
5382
  origin: new URL(request2.url).origin,
5141
5383
  config: this.getAgentSitemap(),
5142
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _164 => _164.metadataBase]),
5384
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _176 => _176.metadataBase]),
5143
5385
  basePath: this.config.basePath,
5144
5386
  trailingSlash: this.config.trailingSlash,
5145
- i18n: _optionalChain([this, 'access', _165 => _165.i18nRuntime, 'optionalAccess', _166 => _166.config])
5387
+ i18n: _optionalChain([this, 'access', _177 => _177.i18nRuntime, 'optionalAccess', _178 => _178.config])
5146
5388
  }
5147
5389
  );
5148
5390
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5149
5391
  res,
5150
- _chunk2MR4MABGcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5392
+ _chunkPXAHSCR6cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5151
5393
  );
5152
5394
  } catch (error) {
5153
5395
  _chunkQMNWKQL4cjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -5174,9 +5416,9 @@ var ServerRenderer = class {
5174
5416
  * matcher) covers, as the production build decides.
5175
5417
  */
5176
5418
  getAgentListedRoutes() {
5177
- const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _167 => _167.middlewareRoutes, 'optionalCall', _168 => _168()]), () => ( [])) };
5419
+ const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _179 => _179.middlewareRoutes, 'optionalCall', _180 => _180()]), () => ( [])) };
5178
5420
  return [...this.routeManager.getRoutes()].filter(
5179
- ([pattern]) => !pattern.includes("[") && !_chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5421
+ ([pattern]) => !pattern.includes("[") && !_chunkPXAHSCR6cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5180
5422
  );
5181
5423
  }
5182
5424
  /**
@@ -5192,7 +5434,7 @@ var ServerRenderer = class {
5192
5434
  )
5193
5435
  )
5194
5436
  );
5195
- return _chunkO32QPFVVcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
5437
+ return _chunk5PDMBWAFcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
5196
5438
  }
5197
5439
  /**
5198
5440
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
@@ -5200,22 +5442,22 @@ var ServerRenderer = class {
5200
5442
  * or a registered server such as the docs engine's. Production applies the same rules.
5201
5443
  */
5202
5444
  getDefaultMCPServer() {
5203
- if (_optionalChain([this, 'access', _169 => _169.config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.mcp]) !== true || _chunkTP4RAV7Ycjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
5204
- if (_optionalChain([this, 'access', _172 => _172.apiRouteExists, 'optionalCall', _173 => _173("/api/mcp")])) return void 0;
5205
- if (this.routeManager.matchRoute(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5206
- _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0,
5445
+ if (_optionalChain([this, 'access', _181 => _181.config, 'access', _182 => _182.agent, 'optionalAccess', _183 => _183.mcp]) !== true || _chunkTU6VAH4Vcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
5446
+ if (_optionalChain([this, 'access', _184 => _184.apiRouteExists, 'optionalCall', _185 => _185("/api/mcp")])) return void 0;
5447
+ if (this.routeManager.matchRoute(_chunkTU6VAH4Vcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5448
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkTU6VAH4Vcjs.createFarmDefaultMCPServer.call(void 0,
5207
5449
  readAppPackageIdentity(this.config.root),
5208
- _chunkMEJCP2LXcjs.FARM_VERSION
5450
+ _chunkUVQRMUARcjs.FARM_VERSION
5209
5451
  ))));
5210
- return _chunkTP4RAV7Ycjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5452
+ return _chunkTU6VAH4Vcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5211
5453
  }
5212
5454
  async renderDefaultMCP(req, res) {
5213
5455
  const server = this.getDefaultMCPServer();
5214
- const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _174 => _174.config, 'access', _175 => _175.server, 'optionalAccess', _176 => _176.trustProxy]) })));
5456
+ const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _186 => _186.config, 'access', _187 => _187.server, 'optionalAccess', _188 => _188.trustProxy]) })));
5215
5457
  try {
5216
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-KE4J3W7S.cjs");
5458
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-VBCA3WZ6.cjs");
5217
5459
  const origin = new URL(request2.url).origin;
5218
- const i18n = _optionalChain([this, 'access', _177 => _177.i18nRuntime, 'optionalAccess', _178 => _178.config]);
5460
+ const i18n = _optionalChain([this, 'access', _189 => _189.i18nRuntime, 'optionalAccess', _190 => _190.config]);
5219
5461
  const metadataBase = await this.getRootMetadataBase();
5220
5462
  const response = await handleFarmDefaultMCPRequest(request2, {
5221
5463
  server,
@@ -5230,13 +5472,13 @@ var ServerRenderer = class {
5230
5472
  return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
5231
5473
  })
5232
5474
  );
5233
- return _chunkTP4RAV7Ycjs.collectFarmDefaultMCPPages.call(void 0,
5475
+ return _chunkTU6VAH4Vcjs.collectFarmDefaultMCPPages.call(void 0,
5234
5476
  sources.filter((source) => source !== null),
5235
5477
  {
5236
5478
  origin,
5237
5479
  metadataBase,
5238
5480
  basePath: this.config.basePath,
5239
- markdown: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5481
+ markdown: _chunkHGB4PM2Ccjs.resolveMarkdownConfig.call(void 0, this.config.md),
5240
5482
  trailingSlash: this.config.trailingSlash,
5241
5483
  i18n
5242
5484
  }
@@ -5263,7 +5505,7 @@ var ServerRenderer = class {
5263
5505
  }
5264
5506
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
5265
5507
  async createLlmsTxtContext(request2, options = {}) {
5266
- const config = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _179 => _179.config, 'access', _180 => _180.agent, 'optionalAccess', _181 => _181.llmsTxt]));
5508
+ const config = _chunk5PDMBWAFcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _191 => _191.config, 'access', _192 => _192.agent, 'optionalAccess', _193 => _193.llmsTxt]));
5267
5509
  const origin = await this.getAgentOrigin(request2);
5268
5510
  const sources = await Promise.all(
5269
5511
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5280,26 +5522,26 @@ var ServerRenderer = class {
5280
5522
  );
5281
5523
  const rootLayout = this.routeManager.getLayouts().get("/");
5282
5524
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5283
- const pages = _chunkO32QPFVVcjs.collectFarmLlmsTxtPages.call(void 0,
5525
+ const pages = _chunk5PDMBWAFcjs.collectFarmLlmsTxtPages.call(void 0,
5284
5526
  sources.filter((source) => source !== null),
5285
5527
  {
5286
5528
  origin,
5287
5529
  basePath: this.config.basePath,
5288
- markdown: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5530
+ markdown: _chunkHGB4PM2Ccjs.resolveMarkdownConfig.call(void 0, this.config.md),
5289
5531
  include: config.include,
5290
5532
  exclude: config.exclude,
5291
5533
  trailingSlash: this.config.trailingSlash,
5292
- i18n: _optionalChain([this, 'access', _182 => _182.i18nRuntime, 'optionalAccess', _183 => _183.config])
5534
+ i18n: _optionalChain([this, 'access', _194 => _194.i18nRuntime, 'optionalAccess', _195 => _195.config])
5293
5535
  }
5294
5536
  );
5295
5537
  return {
5296
5538
  pages,
5297
- defaults: _chunkO32QPFVVcjs.createFarmDefaultLlmsTxt.call(void 0, {
5539
+ defaults: _chunk5PDMBWAFcjs.createFarmDefaultLlmsTxt.call(void 0, {
5298
5540
  origin,
5299
5541
  pages,
5300
5542
  config,
5301
5543
  rootMetadata,
5302
- mcp: _optionalChain([this, 'access', _184 => _184.config, 'access', _185 => _185.agent, 'optionalAccess', _186 => _186.aiCatalog]) === false ? [] : _chunkSXMWVP2Lcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5544
+ mcp: _optionalChain([this, 'access', _196 => _196.config, 'access', _197 => _197.agent, 'optionalAccess', _198 => _198.aiCatalog]) === false ? [] : _chunk4YHGQDTTcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5303
5545
  basePath: this.config.basePath,
5304
5546
  apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
5305
5547
  _chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
@@ -5310,7 +5552,7 @@ var ServerRenderer = class {
5310
5552
  })
5311
5553
  }),
5312
5554
  ...options.full ? {
5313
- markdown: _chunkO32QPFVVcjs.readFarmLlmsMarkdownFrom.call(void 0,
5555
+ markdown: _chunk5PDMBWAFcjs.readFarmLlmsMarkdownFrom.call(void 0,
5314
5556
  new URL(request2.url).origin,
5315
5557
  origin,
5316
5558
  this.createDevMarkdownReader(options.req)
@@ -5323,13 +5565,13 @@ var ServerRenderer = class {
5323
5565
  * `metadataBase`, else the request's origin, as for the sitemap and the production server.
5324
5566
  */
5325
5567
  async getAgentOrigin(request2) {
5326
- return _chunkO32QPFVVcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
5568
+ return _chunk5PDMBWAFcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
5327
5569
  }
5328
5570
  /** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
5329
5571
  async getRootMetadataBase() {
5330
5572
  const rootLayout = this.routeManager.getLayouts().get("/");
5331
5573
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5332
- return _optionalChain([rootMetadata, 'optionalAccess', _187 => _187.metadataBase]);
5574
+ return _optionalChain([rootMetadata, 'optionalAccess', _199 => _199.metadataBase]);
5333
5575
  }
5334
5576
  /**
5335
5577
  * Reads page mirrors back through this dev server, the way its .md handler
@@ -5341,17 +5583,17 @@ var ServerRenderer = class {
5341
5583
  * body is discarded.
5342
5584
  */
5343
5585
  createDevMarkdownReader(req) {
5344
- const socket = _optionalChain([req, 'optionalAccess', _188 => _188.socket]);
5345
- if (_optionalChain([req, 'optionalAccess', _189 => _189.method, 'optionalAccess', _190 => _190.toUpperCase, 'call', _191 => _191()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _192 => _192.localAddress]) || !socket.localPort) {
5586
+ const socket = _optionalChain([req, 'optionalAccess', _200 => _200.socket]);
5587
+ if (_optionalChain([req, 'optionalAccess', _201 => _201.method, 'optionalAccess', _202 => _202.toUpperCase, 'call', _203 => _203()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _204 => _204.localAddress]) || !socket.localPort) {
5346
5588
  return async () => null;
5347
5589
  }
5348
5590
  if (socket.encrypted) {
5349
5591
  const address = { host: socket.localAddress, port: socket.localPort };
5350
- return _chunkO32QPFVVcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5592
+ return _chunk5PDMBWAFcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5351
5593
  }
5352
5594
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
5353
5595
  const localOrigin = `http://${host}:${socket.localPort}`;
5354
- const read = _chunkO32QPFVVcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5596
+ const read = _chunk5PDMBWAFcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5355
5597
  return (url) => {
5356
5598
  const target = new URL(url);
5357
5599
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -5408,7 +5650,7 @@ var ServerRenderer = class {
5408
5650
  }
5409
5651
  const etag = `"${image.staticInfo.hash}"`;
5410
5652
  const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
5411
- trustProxy: _optionalChain([this, 'access', _193 => _193.config, 'access', _194 => _194.server, 'optionalAccess', _195 => _195.trustProxy])
5653
+ trustProxy: _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.server, 'optionalAccess', _207 => _207.trustProxy])
5412
5654
  });
5413
5655
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
5414
5656
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -5473,7 +5715,7 @@ var ServerRenderer = class {
5473
5715
  options.middlewareMap,
5474
5716
  () => _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0,
5475
5717
  options.middlewareContext,
5476
- () => this.rendererRuntime.renderToString(wrapped, rendererRenderOptions())
5718
+ () => this.renderElementToCompleteHTML(wrapped)
5477
5719
  )
5478
5720
  );
5479
5721
  res.statusCode = options.statusCode;
@@ -5505,53 +5747,7 @@ var ServerRenderer = class {
5505
5747
  res.setHeader(key, value);
5506
5748
  }
5507
5749
  try {
5508
- const manifest = _nullishCoalesce(options.routeManifest, () => ( this.routeManager.generateClientManifest(this.config.root)));
5509
- const clientManifest = {
5510
- clientEntry: "/@farm/client.js",
5511
- routes: {},
5512
- layouts: {},
5513
- slots: [],
5514
- sharedAssets: [
5515
- ...this.devGlobalStylesheetAssets(),
5516
- ...this.collectDevStyleHrefs().map((href) => ({
5517
- tag: "link",
5518
- attrs: { rel: "stylesheet", href }
5519
- }))
5520
- ]
5521
- };
5522
- for (const routeEntry of manifest.routes) {
5523
- clientManifest.routes[routeEntry.pattern] = {
5524
- modulePath: routeEntry.modulePath,
5525
- pattern: routeEntry.pattern,
5526
- segments: routeEntry.segments,
5527
- search: routeEntry.search,
5528
- isClientComponent: routeEntry.isClientComponent,
5529
- shouldHydrate: routeEntry.shouldHydrate,
5530
- islandStrategy: routeEntry.islandStrategy,
5531
- renderPlan: routeEntry.renderPlan,
5532
- preloads: [routeEntry.modulePath],
5533
- assets: []
5534
- };
5535
- }
5536
- for (const layoutEntry of manifest.layouts) {
5537
- clientManifest.layouts[layoutEntry.pattern] = {
5538
- modulePath: layoutEntry.modulePath,
5539
- pattern: layoutEntry.pattern,
5540
- shouldHydrate: layoutEntry.shouldHydrate,
5541
- islandStrategy: layoutEntry.islandStrategy,
5542
- // Islands mode: rebuilt from its server tree, so its module is never preloaded.
5543
- ...layoutEntry.serverTree ? { serverTree: true } : {},
5544
- preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
5545
- assets: []
5546
- };
5547
- }
5548
- for (const slotEntry of _nullishCoalesce(manifest.slots, () => ( []))) {
5549
- clientManifest.slots.push({
5550
- ...slotEntry,
5551
- preloads: [slotEntry.modulePath],
5552
- assets: []
5553
- });
5554
- }
5750
+ const clientManifest = this.createDevBootClientManifest(req, options);
5555
5751
  const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
5556
5752
  (slot) => ({
5557
5753
  ...slot,
@@ -5584,11 +5780,11 @@ window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
5584
5780
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
5585
5781
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5586
5782
  window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkJX5VOLAVcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5587
- window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5783
+ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5588
5784
  </script>`);
5589
5785
  const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
5590
5786
  const rendererHydrationScript = farmScripts(
5591
- _optionalChain([this, 'access', _196 => _196.rendererRuntime, 'access', _197 => _197.generateHydrationScript, 'optionalCall', _198 => _198()]) || ""
5787
+ _optionalChain([this, 'access', _208 => _208.rendererRuntime, 'access', _209 => _209.generateHydrationScript, 'optionalCall', _210 => _210()]) || ""
5592
5788
  );
5593
5789
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
5594
5790
  const farmClientScript = farmScripts(
@@ -5597,8 +5793,8 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5597
5793
  const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
5598
5794
  element,
5599
5795
  {
5600
- rejectLateNavigation: _chunkC2JOS77Zcjs._isFarmMarkdownPageCheck.call(void 0,
5601
- _optionalChain([req, 'access', _199 => _199.headers, 'optionalAccess', _200 => _200[_chunkC2JOS77Zcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5796
+ rejectLateNavigation: _chunkHGB4PM2Ccjs._isFarmMarkdownPageCheck.call(void 0,
5797
+ _optionalChain([req, 'access', _211 => _211.headers, 'optionalAccess', _212 => _212[_chunkHGB4PM2Ccjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5602
5798
  )
5603
5799
  }
5604
5800
  );
@@ -5610,29 +5806,29 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5610
5806
  viewport: viewportTags
5611
5807
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5612
5808
  pathname: getFarmMetadataPathname(req),
5613
- jsonLd: _optionalChain([this, 'access', _201 => _201.config, 'access', _202 => _202.agent, 'optionalAccess', _203 => _203.jsonLd])
5809
+ jsonLd: _optionalChain([this, 'access', _213 => _213.config, 'access', _214 => _214.agent, 'optionalAccess', _215 => _215.jsonLd])
5614
5810
  });
5615
5811
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
5616
5812
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
5617
- const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
5813
+ const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5618
5814
  const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(
5619
5815
  req.__FARM_ROUTE__ || req.url || "/",
5620
5816
  i18nSnapshot,
5621
5817
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5622
5818
  ) : "";
5623
- const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
5819
+ const themeDocument = _chunkPXAHSCR6cjs.createFarmThemeDocumentParts.call(void 0,
5624
5820
  this.config.theme,
5625
5821
  this.config.basePath,
5626
5822
  _chunkQIXEU2WVcjs.getTheme.call(void 0, )
5627
5823
  );
5628
5824
  themeDocument.head = farmScripts(themeDocument.head);
5629
- const fullDocument = _chunk2MR4MABGcjs.extractFarmFullDocument.call(void 0, content);
5825
+ const fullDocument = _chunkPXAHSCR6cjs.extractFarmFullDocument.call(void 0, content);
5630
5826
  let html;
5631
5827
  if (fullDocument) {
5632
5828
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
5633
- const documentHtml = shouldReplaceLayoutTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5634
- const effectiveRendererHead = hasExplicitTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5635
- html = _chunk2MR4MABGcjs.composeFarmFullDocument.call(void 0, documentHtml, {
5829
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkPXAHSCR6cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5830
+ const effectiveRendererHead = hasExplicitTitle ? _chunkPXAHSCR6cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5831
+ html = _chunkPXAHSCR6cjs.composeFarmFullDocument.call(void 0, documentHtml, {
5636
5832
  fallbackIcon: !hasFavicon,
5637
5833
  viewport: viewportTags,
5638
5834
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -5658,7 +5854,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5658
5854
  });
5659
5855
  } else {
5660
5856
  html = `<!DOCTYPE html>
5661
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _204 => _204.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5857
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _216 => _216.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5662
5858
  <head>
5663
5859
  ${themeDocument.head}
5664
5860
  <meta charset="utf-8">
@@ -5689,7 +5885,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5689
5885
  const securedHtml = this.secureDocumentHTML(req, html);
5690
5886
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
5691
5887
  res.end();
5692
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _205 => _205.onComplete, 'optionalCall', _206 => _206(securedHtml)]);
5888
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _217 => _217.onComplete, 'optionalCall', _218 => _218(securedHtml)]);
5693
5889
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5694
5890
  type: "render.stream.complete",
5695
5891
  route,
@@ -5699,7 +5895,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5699
5895
  emitFarmRenderError(req, route, error);
5700
5896
  throw error;
5701
5897
  } finally {
5702
- _optionalChain([clearMiddlewareData, 'optionalCall', _207 => _207()]);
5898
+ _optionalChain([clearMiddlewareData, 'optionalCall', _219 => _219()]);
5703
5899
  }
5704
5900
  }
5705
5901
  /**
@@ -5714,7 +5910,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5714
5910
  if (!rootLayout) return false;
5715
5911
  try {
5716
5912
  const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
5717
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _208 => _208.prototype, 'optionalAccess', _209 => _209.isReactComponent]) || _optionalChain([Layout, 'access', _210 => _210.constructor, 'optionalAccess', _211 => _211.name]) === "AsyncFunction") {
5913
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _220 => _220.prototype, 'optionalAccess', _221 => _221.isReactComponent]) || _optionalChain([Layout, 'access', _222 => _222.constructor, 'optionalAccess', _223 => _223.name]) === "AsyncFunction") {
5718
5914
  return false;
5719
5915
  }
5720
5916
  const cached = documentLayouts.get(Layout);
@@ -5726,12 +5922,12 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5726
5922
  params: {}
5727
5923
  });
5728
5924
  rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
5729
- } catch (e15) {
5925
+ } catch (e16) {
5730
5926
  rendersDocument = false;
5731
5927
  }
5732
5928
  documentLayouts.set(Layout, rendersDocument);
5733
5929
  return rendersDocument;
5734
- } catch (e16) {
5930
+ } catch (e17) {
5735
5931
  return false;
5736
5932
  }
5737
5933
  }
@@ -5739,7 +5935,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5739
5935
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
5740
5936
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
5741
5937
  const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument();
5742
- if (!renderToPipeableStream || _chunkC2JOS77Zcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _212 => _212.headers, 'optionalAccess', _213 => _213[_chunkC2JOS77Zcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
5938
+ if (!renderToPipeableStream || _chunkHGB4PM2Ccjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _224 => _224.headers, 'optionalAccess', _225 => _225[_chunkHGB4PM2Ccjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
5743
5939
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
5744
5940
  }
5745
5941
  return new Promise((resolve3, reject) => {
@@ -5775,53 +5971,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5775
5971
  const pagePath = req.__FARM_PAGE_PATH__;
5776
5972
  const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
5777
5973
  const relativePath = pagePath ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
5778
- const manifest = _nullishCoalesce(options.routeManifest, () => ( this.routeManager.generateClientManifest(this.config.root)));
5779
- const clientManifest = {
5780
- clientEntry: "/@farm/client.js",
5781
- routes: {},
5782
- layouts: {},
5783
- slots: [],
5784
- sharedAssets: [
5785
- ...this.devGlobalStylesheetAssets(),
5786
- ...this.collectDevStyleHrefs().map((href) => ({
5787
- tag: "link",
5788
- attrs: { rel: "stylesheet", href }
5789
- }))
5790
- ]
5791
- };
5792
- for (const routeEntry of manifest.routes) {
5793
- clientManifest.routes[routeEntry.pattern] = {
5794
- modulePath: routeEntry.modulePath,
5795
- pattern: routeEntry.pattern,
5796
- segments: routeEntry.segments,
5797
- search: routeEntry.search,
5798
- isClientComponent: routeEntry.isClientComponent,
5799
- shouldHydrate: routeEntry.shouldHydrate,
5800
- islandStrategy: routeEntry.islandStrategy,
5801
- renderPlan: routeEntry.renderPlan,
5802
- preloads: [routeEntry.modulePath],
5803
- assets: []
5804
- };
5805
- }
5806
- for (const layoutEntry of manifest.layouts) {
5807
- clientManifest.layouts[layoutEntry.pattern] = {
5808
- modulePath: layoutEntry.modulePath,
5809
- pattern: layoutEntry.pattern,
5810
- shouldHydrate: layoutEntry.shouldHydrate,
5811
- islandStrategy: layoutEntry.islandStrategy,
5812
- // Islands mode: rebuilt from its server tree, so its module is never preloaded.
5813
- ...layoutEntry.serverTree ? { serverTree: true } : {},
5814
- preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
5815
- assets: []
5816
- };
5817
- }
5818
- for (const slotEntry of _nullishCoalesce(manifest.slots, () => ( []))) {
5819
- clientManifest.slots.push({
5820
- ...slotEntry,
5821
- preloads: [slotEntry.modulePath],
5822
- assets: []
5823
- });
5824
- }
5974
+ const clientManifest = this.createDevBootClientManifest(req, options);
5825
5975
  const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
5826
5976
  (slot) => ({
5827
5977
  ...slot,
@@ -5856,7 +6006,7 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
5856
6006
  )};
5857
6007
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5858
6008
  window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkJX5VOLAVcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5859
- window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6009
+ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5860
6010
  </script>${_chunkW44X6IC2cjs.renderFarmFormStateScript.call(void 0, )}`;
5861
6011
  const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
5862
6012
  const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
@@ -5871,16 +6021,16 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5871
6021
  viewport: viewportTags
5872
6022
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5873
6023
  pathname: getFarmMetadataPathname(req),
5874
- jsonLd: _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.jsonLd])
6024
+ jsonLd: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.jsonLd])
5875
6025
  });
5876
- const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
6026
+ const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5877
6027
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
5878
6028
  req.__FARM_ROUTE__ || req.url || "/",
5879
6029
  i18nSnapshot,
5880
6030
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5881
6031
  ) : "";
5882
6032
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
5883
- const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
6033
+ const themeDocument = _chunkPXAHSCR6cjs.createFarmThemeDocumentParts.call(void 0,
5884
6034
  this.config.theme,
5885
6035
  this.config.basePath,
5886
6036
  _chunkQIXEU2WVcjs.getTheme.call(void 0, )
@@ -5899,7 +6049,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5899
6049
  formState: _chunkW44X6IC2cjs.getFarmFormState.call(void 0, ),
5900
6050
  onShellReady() {
5901
6051
  if (pendingNavigationError) {
5902
- _optionalChain([abort, 'optionalCall', _217 => _217(pendingNavigationError)]);
6052
+ _optionalChain([abort, 'optionalCall', _229 => _229(pendingNavigationError)]);
5903
6053
  if (clearMiddlewareData) {
5904
6054
  clearMiddlewareData();
5905
6055
  }
@@ -5917,7 +6067,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5917
6067
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
5918
6068
  }
5919
6069
  const shell = `<!DOCTYPE html>
5920
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _218 => _218.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6070
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _230 => _230.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5921
6071
  <head>
5922
6072
  ${themeDocument.head}
5923
6073
  <meta charset="utf-8">
@@ -5935,11 +6085,20 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5935
6085
  <body class="">${earlyClient ? `
5936
6086
  ${earlyClientScript}` : ""}
5937
6087
  <div id="root">`;
5938
- const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
5939
- if (securedShell) {
5940
- htmlParts.push(securedShell);
5941
- _optionalChain([staticShellParts, 'optionalAccess', _219 => _219.push, 'call', _220 => _220(securedShell)]);
5942
- }
6088
+ let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
6089
+ let heldHead = "";
6090
+ const releaseShell = (complete) => {
6091
+ const split = _chunkPXAHSCR6cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
6092
+ if (!split) return null;
6093
+ const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkPXAHSCR6cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
6094
+ const opened = _chunkPXAHSCR6cjs.appendFarmHead.call(void 0, shellHead, split.head);
6095
+ pendingShell = "";
6096
+ heldHead = "";
6097
+ htmlParts.push(opened);
6098
+ _optionalChain([staticShellParts, 'optionalAccess', _231 => _231.push, 'call', _232 => _232(opened)]);
6099
+ res.write(opened);
6100
+ return split.body;
6101
+ };
5943
6102
  const withEarlyClient = (document) => earlyClient ? {
5944
6103
  ...document,
5945
6104
  html: document.html.replace(
@@ -5948,10 +6107,10 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5948
6107
  ${stampDocumentHTML(earlyClientScript)}`
5949
6108
  )
5950
6109
  } : document;
5951
- const documentTransform = streamDocument ? _chunk2MR4MABGcjs.createFarmStreamedDocumentTransform.call(void 0,
6110
+ const documentTransform = streamDocument ? _chunkPXAHSCR6cjs.createFarmStreamedDocumentTransform.call(void 0,
5952
6111
  (opening) => withEarlyClient(
5953
- _chunk2MR4MABGcjs.openFarmStreamedDocument.call(void 0,
5954
- hasExplicitTitle ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
6112
+ _chunkPXAHSCR6cjs.openFarmStreamedDocument.call(void 0,
6113
+ hasExplicitTitle ? _chunkPXAHSCR6cjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
5955
6114
  {
5956
6115
  fallbackIcon: !hasFavicon,
5957
6116
  viewport: viewportTags,
@@ -5990,7 +6149,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
5990
6149
  const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
5991
6150
  if (!checkedFullDocument && renderedText) {
5992
6151
  documentPrefix += renderedText;
5993
- const prefix = _chunk2MR4MABGcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6152
+ const prefix = _chunkPXAHSCR6cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
5994
6153
  if (prefix !== "pending") {
5995
6154
  checkedFullDocument = true;
5996
6155
  documentPrefix = "";
@@ -6009,7 +6168,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6009
6168
  staticShellClosed = true;
6010
6169
  if (!suspenseHoleEmitted) {
6011
6170
  suspenseHoleEmitted = true;
6012
- _optionalChain([options, 'access', _221 => _221.onSuspenseHoleDetected, 'optionalCall', _222 => _222()]);
6171
+ _optionalChain([options, 'access', _233 => _233.onSuspenseHoleDetected, 'optionalCall', _234 => _234()]);
6013
6172
  }
6014
6173
  } else {
6015
6174
  staticShellParts.push(chunkText);
@@ -6019,6 +6178,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6019
6178
  const writableStream = new (0, _stream.Writable)({
6020
6179
  write(chunk, encoding, callback) {
6021
6180
  if (flushMarker && chunk === flushMarker) {
6181
+ if (pendingShell) releaseShell(true);
6022
6182
  const marker = documentTransform ? documentTransform.write(flushMarker.toString()) : flushMarker;
6023
6183
  res.write(marker, () => {
6024
6184
  if (typeof res.flush === "function") res.flush();
@@ -6031,7 +6191,18 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6031
6191
  firstChunk = false;
6032
6192
  }
6033
6193
  const chunkText = Buffer.isBuffer(chunk) ? cspStreamDecoder ? cspStreamDecoder.decode(chunk, { stream: true }) : chunk.toString() : String(chunk);
6034
- const securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
6194
+ let securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
6195
+ let held = false;
6196
+ if (pendingShell) {
6197
+ heldHead += securedChunkText;
6198
+ const body = releaseShell(false);
6199
+ if (body === null) {
6200
+ callback();
6201
+ return;
6202
+ }
6203
+ securedChunkText = body;
6204
+ held = true;
6205
+ }
6035
6206
  const outputText = documentTransform ? documentTransform.write(securedChunkText) : securedChunkText;
6036
6207
  recordRenderedChunk(outputText, securedChunkText);
6037
6208
  const onWrite = () => {
@@ -6041,10 +6212,18 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6041
6212
  if (documentTransform) {
6042
6213
  if (outputText) res.write(outputText, onWrite);
6043
6214
  else callback();
6044
- } else if (cspNonceRewriter) res.write(securedChunkText, onWrite);
6215
+ } else if (cspNonceRewriter || held) res.write(securedChunkText, onWrite);
6045
6216
  else res.write(chunk, encoding, onWrite);
6046
6217
  },
6047
6218
  final: (callback) => {
6219
+ if (pendingShell) {
6220
+ const body = releaseShell(true);
6221
+ if (body) {
6222
+ htmlParts.push(body);
6223
+ _optionalChain([staticShellParts, 'optionalAccess', _235 => _235.push, 'call', _236 => _236(body)]);
6224
+ res.write(body);
6225
+ }
6226
+ }
6048
6227
  if (lateNavigationError) {
6049
6228
  const navigationError = lateNavigationError;
6050
6229
  lateNavigationError = null;
@@ -6073,8 +6252,8 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6073
6252
  recordRenderedChunk(tail, rewritten);
6074
6253
  if (tail) res.write(tail);
6075
6254
  }
6076
- const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _223 => _223.end, 'call', _224 => _224()]);
6077
- if (_optionalChain([documentEnd, 'optionalAccess', _225 => _225.text])) {
6255
+ const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _237 => _237.end, 'call', _238 => _238()]);
6256
+ if (_optionalChain([documentEnd, 'optionalAccess', _239 => _239.text])) {
6078
6257
  recordRenderedChunk(documentEnd.text, "");
6079
6258
  res.write(documentEnd.text);
6080
6259
  }
@@ -6085,7 +6264,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6085
6264
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
6086
6265
  earlyClient,
6087
6266
  // A full document: Farm's #root closes only where Farm opened it.
6088
- ..._optionalChain([documentEnd, 'optionalAccess', _226 => _226.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6267
+ ..._optionalChain([documentEnd, 'optionalAccess', _240 => _240.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6089
6268
  })
6090
6269
  );
6091
6270
  htmlParts.push(footer);
@@ -6117,7 +6296,6 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6117
6296
  });
6118
6297
  resolve3();
6119
6298
  };
6120
- res.write(securedShell);
6121
6299
  if (typeof res.flush === "function") {
6122
6300
  res.flush();
6123
6301
  }
@@ -6185,7 +6363,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6185
6363
  };
6186
6364
  }
6187
6365
  localizeRedirectUrl(url) {
6188
- const snapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
6366
+ const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
6189
6367
  return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
6190
6368
  }
6191
6369
  /** The app's not-found component, or null when it relies on the built-in page. */
@@ -6198,7 +6376,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6198
6376
  return await this.routeManager.loadRouteModule(notFoundPath);
6199
6377
  }
6200
6378
  async loadNotFoundComponent() {
6201
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _227 => _227.default]), async () => ( null));
6379
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _241 => _241.default]), async () => ( null));
6202
6380
  }
6203
6381
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
6204
6382
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -6221,34 +6399,33 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6221
6399
  */
6222
6400
  async createLateNavigationRecoveryHTML(req, error) {
6223
6401
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
6224
- return _chunk2MR4MABGcjs.createLateRedirectRecovery.call(void 0,
6402
+ return _chunkPXAHSCR6cjs.createLateRedirectRecovery.call(void 0,
6225
6403
  this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
6226
6404
  this.getCspNonce(req) || ""
6227
6405
  );
6228
6406
  }
6229
6407
  const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6230
- trustProxy: _optionalChain([this, 'access', _228 => _228.config, 'access', _229 => _229.server, 'optionalAccess', _230 => _230.trustProxy])
6408
+ trustProxy: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.server, 'optionalAccess', _244 => _244.trustProxy])
6231
6409
  }).pathname;
6232
6410
  let content = this.defaultNotFoundContent();
6233
6411
  const NotFoundComponent = await this.loadNotFoundComponent();
6234
6412
  if (NotFoundComponent) {
6235
6413
  try {
6236
- content = await this.rendererRuntime.renderToString(
6414
+ content = await this.renderElementToCompleteHTML(
6237
6415
  await this.wrapWithIntegrationProviders(
6238
6416
  this.rendererRuntime.createElement(NotFoundComponent, { pathname })
6239
- ),
6240
- rendererRenderOptions()
6417
+ )
6241
6418
  );
6242
6419
  } catch (error2) {
6243
6420
  _chunkQMNWKQL4cjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
6244
6421
  }
6245
6422
  }
6246
- return _chunk2MR4MABGcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6423
+ return _chunkPXAHSCR6cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6247
6424
  }
6248
6425
  async render404(req, res) {
6249
6426
  res.statusCode = 404;
6250
6427
  const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6251
- trustProxy: _optionalChain([this, 'access', _231 => _231.config, 'access', _232 => _232.server, 'optionalAccess', _233 => _233.trustProxy])
6428
+ trustProxy: _optionalChain([this, 'access', _245 => _245.config, 'access', _246 => _246.server, 'optionalAccess', _247 => _247.trustProxy])
6252
6429
  }).pathname;
6253
6430
  if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6254
6431
  res.setHeader("Content-Type", "application/json");
@@ -6265,11 +6442,11 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6265
6442
  }
6266
6443
  const acceptHeader = req.headers.accept;
6267
6444
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
6268
- if (_chunkC2JOS77Zcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6269
- res.setHeader("Content-Type", _chunkC2JOS77Zcjs.FARM_MARKDOWN_CONTENT_TYPE);
6445
+ if (_chunkHGB4PM2Ccjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6446
+ res.setHeader("Content-Type", _chunkHGB4PM2Ccjs.FARM_MARKDOWN_CONTENT_TYPE);
6270
6447
  res.setHeader("X-Farm-Markdown-Error", "404");
6271
6448
  res.setHeader("Cache-Control", "no-store");
6272
- res.end(_chunkC2JOS77Zcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6449
+ res.end(_chunkHGB4PM2Ccjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6273
6450
  return;
6274
6451
  }
6275
6452
  const appDir = path9.join(this.config.root, this.config.srcDir, "app");
@@ -6289,9 +6466,9 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6289
6466
  );
6290
6467
  if (notFoundPath) {
6291
6468
  const notFoundModule = await this.loadNotFoundModule();
6292
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _234 => _234.default]), () => ( null));
6469
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _248 => _248.default]), () => ( null));
6293
6470
  if (NotFoundComponent) {
6294
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _235 => _235.default]), () => ( null));
6471
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _249 => _249.default]), () => ( null));
6295
6472
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
6296
6473
  if (LayoutComponent) {
6297
6474
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -6299,10 +6476,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6299
6476
  });
6300
6477
  }
6301
6478
  element = await this.wrapWithIntegrationProviders(element);
6302
- const content = await this.rendererRuntime.renderToString(
6303
- element,
6304
- rendererRenderOptions()
6305
- );
6479
+ const content = await this.renderElementToCompleteHTML(element);
6306
6480
  const { head: head2, metadata: metadata2 } = await this.notFoundMetadataHead(layoutModule, notFoundModule);
6307
6481
  const html2 = this.createFullHTML(content, false, pathname, head2, { req, metadata: metadata2 });
6308
6482
  res.setHeader("Content-Type", "text/html; charset=utf-8");
@@ -6331,23 +6505,23 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6331
6505
  res.statusCode = statusCode;
6332
6506
  const isDev = process.env.NODE_ENV === "development";
6333
6507
  const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6334
- trustProxy: _optionalChain([this, 'access', _236 => _236.config, 'access', _237 => _237.server, 'optionalAccess', _238 => _238.trustProxy])
6508
+ trustProxy: _optionalChain([this, 'access', _250 => _250.config, 'access', _251 => _251.server, 'optionalAccess', _252 => _252.trustProxy])
6335
6509
  });
6336
6510
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
6337
- const statusText = _chunk2MR4MABGcjs.getDefaultErrorStatusText.call(void 0, statusCode);
6511
+ const statusText = _chunkPXAHSCR6cjs.getDefaultErrorStatusText.call(void 0, statusCode);
6338
6512
  const content = this.stampFarmScripts(
6339
6513
  req,
6340
- _chunk2MR4MABGcjs.createDefaultErrorMarkup.call(void 0, {
6514
+ _chunkPXAHSCR6cjs.createDefaultErrorMarkup.call(void 0, {
6341
6515
  statusCode,
6342
6516
  statusText,
6343
6517
  requestPath: requestUrl.pathname,
6344
6518
  method: req.method || "GET",
6345
- message: _optionalChain([diagnostics, 'optionalAccess', _239 => _239.message]),
6346
- errorName: _optionalChain([diagnostics, 'optionalAccess', _240 => _240.name]),
6347
- stack: _optionalChain([diagnostics, 'optionalAccess', _241 => _241.stack]),
6348
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _242 => _242.sourceFrame]),
6519
+ message: _optionalChain([diagnostics, 'optionalAccess', _253 => _253.message]),
6520
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _254 => _254.name]),
6521
+ stack: _optionalChain([diagnostics, 'optionalAccess', _255 => _255.stack]),
6522
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _256 => _256.sourceFrame]),
6349
6523
  development: isDev,
6350
- farmVersion: _chunkMEJCP2LXcjs.FARM_VERSION,
6524
+ farmVersion: _chunkUVQRMUARcjs.FARM_VERSION,
6351
6525
  nodeVersion: process.version,
6352
6526
  mode: isDev ? "development" : "production"
6353
6527
  })
@@ -6373,12 +6547,12 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
6373
6547
  */
6374
6548
  getI18nAlternateOptions(req, metadata) {
6375
6549
  return {
6376
- metadataBase: _optionalChain([metadata, 'optionalAccess', _243 => _243.metadataBase]),
6377
- origin: req ? _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.server, 'optionalAccess', _246 => _246.trustProxy]) }).origin : void 0
6550
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _257 => _257.metadataBase]),
6551
+ origin: req ? _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.server, 'optionalAccess', _260 => _260.trustProxy]) }).origin : void 0
6378
6552
  };
6379
6553
  }
6380
6554
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
6381
- const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
6555
+ const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
6382
6556
  const farmScripts = (html) => this.stampFarmScripts(alternates.req, html);
6383
6557
  const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
6384
6558
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
@@ -6393,20 +6567,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6393
6567
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
6394
6568
  ) : "";
6395
6569
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6396
- const themeDocument = _chunk2MR4MABGcjs.createFarmThemeDocumentParts.call(void 0,
6570
+ const themeDocument = _chunkPXAHSCR6cjs.createFarmThemeDocumentParts.call(void 0,
6397
6571
  this.config.theme,
6398
6572
  this.config.basePath,
6399
6573
  _chunkQIXEU2WVcjs.getTheme.call(void 0, )
6400
6574
  );
6401
6575
  themeDocument.head = farmScripts(themeDocument.head);
6402
6576
  const rendererHydrationScript = farmScripts(
6403
- _optionalChain([this, 'access', _247 => _247.rendererRuntime, 'access', _248 => _248.generateHydrationScript, 'optionalCall', _249 => _249()]) || ""
6577
+ _optionalChain([this, 'access', _261 => _261.rendererRuntime, 'access', _262 => _262.generateHydrationScript, 'optionalCall', _263 => _263()]) || ""
6404
6578
  );
6405
- const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _250 => _250.metadata, 'optionalAccess', _251 => _251.viewport]));
6406
- const fullDocument = _chunk2MR4MABGcjs.extractFarmFullDocument.call(void 0, content);
6579
+ const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _264 => _264.metadata, 'optionalAccess', _265 => _265.viewport]));
6580
+ const fullDocument = _chunkPXAHSCR6cjs.extractFarmFullDocument.call(void 0, content);
6407
6581
  if (fullDocument) {
6408
- return _chunk2MR4MABGcjs.composeFarmFullDocument.call(void 0,
6409
- metadataHead ? _chunk2MR4MABGcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6582
+ return _chunkPXAHSCR6cjs.composeFarmFullDocument.call(void 0,
6583
+ metadataHead ? _chunkPXAHSCR6cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6410
6584
  {
6411
6585
  fallbackIcon: !metadataHead,
6412
6586
  viewport: viewportTags,
@@ -6432,7 +6606,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6432
6606
  );
6433
6607
  }
6434
6608
  return `<!DOCTYPE html>
6435
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _252 => _252.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6609
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _266 => _266.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6436
6610
  <head>
6437
6611
  ${themeDocument.head}
6438
6612
  <meta charset="utf-8">
@@ -6474,7 +6648,7 @@ ${clientScript}
6474
6648
  res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6475
6649
  if ((req.method || "GET").toUpperCase() !== "GET") return;
6476
6650
  const forwardedProto = req.headers["x-forwarded-proto"];
6477
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _253 => _253.split, 'call', _254 => _254(","), 'access', _255 => _255[0], 'optionalAccess', _256 => _256.trim, 'call', _257 => _257()]) === "https" || Boolean(_optionalChain([req, 'access', _258 => _258.socket, 'optionalAccess', _259 => _259.encrypted]));
6651
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _267 => _267.split, 'call', _268 => _268(","), 'access', _269 => _269[0], 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]) === "https" || Boolean(_optionalChain([req, 'access', _272 => _272.socket, 'optionalAccess', _273 => _273.encrypted]));
6478
6652
  const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
6479
6653
  const existing = res.getHeader("Set-Cookie");
6480
6654
  if (Array.isArray(existing)) {
@@ -6516,8 +6690,8 @@ var FarmApp = class {
6516
6690
  this.config = this.normalizeConfig(config);
6517
6691
  _chunkEVIWKPJVcjs.configureFarmObservability.call(void 0, this.config.observability);
6518
6692
  _chunkQIXEU2WVcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6519
- this.i18nRuntime = _chunk2AM26UGIcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
6520
- _chunk2AM26UGIcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
6693
+ this.i18nRuntime = _chunkNLBK37HIcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
6694
+ _chunkNLBK37HIcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
6521
6695
  this.viteServer = viteServer;
6522
6696
  this.routeManager = new RouteManager(this.config, viteServer);
6523
6697
  this.serverRenderer = new ServerRenderer(
@@ -6589,9 +6763,9 @@ var FarmApp = class {
6589
6763
  config.images,
6590
6764
  _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
6591
6765
  ),
6592
- performance: _chunkZUVAGMQ5cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6766
+ performance: _chunkODBM54RTcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6593
6767
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
6594
- i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
6768
+ i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
6595
6769
  root,
6596
6770
  mode: process.env.NODE_ENV === "production" ? "production" : "development",
6597
6771
  basePath
@@ -6601,7 +6775,7 @@ var FarmApp = class {
6601
6775
  serverRuntimeConfig: config.serverRuntimeConfig || {},
6602
6776
  publicRuntimeConfig: config.publicRuntimeConfig || {},
6603
6777
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
6604
- md: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, config.md),
6778
+ md: _chunkHGB4PM2Ccjs.resolveMarkdownConfig.call(void 0, config.md),
6605
6779
  mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
6606
6780
  observability: _nullishCoalesce(config.observability, () => ( false)),
6607
6781
  telemetry: config.telemetry !== false,
@@ -6617,10 +6791,10 @@ var FarmApp = class {
6617
6791
  env: config.env || { server: {}, public: {} },
6618
6792
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
6619
6793
  experimental: {
6620
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _260 => _260.experimental, 'optionalAccess', _261 => _261.serverComponents]), () => ( false)),
6621
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _262 => _262.experimental, 'optionalAccess', _263 => _263.serverActions]), () => ( false)),
6622
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _264 => _264.experimental, 'optionalAccess', _265 => _265.isolatedClientHydration]), () => ( "off")),
6623
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _266 => _266.experimental, 'optionalAccess', _267 => _267.ppr]), () => ( false)),
6794
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _274 => _274.experimental, 'optionalAccess', _275 => _275.serverComponents]), () => ( false)),
6795
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _276 => _276.experimental, 'optionalAccess', _277 => _277.serverActions]), () => ( false)),
6796
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _278 => _278.experimental, 'optionalAccess', _279 => _279.isolatedClientHydration]), () => ( "off")),
6797
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _280 => _280.experimental, 'optionalAccess', _281 => _281.ppr]), () => ( false)),
6624
6798
  ...config.experimental
6625
6799
  },
6626
6800
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -6679,7 +6853,7 @@ function isResolvedAuthConfig(value) {
6679
6853
  );
6680
6854
  }
6681
6855
  function normalizeFarmAppAPIConfig(config) {
6682
- if (typeof _optionalChain([config, 'optionalAccess', _268 => _268.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _269 => _269.basePath]) === "function") {
6856
+ if (typeof _optionalChain([config, 'optionalAccess', _282 => _282.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _283 => _283.basePath]) === "function") {
6683
6857
  throw new Error(
6684
6858
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
6685
6859
  );
@@ -6694,7 +6868,7 @@ function createFarmApp(config, viteServer) {
6694
6868
  var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
6695
6869
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
6696
6870
  function resolveFarmImageProviderForRuntime(images, options) {
6697
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _270 => _270.provider]), () => ( "auto"));
6871
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _284 => _284.provider]), () => ( "auto"));
6698
6872
  if (provider === "none") return images;
6699
6873
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
6700
6874
  if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -6729,7 +6903,7 @@ function resolveFarmAppPackages(root) {
6729
6903
  let manifest;
6730
6904
  try {
6731
6905
  manifest = JSON.parse(fs.default.readFileSync(path3.default.join(root, "package.json"), "utf8"));
6732
- } catch (e17) {
6906
+ } catch (e18) {
6733
6907
  return {};
6734
6908
  }
6735
6909
  const names = new Set(
@@ -6748,7 +6922,7 @@ function resolveFarmAppPackages(root) {
6748
6922
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
6749
6923
  versions[name] = version;
6750
6924
  break;
6751
- } catch (e18) {
6925
+ } catch (e19) {
6752
6926
  const parent = path3.default.dirname(dir);
6753
6927
  if (parent === dir) break;
6754
6928
  dir = parent;
@@ -6823,9 +6997,9 @@ function staticValue(node) {
6823
6997
  }
6824
6998
  }
6825
6999
  function property(object, name) {
6826
- return _optionalChain([object, 'access', _271 => _271.properties, 'access', _272 => _272.find, 'call', _273 => _273(
7000
+ return _optionalChain([object, 'access', _285 => _285.properties, 'access', _286 => _286.find, 'call', _287 => _287(
6827
7001
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
6828
- ), 'optionalAccess', _274 => _274.value]);
7002
+ ), 'optionalAccess', _288 => _288.value]);
6829
7003
  }
6830
7004
  function toolFromObject(object) {
6831
7005
  const name = staticValue(property(object, "name"));
@@ -6863,7 +7037,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6863
7037
  let program;
6864
7038
  try {
6865
7039
  program = parseAst2(code, { lang });
6866
- } catch (e19) {
7040
+ } catch (e20) {
6867
7041
  return [];
6868
7042
  }
6869
7043
  const locals = /* @__PURE__ */ new Map();
@@ -6871,7 +7045,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6871
7045
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
6872
7046
  continue;
6873
7047
  for (const specifier of statement.specifiers) {
6874
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _275 => _275.imported, 'optionalAccess', _276 => _276.name]), () => ( _optionalChain([specifier, 'access', _277 => _277.imported, 'optionalAccess', _278 => _278.value])));
7048
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _289 => _289.imported, 'optionalAccess', _290 => _290.name]), () => ( _optionalChain([specifier, 'access', _291 => _291.imported, 'optionalAccess', _292 => _292.value])));
6875
7049
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
6876
7050
  locals.set(specifier.local.name, imported);
6877
7051
  }
@@ -6887,7 +7061,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6887
7061
  const [argument] = current.arguments;
6888
7062
  if (definer && argument) {
6889
7063
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
6890
- (element) => _optionalChain([element, 'optionalAccess', _279 => _279.type]) === "ObjectExpression"
7064
+ (element) => _optionalChain([element, 'optionalAccess', _293 => _293.type]) === "ObjectExpression"
6891
7065
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
6892
7066
  for (const object of objects) {
6893
7067
  const tool = toolFromObject(object);
@@ -6912,7 +7086,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6912
7086
  expandDirectories: false,
6913
7087
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
6914
7088
  });
6915
- } catch (e20) {
7089
+ } catch (e21) {
6916
7090
  return [];
6917
7091
  }
6918
7092
  const seen = /* @__PURE__ */ new Set();
@@ -6921,7 +7095,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6921
7095
  let mtimeMs;
6922
7096
  try {
6923
7097
  mtimeMs = fs.default.statSync(file).mtimeMs;
6924
- } catch (e21) {
7098
+ } catch (e22) {
6925
7099
  continue;
6926
7100
  }
6927
7101
  let entry = cache.get(file);
@@ -6929,7 +7103,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6929
7103
  let code = "";
6930
7104
  try {
6931
7105
  code = fs.default.readFileSync(file, "utf8");
6932
- } catch (e22) {
7106
+ } catch (e23) {
6933
7107
  }
6934
7108
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
6935
7109
  cache.set(file, entry);
@@ -6948,8 +7122,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6948
7122
 
6949
7123
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
6950
7124
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
6951
- const client = _optionalChain([cache2, 'optionalAccess', _280 => _280.client]);
6952
- const adapter = _optionalChain([client, 'optionalAccess', _281 => _281.adapter]);
7125
+ const client = _optionalChain([cache2, 'optionalAccess', _294 => _294.client]);
7126
+ const adapter = _optionalChain([client, 'optionalAccess', _295 => _295.adapter]);
6953
7127
  if (adapter === void 0) return void 0;
6954
7128
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
6955
7129
  throw new Error(
@@ -6964,8 +7138,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
6964
7138
  );
6965
7139
  }
6966
7140
  const options = {};
6967
- if (_optionalChain([client, 'optionalAccess', _282 => _282.version]) !== void 0) options.version = client.version;
6968
- if (_optionalChain([client, 'optionalAccess', _283 => _283.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
7141
+ if (_optionalChain([client, 'optionalAccess', _296 => _296.version]) !== void 0) options.version = client.version;
7142
+ if (_optionalChain([client, 'optionalAccess', _297 => _297.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
6969
7143
  return { importPath: found.replace(/\\/g, "/"), options };
6970
7144
  }
6971
7145
  function resolveAdapterFile(resolved) {
@@ -7335,7 +7509,7 @@ function fileNamePattern(files) {
7335
7509
  names.add(path3.default.basename(file));
7336
7510
  try {
7337
7511
  names.add(path3.default.basename(_fs.realpathSync.call(void 0, file)));
7338
- } catch (e23) {
7512
+ } catch (e24) {
7339
7513
  }
7340
7514
  }
7341
7515
  return new RegExp(`(?:^|/)(?:${[...names].map(escapeRegExp).join("|")})(?:\\?.*)?$`);
@@ -7371,7 +7545,7 @@ function redactFarmDocsClientConfig(code, filename) {
7371
7545
  const current = node;
7372
7546
  if (current.type === "Property") {
7373
7547
  const name = propertyKeyName(current);
7374
- const valueType = _optionalChain([current, 'access', _284 => _284.value, 'optionalAccess', _285 => _285.type]);
7548
+ const valueType = _optionalChain([current, 'access', _298 => _298.value, 'optionalAccess', _299 => _299.type]);
7375
7549
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
7376
7550
  if (name && credential) {
7377
7551
  edits.push(
@@ -7402,7 +7576,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
7402
7576
  if (file === configModule) return true;
7403
7577
  try {
7404
7578
  return file === _fs.realpathSync.call(void 0, configModule).replace(/\\/g, "/");
7405
- } catch (e24) {
7579
+ } catch (e25) {
7406
7580
  return false;
7407
7581
  }
7408
7582
  }
@@ -7414,7 +7588,7 @@ function farmDocsClientConfigPlugin(configModule) {
7414
7588
  // Never matches without a docs config module, so the bundler never calls the handler.
7415
7589
  filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
7416
7590
  handler(code, id, options) {
7417
- if (_optionalChain([options, 'optionalAccess', _286 => _286.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7591
+ if (_optionalChain([options, 'optionalAccess', _300 => _300.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7418
7592
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7419
7593
  return redacted === null ? null : { code: redacted, map: null };
7420
7594
  }
@@ -7446,7 +7620,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
7446
7620
  ];
7447
7621
  function getFarmClientOptimizeDepsInclude(renderer) {
7448
7622
  return Array.from(
7449
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _287 => _287.optimizeDeps]) || []])
7623
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _301 => _301.optimizeDeps]) || []])
7450
7624
  );
7451
7625
  }
7452
7626
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
@@ -7470,7 +7644,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
7470
7644
  // Farm's HTML boots through a virtual module and imports route UI lazily.
7471
7645
  // Explicit entries let Vite finish that crawl before a navigation can
7472
7646
  // rotate the optimizer hash underneath a hydrated React runtime.
7473
- ..._optionalChain([entries, 'optionalAccess', _288 => _288.length]) ? { entries: [...entries] } : {}
7647
+ ..._optionalChain([entries, 'optionalAccess', _302 => _302.length]) ? { entries: [...entries] } : {}
7474
7648
  };
7475
7649
  }
7476
7650
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
@@ -7502,8 +7676,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
7502
7676
  return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
7503
7677
  }
7504
7678
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7505
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _289 => _289.optimizeDeps, 'optionalAccess', _290 => _290.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _291 => _291.optimizeDeps, 'optionalAccess', _292 => _292.noDiscovery])));
7506
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _293 => _293.optimizeDeps, 'optionalAccess', _294 => _294.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _295 => _295.optimizeDeps, 'optionalAccess', _296 => _296.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _297 => _297.optimizeDeps, 'optionalAccess', _298 => _298.holdUntilCrawlEnd]))));
7679
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _303 => _303.optimizeDeps, 'optionalAccess', _304 => _304.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _305 => _305.optimizeDeps, 'optionalAccess', _306 => _306.noDiscovery])));
7680
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _307 => _307.optimizeDeps, 'optionalAccess', _308 => _308.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _309 => _309.optimizeDeps, 'optionalAccess', _310 => _310.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _311 => _311.optimizeDeps, 'optionalAccess', _312 => _312.holdUntilCrawlEnd]))));
7507
7681
  return {
7508
7682
  ...farmConfig,
7509
7683
  ...userConfig,
@@ -7515,9 +7689,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7515
7689
  resolve: {
7516
7690
  ...farmConfig.resolve,
7517
7691
  ...userConfig.resolve,
7518
- alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _299 => _299.resolve, 'optionalAccess', _300 => _300.alias]), _optionalChain([userConfig, 'access', _301 => _301.resolve, 'optionalAccess', _302 => _302.alias])),
7692
+ alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _313 => _313.resolve, 'optionalAccess', _314 => _314.alias]), _optionalChain([userConfig, 'access', _315 => _315.resolve, 'optionalAccess', _316 => _316.alias])),
7519
7693
  dedupe: Array.from(
7520
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _303 => _303.resolve, 'optionalAccess', _304 => _304.dedupe]) || [], ..._optionalChain([userConfig, 'access', _305 => _305.resolve, 'optionalAccess', _306 => _306.dedupe]) || []])
7694
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _317 => _317.resolve, 'optionalAccess', _318 => _318.dedupe]) || [], ..._optionalChain([userConfig, 'access', _319 => _319.resolve, 'optionalAccess', _320 => _320.dedupe]) || []])
7521
7695
  )
7522
7696
  },
7523
7697
  optimizeDeps: {
@@ -7527,21 +7701,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7527
7701
  holdUntilCrawlEnd,
7528
7702
  include: Array.from(
7529
7703
  /* @__PURE__ */ new Set([
7530
- ..._optionalChain([farmConfig, 'access', _307 => _307.optimizeDeps, 'optionalAccess', _308 => _308.include]) || [],
7531
- ..._optionalChain([userConfig, 'access', _309 => _309.optimizeDeps, 'optionalAccess', _310 => _310.include]) || []
7704
+ ..._optionalChain([farmConfig, 'access', _321 => _321.optimizeDeps, 'optionalAccess', _322 => _322.include]) || [],
7705
+ ..._optionalChain([userConfig, 'access', _323 => _323.optimizeDeps, 'optionalAccess', _324 => _324.include]) || []
7532
7706
  ])
7533
7707
  ),
7534
7708
  exclude: Array.from(
7535
7709
  /* @__PURE__ */ new Set([
7536
- ..._optionalChain([farmConfig, 'access', _311 => _311.optimizeDeps, 'optionalAccess', _312 => _312.exclude]) || [],
7537
- ..._optionalChain([userConfig, 'access', _313 => _313.optimizeDeps, 'optionalAccess', _314 => _314.exclude]) || []
7710
+ ..._optionalChain([farmConfig, 'access', _325 => _325.optimizeDeps, 'optionalAccess', _326 => _326.exclude]) || [],
7711
+ ..._optionalChain([userConfig, 'access', _327 => _327.optimizeDeps, 'optionalAccess', _328 => _328.exclude]) || []
7538
7712
  ])
7539
7713
  )
7540
7714
  },
7541
7715
  ssr: {
7542
7716
  ...farmConfig.ssr,
7543
7717
  ...userConfig.ssr,
7544
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _315 => _315.ssr, 'optionalAccess', _316 => _316.noExternal]), _optionalChain([userConfig, 'access', _317 => _317.ssr, 'optionalAccess', _318 => _318.noExternal]))
7718
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _329 => _329.ssr, 'optionalAccess', _330 => _330.noExternal]), _optionalChain([userConfig, 'access', _331 => _331.ssr, 'optionalAccess', _332 => _332.noExternal]))
7545
7719
  }
7546
7720
  };
7547
7721
  }
@@ -7612,8 +7786,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
7612
7786
  ...userRolldownOptions
7613
7787
  };
7614
7788
  const merged = mergeFarmViteConfig(farmConfig, shared);
7615
- const farmBundlerOptions = _optionalChain([farmConfig, 'access', _319 => _319.build, 'optionalAccess', _320 => _320.rollupOptions]);
7616
- const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _321 => _321.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _322 => _322.output]);
7789
+ const farmBundlerOptions = _optionalChain([farmConfig, 'access', _333 => _333.build, 'optionalAccess', _334 => _334.rollupOptions]);
7790
+ const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _335 => _335.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _336 => _336.output]);
7617
7791
  return {
7618
7792
  ...merged,
7619
7793
  build: {
@@ -7630,7 +7804,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
7630
7804
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
7631
7805
  ssr: {
7632
7806
  ...merged.ssr,
7633
- external: mergeExternal(_optionalChain([farmConfig, 'access', _323 => _323.ssr, 'optionalAccess', _324 => _324.external]), _optionalChain([userConfig, 'access', _325 => _325.ssr, 'optionalAccess', _326 => _326.external]))
7807
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _337 => _337.ssr, 'optionalAccess', _338 => _338.external]), _optionalChain([userConfig, 'access', _339 => _339.ssr, 'optionalAccess', _340 => _340.external]))
7634
7808
  }
7635
7809
  };
7636
7810
  }
@@ -7701,4 +7875,6 @@ ${FARM_DARK_VARIANT}
7701
7875
 
7702
7876
 
7703
7877
 
7704
- exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
7878
+
7879
+
7880
+ exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.createFarmDevClientManifest = createFarmDevClientManifest; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.invalidateFarmRouteRootInferences = invalidateFarmRouteRootInferences; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;