@farm.js/core 0.1.70 → 0.1.72

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 (242) hide show
  1. package/dist/{agent-mcp-handler-6T2Z7TB6.cjs → agent-mcp-handler-KE4J3W7S.cjs} +4 -4
  2. package/dist/{agent-mcp-handler-CPU354QQ.mjs → agent-mcp-handler-VIT4GOSR.mjs} +3 -3
  3. package/dist/{agent-mcp.d-DulgFLBt.d.ts → agent-mcp.d-BO3rZXEM.d.ts} +15 -5
  4. package/dist/{agent-mcp.d-TAs1ES2F.d.mts → agent-mcp.d-Cwff7lcA.d.mts} +15 -5
  5. package/dist/agent-runtime.d.mts +3 -3
  6. package/dist/agent-runtime.d.ts +3 -3
  7. package/dist/{analyzer-QGRBLETM.mjs → analyzer-5Q75LTIL.mjs} +2 -2
  8. package/dist/analyzer-UJG4MIZW.cjs +16 -0
  9. package/dist/api/node.d.mts +5 -5
  10. package/dist/api/node.d.ts +5 -5
  11. package/dist/api/route-manager.cjs +7 -6
  12. package/dist/api/route-manager.d.mts +7 -7
  13. package/dist/api/route-manager.d.ts +7 -7
  14. package/dist/api/route-manager.mjs +6 -5
  15. package/dist/api/runtime.d.mts +4 -4
  16. package/dist/api/runtime.d.ts +4 -4
  17. package/dist/api.cjs +8 -7
  18. package/dist/api.d.mts +8 -8
  19. package/dist/api.d.ts +8 -8
  20. package/dist/api.mjs +7 -6
  21. package/dist/{app-manifest.d-C-nf3Vmm.d.ts → app-manifest.d-DwjGkYlP.d.ts} +1 -1
  22. package/dist/{app-manifest.d-6zXb90o6.d.mts → app-manifest.d-USD_IbFd.d.mts} +1 -1
  23. package/dist/app-markdown.cjs +5 -3
  24. package/dist/app-markdown.d.mts +5 -5
  25. package/dist/app-markdown.d.ts +5 -5
  26. package/dist/app-markdown.mjs +4 -2
  27. package/dist/{app.d-C2xeMIYT.d.ts → app.d-DAmF2MAk.d.ts} +52 -8
  28. package/dist/{app.d-DF0aundc.d.mts → app.d-fW06_h8h.d.mts} +52 -8
  29. package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
  30. package/dist/{chunk-JRF2SKCD.mjs → chunk-3JN5M3T5.mjs} +259 -61
  31. package/dist/{chunk-XYVPTTUT.cjs → chunk-3WG7GJQL.cjs} +11 -6
  32. package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
  33. package/dist/{chunk-I7NUT24Z.cjs → chunk-5R4Q5FN7.cjs} +2 -2
  34. package/dist/{chunk-BPUVDCGG.cjs → chunk-5X6OHJEE.cjs} +15 -3
  35. package/dist/{chunk-RMOU3PR4.mjs → chunk-5XFKWHZD.mjs} +293 -66
  36. package/dist/{chunk-A2TH5MKE.mjs → chunk-645ENY7W.mjs} +3 -3
  37. package/dist/{chunk-NYF7A4UW.mjs → chunk-77VNYVVX.mjs} +1 -1
  38. package/dist/{chunk-32SYRIQ7.cjs → chunk-7QCJDYZQ.cjs} +3 -3
  39. package/dist/{chunk-QZHTDVH4.mjs → chunk-AUAMXI6N.mjs} +1 -1
  40. package/dist/{chunk-5R3JQPWD.mjs → chunk-AYVGD3PK.mjs} +1 -1
  41. package/dist/{chunk-IEN2EFE5.cjs → chunk-BE7AQXJB.cjs} +346 -148
  42. package/dist/{chunk-CCHJWJGP.mjs → chunk-BSXKZPFE.mjs} +204 -98
  43. package/dist/{chunk-2MR4MABG.cjs → chunk-C5AM2XDN.cjs} +54 -4
  44. package/dist/{chunk-M6U6E4F7.cjs → chunk-CBLRSZQL.cjs} +557 -330
  45. package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
  46. package/dist/{chunk-5IJRJWJS.mjs → chunk-DGNMXL2O.mjs} +11 -1
  47. package/dist/{chunk-3EXCZJEN.mjs → chunk-DS7JGFW5.mjs} +13 -1
  48. package/dist/{chunk-EDZU7YRK.mjs → chunk-E2V7RRFL.mjs} +2 -2
  49. package/dist/{chunk-K7JMTAFH.cjs → chunk-E3LE6EZH.cjs} +20 -10
  50. package/dist/{chunk-DIHBWZDZ.cjs → chunk-ET6WW3FY.cjs} +636 -355
  51. package/dist/{chunk-65FPDDT4.cjs → chunk-EXN4DTVF.cjs} +2 -2
  52. package/dist/{chunk-K4UGCUXX.cjs → chunk-FSSONJRV.cjs} +7 -7
  53. package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
  54. package/dist/{chunk-FJ5YCERM.cjs → chunk-HLMUWKAP.cjs} +466 -359
  55. package/dist/{chunk-A7HCBHMC.cjs → chunk-IWCYRDRQ.cjs} +3 -3
  56. package/dist/{chunk-R7254L3R.mjs → chunk-J5ASGNKF.mjs} +23 -0
  57. package/dist/{chunk-75E5FDX2.mjs → chunk-JMFTKNBA.mjs} +10 -10
  58. package/dist/{chunk-TLSSIYAL.mjs → chunk-KQAB5LML.mjs} +10 -3
  59. package/dist/{chunk-NSZY3EWG.cjs → chunk-L6E4SHUB.cjs} +31 -8
  60. package/dist/{chunk-OCNV4CI2.cjs → chunk-MQ4DYVFS.cjs} +26 -0
  61. package/dist/{chunk-4AC4PXZO.cjs → chunk-N3XO5AL5.cjs} +2 -2
  62. package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
  63. package/dist/{chunk-R2ZHU37O.mjs → chunk-NLRAQXAA.mjs} +26 -0
  64. package/dist/{chunk-NA77GEIU.mjs → chunk-NV26EGMC.mjs} +51 -1
  65. package/dist/{chunk-LECZ5DPZ.cjs → chunk-OSEQL34Q.cjs} +2 -2
  66. package/dist/{chunk-3WS5AZ3R.mjs → chunk-OSMUE5ST.mjs} +8 -3
  67. package/dist/{chunk-JFPKARWM.cjs → chunk-PMU4U2W2.cjs} +1 -0
  68. package/dist/{chunk-KPMLDT3B.mjs → chunk-QUYAGU65.mjs} +581 -300
  69. package/dist/{chunk-N62IYXYD.mjs → chunk-RFWWXEIF.mjs} +1 -1
  70. package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
  71. package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
  72. package/dist/{chunk-VG6HYT5K.cjs → chunk-TP4RAV7Y.cjs} +9 -9
  73. package/dist/{chunk-JFVT5ZZV.mjs → chunk-VAWDGGW3.mjs} +1 -1
  74. package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
  75. package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
  76. package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
  77. package/dist/{chunk-HAXFV2CD.mjs → chunk-WIJF3PBM.mjs} +1 -1
  78. package/dist/{chunk-QEWWKYDL.cjs → chunk-YCNHUIPR.cjs} +17 -10
  79. package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
  80. package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
  81. package/dist/{chunk-PJQ5W356.mjs → chunk-Z5ZZAGIH.mjs} +1 -0
  82. package/dist/{chunk-MZLJFNMH.cjs → chunk-ZDZUFD67.cjs} +1 -1
  83. package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
  84. package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
  85. package/dist/{client-component.d-DNbC4oWI.d.ts → client-component.d-9J7CkTWW.d.ts} +2 -2
  86. package/dist/{client-component.d-Bk5qKJM-.d.mts → client-component.d-ciHeCxr-.d.mts} +2 -2
  87. package/dist/{client-plugins.d-DwUqh4gp.d.ts → client-plugins.d-CUOhfapO.d.ts} +12 -8
  88. package/dist/{client-plugins.d-Pi9nG0W0.d.mts → client-plugins.d-JnRz5a1o.d.mts} +12 -8
  89. package/dist/client-plugins.d.mts +3 -3
  90. package/dist/client-plugins.d.ts +3 -3
  91. package/dist/client.cjs +1 -1
  92. package/dist/client.d.mts +8 -8
  93. package/dist/client.d.ts +8 -8
  94. package/dist/client.mjs +1 -1
  95. package/dist/config.d.mts +3 -3
  96. package/dist/config.d.ts +3 -3
  97. package/dist/desktop.d.mts +4 -4
  98. package/dist/desktop.d.ts +4 -4
  99. package/dist/{devtools-CB43AHEP.mjs → devtools-7JPQMSTQ.mjs} +4 -4
  100. package/dist/{devtools-L5DUNDF3.cjs → devtools-IZFUYWPG.cjs} +5 -5
  101. package/dist/docs.cjs +6 -6
  102. package/dist/docs.d.mts +4 -4
  103. package/dist/docs.d.ts +4 -4
  104. package/dist/docs.mjs +5 -5
  105. package/dist/environment/vite.cjs +3 -3
  106. package/dist/environment/vite.mjs +2 -2
  107. package/dist/{headers.d-CE6OWB-n.d.ts → headers.d-CqpTL_fZ.d.ts} +2 -2
  108. package/dist/{headers.d-DED1hHh4.d.mts → headers.d-rbbTKGaN.d.mts} +2 -2
  109. package/dist/i18n/client.cjs +3 -2
  110. package/dist/i18n/client.d.mts +2 -2
  111. package/dist/i18n/client.d.ts +2 -2
  112. package/dist/i18n/client.mjs +2 -1
  113. package/dist/i18n/index.cjs +3 -2
  114. package/dist/i18n/index.d.mts +3 -3
  115. package/dist/i18n/index.d.ts +3 -3
  116. package/dist/i18n/index.mjs +2 -1
  117. package/dist/i18n/server.cjs +6 -5
  118. package/dist/i18n/server.d.mts +5 -5
  119. package/dist/i18n/server.d.ts +5 -5
  120. package/dist/i18n/server.mjs +5 -4
  121. package/dist/index.cjs +29 -27
  122. package/dist/{index.d-c9UwIqDy.d.ts → index.d-CMKvzHLW.d.ts} +1 -1
  123. package/dist/{index.d-CbvOjJcp.d.mts → index.d-D_B2D9Il.d.mts} +1 -1
  124. package/dist/index.d.mts +24 -24
  125. package/dist/index.d.ts +24 -24
  126. package/dist/index.mjs +28 -26
  127. package/dist/integrations/orm.d.mts +3 -3
  128. package/dist/integrations/orm.d.ts +3 -3
  129. package/dist/integrations.d.mts +3 -3
  130. package/dist/integrations.d.ts +3 -3
  131. package/dist/internal/app-markdown-runtime.cjs +4 -2
  132. package/dist/internal/app-markdown-runtime.d.mts +13 -5
  133. package/dist/internal/app-markdown-runtime.d.ts +13 -5
  134. package/dist/internal/app-markdown-runtime.mjs +3 -1
  135. package/dist/internal/build-runtime.cjs +26 -26
  136. package/dist/internal/build-runtime.d.mts +5 -5
  137. package/dist/internal/build-runtime.d.ts +5 -5
  138. package/dist/internal/build-runtime.mjs +25 -25
  139. package/dist/internal/cli-runtime.cjs +9 -7
  140. package/dist/internal/cli-runtime.mjs +8 -6
  141. package/dist/internal/client-error-overlay.cjs +4 -4
  142. package/dist/internal/client-error-overlay.mjs +1 -1
  143. package/dist/internal/client-runtime.cjs +2 -2
  144. package/dist/internal/client-runtime.d.mts +6 -6
  145. package/dist/internal/client-runtime.d.ts +6 -6
  146. package/dist/internal/client-runtime.mjs +3 -3
  147. package/dist/internal/compression-runtime.d.mts +3 -3
  148. package/dist/internal/compression-runtime.d.ts +3 -3
  149. package/dist/internal/config-runtime.cjs +6 -6
  150. package/dist/internal/config-runtime.d.mts +6 -6
  151. package/dist/internal/config-runtime.d.ts +6 -6
  152. package/dist/internal/config-runtime.mjs +5 -5
  153. package/dist/internal/infra-analytics-runtime.cjs +8 -8
  154. package/dist/internal/infra-analytics-runtime.mjs +6 -6
  155. package/dist/internal/native-server-fns.cjs +4 -4
  156. package/dist/internal/native-server-fns.mjs +3 -3
  157. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  158. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  159. package/dist/internal/production-runtime.cjs +15 -15
  160. package/dist/internal/production-runtime.d.mts +41 -24
  161. package/dist/internal/production-runtime.d.ts +41 -24
  162. package/dist/internal/production-runtime.mjs +14 -14
  163. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  164. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  165. package/dist/markdown.d.mts +3 -3
  166. package/dist/markdown.d.ts +3 -3
  167. package/dist/middleware.cjs +3 -3
  168. package/dist/middleware.d.mts +4 -4
  169. package/dist/middleware.d.ts +4 -4
  170. package/dist/middleware.mjs +2 -2
  171. package/dist/mobile.d.mts +3 -3
  172. package/dist/mobile.d.ts +3 -3
  173. package/dist/{mount.d-DngLY7NL.d.ts → mount.d-B0XMxDRh.d.ts} +1 -1
  174. package/dist/{mount.d-BvWxf8ZE.d.mts → mount.d-ImEO7q8a.d.mts} +1 -1
  175. package/dist/{navigation-delegate.d-CMyl1h2l.d.mts → navigation-delegate.d-83Q7ksf7.d.mts} +1 -1
  176. package/dist/{navigation-delegate.d-zZogiDfa.d.ts → navigation-delegate.d-RRx1CSlb.d.ts} +1 -1
  177. package/dist/navigation.d.mts +6 -6
  178. package/dist/navigation.d.ts +6 -6
  179. package/dist/{nitro-Y3LGITW3.cjs → nitro-2LMOMIST.cjs} +2 -2
  180. package/dist/{nitro-NSTXT7LB.mjs → nitro-72TFIGGO.mjs} +1 -1
  181. package/dist/{plugin-F2O4BFTK.cjs → plugin-5PIQQVRP.cjs} +2 -2
  182. package/dist/{plugin-VEBRN7A3.mjs → plugin-QZT747YW.mjs} +1 -1
  183. package/dist/plugin.cjs +20 -20
  184. package/dist/plugin.d.mts +6 -6
  185. package/dist/plugin.d.ts +6 -6
  186. package/dist/plugin.mjs +19 -19
  187. package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
  188. package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
  189. package/dist/{render-plan.d-DQj2bzd2.d.ts → render-plan.d-Ds2sXJ5m.d.ts} +1 -1
  190. package/dist/{render-plan.d-Di1znBDW.d.mts → render-plan.d-wP8nTeRV.d.mts} +1 -1
  191. package/dist/renderer-client.cjs +3 -2
  192. package/dist/renderer-client.d.mts +6 -6
  193. package/dist/renderer-client.d.ts +6 -6
  194. package/dist/renderer-client.mjs +2 -1
  195. package/dist/{request.d-CJWzfDYJ.d.mts → request.d-F3h7K37m.d.mts} +1 -1
  196. package/dist/{request.d-C5vyoYeL.d.ts → request.d-zpSn6pu_.d.ts} +1 -1
  197. package/dist/request.d.mts +4 -4
  198. package/dist/request.d.ts +4 -4
  199. package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
  200. package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
  201. package/dist/{route-rendering.d-DhsY5M2I.d.ts → route-rendering.d-BL0_AdKj.d.ts} +1 -1
  202. package/dist/{route-rendering.d-C-et2TZ1.d.mts → route-rendering.d-Mw0ZKG2e.d.mts} +1 -1
  203. package/dist/{router.d-CJB-Ntni.d.ts → router.d-BwXigemZ.d.ts} +1 -1
  204. package/dist/{router.d-BMDS5s5X.d.mts → router.d-NGVsU11T.d.mts} +1 -1
  205. package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
  206. package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
  207. package/dist/routes.d.mts +3 -3
  208. package/dist/routes.d.ts +3 -3
  209. package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-BhPgtN_S.d.ts} +2 -1
  210. package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-D67HQmnv.d.mts} +2 -1
  211. package/dist/{rsc-pipeline-NJKLZ3YE.cjs → rsc-pipeline-BNXYMG4G.cjs} +6 -6
  212. package/dist/{rsc-pipeline-AXQJCCHI.mjs → rsc-pipeline-DHYZLWSF.mjs} +5 -5
  213. package/dist/{runtime-DMW6DDOI.cjs → runtime-IWOT6ZVC.cjs} +7 -7
  214. package/dist/{runtime-JXNEKOSE.mjs → runtime-XPYKUNL3.mjs} +5 -5
  215. package/dist/{runtime.d-BonodRI9.d.mts → runtime.d-BA3MzhXz.d.mts} +1 -1
  216. package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
  217. package/dist/{runtime.d-uw4123iI.d.ts → runtime.d-OBIZWpx1.d.ts} +1 -1
  218. package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
  219. package/dist/server-plugins.d.mts +5 -5
  220. package/dist/server-plugins.d.ts +5 -5
  221. package/dist/server.cjs +40 -40
  222. package/dist/server.d.mts +14 -14
  223. package/dist/server.d.ts +14 -14
  224. package/dist/server.mjs +22 -22
  225. package/dist/{spa-router.d-rha3M95y.d.mts → spa-router.d-BG2XzE5p.d.mts} +3 -3
  226. package/dist/{spa-router.d-l0d9pPZj.d.ts → spa-router.d-DrYT944-.d.ts} +3 -3
  227. package/dist/testing.cjs +6 -5
  228. package/dist/testing.d.mts +3 -3
  229. package/dist/testing.d.ts +3 -3
  230. package/dist/testing.mjs +6 -5
  231. package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.mts} +4 -0
  232. package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.ts} +4 -0
  233. package/dist/{utils.d-BzuTobEc.d.mts → utils.d-C1k9BJeD.d.mts} +1 -1
  234. package/dist/{utils.d-BK-PTOF8.d.ts → utils.d-DcF4wxey.d.ts} +1 -1
  235. package/dist/version.cjs +2 -2
  236. package/dist/version.mjs +1 -1
  237. package/dist/vite.cjs +20 -20
  238. package/dist/vite.d.mts +9 -7
  239. package/dist/vite.d.ts +9 -7
  240. package/dist/vite.mjs +19 -19
  241. package/package.json +2 -2
  242. package/dist/analyzer-GUIRJWZH.cjs +0 -16
@@ -26,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkA7HCBHMCcjs = require('./chunk-A7HCBHMC.cjs');
29
+ var _chunkIWCYRDRQcjs = require('./chunk-IWCYRDRQ.cjs');
30
30
 
31
31
 
32
32
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
@@ -41,7 +41,7 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkI7NUT24Zcjs = require('./chunk-I7NUT24Z.cjs');
44
+ var _chunk5R4Q5FN7cjs = require('./chunk-5R4Q5FN7.cjs');
45
45
 
46
46
 
47
47
 
@@ -65,7 +65,7 @@ var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
65
65
  var _chunkJWY66PIDcjs = require('./chunk-JWY66PID.cjs');
66
66
 
67
67
 
68
- var _chunkBPUVDCGGcjs = require('./chunk-BPUVDCGG.cjs');
68
+ var _chunk5X6OHJEEcjs = require('./chunk-5X6OHJEE.cjs');
69
69
 
70
70
 
71
71
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
@@ -74,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkXYVPTTUTcjs = require('./chunk-XYVPTTUT.cjs');
77
+ var _chunk3WG7GJQLcjs = require('./chunk-3WG7GJQL.cjs');
78
78
 
79
79
 
80
80
  var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
@@ -110,7 +110,7 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
110
110
 
111
111
 
112
112
 
113
- var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
113
+ var _chunkCBLRSZQLcjs = require('./chunk-CBLRSZQL.cjs');
114
114
 
115
115
 
116
116
 
@@ -118,12 +118,12 @@ var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
118
118
  var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
119
119
 
120
120
 
121
- var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
121
+ var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
122
122
 
123
123
 
124
124
 
125
125
 
126
- var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
126
+ var _chunkE3LE6EZHcjs = require('./chunk-E3LE6EZH.cjs');
127
127
 
128
128
 
129
129
 
@@ -136,7 +136,7 @@ var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
136
136
 
137
137
 
138
138
 
139
- var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
139
+ var _chunkC5AM2XDNcjs = require('./chunk-C5AM2XDN.cjs');
140
140
 
141
141
 
142
142
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -150,15 +150,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
150
150
 
151
151
 
152
152
 
153
- var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
153
+ var _chunkFSSONJRVcjs = require('./chunk-FSSONJRV.cjs');
154
154
 
155
155
 
156
156
 
157
157
 
158
- var _chunkVG6HYT5Kcjs = require('./chunk-VG6HYT5K.cjs');
158
+ var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
159
159
 
160
160
 
161
- var _chunkLECZ5DPZcjs = require('./chunk-LECZ5DPZ.cjs');
161
+ var _chunkOSEQL34Qcjs = require('./chunk-OSEQL34Q.cjs');
162
162
 
163
163
 
164
164
  var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
@@ -176,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
176
176
 
177
177
 
178
178
 
179
- var _chunkIEN2EFE5cjs = require('./chunk-IEN2EFE5.cjs');
179
+ var _chunkBE7AQXJBcjs = require('./chunk-BE7AQXJB.cjs');
180
180
 
181
181
 
182
182
 
@@ -188,7 +188,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
188
188
 
189
189
 
190
190
 
191
- var _chunkOCNV4CI2cjs = require('./chunk-OCNV4CI2.cjs');
191
+ var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
192
192
 
193
193
 
194
194
 
@@ -223,7 +223,7 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
223
223
  var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
224
224
 
225
225
 
226
- var _chunkNSZY3EWGcjs = require('./chunk-NSZY3EWG.cjs');
226
+ var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
227
227
 
228
228
 
229
229
 
@@ -255,10 +255,10 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
255
255
  var _chunkMHLNWRCJcjs = require('./chunk-MHLNWRCJ.cjs');
256
256
 
257
257
 
258
- var _chunkK66JILV3cjs = require('./chunk-K66JILV3.cjs');
258
+ var _chunk5LOARKDPcjs = require('./chunk-5LOARKDP.cjs');
259
259
 
260
260
 
261
- var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
261
+ var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
262
262
 
263
263
 
264
264
  var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
@@ -270,6 +270,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
270
270
 
271
271
 
272
272
 
273
+
273
274
  var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
274
275
 
275
276
 
@@ -282,14 +283,14 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
282
283
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
283
284
 
284
285
 
285
- var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
286
+ var _chunkZDZUFD67cjs = require('./chunk-ZDZUFD67.cjs');
286
287
 
287
288
 
288
- var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
289
289
 
290
+ var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
290
291
 
291
292
 
292
- var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
293
+ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
293
294
 
294
295
 
295
296
  var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
@@ -455,7 +456,7 @@ async function compileFarmDocsManifest(docs, options) {
455
456
  isPathGuarded: options.isPathGuarded,
456
457
  basePath
457
458
  });
458
- const apiHandler = _chunkI7NUT24Zcjs.createFarmDocsAPIHandler.call(void 0, {
459
+ const apiHandler = _chunk5R4Q5FN7cjs.createFarmDocsAPIHandler.call(void 0, {
459
460
  rootDir: options.root,
460
461
  srcDir: options.srcDir,
461
462
  docs,
@@ -615,6 +616,7 @@ function collectFarmClientModulePreloads(bundle, options) {
615
616
  function createFarmClientModulePreloadPlugin(options) {
616
617
  return {
617
618
  name: "farm-client-module-preloads",
619
+ enforce: "post",
618
620
  async generateBundle(_output, bundle) {
619
621
  await _promises2.default.mkdir(options.buildDir, { recursive: true });
620
622
  await _promises2.default.writeFile(
@@ -689,6 +691,8 @@ function createFarmDocsModulePreloadPlugin(options) {
689
691
  let runtimeModuleIds = [];
690
692
  return {
691
693
  name: "farm-docs-module-preloads",
694
+ // After Vite's CSS plugin deletes stylesheet-only chunks (see client-module-preloads.ts).
695
+ enforce: "post",
692
696
  async buildStart() {
693
697
  const resolved = await Promise.all(
694
698
  options.modules.map((specifier) => this.resolve(specifier, options.importer))
@@ -730,7 +734,7 @@ async function createFarmRouteRuntimeManifest(options) {
730
734
  const routes = [];
731
735
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
732
736
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
733
- const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
737
+ const rendering = await _chunkE3LE6EZHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
734
738
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
735
739
  routes.push({
736
740
  kind: "page",
@@ -953,12 +957,65 @@ function escapeRegExp(value) {
953
957
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
954
958
  }
955
959
 
956
- // src/nitro/vercel-assets.ts
960
+ // src/nitro/immutable-assets.ts
961
+
957
962
  var FARM_IMMUTABLE_ASSET_CACHE_CONTROL = "public, max-age=31536000, immutable";
963
+ var FARM_IMMUTABLE_ASSET_MAX_AGE = 31536e3;
964
+ var FARM_IMMUTABLE_ASSET_PATH_SOURCE = "^/(?:(?:assets|chunks)/(?:.+/)*[^/]+|farm-(?:mobile-)?client(?:-boot)?)-h(?:[a-fA-F0-9]{8}|[a-fA-F0-9]{12}|[a-fA-F0-9]{16})\\.(?!(?:[hH][tT][mM][lL]?)$)[^/]+$";
965
+ var FARM_IMMUTABLE_ASSET_PATH = new RegExp(FARM_IMMUTABLE_ASSET_PATH_SOURCE);
966
+ function isFarmImmutableAssetPath(pathname) {
967
+ return FARM_IMMUTABLE_ASSET_PATH.test(pathname);
968
+ }
969
+ var FARM_HASHED_ASSET_DIRS = ["assets", "chunks"];
970
+ var LITERAL_ROUTE_PATH = /^\/[\w.~@/-]+$/;
971
+ function planFarmImmutableAssets(options) {
972
+ const cacheRulePatterns = Object.entries(_nullishCoalesce(options.routeRules, () => ( {}))).filter(
973
+ ([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess', _16 => _16.headers]), () => ( {}))).some((name) => name.toLowerCase() === "cache-control")
974
+ ).map(([pattern]) => pattern);
975
+ const isImmutable = (file) => isFarmImmutableAssetPath(file) && !cacheRulePatterns.some((pattern) => _chunkIUKBPBM7cjs.farmRouteRuleMatches.call(void 0, pattern, file));
976
+ const routeDirs = new Set(
977
+ (_nullishCoalesce(options.routePaths, () => ( []))).map((routePath) => routePath.split("/").filter(Boolean)[0])
978
+ );
979
+ const plan = { publicAssets: [], routeRules: {} };
980
+ const addRule = (file) => {
981
+ if (!LITERAL_ROUTE_PATH.test(file)) return;
982
+ plan.routeRules[file] = { headers: { "cache-control": FARM_IMMUTABLE_ASSET_CACHE_CONTROL } };
983
+ };
984
+ const dirFiles = /* @__PURE__ */ new Map();
985
+ for (const file of options.files) {
986
+ const dir = file.split("/")[1];
987
+ if (file.split("/").length > 2 && FARM_HASHED_ASSET_DIRS.includes(dir)) {
988
+ dirFiles.set(dir, [..._nullishCoalesce(dirFiles.get(dir), () => ( [])), file]);
989
+ } else if (isImmutable(file)) {
990
+ addRule(file);
991
+ }
992
+ }
993
+ for (const [dir, files] of dirFiles) {
994
+ if (!routeDirs.has(dir) && files.every(isImmutable)) {
995
+ plan.publicAssets.push({
996
+ dir: _path2.default.join(options.clientOutputDir, dir),
997
+ baseURL: `/${dir}`,
998
+ maxAge: FARM_IMMUTABLE_ASSET_MAX_AGE
999
+ });
1000
+ } else {
1001
+ for (const file of files) if (isImmutable(file)) addRule(file);
1002
+ }
1003
+ }
1004
+ return plan;
1005
+ }
1006
+ async function listFarmClientOutputFiles(dir) {
1007
+ const fs4 = await import("fs/promises");
1008
+ const entries = await fs4.readdir(dir, { recursive: true, withFileTypes: true }).catch(() => []);
1009
+ return entries.filter((entry) => entry.isFile()).map((entry) => {
1010
+ const relative = _path2.default.relative(dir, _path2.default.join(entry.parentPath, entry.name));
1011
+ return `/${relative.split(_path2.default.sep).join("/")}`;
1012
+ });
1013
+ }
1014
+
1015
+ // src/nitro/vercel-assets.ts
958
1016
  function createFarmVercelImmutableAssetRoute() {
959
- const fingerprint = "-h(?:[a-fA-F0-9]{8}|[a-fA-F0-9]{12}|[a-fA-F0-9]{16})";
960
1017
  return {
961
- src: `^/(?:(?:assets|chunks)/(?:.+/)*[^/]+|farm-client)${fingerprint}\\.(?!(?:[hH][tT][mM][lL]?)$)[^/]+$`,
1018
+ src: FARM_IMMUTABLE_ASSET_PATH_SOURCE,
962
1019
  headers: {
963
1020
  "Cache-Control": FARM_IMMUTABLE_ASSET_CACHE_CONTROL
964
1021
  },
@@ -987,14 +1044,40 @@ function buildFarmVercelRoutes(options) {
987
1044
  function escapeRegExp2(value) {
988
1045
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
989
1046
  }
1047
+ var FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH = 4096;
1048
+ function groupFarmVercelRouteAlternatives(items, alternative) {
1049
+ const groups = [];
1050
+ let current = null;
1051
+ const frame = 6;
1052
+ for (const item of items) {
1053
+ const part = alternative(item);
1054
+ if (part.length + frame > FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH) {
1055
+ throw new Error(
1056
+ `Farm cannot route ${JSON.stringify(part.slice(0, 80))}\u2026 on Vercel: its pattern is longer than Vercel's ${FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH}-character limit for a route. Shorten the page's path.`
1057
+ );
1058
+ }
1059
+ if (current && current.length + 1 + part.length > FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH) {
1060
+ groups.push({ src: `^(?:${current.parts.join("|")})$`, items: current.items });
1061
+ current = null;
1062
+ }
1063
+ if (!current) current = { parts: [], items: [], length: frame - 1 };
1064
+ current.parts.push(part);
1065
+ current.items.push(item);
1066
+ current.length += 1 + part.length;
1067
+ }
1068
+ if (current) groups.push({ src: `^(?:${current.parts.join("|")})$`, items: current.items });
1069
+ return groups;
1070
+ }
990
1071
  function createFarmVercelCanonicalSlashRoutes(publicPaths) {
991
1072
  const otherSpellings = [
992
1073
  ...new Set(
993
1074
  publicPaths.filter((pathname) => pathname !== "/").map((pathname) => pathname.endsWith("/") ? pathname.replace(/\/+$/, "") : `${pathname}/`).filter((pathname) => pathname !== "")
994
1075
  )
995
1076
  ];
996
- if (otherSpellings.length === 0) return [];
997
- return [{ src: `^(?:${otherSpellings.map(escapeRegExp2).join("|")})$`, dest: "/__nitro" }];
1077
+ return groupFarmVercelRouteAlternatives(otherSpellings, escapeRegExp2).map((group) => ({
1078
+ src: group.src,
1079
+ dest: "/__nitro"
1080
+ }));
998
1081
  }
999
1082
 
1000
1083
  // src/nitro/ssr-public-assets.ts
@@ -1015,7 +1098,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
1015
1098
  function replaceServerFileReferences(bundle, chunkFileName, code, replace) {
1016
1099
  return code.replace(SERVER_FILE_URL_RE, (reference, _quote, relativeUrl) => {
1017
1100
  const target = resolveBundleFileName(chunkFileName, relativeUrl);
1018
- return target && _optionalChain([bundle, 'access', _16 => _16[target], 'optionalAccess', _17 => _17.type]) === "asset" ? replace(target) : reference;
1101
+ return target && _optionalChain([bundle, 'access', _17 => _17[target], 'optionalAccess', _18 => _18.type]) === "asset" ? replace(target) : reference;
1019
1102
  });
1020
1103
  }
1021
1104
  function collectServerReadSSRAssets(bundle) {
@@ -1068,7 +1151,7 @@ function assertServerReadSSRAssetsSupported(bundle, preset, root) {
1068
1151
  if (assets.length === 0) return;
1069
1152
  const sources = assets.map((fileName) => {
1070
1153
  const output = bundle[fileName];
1071
- const original = _optionalChain([output, 'optionalAccess', _18 => _18.type]) === "asset" ? _optionalChain([output, 'access', _19 => _19.originalFileNames, 'optionalAccess', _20 => _20[0]]) : void 0;
1154
+ const original = _optionalChain([output, 'optionalAccess', _19 => _19.type]) === "asset" ? _optionalChain([output, 'access', _20 => _20.originalFileNames, 'optionalAccess', _21 => _21[0]]) : void 0;
1072
1155
  if (!original) return fileName;
1073
1156
  return _path2.default.relative(root, _path2.default.resolve(root, original)).split(_path2.default.sep).join("/");
1074
1157
  });
@@ -1087,7 +1170,7 @@ function createServerReadSSRAssetsPlugin(bundle, ssrOutputDir) {
1087
1170
  transform(code, id) {
1088
1171
  if (!code.includes("import.meta.url")) return null;
1089
1172
  const chunkFileName = _path2.default.relative(ssrOutputDir, id.split("?", 1)[0]).split(_path2.default.sep).join("/");
1090
- if (_optionalChain([bundle, 'access', _21 => _21[chunkFileName], 'optionalAccess', _22 => _22.type]) !== "chunk") return null;
1173
+ if (_optionalChain([bundle, 'access', _22 => _22[chunkFileName], 'optionalAccess', _23 => _23.type]) !== "chunk") return null;
1091
1174
  let changed = false;
1092
1175
  const transformed = replaceServerFileReferences(
1093
1176
  bundle,
@@ -1183,7 +1266,7 @@ export default async function farmNetlifyHandler(request, context) {
1183
1266
  var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
1184
1267
  var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
1185
1268
  function isConfigObject(node) {
1186
- return _optionalChain([node, 'optionalAccess', _23 => _23.type]) === "ObjectExpression";
1269
+ return _optionalChain([node, 'optionalAccess', _24 => _24.type]) === "ObjectExpression";
1187
1270
  }
1188
1271
  function propertyName(property) {
1189
1272
  if (property.type !== "Property" || property.computed) return void 0;
@@ -1204,7 +1287,7 @@ function collectConfigObjects(node, found) {
1204
1287
  }
1205
1288
  if (current.type === "CallExpression") {
1206
1289
  const callee = current.callee;
1207
- const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _24 => _24.property, 'optionalAccess', _25 => _25.name]);
1290
+ const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _25 => _25.property, 'optionalAccess', _26 => _26.name]);
1208
1291
  const argument = current.arguments[0];
1209
1292
  if (name && CONFIG_FACTORIES.has(name) && isConfigObject(argument)) found.push(argument);
1210
1293
  }
@@ -1237,7 +1320,7 @@ function stripPlatformConfigSource(code, parse) {
1237
1320
  const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
1238
1321
  removals.push([
1239
1322
  properties[first].start,
1240
- properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _26 => _26[0], 'access', _27 => _27.length]), () => ( 0)))
1323
+ properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _27 => _27[0], 'access', _28 => _28.length]), () => ( 0)))
1241
1324
  ]);
1242
1325
  }
1243
1326
  first = last;
@@ -1264,7 +1347,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
1264
1347
  // removed block used (`readFileSync` for a version, say).
1265
1348
  enforce: "pre",
1266
1349
  transform: {
1267
- filter: { id: _chunkM6U6E4F7cjs.fileNamePattern.call(void 0, configFiles) },
1350
+ filter: { id: _chunkCBLRSZQLcjs.fileNamePattern.call(void 0, configFiles) },
1268
1351
  async handler(code, id) {
1269
1352
  const file = id.split("?", 1)[0];
1270
1353
  if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
@@ -1316,7 +1399,7 @@ function literalMatcher(node) {
1316
1399
  if (node.type === "Literal" && node.regex)
1317
1400
  return new RegExp(node.regex.pattern, node.regex.flags);
1318
1401
  if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
1319
- return _nullishCoalesce(_optionalChain([node, 'access', _28 => _28.quasis, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.value, 'optionalAccess', _31 => _31.cooked]), () => ( void 0));
1402
+ return _nullishCoalesce(_optionalChain([node, 'access', _29 => _29.quasis, 'access', _30 => _30[0], 'optionalAccess', _31 => _31.value, 'optionalAccess', _32 => _32.cooked]), () => ( void 0));
1320
1403
  }
1321
1404
  return void 0;
1322
1405
  }
@@ -1340,7 +1423,7 @@ function readStaticMiddlewareConfig(program) {
1340
1423
  let found = null;
1341
1424
  for (const statement of program.body) {
1342
1425
  if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
1343
- if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _32 => _32.exported, 'optionalAccess', _33 => _33.name]) === "config")) {
1426
+ if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _33 => _33.exported, 'optionalAccess', _34 => _34.name]) === "config")) {
1344
1427
  return "unknown";
1345
1428
  }
1346
1429
  continue;
@@ -1348,14 +1431,14 @@ function readStaticMiddlewareConfig(program) {
1348
1431
  const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
1349
1432
  if (!declaration || declaration.type !== "VariableDeclaration") continue;
1350
1433
  for (const declarator of declaration.declarations) {
1351
- if (_optionalChain([declarator, 'access', _34 => _34.id, 'optionalAccess', _35 => _35.type]) !== "Identifier" || declarator.id.name !== "config") continue;
1434
+ if (_optionalChain([declarator, 'access', _35 => _35.id, 'optionalAccess', _36 => _36.type]) !== "Identifier" || declarator.id.name !== "config") continue;
1352
1435
  if (declaration.kind !== "const" || !declarator.init) return "unknown";
1353
1436
  const init = unwrap(declarator.init);
1354
1437
  if (init.type !== "ObjectExpression") return "unknown";
1355
1438
  const config = {};
1356
1439
  for (const property of init.properties) {
1357
1440
  if (property.type !== "Property" || property.computed) return "unknown";
1358
- const key = _nullishCoalesce(_optionalChain([property, 'access', _36 => _36.key, 'optionalAccess', _37 => _37.name]), () => ( _optionalChain([property, 'access', _38 => _38.key, 'optionalAccess', _39 => _39.value])));
1441
+ const key = _nullishCoalesce(_optionalChain([property, 'access', _37 => _37.key, 'optionalAccess', _38 => _38.name]), () => ( _optionalChain([property, 'access', _39 => _39.key, 'optionalAccess', _40 => _40.value])));
1359
1442
  if (key === "runtime") {
1360
1443
  const runtime = literalMatcher(unwrap(property.value));
1361
1444
  if (runtime === "edge" || runtime === "nodejs") config.runtime = runtime;
@@ -1376,7 +1459,7 @@ async function readMiddlewareFileConfig(filePath) {
1376
1459
  try {
1377
1460
  const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1378
1461
  const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1379
- if (_optionalChain([parsed, 'access', _40 => _40.errors, 'optionalAccess', _41 => _41.length])) return "unknown";
1462
+ if (_optionalChain([parsed, 'access', _41 => _41.errors, 'optionalAccess', _42 => _42.length])) return "unknown";
1380
1463
  return readStaticMiddlewareConfig(parsed.program);
1381
1464
  } catch (e9) {
1382
1465
  return "unknown";
@@ -1395,7 +1478,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
1395
1478
  return preset === "vercel";
1396
1479
  }
1397
1480
  function isFarmEdgeMiddlewareRoute(route) {
1398
- return typeof route.config === "object" && _optionalChain([route, 'access', _42 => _42.config, 'optionalAccess', _43 => _43.runtime]) === "edge";
1481
+ return typeof route.config === "object" && _optionalChain([route, 'access', _43 => _43.config, 'optionalAccess', _44 => _44.runtime]) === "edge";
1399
1482
  }
1400
1483
  function escapeRegExp3(value) {
1401
1484
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -1405,18 +1488,17 @@ function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
1405
1488
  ...new Set(pathnames.flatMap((pathname) => [pathname, _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pathname, basePath)]))
1406
1489
  ];
1407
1490
  }
1408
- function createFarmVercelEdgeMiddlewareRoute(pathnames, basePath = "/") {
1491
+ function createFarmVercelEdgeMiddlewareRoutes(pathnames, basePath = "/") {
1409
1492
  const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
1410
- const alternatives = publicPaths.map((pathname) => {
1493
+ return groupFarmVercelRouteAlternatives(publicPaths, (pathname) => {
1411
1494
  const trimmed = pathname.replace(/\/+$/, "");
1412
1495
  return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
1413
- });
1414
- return {
1415
- src: `^(?:${alternatives.join("|")})$`,
1496
+ }).map((group) => ({
1497
+ src: group.src,
1416
1498
  middlewarePath: FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION,
1417
- middlewareRawSrc: publicPaths,
1499
+ middlewareRawSrc: group.items,
1418
1500
  continue: true
1419
- };
1501
+ }));
1420
1502
  }
1421
1503
  function generateFarmVercelEdgeMiddlewareEntry(routes, config, guardedPages) {
1422
1504
  const imports = routes.map(
@@ -1433,7 +1515,7 @@ export default createFarmVercelEdgeMiddleware({
1433
1515
  ${modules.join("\n")}
1434
1516
  ],
1435
1517
  i18n: ${JSON.stringify(config.i18n)},
1436
- server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _44 => _44.server, 'optionalAccess', _45 => _45.trustProxy]) === true })},
1518
+ server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _45 => _45.server, 'optionalAccess', _46 => _46.trustProxy]) === true })},
1437
1519
  apiBasePath: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
1438
1520
  notFoundPath: ${JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, FARM_VERCEL_EDGE_NOT_FOUND_PATH, config.basePath))},
1439
1521
  pages: ${JSON.stringify(toFarmVercelEdgeGuardedUrls(guardedPages, config.basePath))},
@@ -1492,7 +1574,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1492
1574
  logLevel: "silent",
1493
1575
  plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
1494
1576
  resolve: {
1495
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1577
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1496
1578
  conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
1497
1579
  },
1498
1580
  transform: {
@@ -1711,7 +1793,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1711
1793
  return {
1712
1794
  name: "farm-prerender-runtime-resolver",
1713
1795
  async resolveId(id, _importer, options) {
1714
- if (_optionalChain([options, 'access', _46 => _46.custom, 'optionalAccess', _47 => _47.farmPrerenderRuntimeResolve])) return null;
1796
+ if (_optionalChain([options, 'access', _47 => _47.custom, 'optionalAccess', _48 => _48.farmPrerenderRuntimeResolve])) return null;
1715
1797
  if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
1716
1798
  return null;
1717
1799
  }
@@ -1881,7 +1963,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1881
1963
  return {
1882
1964
  name: "farm-omitted-metadata-image-runtime",
1883
1965
  resolveId: {
1884
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1966
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1885
1967
  handler(source, importer) {
1886
1968
  if (source !== "@vercel/og") return null;
1887
1969
  const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
@@ -1890,7 +1972,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1890
1972
  }
1891
1973
  },
1892
1974
  load: {
1893
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1975
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1894
1976
  handler(id) {
1895
1977
  if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
1896
1978
  return `
@@ -1918,8 +2000,8 @@ function readVercelOgManifest(file) {
1918
2000
  }
1919
2001
  function resolveVercelOgConditionEntry(resolvedId, condition) {
1920
2002
  const vercelOg = readVercelOgManifest(resolvedId);
1921
- const entry = _optionalChain([vercelOg, 'optionalAccess', _48 => _48.manifest, 'access', _49 => _49.exports, 'optionalAccess', _50 => _50["."], 'optionalAccess', _51 => _51[condition]]);
1922
- const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _52 => _52.default]);
2003
+ const entry = _optionalChain([vercelOg, 'optionalAccess', _49 => _49.manifest, 'access', _50 => _50.exports, 'optionalAccess', _51 => _51["."], 'optionalAccess', _52 => _52[condition]]);
2004
+ const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _53 => _53.default]);
1923
2005
  return vercelOg && typeof file === "string" ? _path2.default.join(vercelOg.dir, file) : null;
1924
2006
  }
1925
2007
  function createEdgeMetadataImageRuntimePlugin({
@@ -1935,7 +2017,7 @@ function createEdgeMetadataImageRuntimePlugin({
1935
2017
  const edgeEntry = resolveVercelOgConditionEntry(resolved.id, condition);
1936
2018
  return edgeEntry ? { ...resolved, id: edgeEntry } : resolved;
1937
2019
  }
1938
- if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _53 => _53.replace, 'call', _54 => _54(/\\/g, "/"), 'access', _55 => _55.includes, 'call', _56 => _56("/@vercel/og/")])) {
2020
+ if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _54 => _54.replace, 'call', _55 => _55(/\\/g, "/"), 'access', _56 => _56.includes, 'call', _57 => _57("/@vercel/og/")])) {
1939
2021
  return null;
1940
2022
  }
1941
2023
  const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
@@ -1957,7 +2039,7 @@ function createVercelOgFontInlinePlugin(runtime = "Cloudflare Workers") {
1957
2039
  return `Promise.resolve({ arrayBuffer: () => Uint8Array.from(atob(${JSON.stringify(encoded)}), (character) => character.charCodeAt(0)).buffer })`;
1958
2040
  });
1959
2041
  if (inlined !== code) return { code: inlined, map: null };
1960
- const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _57 => _57(file), 'optionalAccess', _58 => _58.manifest, 'access', _59 => _59.version]), () => ( "(unknown version)"));
2042
+ const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _58 => _58(file), 'optionalAccess', _59 => _59.manifest, 'access', _60 => _60.version]), () => ( "(unknown version)"));
1961
2043
  this.error(
1962
2044
  `@vercel/og ${version} cannot be bundled for ${runtime}: ${file} does not load its default font with fetch(new URL("./<font>.ttf", import.meta.url)), the pattern Farm inlines because an edge function cannot fetch it. Install a @vercel/og version whose edge build does, such as 1.0.1.`
1963
2045
  );
@@ -1968,7 +2050,7 @@ function createMetadataImageWasmPlugin() {
1968
2050
  return {
1969
2051
  name: "farm-metadata-image-wasm",
1970
2052
  resolveId(source, importer) {
1971
- if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _60 => _60.replace, 'call', _61 => _61(/\\/g, "/"), 'access', _62 => _62.includes, 'call', _63 => _63("/@vercel/og/")])) {
2053
+ if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _61 => _61.replace, 'call', _62 => _62(/\\/g, "/"), 'access', _63 => _63.includes, 'call', _64 => _64("/@vercel/og/")])) {
1972
2054
  return null;
1973
2055
  }
1974
2056
  const requestPath = source.slice(0, -"?module".length);
@@ -2044,9 +2126,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
2044
2126
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
2045
2127
  }
2046
2128
  function nameCodeSplittingGroups(bundlerConfig) {
2047
- const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _64 => _64.output]);
2129
+ const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _65 => _65.output]);
2048
2130
  for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
2049
- const groups = _optionalChain([output, 'optionalAccess', _65 => _65.codeSplitting, 'optionalAccess', _66 => _66.groups]);
2131
+ const groups = _optionalChain([output, 'optionalAccess', _66 => _66.codeSplitting, 'optionalAccess', _67 => _67.groups]);
2050
2132
  if (!Array.isArray(groups)) continue;
2051
2133
  groups.forEach((group, index) => {
2052
2134
  if (group && typeof group.name === "function" && !group.debugName) {
@@ -2102,9 +2184,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
2102
2184
  if (needsAst) {
2103
2185
  replacements.length = 0;
2104
2186
  const restore = (node) => {
2105
- if (_optionalChain([node, 'optionalAccess', _67 => _67.type]) !== "TemplateLiteral") return;
2187
+ if (_optionalChain([node, 'optionalAccess', _68 => _68.type]) !== "TemplateLiteral") return;
2106
2188
  const template = node;
2107
- const value = _optionalChain([template, 'access', _68 => _68.quasis, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.value, 'access', _71 => _71.cooked]);
2189
+ const value = _optionalChain([template, 'access', _69 => _69.quasis, 'access', _70 => _70[0], 'optionalAccess', _71 => _71.value, 'access', _72 => _72.cooked]);
2108
2190
  if (template.expressions.length > 0 || typeof value !== "string") return;
2109
2191
  replacements.push({
2110
2192
  start: template.start,
@@ -2262,7 +2344,7 @@ async function discoverMiddlewareRoutes(appDir) {
2262
2344
  return Array.from(routes.values()).sort(_chunkMHLNWRCJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
2263
2345
  }
2264
2346
  function assertFarmDocsRuntimeSupported(config, preset) {
2265
- if (!_optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) || !_optionalChain([config, 'access', _74 => _74.docs, 'access', _75 => _75.adapter, 'optionalAccess', _76 => _76.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
2347
+ if (!_optionalChain([config, 'access', _73 => _73.docs, 'optionalAccess', _74 => _74.enabled]) || !_optionalChain([config, 'access', _75 => _75.docs, 'access', _76 => _76.adapter, 'optionalAccess', _77 => _77.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
2266
2348
  return;
2267
2349
  }
2268
2350
  throw new Error(
@@ -2275,7 +2357,6 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2275
2357
  assertFarmDocsRuntimeSupported(config, preset);
2276
2358
  const srcDir = config.srcDir || "src";
2277
2359
  const distDir = config.distDir || ".farm";
2278
- const deployOutputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
2279
2360
  const lifecyclePluginManager = options.pluginManager;
2280
2361
  const productionViteResultPromise = Promise.allSettled([
2281
2362
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
@@ -2294,7 +2375,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2294
2375
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
2295
2376
  const pageRoutes = [];
2296
2377
  for (const [pattern, entry] of routeManager.getRoutes()) {
2297
- const markdownSourcePath = entry.markdownSourcePath || (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2378
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2298
2379
  pageRoutes.push({
2299
2380
  pattern,
2300
2381
  ...entry.directory ? { directory: entry.directory } : {},
@@ -2500,7 +2581,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2500
2581
  _chunkQMNWKQL4cjs.logger.error(`\u274C Build failed: ${error}`);
2501
2582
  throw error;
2502
2583
  } finally {
2503
- _optionalChain([rendererBuild, 'optionalAccess', _77 => _77.abort, 'call', _78 => _78()]);
2584
+ _optionalChain([rendererBuild, 'optionalAccess', _78 => _78.abort, 'call', _79 => _79()]);
2504
2585
  }
2505
2586
  }
2506
2587
  function shouldBuildFarmMobileClient(config) {
@@ -2510,7 +2591,7 @@ function varyFarmNitroCacheRules(rules, headerNames) {
2510
2591
  if (headerNames.length === 0) return rules;
2511
2592
  return Object.fromEntries(
2512
2593
  Object.entries(rules).map(([source, rule]) => {
2513
- const cached = _optionalChain([rule, 'optionalAccess', _79 => _79.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _80 => _80.cache]) !== void 0 && rule.cache !== false;
2594
+ const cached = _optionalChain([rule, 'optionalAccess', _80 => _80.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _81 => _81.cache]) !== void 0 && rule.cache !== false;
2514
2595
  if (!cached || rule.cache === false) return [source, rule];
2515
2596
  const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
2516
2597
  const varies = [
@@ -2563,7 +2644,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
2563
2644
  }
2564
2645
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
2565
2646
  await fs4.writeFile(fontCssPath, normalizedFontCss);
2566
- await fs4.writeFile(clientCssPath, _chunkM6U6E4F7cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2647
+ await fs4.writeFile(clientCssPath, _chunkCBLRSZQLcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2567
2648
  }
2568
2649
  function importsFarmClientBlockedPackage(id, packageName) {
2569
2650
  return id === packageName || id.startsWith(`${packageName}/`);
@@ -2616,7 +2697,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2616
2697
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
2617
2698
  let plan = cache.get(key);
2618
2699
  if (!plan) {
2619
- plan = _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2700
+ plan = _chunkBE7AQXJBcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2620
2701
  cache.set(key, plan);
2621
2702
  }
2622
2703
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2625,7 +2706,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2625
2706
  if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
2626
2707
  const viteBuild = productionVite.build;
2627
2708
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
2628
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
2709
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
2629
2710
  const fs4 = await import("fs/promises");
2630
2711
  const pluginManager = new PluginManager2({
2631
2712
  config,
@@ -2640,25 +2721,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2640
2721
  const unsupportedIntegrationProvider = integrationProviders.find(
2641
2722
  (provider) => provider.supportsIsolatedHydration !== true
2642
2723
  );
2643
- if (_optionalChain([config, 'access', _81 => _81.experimental, 'optionalAccess', _82 => _82.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _83 => _83.experimental, 'optionalAccess', _84 => _84.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2724
+ if (_optionalChain([config, 'access', _82 => _82.experimental, 'optionalAccess', _83 => _83.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _84 => _84.experimental, 'optionalAccess', _85 => _85.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2644
2725
  _chunkQMNWKQL4cjs.logger.warn(
2645
2726
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2646
2727
  );
2647
2728
  }
2648
- const isolatedMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2649
- _optionalChain([config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.isolatedClientHydration]),
2729
+ const isolatedMode = _chunkBE7AQXJBcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2730
+ _optionalChain([config, 'access', _86 => _86.experimental, 'optionalAccess', _87 => _87.isolatedClientHydration]),
2650
2731
  {
2651
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.serverComponents])) === "rsc",
2732
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _88 => _88.experimental, 'optionalAccess', _89 => _89.serverComponents])) === "rsc",
2652
2733
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2653
2734
  }
2654
2735
  );
2655
- const planOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
2736
+ const planOptions = _chunkBE7AQXJBcjs.getFarmClientHydrationPlanOptions.call(void 0,
2656
2737
  config.renderer,
2657
2738
  Boolean(unsupportedIntegrationProvider)
2658
2739
  );
2659
2740
  const pagePlanOptions = {
2660
2741
  ...planOptions,
2661
- serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.serverComponents])) === "islands"
2742
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _90 => _90.experimental, 'optionalAccess', _91 => _91.serverComponents])) === "islands"
2662
2743
  };
2663
2744
  const layoutPlanOptions = {
2664
2745
  ...planOptions,
@@ -2709,22 +2790,22 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2709
2790
  };
2710
2791
  }
2711
2792
  });
2712
- const layoutAppliesToRoute = _chunk2MR4MABGcjs.routeBoundaryCoversDirectory;
2793
+ const layoutAppliesToRoute = _chunkC5AM2XDNcjs.routeBoundaryCoversDirectory;
2713
2794
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2714
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents])) === "islands";
2795
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _92 => _92.experimental, 'optionalAccess', _93 => _93.serverComponents])) === "islands";
2715
2796
  const adapterOwnsDocsRuntime = Boolean(
2716
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) && _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) && config.docs.adapter.react
2797
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && _optionalChain([config, 'access', _96 => _96.docs, 'access', _97 => _97.adapter, 'optionalAccess', _98 => _98.server]) && config.docs.adapter.react
2717
2798
  );
2718
- const docsEntries = _optionalChain([config, 'access', _98 => _98.docs, 'optionalAccess', _99 => _99.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2799
+ const docsEntries = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2719
2800
  (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
2720
2801
  ) : [];
2721
2802
  const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
2722
2803
  const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
2723
2804
  (docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
2724
2805
  );
2725
- const syntheticDocsEntry = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2806
+ const syntheticDocsEntry = _optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2726
2807
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2727
- const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
2808
+ const markdownPagePlan = _chunkBE7AQXJBcjs.createMarkdownPageHydrationPlanner.call(void 0,
2728
2809
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2729
2810
  root,
2730
2811
  isolatedMode,
@@ -2732,7 +2813,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2732
2813
  );
2733
2814
  const routePlans = pageRoutes.map((route) => ({
2734
2815
  route,
2735
- metadata: _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2816
+ metadata: _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2736
2817
  route.modulePath,
2737
2818
  root,
2738
2819
  isolatedMode,
@@ -2740,7 +2821,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2740
2821
  pagePlanOptions
2741
2822
  )
2742
2823
  }));
2743
- _chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2824
+ _chunkBE7AQXJBcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2744
2825
  clientLayouts.map((layout) => ({
2745
2826
  pattern: layout.pattern,
2746
2827
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2749,7 +2830,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2749
2830
  [
2750
2831
  ...routePlans.map(({ route, metadata }) => ({
2751
2832
  pattern: routeDirectory(route),
2752
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2833
+ depth: _chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2753
2834
  metadata
2754
2835
  })),
2755
2836
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2773,7 +2854,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2773
2854
  for (const layout of clientLayouts) {
2774
2855
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
2775
2856
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2776
- _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2857
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkBE7AQXJBcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2777
2858
  }
2778
2859
  }
2779
2860
  if (isolatedMode === "analyze") {
@@ -2807,7 +2888,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2807
2888
  );
2808
2889
  if (metadata.suppressedAsyncHydration) {
2809
2890
  _chunkQMNWKQL4cjs.logger.warn(
2810
- `\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2891
+ `\u26A0\uFE0F ${_chunkBE7AQXJBcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2811
2892
  );
2812
2893
  }
2813
2894
  const slotBoundaries = serverSlotPlans.filter(
@@ -2815,7 +2896,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2815
2896
  ).flatMap(({ plan }) => plan.isolatedBoundaries);
2816
2897
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
2817
2898
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
2818
- const islandStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
2899
+ const islandStrategy = _chunkCBLRSZQLcjs.resolveFarmRouteRootStrategy.call(void 0,
2819
2900
  route,
2820
2901
  metadata,
2821
2902
  clientLayouts,
@@ -2834,7 +2915,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2834
2915
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2835
2916
  ],
2836
2917
  // The server renders a server tree only below a hydrating layout.
2837
- ..._chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2918
+ ..._chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2838
2919
  });
2839
2920
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2840
2921
  }
@@ -2871,7 +2952,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2871
2952
  }
2872
2953
  const clientRouteSlots = routeSlots.filter((slot) => {
2873
2954
  try {
2874
- const metadata = _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2955
+ const metadata = _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2875
2956
  return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
2876
2957
  } catch (error) {
2877
2958
  _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
@@ -2894,8 +2975,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2894
2975
  srcDir,
2895
2976
  adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2896
2977
  adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2897
- _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2898
- adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _104 => _104.docs, 'access', _105 => _105.adapter, 'optionalAccess', _106 => _106.react]) : void 0,
2978
+ _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2979
+ adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.react]) : void 0,
2899
2980
  config.i18n,
2900
2981
  config.plugins,
2901
2982
  config.renderer,
@@ -2903,11 +2984,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2903
2984
  config.trailingSlash,
2904
2985
  _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations),
2905
2986
  config.basePath,
2906
- _chunkM6U6E4F7cjs.generateClientCachePersistenceCode.call(void 0, _chunkM6U6E4F7cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2987
+ _chunkCBLRSZQLcjs.generateClientCachePersistenceCode.call(void 0, _chunkCBLRSZQLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2907
2988
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2908
- _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands",
2989
+ _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents])) === "islands",
2909
2990
  platform,
2910
- islandsMode ? _chunkIEN2EFE5cjs.collectFarmServerStylesheets.call(void 0,
2991
+ islandsMode ? _chunkBE7AQXJBcjs.collectFarmServerStylesheets.call(void 0,
2911
2992
  [
2912
2993
  ...layoutRoutes.map((layout) => layout.modulePath),
2913
2994
  ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
@@ -2922,7 +3003,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2922
3003
  await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
2923
3004
  }
2924
3005
  const clientInput = { [entryName]: clientEntryPath };
2925
- if (platform === "web" && _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config)) {
3006
+ if (platform === "web" && _chunkCBLRSZQLcjs.canBootFarmIslandsClient.call(void 0, config)) {
2926
3007
  const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
2927
3008
  await fs4.writeFile(
2928
3009
  clientBootPath,
@@ -2965,7 +3046,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2965
3046
  outDir: outputDir,
2966
3047
  emptyOutDir: platform === "web",
2967
3048
  // Never public: see resolveFarmClientSourcemap.
2968
- sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _109 => _109.vite, 'optionalAccess', _110 => _110.build, 'optionalAccess', _111 => _111.sourcemap])),
3049
+ sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _110 => _110.vite, 'optionalAccess', _111 => _111.build, 'optionalAccess', _112 => _112.sourcemap])),
2969
3050
  assetsInlineLimit: 0,
2970
3051
  cssCodeSplit: false,
2971
3052
  // Bundle all CSS into one file
@@ -2977,7 +3058,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2977
3058
  hashCharacters: "hex",
2978
3059
  // Use predictable name for CSS so we can reference it in SSR HTML
2979
3060
  assetFileNames: (assetInfo) => {
2980
- if (_optionalChain([assetInfo, 'access', _112 => _112.name, 'optionalAccess', _113 => _113.endsWith, 'call', _114 => _114(".css")])) {
3061
+ if (_optionalChain([assetInfo, 'access', _113 => _113.name, 'optionalAccess', _114 => _114.endsWith, 'call', _115 => _115(".css")])) {
2981
3062
  return `${entryName}.css`;
2982
3063
  }
2983
3064
  return "assets/[name]-h[hash][extname]";
@@ -2994,7 +3075,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2994
3075
  }
2995
3076
  },
2996
3077
  plugins: [
2997
- _chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3078
+ _chunkCBLRSZQLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2998
3079
  createFarmPrivateClientSourcemapsPlugin({
2999
3080
  outDir: _path2.default.join(
3000
3081
  _path2.default.dirname(outputDir),
@@ -3026,7 +3107,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3026
3107
  ...rendererVitePlugins,
3027
3108
  ...config.vite.plugins || [],
3028
3109
  farmServerOnlyEntriesPlugin({ platform }),
3029
- _chunkM6U6E4F7cjs.farmDocsClientConfigPlugin.call(void 0,
3110
+ _chunkCBLRSZQLcjs.farmDocsClientConfigPlugin.call(void 0,
3030
3111
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
3031
3112
  ),
3032
3113
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -3059,7 +3140,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3059
3140
  },
3060
3141
  load: {
3061
3142
  filter: {
3062
- id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [
3143
+ id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [
3063
3144
  "\0empty-module",
3064
3145
  "\0empty-api-route",
3065
3146
  "\0farm-i18n-client-bridge",
@@ -3096,7 +3177,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3096
3177
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
3097
3178
  pluginManager
3098
3179
  ),
3099
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3180
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3100
3181
  ],
3101
3182
  mode: "production",
3102
3183
  css: postcssSearchPath ? {
@@ -3104,7 +3185,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3104
3185
  } : void 0,
3105
3186
  // Ensure React is bundled for client
3106
3187
  resolve: {
3107
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3188
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3108
3189
  dedupe: [...config.renderer.dedupe || []]
3109
3190
  },
3110
3191
  // Optimize dependencies - exclude server-side code from client bundle
@@ -3117,7 +3198,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3117
3198
  ]
3118
3199
  }
3119
3200
  };
3120
- await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
3201
+ await viteBuild(
3202
+ _chunkCBLRSZQLcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3203
+ );
3121
3204
  if (platform === "mobile") {
3122
3205
  await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
3123
3206
  if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
@@ -3217,7 +3300,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3217
3300
  return response;
3218
3301
  }
3219
3302
 
3220
- ${streamNavigations ? _chunkM6U6E4F7cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3303
+ ${streamNavigations ? _chunkCBLRSZQLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3221
3304
 
3222
3305
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3223
3306
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4079,7 +4162,7 @@ function readFarmEntryImports(source) {
4079
4162
  for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
4080
4163
  const from = match[2];
4081
4164
  const named = /\{([^}]*)\}/.exec(match[1]);
4082
- for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _115 => _115[1], 'optionalAccess', _116 => _116.split, 'call', _117 => _117(",")]), () => ( []))) {
4165
+ for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _116 => _116[1], 'optionalAccess', _117 => _117.split, 'call', _118 => _118(",")]), () => ( []))) {
4083
4166
  const [imported, local] = specifier.trim().split(/\s+as\s+/);
4084
4167
  if (imported)
4085
4168
  bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
@@ -4186,7 +4269,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4186
4269
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4187
4270
  import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
4188
4271
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
4189
- const providerClientCode = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderClientCode.call(void 0,
4272
+ const providerClientCode = _chunkCBLRSZQLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4190
4273
  integrationProviders,
4191
4274
  root,
4192
4275
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -4209,18 +4292,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
4209
4292
  const layoutImportStatements = [];
4210
4293
  const layoutRegistrations = [];
4211
4294
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
4212
- const treeLayoutPatterns = islandValues ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4295
+ const treeLayoutPatterns = islandValues ? _chunkC5AM2XDNcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4213
4296
  layoutRoutes.forEach((layout, index) => {
4214
4297
  const relativePath = toImportPath(layout.modulePath);
4215
4298
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
4216
4299
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
4217
- (pattern) => _chunk2MR4MABGcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4300
+ (pattern) => _chunkC5AM2XDNcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4218
4301
  );
4219
4302
  if (rendersOnClient && !treeLayout) {
4220
4303
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
4221
4304
  }
4222
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, layout.pattern);
4223
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4305
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, layout.pattern);
4306
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4224
4307
  layoutRegistrations.push(
4225
4308
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
4226
4309
  );
@@ -4307,7 +4390,7 @@ mountFarmDocsSearch();
4307
4390
 
4308
4391
  ${generateUniversalRouterStateRuntime()}
4309
4392
 
4310
- ${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4393
+ ${_chunkCBLRSZQLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4311
4394
 
4312
4395
  // SPA Router for server-rendered pages (HTML swap)
4313
4396
  const spaRouter = {
@@ -4371,7 +4454,8 @@ ${generateUniversalRouterStateProperties()}
4371
4454
  this.currentHistoryState = options.popState;
4372
4455
  }
4373
4456
 
4374
- this.saveScrollPosition(window.location.pathname + window.location.search);
4457
+ // Save under the page still on screen: on Back/Forward the URL already names the destination.
4458
+ this.saveScrollPosition(from);
4375
4459
  const navigation = this.startNavigation(from, url, action);
4376
4460
  let clientNavigation;
4377
4461
  try {
@@ -4631,7 +4715,8 @@ async function createFarmServerTreePageElement(source, pathname) {
4631
4715
  return await createFarmServerTreeElement(React, source, {
4632
4716
  load: loadFarmIsolatedBoundary,
4633
4717
  ServerHtml: FarmServerPage,
4634
- key: pathname,
4718
+ // No key: the next page of the same layout updates this one in place, as React Server
4719
+ // Components do, instead of unmounting it and building every node again.
4635
4720
  });
4636
4721
  } catch (error) {
4637
4722
  console.warn("[Farm.js] Could not rebuild the server tree of " + pathname + "; its server HTML was kept.", error);
@@ -4743,7 +4828,7 @@ function hasHydratableLayout(pathname) {
4743
4828
  });
4744
4829
  }
4745
4830
 
4746
- ${_chunkM6U6E4F7cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4831
+ ${_chunkCBLRSZQLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4747
4832
  // Wrap a page element with applicable layouts
4748
4833
  function wrapWithLayouts(pageElement, pathname, params) {
4749
4834
  const layouts = getApplicableLayouts(pathname);
@@ -4778,7 +4863,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
4778
4863
  return React.createElement("div", props, pageElement);
4779
4864
  }
4780
4865
  let farmLastRouteState = null;
4781
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkM6U6E4F7cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4866
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkCBLRSZQLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4782
4867
  function farmTreeLayoutsOf(pathname) {
4783
4868
  return getApplicableLayouts(pathname).filter(function(layout) {
4784
4869
  return layout.serverTree === true;
@@ -5342,7 +5427,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
5342
5427
  return true;
5343
5428
  }` : ""}
5344
5429
 
5345
- ${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5430
+ ${_chunkCBLRSZQLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5346
5431
 
5347
5432
  function activateNavigationScripts(root) {
5348
5433
  for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
@@ -5445,7 +5530,7 @@ function getLayoutShell(root, patterns, index) {
5445
5530
  return shell.innerHTML;
5446
5531
  }
5447
5532
 
5448
- ${islandValues ? _chunkM6U6E4F7cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5533
+ ${islandValues ? _chunkCBLRSZQLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5449
5534
  // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
5450
5535
  if (refresh) revealFarmStreamedContent(nextRoot);
5451
5536
  const currentPatterns = getLayoutPatterns(currentRoot);
@@ -5580,7 +5665,8 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
5580
5665
  // A route transition invalidates any trigger waiting on the previous DOM boundary.
5581
5666
  cancelPendingPageHydration();
5582
5667
  this.stopNavigationStream();
5583
- this.saveScrollPosition(window.location.pathname + window.location.search);
5668
+ // Save under the page still on screen: on Back/Forward the URL already names the destination.
5669
+ this.saveScrollPosition(from);
5584
5670
  const navigation = this.startNavigation(from, url, action);
5585
5671
  // A refresh keeps the islands still on the page (islands mode).
5586
5672
  navigation.refresh = options.refresh === true;
@@ -6027,7 +6113,7 @@ void hydrate();
6027
6113
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
6028
6114
  const viteBuild = productionVite.build;
6029
6115
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
6030
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
6116
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
6031
6117
  const fs4 = await import("fs/promises");
6032
6118
  const pluginManager = new PluginManager2({
6033
6119
  config,
@@ -6126,7 +6212,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6126
6212
  pattern: entry.pattern,
6127
6213
  modulePath: entry.modulePath
6128
6214
  })) : [];
6129
- const i18nCatalogs = config.i18n.enabled ? (await _chunkBBPDJGCUcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
6215
+ const i18nCatalogs = config.i18n.enabled ? (await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
6130
6216
  const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config);
6131
6217
  let openAPIReference = null;
6132
6218
  if (config.openapi.enabled && config.openapi.route) {
@@ -6147,15 +6233,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6147
6233
  specRoute: config.openapi.specRoute || null
6148
6234
  };
6149
6235
  }
6150
- const discoveredMiddlewareRoutes = await discoverMiddlewareRoutes(appDirs);
6151
- const middlewareRoutes = farmTargetRunsEdgeMiddleware(preset) ? await Promise.all(
6152
- discoveredMiddlewareRoutes.map(async (route) => ({
6236
+ const middlewareRoutes = await Promise.all(
6237
+ (await discoverMiddlewareRoutes(appDirs)).map(async (route) => ({
6153
6238
  ...route,
6154
6239
  config: await readMiddlewareFileConfig(route.filePath)
6155
6240
  }))
6156
- ) : discoveredMiddlewareRoutes;
6241
+ );
6157
6242
  const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
6158
- const notFoundPath = _chunkM6U6E4F7cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6243
+ const notFoundPath = _chunkCBLRSZQLcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6159
6244
  if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
6160
6245
  layoutRoutes.sort((a, b) => {
6161
6246
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -6176,9 +6261,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6176
6261
  (provider) => provider.component || provider.type === "clerk"
6177
6262
  );
6178
6263
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
6179
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _118 => _118.mdx, 'optionalAccess', _119 => _119.components]));
6180
- const hasMiddlewareConfig = _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6181
- const hasRouteContextConfig = _chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config);
6264
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _119 => _119.mdx, 'optionalAccess', _120 => _120.components]));
6265
+ const hasMiddlewareConfig = _chunkC5AM2XDNcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6266
+ const hasRouteContextConfig = _chunk3WG7GJQLcjs.hasCustomFarmRouteContext.call(void 0, config);
6182
6267
  const hasServerRuntimePlugins = _chunkDMXMIE2Ccjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
6183
6268
  const hasPluginRoutes = hasFarmPluginRoutes(config);
6184
6269
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -6188,9 +6273,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6188
6273
  const hasConfiguredRuntimePlugins = Boolean(
6189
6274
  hasRuntimeConfigModule && (config.plugins || []).length > 0
6190
6275
  );
6191
- if (_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6276
+ if (_chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6192
6277
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
6193
- _chunkI7NUT24Zcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6278
+ _chunk5R4Q5FN7cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6194
6279
  config.docs,
6195
6280
  { root, srcDir: config.srcDir },
6196
6281
  (pathname) => adapterGuardedPaths.has(pathname),
@@ -6198,9 +6283,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6198
6283
  );
6199
6284
  }
6200
6285
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
6201
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
6286
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
6202
6287
  farmDocsCspNonceMarker,
6203
- async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await _chunkI7NUT24Zcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6288
+ async () => _optionalChain([config, 'access', _123 => _123.docs, 'access', _124 => _124.adapter, 'optionalAccess', _125 => _125.server]) ? await _chunk5R4Q5FN7cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6204
6289
  root,
6205
6290
  srcDir: config.srcDir,
6206
6291
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -6314,7 +6399,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6314
6399
  // Adapters can render provider scripts by serializing function source.
6315
6400
  // keepNames injects helper calls into those functions; after Nitro
6316
6401
  // minifies the server chunk the helper is no longer in script scope.
6317
- keepNames: !(_optionalChain([config, 'access', _125 => _125.docs, 'optionalAccess', _126 => _126.enabled]) && _optionalChain([config, 'access', _127 => _127.docs, 'access', _128 => _128.adapter, 'optionalAccess', _129 => _129.server])),
6402
+ keepNames: !(_optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) && _optionalChain([config, 'access', _128 => _128.docs, 'access', _129 => _129.adapter, 'optionalAccess', _130 => _130.server])),
6318
6403
  jsxDev: false
6319
6404
  },
6320
6405
  // SSR configuration to externalize problematic modules
@@ -6364,10 +6449,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6364
6449
  define: {
6365
6450
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
6366
6451
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
6367
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _130 => _130.env, 'optionalAccess', _131 => _131.public]) || {})
6452
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _131 => _131.env, 'optionalAccess', _132 => _132.public]) || {})
6368
6453
  },
6369
6454
  plugins: [
6370
- _chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6455
+ _chunkCBLRSZQLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6371
6456
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
6372
6457
  ...rendererVitePlugins,
6373
6458
  ...config.vite.plugins || [],
@@ -6390,7 +6475,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6390
6475
  { ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
6391
6476
  farmServerOnlyEntriesPlugin(),
6392
6477
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
6393
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6478
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6394
6479
  ...hasRuntimeConfigModule ? [
6395
6480
  farmStripPlatformConfigPlugin(
6396
6481
  [
@@ -6402,7 +6487,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6402
6487
  {
6403
6488
  name: "farm-virtual-ssr-entry",
6404
6489
  resolveId: {
6405
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6490
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6406
6491
  handler(id) {
6407
6492
  if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
6408
6493
  return virtualEntryId;
@@ -6411,7 +6496,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6411
6496
  }
6412
6497
  },
6413
6498
  load: {
6414
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6499
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6415
6500
  handler(id) {
6416
6501
  if (id === virtualEntryId) {
6417
6502
  return virtualEntryCode;
@@ -6443,7 +6528,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6443
6528
  resolve: {
6444
6529
  alias: [
6445
6530
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
6446
- ...Object.entries(_chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6531
+ ...Object.entries(_chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6447
6532
  ([find, replacement]) => ({ find, replacement })
6448
6533
  )
6449
6534
  ],
@@ -6451,7 +6536,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6451
6536
  dedupe: [...config.renderer.dedupe || []]
6452
6537
  }
6453
6538
  };
6454
- await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6539
+ await viteBuild(_chunkCBLRSZQLcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6455
6540
  } finally {
6456
6541
  if (postcssConfigDir) {
6457
6542
  try {
@@ -6487,7 +6572,7 @@ function readFarmPageLastModified(pageRoutes) {
6487
6572
  return lastModified;
6488
6573
  }
6489
6574
  function getFarmDocsGuardedPaths(config, middlewareRoutes) {
6490
- if (!_optionalChain([config, 'access', _132 => _132.docs, 'optionalAccess', _133 => _133.enabled])) return [];
6575
+ if (!_optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled])) return [];
6491
6576
  const options = { root: config.root, srcDir: config.srcDir };
6492
6577
  const guards = {
6493
6578
  config: { middleware: config.middleware, integrations: config.integrations },
@@ -6495,18 +6580,18 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
6495
6580
  };
6496
6581
  return _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
6497
6582
  (docsRoot) => _chunkNAXKOTPPcjs.discoverFarmDocsPages.call(void 0, _chunkNAXKOTPPcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
6498
- ).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
6583
+ ).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkC5AM2XDNcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
6499
6584
  }
6500
6585
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
6501
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _134 => _134.llmsTxt]);
6586
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _135 => _135.llmsTxt]);
6502
6587
  const ownedByFile = (kind) => applicationMetadataRoutes.some(
6503
6588
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
6504
6589
  );
6505
6590
  return [
6506
- ..._optionalChain([llmsTxt, 'optionalAccess', _135 => _135.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
6507
- ..._optionalChain([llmsTxt, 'optionalAccess', _136 => _136.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
6508
- ..._optionalChain([agent, 'optionalAccess', _137 => _137.sitemap, 'optionalAccess', _138 => _138.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
6509
- ..._optionalChain([agent, 'optionalAccess', _139 => _139.crawlers, 'optionalAccess', _140 => _140.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
6591
+ ..._optionalChain([llmsTxt, 'optionalAccess', _136 => _136.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
6592
+ ..._optionalChain([llmsTxt, 'optionalAccess', _137 => _137.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
6593
+ ..._optionalChain([agent, 'optionalAccess', _138 => _138.sitemap, 'optionalAccess', _139 => _139.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
6594
+ ..._optionalChain([agent, 'optionalAccess', _140 => _140.crawlers, 'optionalAccess', _141 => _141.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
6510
6595
  ];
6511
6596
  }
6512
6597
  function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
@@ -6517,7 +6602,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
6517
6602
  docsPath: ${root}.entry,
6518
6603
  contentDir: ${root}.contentDir || ${root}.config?.contentDir,
6519
6604
  }`;
6520
- if (_optionalChain([docs, 'optionalAccess', _141 => _141.roots, 'optionalAccess', _142 => _142.length])) {
6605
+ if (_optionalChain([docs, 'optionalAccess', _142 => _142.roots, 'optionalAccess', _143 => _143.length])) {
6521
6606
  return {
6522
6607
  factory: "createFarmDocsAdapterMultiRuntimeHandler",
6523
6608
  config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
@@ -6530,7 +6615,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
6530
6615
  }
6531
6616
  function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
6532
6617
  if (!docs.enabled) return "null";
6533
- const serializableDocs = _optionalChain([docs, 'access', _143 => _143.roots, 'optionalAccess', _144 => _144.length]) ? {
6618
+ const serializableDocs = _optionalChain([docs, 'access', _144 => _144.roots, 'optionalAccess', _145 => _145.length]) ? {
6534
6619
  ...docs,
6535
6620
  // React elements and functions do not survive JSON; see runtimeConfig below.
6536
6621
  roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
@@ -6564,7 +6649,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
6564
6649
  },
6565
6650
  }
6566
6651
  : ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
6567
- if (!_optionalChain([docs, 'access', _145 => _145.roots, 'optionalAccess', _146 => _146.length])) return expression;
6652
+ if (!_optionalChain([docs, 'access', _146 => _146.roots, 'optionalAccess', _147 => _147.length])) return expression;
6568
6653
  return `((farmDocs) => ({
6569
6654
  ...farmDocs,
6570
6655
  roots: farmDocs.roots.map((farmDocsRoot, index) => {
@@ -6581,7 +6666,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
6581
6666
  return JSON.stringify(modulePath.replace(/\\/g, "/"));
6582
6667
  }
6583
6668
  function generateNativeAuthIntegrationSource(auth) {
6584
- if (_optionalChain([auth, 'optionalAccess', _147 => _147.enabled]) !== true) {
6669
+ if (_optionalChain([auth, 'optionalAccess', _148 => _148.enabled]) !== true) {
6585
6670
  return { importSource: "", registerSource: "" };
6586
6671
  }
6587
6672
  return {
@@ -6891,26 +6976,26 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
6891
6976
  }
6892
6977
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
6893
6978
  const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
6894
- const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _148 => _148.experimental, 'optionalAccess', _149 => _149.serverComponents])) === "islands";
6895
- const farmClientBoot = _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config);
6979
+ const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.serverComponents])) === "islands";
6980
+ const farmClientBoot = _chunkCBLRSZQLcjs.canBootFarmIslandsClient.call(void 0, config);
6896
6981
  const farmMobileClient = shouldBuildFarmMobileClient(config);
6897
6982
  const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
6898
6983
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
6899
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.crawlers, 'optionalAccess', _152 => _152.enabled])) && !applicationMetadataRoutes.some(
6984
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _151 => _151.agent, 'optionalAccess', _152 => _152.crawlers, 'optionalAccess', _153 => _153.enabled])) && !applicationMetadataRoutes.some(
6900
6985
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
6901
6986
  );
6902
- const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.sitemap, 'optionalAccess', _155 => _155.enabled])) && !applicationMetadataRoutes.some(
6987
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.sitemap, 'optionalAccess', _156 => _156.enabled])) && !applicationMetadataRoutes.some(
6903
6988
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
6904
6989
  );
6905
- const servesDefaultMCP = _optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.mcp]) === true && !_chunkVG6HYT5Kcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6906
- const servesAiCatalog = _optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.aiCatalog]) !== false;
6990
+ const servesDefaultMCP = _optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.mcp]) === true && !_chunkTP4RAV7Ycjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6991
+ const servesAiCatalog = _optionalChain([config, 'access', _159 => _159.agent, 'optionalAccess', _160 => _160.aiCatalog]) !== false;
6907
6992
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
6908
6993
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
6909
6994
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
6910
6995
  const adapterOwnsDocsRuntime = Boolean(
6911
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _160 => _160.docs, 'optionalAccess', _161 => _161.enabled]) && _optionalChain([config, 'access', _162 => _162.docs, 'access', _163 => _163.adapter, 'optionalAccess', _164 => _164.server]) && config.docs.adapter.react
6996
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _161 => _161.docs, 'optionalAccess', _162 => _162.enabled]) && _optionalChain([config, 'access', _163 => _163.docs, 'access', _164 => _164.adapter, 'optionalAccess', _165 => _165.server]) && config.docs.adapter.react
6912
6997
  );
6913
- if (_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) && _optionalChain([config, 'access', _167 => _167.docs, 'access', _168 => _168.roots, 'optionalAccess', _169 => _169.length]) && !adapterOwnsDocsRuntime) {
6998
+ if (_optionalChain([config, 'access', _166 => _166.docs, 'optionalAccess', _167 => _167.enabled]) && _optionalChain([config, 'access', _168 => _168.docs, 'access', _169 => _169.roots, 'optionalAccess', _170 => _170.length]) && !adapterOwnsDocsRuntime) {
6914
6999
  throw new Error(
6915
7000
  "Several docs roots need the docs adapter, which serves the React renderer only; Farm's built-in docs renderer serves a single docs root."
6916
7001
  );
@@ -6960,8 +7045,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6960
7045
  (image) => image.sourceType === "module"
6961
7046
  );
6962
7047
  const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
6963
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6964
- const farmDocsFontAssets = _optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 => _171.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
7048
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkC5AM2XDNcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7049
+ const farmDocsFontAssets = _optionalChain([config, 'access', _171 => _171.docs, 'optionalAccess', _172 => _172.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
6965
7050
  const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations);
6966
7051
  const renderedIntegrationProviders = integrationProviders.filter(
6967
7052
  (provider) => provider.component || provider.type === "clerk"
@@ -6971,16 +7056,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6971
7056
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
6972
7057
  );
6973
7058
  }
6974
- const providerServerModules = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderServerModules.call(void 0,
7059
+ const providerServerModules = _chunkCBLRSZQLcjs.generateFarmIntegrationProviderServerModules.call(void 0,
6975
7060
  renderedIntegrationProviders,
6976
7061
  config.root,
6977
7062
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
6978
7063
  );
6979
7064
  const resolvedIntegrationProviderFallback = Object.fromEntries(
6980
7065
  Object.entries(config.integrations).flatMap(([name, integration]) => {
6981
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _172 => _172.providers]);
7066
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _173 => _173.providers]);
6982
7067
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
6983
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _173 => _173.component]) === "function")) {
7068
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _174 => _174.component]) === "function")) {
6984
7069
  throw new Error(
6985
7070
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
6986
7071
  );
@@ -6991,20 +7076,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6991
7076
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
6992
7077
  (provider) => provider.supportsIsolatedHydration !== true
6993
7078
  );
6994
- const isolatedHydrationMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
6995
- _optionalChain([config, 'access', _174 => _174.experimental, 'optionalAccess', _175 => _175.isolatedClientHydration]),
7079
+ const isolatedHydrationMode = _chunkBE7AQXJBcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7080
+ _optionalChain([config, 'access', _175 => _175.experimental, 'optionalAccess', _176 => _176.isolatedClientHydration]),
6996
7081
  {
6997
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _176 => _176.experimental, 'optionalAccess', _177 => _177.serverComponents])) === "rsc",
7082
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.serverComponents])) === "rsc",
6998
7083
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
6999
7084
  }
7000
7085
  );
7001
- const hydrationPlanOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
7086
+ const hydrationPlanOptions = _chunkBE7AQXJBcjs.getFarmClientHydrationPlanOptions.call(void 0,
7002
7087
  config.renderer,
7003
7088
  Boolean(unsupportedIntegrationProvider)
7004
7089
  );
7005
7090
  const pageHydrationPlanOptions = {
7006
7091
  ...hydrationPlanOptions,
7007
- serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _178 => _178.experimental, 'optionalAccess', _179 => _179.serverComponents])) === "islands"
7092
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _179 => _179.experimental, 'optionalAccess', _180 => _180.serverComponents])) === "islands"
7008
7093
  };
7009
7094
  const layoutHydrationPlans = layoutRoutes.map((layout) => ({
7010
7095
  ...layout,
@@ -7016,7 +7101,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7016
7101
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
7017
7102
  )
7018
7103
  }));
7019
- const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
7104
+ const markdownPagePlan = _chunkBE7AQXJBcjs.createMarkdownPageHydrationPlanner.call(void 0,
7020
7105
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
7021
7106
  config.root,
7022
7107
  isolatedHydrationMode,
@@ -7025,7 +7110,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7025
7110
  const pageHydrationPlans = new Map(
7026
7111
  pageRoutes.map((route) => [
7027
7112
  route.modulePath,
7028
- _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7113
+ _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7029
7114
  route.modulePath,
7030
7115
  config.root,
7031
7116
  isolatedHydrationMode,
@@ -7034,7 +7119,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7034
7119
  )
7035
7120
  ])
7036
7121
  );
7037
- _chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7122
+ _chunkBE7AQXJBcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7038
7123
  layoutHydrationPlans.map((layout) => ({
7039
7124
  pattern: layout.pattern,
7040
7125
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -7043,10 +7128,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7043
7128
  pageRoutes.map((route) => ({
7044
7129
  // Compared by directory so a grouped layout applies only inside its group.
7045
7130
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
7046
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7131
+ depth: _chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7047
7132
  metadata: pageHydrationPlans.get(route.modulePath)
7048
7133
  })),
7049
- _chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
7134
+ _chunkC5AM2XDNcjs.routeBoundaryCoversDirectory,
7050
7135
  { serverOwners: pageHydrationPlanOptions.serverOwners }
7051
7136
  );
7052
7137
  const providerServerImports = [
@@ -7064,7 +7149,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7064
7149
  apiRegistrations.push(`
7065
7150
  {
7066
7151
  path: ${JSON.stringify(route.path)},
7067
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _180 => _180.pluginMethods, 'optionalAccess', _181 => _181.includes, 'call', _182 => _182(method)])))},
7152
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _181 => _181.pluginMethods, 'optionalAccess', _182 => _182.includes, 'call', _183 => _183(method)])))},
7068
7153
  endpoints: ${varName},
7069
7154
  }`);
7070
7155
  });
@@ -7077,11 +7162,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7077
7162
  }).map(({ route }) => route);
7078
7163
  orderedPageRoutes.forEach((route, index) => {
7079
7164
  const varName = `pageRoute${index}`;
7080
- if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7165
+ if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7166
+ const renderingDirective2 = _chunkE3LE6EZHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7167
+ const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
7081
7168
  pageRegistrations.push(`
7082
7169
  {
7083
7170
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
7084
- directory: ${JSON.stringify(route.directory)},` : ""}
7171
+ directory: ${JSON.stringify(route.directory)},` : ""}${renderingDirective2 ? `
7172
+ rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
7085
7173
  module: createFarmMarkdownRouteModule({
7086
7174
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
7087
7175
  filePath: ${JSON.stringify(toBakedMarkdownSourcePath(config.root, route.modulePath))},
@@ -7101,7 +7189,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7101
7189
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
7102
7190
  );
7103
7191
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
7104
- const renderingDirective = _chunkK7JMTAFHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7192
+ const renderingDirective = _chunkE3LE6EZHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7105
7193
  pageRegistrations.push(`
7106
7194
  {
7107
7195
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -7109,8 +7197,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7109
7197
  module: ${varName},
7110
7198
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
7111
7199
  clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
7112
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7113
- const rootStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
7200
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7201
+ const rootStrategy = _chunkCBLRSZQLcjs.resolveFarmRouteRootStrategy.call(void 0,
7114
7202
  route,
7115
7203
  clientMetadata,
7116
7204
  layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
@@ -7129,7 +7217,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7129
7217
  });
7130
7218
  const layoutImports = [];
7131
7219
  const layoutRegistrations = [];
7132
- const treeLayoutPatterns = farmIslandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
7220
+ const treeLayoutPatterns = farmIslandsMode ? _chunkC5AM2XDNcjs.getFarmServerTreeLayoutPatterns.call(void 0,
7133
7221
  layoutHydrationPlans.map((layout) => ({
7134
7222
  pattern: layout.pattern,
7135
7223
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -7173,7 +7261,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7173
7261
  containerId: ${JSON.stringify(slot.containerId)},
7174
7262
  interception: ${JSON.stringify(slot.interception)},
7175
7263
  fallback: ${JSON.stringify(slot.fallback)},
7176
- hydrates: ${!farmIslandsMode || _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7264
+ hydrates: ${!farmIslandsMode || _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7177
7265
  module: ${varName},
7178
7266
  }`);
7179
7267
  });
@@ -7184,12 +7272,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7184
7272
  errorImports.push(
7185
7273
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
7186
7274
  );
7187
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
7275
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
7188
7276
  errorRegistrations.push(`
7189
7277
  {
7190
- pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
7278
+ pattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
7191
7279
  groupScope: ${JSON.stringify(groupScope)},
7192
- directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
7280
+ directoryDepth: ${_chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
7193
7281
  module: ${varName},
7194
7282
  }`);
7195
7283
  });
@@ -7201,12 +7289,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7201
7289
  loadingImports.push(
7202
7290
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
7203
7291
  );
7204
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
7292
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
7205
7293
  loadingRegistrations.push(`
7206
7294
  {
7207
- pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
7295
+ pattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
7208
7296
  groupScope: ${JSON.stringify(groupScope)},
7209
- directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
7297
+ directoryDepth: ${_chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
7210
7298
  module: ${varName},
7211
7299
  }`);
7212
7300
  });
@@ -7369,7 +7457,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7369
7457
  createFarmDeploymentMismatchResponse,
7370
7458
  FARM_DEPLOYMENT_ID_HEADER,
7371
7459
  getFarmDeploymentMismatch,
7372
- withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _183 => _183.md, 'optionalAccess', _184 => _184.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7460
+ withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _184 => _184.md, 'optionalAccess', _185 => _185.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7373
7461
  } from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
7374
7462
  import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
7375
7463
  // The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
@@ -7438,25 +7526,25 @@ function farmFormStateScript() { return ""; }`}`;
7438
7526
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
7439
7527
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
7440
7528
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
7441
- const docsHandlerImport = _optionalChain([config, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
7529
+ const docsHandlerImport = _optionalChain([config, 'access', _186 => _186.docs, 'optionalAccess', _187 => _187.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
7442
7530
  const isFarmDocsAPIRequest = (requestOrPathname) => {
7443
7531
  const pathname = typeof requestOrPathname === "string"
7444
7532
  ? requestOrPathname
7445
7533
  : new URL(requestOrPathname.url).pathname;
7446
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _187 => _187.apiPath]) || "/api/docs")};
7534
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _188 => _188.apiPath]) || "/api/docs")};
7447
7535
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
7448
7536
  };` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
7449
- import { ${_optionalChain([config, 'access', _188 => _188.docs, 'access', _189 => _189.roots, 'optionalAccess', _190 => _190.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
7537
+ import { ${_optionalChain([config, 'access', _189 => _189.docs, 'access', _190 => _190.roots, 'optionalAccess', _191 => _191.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
7450
7538
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
7451
7539
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
7452
- const docsFontImport = _optionalChain([config, 'access', _191 => _191.docs, 'optionalAccess', _192 => _192.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
7453
- const docsRuntimeImport = _optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
7540
+ const docsFontImport = _optionalChain([config, 'access', _192 => _192.docs, 'optionalAccess', _193 => _193.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
7541
+ const docsRuntimeImport = _optionalChain([config, 'access', _194 => _194.docs, 'optionalAccess', _195 => _195.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
7454
7542
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
7455
7543
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
7456
- const markdownHandlerImport = _optionalChain([config, 'access', _195 => _195.md, 'optionalAccess', _196 => _196.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
7544
+ const markdownHandlerImport = _optionalChain([config, 'access', _196 => _196.md, 'optionalAccess', _197 => _197.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
7457
7545
  const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
7458
7546
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
7459
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _197 => _197.mdx, 'optionalAccess', _198 => _198.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
7547
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _198 => _198.mdx, 'optionalAccess', _199 => _199.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
7460
7548
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
7461
7549
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
7462
7550
  const layerConfigImports = layerConfigPaths.map(
@@ -7476,14 +7564,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
7476
7564
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
7477
7565
  const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
7478
7566
  const mobileSession = (config.plugins || []).some(
7479
- (plugin) => _optionalChain([plugin, 'optionalAccess', _199 => _199.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
7567
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
7480
7568
  );
7481
7569
  const nativeServerFns = (config.plugins || []).some(
7482
- (plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
7483
- ) ? _chunkA7HCBHMCcjs.collectFarmNativeServerFns.call(void 0, {
7570
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _201 => _201.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
7571
+ ) ? _chunkIWCYRDRQcjs.collectFarmNativeServerFns.call(void 0, {
7484
7572
  root: config.root,
7485
7573
  srcDir: config.srcDir,
7486
- entries: _chunkA7HCBHMCcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7574
+ entries: _chunkIWCYRDRQcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7487
7575
  }) : void 0;
7488
7576
  const integrationImports = `
7489
7577
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -7498,7 +7586,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
7498
7586
  ${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
7499
7587
  });` : ""}
7500
7588
  `;
7501
- const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7589
+ const imageRuntime = _chunkCBLRSZQLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7502
7590
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
7503
7591
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
7504
7592
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -7680,7 +7768,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
7680
7768
 
7681
7769
  function FarmDefault404Page() {
7682
7770
  return React.createElement(React.Fragment, null,
7683
- React.createElement("style", null, ${JSON.stringify(_chunkM6U6E4F7cjs.DEFAULT_NOT_FOUND_STYLES)}),
7771
+ React.createElement("style", null, ${JSON.stringify(_chunkCBLRSZQLcjs.DEFAULT_NOT_FOUND_STYLES)}),
7684
7772
  React.createElement("main", {
7685
7773
  className: "farm-default-not-found",
7686
7774
  "aria-labelledby": "farm-default-not-found-title",
@@ -7817,24 +7905,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
7817
7905
  validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
7818
7906
  onError(error) { console.error("[Farm Image]", error); },
7819
7907
  })`};
7820
- const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _201 => _201.md, 'optionalAccess', _202 => _202.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
7908
+ const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _202 => _202.md, 'optionalAccess', _203 => _203.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
7821
7909
  // A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
7822
7910
  // ('/about/'), so the trailing-slash 308 never answers in its place.
7823
7911
  const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
7824
7912
  const toFarmMarkdownPageRequest = (request) => request;` : ""}
7825
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _203 => _203.agent, 'optionalAccess', _204 => _204.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
7826
- ${_optionalChain([config, 'access', _205 => _205.agent, 'optionalAccess', _206 => _206.llmsTxt, 'optionalAccess', _207 => _207.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
7913
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _204 => _204.agent, 'optionalAccess', _205 => _205.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
7914
+ ${_optionalChain([config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt, 'optionalAccess', _208 => _208.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
7827
7915
  const farmMdxConfig = ${JSON.stringify({
7828
7916
  ...config.mdx,
7829
- components: typeof _optionalChain([config, 'access', _208 => _208.mdx, 'optionalAccess', _209 => _209.components]) === "string" ? config.mdx.components : void 0
7917
+ components: typeof _optionalChain([config, 'access', _209 => _209.mdx, 'optionalAccess', _210 => _210.components]) === "string" ? config.mdx.components : void 0
7830
7918
  })};
7831
7919
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
7832
- ${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
7920
+ ${_optionalChain([config, 'access', _211 => _211.agent, 'optionalAccess', _212 => _212.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
7833
7921
  // environment this was built in, since Netlify exposes its deploy context only
7834
7922
  // to the build.
7835
7923
  const farmNoindexPreview = resolveFarmPreviewDeployment(
7836
7924
  globalThis.process?.env,
7837
- ${JSON.stringify(_chunkLECZ5DPZcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7925
+ ${JSON.stringify(_chunkOSEQL34Qcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7838
7926
  );` : ""}
7839
7927
  const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
7840
7928
  const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
@@ -7880,7 +7968,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
7880
7968
  });
7881
7969
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
7882
7970
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
7883
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _212.docs, 'optionalAccess', _213 => _213.enabled]) && !hasPrecompiledDocs ? `(() => {
7971
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `(() => {
7884
7972
  try {
7885
7973
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
7886
7974
  const candidates = [
@@ -7892,7 +7980,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _2
7892
7980
  } catch {
7893
7981
  return null;
7894
7982
  }
7895
- })()` : "null"};${_optionalChain([config, 'access', _214 => _214.docs, 'optionalAccess', _215 => _215.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _216 => _216.docs, 'access', _217 => _217.roots, 'optionalAccess', _218 => _218.length]) ? `
7983
+ })()` : "null"};${_optionalChain([config, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _217 => _217.docs, 'access', _218 => _218.roots, 'optionalAccess', _219 => _219.length]) ? `
7896
7984
  const farmDocsBundledRootsDir = (() => {
7897
7985
  try {
7898
7986
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
@@ -7944,7 +8032,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
7944
8032
  ),
7945
8033
  }
7946
8034
  : undefined;
7947
- const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, 'optionalAccess', _220 => _220.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8035
+ const farmDocsHandler = ${_optionalChain([config, 'access', _220 => _220.docs, 'optionalAccess', _221 => _221.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
7948
8036
  rootDir: farmDocsRuntimeRoot,
7949
8037
  // A production build's content cannot change, so the adapter reads its
7950
8038
  // navigation once instead of scanning the content directory per request.
@@ -7965,7 +8053,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, '
7965
8053
  registerMCPServer: registerFarmMCPServer,
7966
8054
  // A page built with this keeps its HTML string, so the preload budget and the response
7967
8055
  // writer use it instead of reading and re-encoding the body. Older adapters ignore it.
7968
- createHtmlResponse: farmOwnedHtmlResponse,${_chunkI7NUT24Zcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8056
+ createHtmlResponse: farmOwnedHtmlResponse,${_chunk5R4Q5FN7cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
7969
8057
  // The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
7970
8058
  // asks about any path its own content lists, so the guards decide here, not a page list.
7971
8059
  isPathGuarded: (pathname) =>
@@ -7991,11 +8079,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, '
7991
8079
  isPathGuarded: isFarmDocsPathGuarded,
7992
8080
  basePath: ${JSON.stringify(config.basePath)},
7993
8081
  })` : "null"};
7994
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _221 => _221.docs, 'optionalAccess', _222 => _222.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
8082
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _222 => _222.docs, 'optionalAccess', _223 => _223.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
7995
8083
 
7996
8084
  // API routes bundled at build time
7997
8085
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
7998
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path14, methods }) => ({ path: path14, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
8086
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path15, methods }) => ({ path: path15, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
7999
8087
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
8000
8088
  // pipeline, so the endpoint's middleware and integration guards run for it.
8001
8089
  function dispatchFarmPluginAPIRequest(request) {
@@ -8023,12 +8111,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
8023
8111
  // runtime request.
8024
8112
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
8025
8113
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
8026
- ${_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkK4UGCUXXcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8027
- ` : ""}${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8028
- _chunkK4UGCUXXcjs.resolveFarmAppManifestInput.call(void 0, config, {
8114
+ ${_optionalChain([config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkFSSONJRVcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8115
+ ` : ""}${_optionalChain([config, 'access', _226 => _226.agent, 'optionalAccess', _227 => _227.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8116
+ _chunkFSSONJRVcjs.resolveFarmAppManifestInput.call(void 0, config, {
8029
8117
  build: config.deploymentId,
8030
- packages: _chunkM6U6E4F7cjs.resolveFarmAppPackages.call(void 0, config.root),
8031
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkM6U6E4F7cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8118
+ packages: _chunkCBLRSZQLcjs.resolveFarmAppPackages.call(void 0, config.root),
8119
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkCBLRSZQLcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8032
8120
  })
8033
8121
  )};
8034
8122
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -8532,12 +8620,98 @@ async function renderFarmElement(ReactDOMServer, element, routeKey, flushToken =
8532
8620
  return { html, head: "", shellHtml: html, streamErrors };
8533
8621
  }
8534
8622
 
8535
- async function renderFarmElementToString(ReactDOMServer, element) {
8536
- const rendered = await renderFarmElement(ReactDOMServer, element);
8537
- if (rendered.html !== undefined) return rendered.html;
8538
- const html = await new Response(rendered.stream).text();
8539
- if (rendered.streamErrors.length > 0) throw rendered.streamErrors[0];
8540
- return html;
8623
+ // The not-found and error documents go out whole, with their status, so they never stream.
8624
+ // renderToString renders a tree that does not suspend in one synchronous pass, but throws "A
8625
+ // component suspended while responding to synchronous input" when a lazy component or a use()
8626
+ // read suspends outside a Suspense boundary, and leaves a boundary that suspends inside one to
8627
+ // the client (<!--$!-->). Such a document renders with the streaming renderer instead, which
8628
+ // sends nothing until every boundary is done, so the output is the resolved markup without
8629
+ // fallbacks or reveal scripts. A document that suspended once keeps that renderer for the rest
8630
+ // of this server process, as a page route that suspends keeps streaming. As for pages, a
8631
+ // response with a CSP nonce or a posted form state renders with the stream, which takes them.
8632
+ // Renderers other than React wait for their own async content in renderToString.
8633
+ const farmSuspendingDocuments = new Set();
8634
+
8635
+ async function renderFarmCompleteDocument(ReactDOMServer, element, documentKey) {
8636
+ if (!farmReactSyncRender || !canRenderFarmElementWhenAllReady(ReactDOMServer)) {
8637
+ return await ReactDOMServer.renderToString(element, getFarmRendererRenderOptions());
8638
+ }
8639
+ if (!farmSuspendingDocuments.has(documentKey) &&
8640
+ !_resolveCurrentCspNonce() &&
8641
+ farmFormState() === undefined) {
8642
+ let html;
8643
+ try {
8644
+ html = ReactDOMServer.renderToString(element, getFarmRendererRenderOptions());
8645
+ } catch {
8646
+ // A real render error fails the streaming render the same way.
8647
+ }
8648
+ if (typeof html === "string" && !html.includes("<!--$!-->")) return html;
8649
+ farmSuspendingDocuments.add(documentKey);
8650
+ }
8651
+ return await renderFarmElementWhenAllReady(ReactDOMServer, element);
8652
+ }
8653
+
8654
+ function canRenderFarmElementWhenAllReady(ReactDOMServer) {
8655
+ return (farmRendererStreamingCapabilities.web &&
8656
+ typeof ReactDOMServer.renderToReadableStream === "function") ||
8657
+ (farmRendererStreamingCapabilities.node &&
8658
+ typeof ReactDOMServer.renderToPipeableStream === "function");
8659
+ }
8660
+
8661
+ async function renderFarmElementWhenAllReady(ReactDOMServer, element) {
8662
+ const onError = function(error) {
8663
+ // After the shell, a failed boundary is rendered by the client, as on a page.
8664
+ if (isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
8665
+ console.error("[Farm SSR stream]", error);
8666
+ };
8667
+ // Completed boundaries larger than this would stream behind their fallback: keep them inline.
8668
+ const progressiveChunkSize = Number.MAX_SAFE_INTEGER;
8669
+ if (farmRendererStreamingCapabilities.web &&
8670
+ typeof ReactDOMServer.renderToReadableStream === "function") {
8671
+ const stream = await ReactDOMServer.renderToReadableStream(element, {
8672
+ nonce: _resolveCurrentCspNonce(),
8673
+ formState: farmFormState(),
8674
+ progressiveChunkSize,
8675
+ onError,
8676
+ });
8677
+ await stream.allReady;
8678
+ return await new Response(stream).text();
8679
+ }
8680
+ return await new Promise(function(resolve, reject) {
8681
+ const chunks = [];
8682
+ const decoder = new TextDecoder();
8683
+ const destination = {
8684
+ write(chunk) {
8685
+ chunks.push(typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true }));
8686
+ return true;
8687
+ },
8688
+ flush() {},
8689
+ end() {
8690
+ chunks.push(decoder.decode());
8691
+ resolve(chunks.join(""));
8692
+ },
8693
+ on() {
8694
+ return destination;
8695
+ },
8696
+ destroy(error) {
8697
+ reject(error || new Error("React server render stream was destroyed"));
8698
+ },
8699
+ };
8700
+ const pipeableStream = ReactDOMServer.renderToPipeableStream(element, {
8701
+ nonce: _resolveCurrentCspNonce(),
8702
+ formState: farmFormState(),
8703
+ progressiveChunkSize,
8704
+ onAllReady() {
8705
+ try {
8706
+ pipeableStream.pipe(destination);
8707
+ } catch (error) {
8708
+ reject(error);
8709
+ }
8710
+ },
8711
+ onShellError: reject,
8712
+ onError,
8713
+ });
8714
+ });
8541
8715
  }
8542
8716
 
8543
8717
  // Most pages render without suspending. React's renderToString renders them in
@@ -8695,7 +8869,7 @@ function peelFarmDocumentPrefix(markup) {
8695
8869
  let inner = markup.replace(/^\\s+/, "");
8696
8870
  let hoisted = "";
8697
8871
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
8698
- const hoistable = /${_chunk2MR4MABGcjs.HOISTED_HEAD_ELEMENT.source}/i;
8872
+ const hoistable = /${_chunkC5AM2XDNcjs.HOISTED_HEAD_ELEMENT.source}/i;
8699
8873
  let match;
8700
8874
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
8701
8875
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -8719,6 +8893,50 @@ function opensFarmFullDocument(markup) {
8719
8893
  return /^<!doctype/i.test(inner) || /^<html[\\s>]/i.test(inner);
8720
8894
  }
8721
8895
 
8896
+ // The head elements a component renders (<meta>, <title>, preloads), which React writes ahead of
8897
+ // a render whose root is not <html>, split off for the document's head. A full document keeps
8898
+ // them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
8899
+ function takeFarmHoistedHead(markup) {
8900
+ if (opensFarmFullDocument(markup)) return { head: "", body: markup };
8901
+ const hoistable = /${_chunkC5AM2XDNcjs.HOISTED_HEAD_ELEMENT.source}/i;
8902
+ let head = "";
8903
+ let body = markup;
8904
+ let match;
8905
+ while ((match = hoistable.exec(body.replace(/^\\s+/, "")))) {
8906
+ head += match[0];
8907
+ body = body.replace(/^\\s+/, "").slice(match[0].length);
8908
+ }
8909
+ return { head: head, body: body };
8910
+ }
8911
+
8912
+ // A rendered page with the head elements React wrote first moved to its head field, for Farm's shell to
8913
+ // put in the document's head. A streamed page's first chunk is its shellHtml: those bytes are
8914
+ // dropped from the stream.
8915
+ function takeFarmRenderedHead(rendered) {
8916
+ if (rendered.head) return rendered;
8917
+ if (rendered.html !== undefined) {
8918
+ const split = takeFarmHoistedHead(rendered.html);
8919
+ if (!split.head) return rendered;
8920
+ return Object.assign({}, rendered, { html: split.body, shellHtml: split.body, head: split.head });
8921
+ }
8922
+ const shell = rendered.shellHtml || "";
8923
+ const split = takeFarmHoistedHead(shell);
8924
+ if (!split.head) return rendered;
8925
+ let left = new TextEncoder().encode(shell.slice(0, shell.length - split.body.length)).byteLength;
8926
+ const stream = rendered.stream.pipeThrough(new TransformStream({
8927
+ transform(chunk, controller) {
8928
+ if (left > 0) {
8929
+ const dropped = Math.min(left, chunk.byteLength);
8930
+ left -= dropped;
8931
+ chunk = chunk.subarray(dropped);
8932
+ if (chunk.byteLength === 0) return;
8933
+ }
8934
+ controller.enqueue(chunk);
8935
+ },
8936
+ }));
8937
+ return Object.assign({}, rendered, { stream: stream, shellHtml: split.body, head: split.head });
8938
+ }
8939
+
8722
8940
  function extractFarmFullDocument(markup) {
8723
8941
  if (!opensFarmFullDocument(markup)) return null;
8724
8942
  const hoisted = peelFarmDocumentPrefix(markup).hoisted;
@@ -8834,8 +9052,9 @@ const farmClientEntryPreloadTags = farmClientModulePreloads
8834
9052
  ? farmClientModulePreloads.entry.map(renderFarmClientModulePreload).join("")
8835
9053
  : "";
8836
9054
  // The client modules a document's markup loads: its islands' boundaries and the
8837
- // client references of its server tree.
8838
- const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"|"r":"(\\/[^"]+)"/g;
9055
+ // client references of its server tree. An island with a deferred strategy loads its
9056
+ // module on its own trigger, so it is not preloaded.
9057
+ const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"([^>]*)>|"r":"(\\/[^"]+)"/g;
8839
9058
 
8840
9059
  function renderFarmClientModulePreload(index) {
8841
9060
  return '\\n <link rel="modulepreload" href="/' +
@@ -8863,7 +9082,10 @@ function renderFarmClientModulePreloads(markup, pageModule) {
8863
9082
  };
8864
9083
  add(pageModule);
8865
9084
  if (typeof markup === "string") {
8866
- for (const match of markup.matchAll(FARM_CLIENT_MODULE_REFERENCE_PATTERN)) add(match[1] || match[2]);
9085
+ for (const match of markup.matchAll(FARM_CLIENT_MODULE_REFERENCE_PATTERN)) {
9086
+ if (match[1] && FARM_DEFERRED_ISLAND_STRATEGY.test(match[2])) continue;
9087
+ add(match[1] || match[3]);
9088
+ }
8867
9089
  }
8868
9090
  return tags;
8869
9091
  }
@@ -9200,7 +9422,7 @@ function createFarmAgentRobotsResponse(request) {
9200
9422
  // its nearest layout's.
9201
9423
  const farmAgentGuardedPages = new Set(${JSON.stringify(
9202
9424
  pageRoutes.map((route) => route.pattern).filter(
9203
- (pattern) => !pattern.includes("[") && _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0,
9425
+ (pattern) => !pattern.includes("[") && _chunkC5AM2XDNcjs.farmPathGuardCoversPage.call(void 0,
9204
9426
  {
9205
9427
  config: { middleware: config.middleware, integrations: config.integrations },
9206
9428
  middlewareRoutes
@@ -9255,27 +9477,31 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
9255
9477
  // aside for a page route that answers /mcp and for any MCP server published or
9256
9478
  // registered at runtime, such as the docs engine's.
9257
9479
  const farmDefaultMCPServer = ${JSON.stringify(
9258
- _chunkVG6HYT5Kcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMZLJFNMHcjs.FARM_VERSION)
9480
+ _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkZDZUFD67cjs.FARM_VERSION)
9259
9481
  )};
9260
9482
  let farmDefaultMCPRouteFree;
9261
9483
  function getFarmDefaultMCPServer() {
9262
9484
  if (farmDefaultMCPRouteFree === undefined) {
9263
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)});
9485
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH)});
9264
9486
  }
9265
9487
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
9266
9488
  }
9267
9489
  async function handleFarmDefaultMCP(request) {
9268
9490
  const origin = new URL(request.url).origin;
9491
+ // Pages are linked on metadataBase, as sitemap.xml and llms.txt link them.
9492
+ const metadataBase = getFarmRootMetadataBase();
9269
9493
  return handleFarmDefaultMCPRequest(request, {
9270
9494
  server: getFarmDefaultMCPServer(),
9271
9495
  basePath: ${JSON.stringify(config.basePath)},
9272
9496
  i18n: farmI18nConfig,
9497
+ metadataBase,
9273
9498
  // Each page at the URL it answers at, as in development and as the sitemap lists it.
9274
9499
  listPages: () =>
9275
9500
  collectFarmDefaultMCPPages(
9276
9501
  getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
9277
9502
  {
9278
9503
  origin,
9504
+ metadataBase,
9279
9505
  basePath: ${JSON.stringify(config.basePath)},
9280
9506
  markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
9281
9507
  i18n: farmI18nConfig,
@@ -9291,16 +9517,16 @@ async function handleFarmDefaultMCP(request) {
9291
9517
  // gets its own request context, as for a direct request.
9292
9518
  const farmDefaultMCPReadMarkdown = createFarmLlmsMarkdownReader((page) => fetch(page));
9293
9519
  ` : ""}
9294
- // The origin llms.txt and llms-full.txt link to: the root layout's metadataBase, else the
9295
- // request's origin, as for the sitemap and in development.
9520
+ // The origin llms.txt, llms-full.txt and list_pages link to: the root layout's metadataBase,
9521
+ // else the request's origin, as for the sitemap and in development.
9296
9522
  function getFarmAgentOrigin(request) {
9523
+ return resolveFarmAgentOrigin(getFarmRootMetadataBase(), new URL(request.url).origin);
9524
+ }
9525
+ function getFarmRootMetadataBase() {
9297
9526
  const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
9298
- return resolveFarmAgentOrigin(
9299
- rootLayout && rootLayout.module && rootLayout.module.metadata
9300
- ? rootLayout.module.metadata.metadataBase
9301
- : undefined,
9302
- new URL(request.url).origin,
9303
- );
9527
+ return rootLayout && rootLayout.module && rootLayout.module.metadata
9528
+ ? rootLayout.module.metadata.metadataBase
9529
+ : undefined;
9304
9530
  }
9305
9531
 
9306
9532
  // Static pages and root metadata for llms.txt, built the same way as in development.
@@ -9445,7 +9671,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
9445
9671
  // middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
9446
9672
  const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
9447
9673
  const farmPrerendering =
9448
- typeof process !== "undefined" && process.env?.${_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV} === "1";
9674
+ typeof process !== "undefined" && process.env?.${_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV} === "1";
9449
9675
  ` : ""}
9450
9676
  const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
9451
9677
  config: farmMiddlewareConfig,
@@ -9589,7 +9815,7 @@ function hasLocalRequestRoute(request, routePathname) {
9589
9815
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
9590
9816
  return true;
9591
9817
  }
9592
- ${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
9818
+ ${_optionalChain([config, 'access', _228 => _228.docs, 'optionalAccess', _229 => _229.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
9593
9819
  // The docs answer below the basePath; their API stays at /api/docs, as API routes do.
9594
9820
  const docsRoutePathname = stripFarmBasePath(pathname);
9595
9821
  if (
@@ -9617,7 +9843,7 @@ function getFarmPluginRequestOptions(request) {
9617
9843
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
9618
9844
  };
9619
9845
  }
9620
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
9846
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _230 => _230.docs, 'optionalAccess', _231 => _231.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
9621
9847
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
9622
9848
  pathname,
9623
9849
  method: request.method,
@@ -9701,7 +9927,7 @@ ${hasInfraAnalyticsRuntime ? `
9701
9927
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
9702
9928
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
9703
9929
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
9704
- _chunkK4UGCUXXcjs.listFarmBuiltInRoutePaths.call(void 0, {
9930
+ _chunkFSSONJRVcjs.listFarmBuiltInRoutePaths.call(void 0, {
9705
9931
  agent: {
9706
9932
  ...config.agent,
9707
9933
  aiCatalog: servesAiCatalog,
@@ -9712,9 +9938,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
9712
9938
  openapi: openAPIReference
9713
9939
  })
9714
9940
  )});
9715
- ${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) ? `const farmDocsRouteLabelInput = {
9941
+ ${_optionalChain([config, 'access', _232 => _232.docs, 'optionalAccess', _233 => _233.enabled]) ? `const farmDocsRouteLabelInput = {
9716
9942
  path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
9717
- apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _233 => _233.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _234 => _234.docs, 'access', _235 => _235.roots, 'optionalAccess', _236 => _236.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
9943
+ apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _234 => _234.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _235 => _235.docs, 'access', _236 => _236.roots, 'optionalAccess', _237 => _237.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
9718
9944
  pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
9719
9945
  };
9720
9946
  ` : ""}// The request's route payload, for a handler that learns what answered while it handles.
@@ -9730,11 +9956,11 @@ function labelFarmRequestOptions(options) {
9730
9956
  setFarmRouteLabel(options.route, mcpLabel);
9731
9957
  return options;
9732
9958
  }
9733
- ${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled]) ? `if (options.kind === "docs") {
9959
+ ${_optionalChain([config, 'access', _238 => _238.docs, 'optionalAccess', _239 => _239.enabled]) ? `if (options.kind === "docs") {
9734
9960
  setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
9735
9961
  return options;
9736
9962
  }` : ""}
9737
- ${_optionalChain([config, 'access', _239 => _239.md, 'optionalAccess', _240 => _240.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
9963
+ ${_optionalChain([config, 'access', _240 => _240.md, 'optionalAccess', _241 => _241.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
9738
9964
  routePathname,
9739
9965
  (page) => matchPageRoute(page)?.route.pattern,
9740
9966
  );
@@ -9769,7 +9995,7 @@ function getApplicableLayouts(pathname, directory) {
9769
9995
  return applicable;
9770
9996
  }
9771
9997
 
9772
- ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
9998
+ ${_optionalChain([config, 'access', _242 => _242.docs, 'optionalAccess', _243 => _243.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
9773
9999
  if (request.method === "HEAD") return response;
9774
10000
  if (response.headers.get("x-farm-docs-adapter")) return response;
9775
10001
 
@@ -9877,7 +10103,7 @@ ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 =>
9877
10103
 
9878
10104
  // Shells keep their own LRU so query-string variants never evict app cache entries.
9879
10105
  const pprShellCache = getFarmDataCache().pprShellCache;
9880
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _243 => _243.experimental, 'optionalAccess', _244 => _244.ppr]) === true)};
10106
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _244 => _244.experimental, 'optionalAccess', _245 => _245.ppr]) === true)};
9881
10107
 
9882
10108
  function resolveRouteRenderingView(route) {
9883
10109
  // The same merge development uses: baked directive config under the
@@ -10005,7 +10231,7 @@ async function handleFarmRequest(request, adapterContext) {
10005
10231
  },
10006
10232
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
10007
10233
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
10008
- ${_optionalChain([config, 'access', _245 => _245.md, 'optionalAccess', _246 => _246.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
10234
+ ${_optionalChain([config, 'access', _246 => _246.md, 'optionalAccess', _247 => _247.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
10009
10235
  if (matchPageRoute(pathname)) {
10010
10236
  // The Link header advertises the public .md URL, like the head alternate.
10011
10237
  return applyMarkdownNegotiationHeaders(response, {
@@ -10222,7 +10448,7 @@ ${hasServerRuntimeIntegrations ? `
10222
10448
  return renderFarmErrorJSONResponse();` : `
10223
10449
  if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
10224
10450
  // No page was selected, so only the root error boundary and layouts apply.
10225
- const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _247 => _247.md, 'optionalAccess', _248 => _248.enabled]) ? `
10451
+ const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _248 => _248.md, 'optionalAccess', _249 => _249.enabled]) ? `
10226
10452
  // An agent asking for Markdown reads the error document as Markdown, as it
10227
10453
  // does when a page throws. The helper answers null when Markdown is off.
10228
10454
  const markdownErrorResponse = await createMarkdownMirrorResponse({
@@ -10264,7 +10490,7 @@ ${hasServerRuntimeIntegrations ? `
10264
10490
  }
10265
10491
  ` : ""}
10266
10492
 
10267
- ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `
10493
+ ${_optionalChain([config, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.enabled]) ? `
10268
10494
  // Docs responses are served after app middleware so route guards and
10269
10495
  // middleware headers apply to the docs engine like any other page content.
10270
10496
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -10362,7 +10588,7 @@ ${hasServerRuntimeIntegrations ? `
10362
10588
  }
10363
10589
  ` : ""}
10364
10590
 
10365
- ${_optionalChain([config, 'access', _251 => _251.md, 'optionalAccess', _252 => _252.enabled]) ? `
10591
+ ${_optionalChain([config, 'access', _252 => _252.md, 'optionalAccess', _253 => _253.enabled]) ? `
10366
10592
  if (farmMarkdownConfig?.enabled) {
10367
10593
  const markdownResponse = await createMarkdownMirrorResponse({
10368
10594
  // The mirror helper only reads metadata and creates its own GET request.
@@ -10466,11 +10692,11 @@ ${hasServerRuntimeIntegrations ? `
10466
10692
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
10467
10693
  }
10468
10694
  ` : ""}
10469
- ${_optionalChain([config, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.manifest]) !== false ? `
10695
+ ${_optionalChain([config, 'access', _254 => _254.agent, 'optionalAccess', _255 => _255.manifest]) !== false ? `
10470
10696
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
10471
10697
  // public manifest, the same document for every request.
10472
10698
  if (
10473
- [${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10699
+ [${JSON.stringify(_chunkFSSONJRVcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkFSSONJRVcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10474
10700
  normalizeRuntimePath(routePathname),
10475
10701
  )
10476
10702
  ) {
@@ -10480,9 +10706,9 @@ ${hasServerRuntimeIntegrations ? `
10480
10706
  );
10481
10707
  }
10482
10708
  ` : ""}
10483
- ${_optionalChain([config, 'access', _255 => _255.agent, 'optionalAccess', _256 => _256.apiCatalog]) ? `
10709
+ ${_optionalChain([config, 'access', _256 => _256.agent, 'optionalAccess', _257 => _257.apiCatalog]) ? `
10484
10710
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
10485
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_API_CATALOG_PATH)}) {
10711
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkFSSONJRVcjs.FARM_API_CATALOG_PATH)}) {
10486
10712
  return applyProductionMiddlewareHeaders(
10487
10713
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
10488
10714
  middlewareHeaders,
@@ -10507,11 +10733,11 @@ ${hasServerRuntimeIntegrations ? `
10507
10733
  );
10508
10734
  }
10509
10735
  ` : ""}
10510
- ${_optionalChain([config, 'access', _257 => _257.agent, 'optionalAccess', _258 => _258.llmsTxt, 'optionalAccess', _259 => _259.enabled]) ? `
10736
+ ${_optionalChain([config, 'access', _258 => _258.agent, 'optionalAccess', _259 => _259.llmsTxt, 'optionalAccess', _260 => _260.enabled]) ? `
10511
10737
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
10512
10738
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
10513
10739
  ? "llms"
10514
- : ${_optionalChain([config, 'access', _260 => _260.agent, 'optionalAccess', _261 => _261.llmsTxt, 'optionalAccess', _262 => _262.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
10740
+ : ${_optionalChain([config, 'access', _261 => _261.agent, 'optionalAccess', _262 => _262.llmsTxt, 'optionalAccess', _263 => _263.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
10515
10741
  if (farmGeneratedLlmsKind) {
10516
10742
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
10517
10743
  // Renders are shared per origin the request reached, which is where pages are read.
@@ -10547,7 +10773,7 @@ ${hasServerRuntimeIntegrations ? `
10547
10773
  }
10548
10774
  ` : ""}
10549
10775
 
10550
- ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
10776
+ ${_optionalChain([config, 'access', _264 => _264.docs, 'optionalAccess', _265 => _265.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
10551
10777
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
10552
10778
  if (docsAPIResponse) {
10553
10779
  return applyProductionMiddlewareHeaders(
@@ -10685,6 +10911,12 @@ ${hasServerRuntimeIntegrations ? `
10685
10911
 
10686
10912
  // Reads from here on belong to the page render, not to middleware.
10687
10913
  const requestReadsBeforeRender = _getRequestReadCount();
10914
+ // A swr or cache route rule stores this page by URL for every visitor. Nitro hands Farm the
10915
+ // request without its cookies, Authorization, or any header the rule does not key on, so a
10916
+ // render that reads nothing of the request is that shared page, whatever its route config.
10917
+ const farmRouteRuleCached =
10918
+ Boolean(adapterContext?.routeRuleCache) &&
10919
+ (request.method === "GET" || request.method === "HEAD");
10688
10920
 
10689
10921
  // Get the page component and metadata
10690
10922
  let PageComponent = route.module.default;
@@ -10918,7 +11150,8 @@ ${hasServerRuntimeIntegrations ? `
10918
11150
  ${farmIslandsMode ? `// Islands mode: a route a shared cache may store (a PPR shell, a static page) renders
10919
11151
  // whole for every request, so a cache hit stays a hit. Other routes leave out what the
10920
11152
  // navigating browser keeps: the layouts it shows and the values it holds.
10921
- const farmSharedCacheableRoute = Boolean(getRouteSharedCacheControl(route, pprCanCache));
11153
+ const farmSharedCacheableRoute =
11154
+ farmRouteRuleCached || Boolean(getRouteSharedCacheControl(route, pprCanCache));
10922
11155
  if (farmSharedCacheableRoute) ignoreFarmHeldValues();
10923
11156
  const farmLayoutKeyOf = getFarmLayoutKey;
10924
11157
  // A navigation the browser renders in its layout's React root rebuilds a server-tree page
@@ -11079,9 +11312,10 @@ ${hasServerRuntimeIntegrations ? `
11079
11312
  wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
11080
11313
  return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
11081
11314
  };
11082
- const renderedPage = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11315
+ // The head elements a component rendered go to the document's head (takeFarmRenderedHead).
11316
+ const renderedPage = takeFarmRenderedHead(${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11083
11317
  _runWithMiddlewareContext(middlewareContext, renderPageElement)
11084
- )` : "await renderPageElement()"};
11318
+ )` : "await renderPageElement()"});
11085
11319
 
11086
11320
  // A completed document is not a reusable PPR shell: it already contains
11087
11321
  // the request's resolved Suspense content. Until the production runtime
@@ -11145,7 +11379,7 @@ ${hasServerRuntimeIntegrations ? `
11145
11379
  );
11146
11380
  }
11147
11381
  }
11148
- ${_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled]) ? `
11382
+ ${_optionalChain([config, 'access', _266 => _266.md, 'optionalAccess', _267 => _267.enabled]) ? `
11149
11383
  // Advertise the Markdown mirror in the head as well as the Link header,
11150
11384
  // using the public path the .md request will be resolved against.
11151
11385
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -11164,7 +11398,7 @@ ${hasServerRuntimeIntegrations ? `
11164
11398
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
11165
11399
  }
11166
11400
 
11167
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.jsonLd]), () => ( false)))} });
11401
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _268 => _268.agent, 'optionalAccess', _269 => _269.jsonLd]), () => ( false)))} });
11168
11402
  const title = renderedMetadata.title;
11169
11403
  const metaTags = renderedMetadata.tags;
11170
11404
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -11183,6 +11417,24 @@ ${hasServerRuntimeIntegrations ? `
11183
11417
  middlewareData?.size ||
11184
11418
  middlewareContext?.size
11185
11419
  );
11420
+ if (farmRouteRuleCached && (renderedPage.stream || hasRequestScopedRender)) {
11421
+ // The route rule's cache refuses a private page: say why it renders on every request.
11422
+ emitFarmEvent({
11423
+ type: "cache.bypass",
11424
+ route: pathname,
11425
+ reason: pageStatus >= 400
11426
+ ? "error-status"
11427
+ : renderReadRequest
11428
+ ? "request-read"
11429
+ : middlewareData?.size || middlewareContext?.size
11430
+ ? "middleware-data"
11431
+ : hasConfiguredRouteContext
11432
+ ? "route-context"
11433
+ : renderedPage.stream
11434
+ ? "suspense-stream"
11435
+ : "request-scoped",
11436
+ });
11437
+ }
11186
11438
  const sharedCacheControl = getRouteSharedCacheControl(route, pprCanCache);
11187
11439
  const responseHeaders = {
11188
11440
  "Content-Type": "text/html; charset=utf-8",
@@ -11192,8 +11444,16 @@ ${hasServerRuntimeIntegrations ? `
11192
11444
  };
11193
11445
  // An error status or a request-scoped render is never shareable, even when
11194
11446
  // the PPR shell headers would otherwise grant a shared max-age.
11195
- if (renderedPage.stream || hasRequestScopedRender || !sharedCacheControl) {
11447
+ if (
11448
+ renderedPage.stream ||
11449
+ hasRequestScopedRender ||
11450
+ (!sharedCacheControl && !farmRouteRuleCached)
11451
+ ) {
11196
11452
  responseHeaders["Cache-Control"] = "private, no-store";
11453
+ } else if (responseHeaders["Cache-Control"] == null) {
11454
+ // A page with no policy of its own under a swr or cache route rule: the rule's cache
11455
+ // stores it and sends the rule's Cache-Control.
11456
+ delete responseHeaders["Cache-Control"];
11197
11457
  }
11198
11458
  const farmI18nSnapshot = getFarmI18nSnapshot();${farmIslandsMode ? `
11199
11459
  // Islands mode: a navigation that names the values it holds, or the layouts it shows,
@@ -11295,7 +11555,8 @@ ${hasServerRuntimeIntegrations ? `
11295
11555
  ' <meta charset="utf-8">\\n' +
11296
11556
  ' ' + viewportTags + '\\n' +
11297
11557
  (hasFavicon ? '' : ' <link rel="icon" href="data:,">\\n') +
11298
- ' <title>' + title + '</title>' + metaTags + '\\n' +
11558
+ (suppressDefaultTitle ? '' : ' <title>' + title + '</title>') + metaTags +
11559
+ (rendererHead ? '\\n ' + rendererHead : '') + '\\n' +
11299
11560
  ' <link rel="stylesheet" href="/__farm_client_css_href__">\\n' +
11300
11561
  ' <link rel="modulepreload" href="/__farm_client_js_src__">' + renderFarmClientModulePreloads(null, route.clientModule) + '\\n' +
11301
11562
  renderFarmRendererHydrationScript() + '\\n' +
@@ -11322,9 +11583,10 @@ ${hasServerRuntimeIntegrations ? `
11322
11583
  }
11323
11584
  try {
11324
11585
  return createLateNotFoundRecovery(
11325
- await ReactDOMServer.renderToString(
11586
+ await renderFarmCompleteDocument(
11587
+ ReactDOMServer,
11326
11588
  wrapWithFarmIntegrationProviders(createFarmNotFoundElement(pathname)),
11327
- getFarmRendererRenderOptions()
11589
+ "not-found-recovery"
11328
11590
  )
11329
11591
  );
11330
11592
  } catch (error) {
@@ -11482,7 +11744,9 @@ ${hasServerRuntimeIntegrations ? `
11482
11744
  pprCacheKey,
11483
11745
  { html: fullHtml },
11484
11746
  {
11485
- paths: [pathname],
11747
+ // revalidatePath() takes the route path ("/pricing"), as the docs show, while the
11748
+ // shell answers the public one ("/console/fr/pricing"): either clears it.
11749
+ paths: [...new Set([pathname, getFarmRoutePathname(pathname)])],
11486
11750
  tags: ["ppr"],
11487
11751
  revalidate: pprConfig.revalidate ?? false,
11488
11752
  }
@@ -11566,7 +11830,7 @@ ${hasServerRuntimeIntegrations ? `
11566
11830
  ${servesDefaultMCP ? `
11567
11831
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
11568
11832
  if (
11569
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)} &&
11833
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH)} &&
11570
11834
  getFarmDefaultMCPServer()
11571
11835
  ) {
11572
11836
  return applyProductionMiddlewareHeaders(
@@ -11613,7 +11877,12 @@ ${servesDefaultMCP ? `
11613
11877
  errorElement = wrapWithFarmIntegrationProviders(errorElement);
11614
11878
 
11615
11879
  const renderErrorElement = () =>
11616
- renderFarmElementToString(ReactDOMServer, errorElement);
11880
+ renderFarmCompleteDocument(
11881
+ ReactDOMServer,
11882
+ // Islands mode: the error document writes its islands' values, as a page does.
11883
+ typeof farmIslandsRender === "function" ? farmIslandsRender(errorElement) : errorElement,
11884
+ "error:" + errorBoundaryMatch.route.pattern
11885
+ );
11617
11886
  const errorHtml = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11618
11887
  _runWithMiddlewareContext(middlewareContext, renderErrorElement)
11619
11888
  )` : "await renderErrorElement()"};
@@ -11754,7 +12023,7 @@ ${farmRendererDisabled ? `
11754
12023
  }
11755
12024
  notFoundElement = wrapWithFarmIntegrationProviders(notFoundElement);
11756
12025
 
11757
- const html = await ReactDOMServer.renderToString(notFoundElement, getFarmRendererRenderOptions());
12026
+ const html = await renderFarmCompleteDocument(ReactDOMServer, notFoundElement, "not-found");
11758
12027
  // The layouts' and the not-found page's metadata, as the development renderer uses it.
11759
12028
  const notFoundMetadata = renderMetadataHead(
11760
12029
  await resolveFarmNotFoundMetadata(
@@ -11931,11 +12200,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
11931
12200
  export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
11932
12201
  // The image optimizer's fetch of a local source is not a loopback visitor.
11933
12202
  context = _withFarmImageSourceClientAddress(request, context);`}
11934
- ${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
12203
+ ${_optionalChain([config, 'access', _270 => _270.agent, 'optionalAccess', _271 => _271.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
11935
12204
  basePath: farmLocalAPIBasePath,
11936
12205
  dispatch: async (localRequest) =>
11937
12206
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
11938
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _271 => _271.agent, 'optionalAccess', _272 => _272.noindexPreviews]) ? `
12207
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _272 => _272.agent, 'optionalAccess', _273 => _273.noindexPreviews]) ? `
11939
12208
  // Keep every response of a preview deployment out of search indexes.
11940
12209
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
11941
12210
  }
@@ -12163,13 +12432,13 @@ function getPhysicalPrerenderBypassReason(options) {
12163
12432
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
12164
12433
  return "rewrite";
12165
12434
  }
12166
- if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
12167
- if (_chunk2MR4MABGcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
12168
- if (_chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12435
+ if (_chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
12436
+ if (_chunkC5AM2XDNcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
12437
+ if (_chunk3WG7GJQLcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12169
12438
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
12170
12439
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
12171
- if (_optionalChain([manifestEntry, 'optionalAccess', _273 => _273.rendering]) === "dynamic") return "dynamic runtime manifest";
12172
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _274 => _274.regions, 'optionalAccess', _275 => _275.length])) || manifestEntry.maxDuration !== void 0)) {
12440
+ if (_optionalChain([manifestEntry, 'optionalAccess', _274 => _274.rendering]) === "dynamic") return "dynamic runtime manifest";
12441
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _275 => _275.regions, 'optionalAccess', _276 => _276.length])) || manifestEntry.maxDuration !== void 0)) {
12173
12442
  return "route runtime controls";
12174
12443
  }
12175
12444
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -12182,14 +12451,14 @@ function getPhysicalPrerenderBypassReason(options) {
12182
12451
  return void 0;
12183
12452
  }
12184
12453
  async function getFarmDocsPrerenderPages(config, root, preset) {
12185
- if (!_optionalChain([config, 'access', _276 => _276.docs, 'optionalAccess', _277 => _277.enabled]) || !config.docs.prerender) return [];
12454
+ if (!_optionalChain([config, 'access', _277 => _277.docs, 'optionalAccess', _278 => _278.enabled]) || !config.docs.prerender) return [];
12186
12455
  if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
12187
12456
  _chunkQMNWKQL4cjs.logger.info(
12188
12457
  `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
12189
12458
  );
12190
12459
  return [];
12191
12460
  }
12192
- if (!_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12461
+ if (!_chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12193
12462
  const { pages: pages2, originDependent } = _chunkNAXKOTPPcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
12194
12463
  root,
12195
12464
  srcDir: config.srcDir
@@ -12207,7 +12476,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12207
12476
  );
12208
12477
  return [];
12209
12478
  }
12210
- const pages = await _chunkI7NUT24Zcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12479
+ const pages = await _chunk5R4Q5FN7cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12211
12480
  if (!pages) {
12212
12481
  _chunkQMNWKQL4cjs.logger.warn(
12213
12482
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
@@ -12217,14 +12486,14 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12217
12486
  return pages;
12218
12487
  }
12219
12488
  async function listFarmDocsAnalyticsPages(config, root, preset) {
12220
- if (!_optionalChain([config, 'access', _278 => _278.docs, 'optionalAccess', _279 => _279.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
12489
+ if (!_optionalChain([config, 'access', _279 => _279.docs, 'optionalAccess', _280 => _280.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
12221
12490
  return [];
12222
12491
  }
12223
12492
  try {
12224
- return await _chunkI7NUT24Zcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12493
+ return await _chunk5R4Q5FN7cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12225
12494
  root,
12226
12495
  srcDir: config.srcDir,
12227
- adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12496
+ adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12228
12497
  });
12229
12498
  } catch (error) {
12230
12499
  _chunkQMNWKQL4cjs.logger.warn(
@@ -12235,9 +12504,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
12235
12504
  }
12236
12505
  function hasFarmNitroCacheRouteRule(routeRules) {
12237
12506
  return Object.values(routeRules || {}).some((rule) => {
12238
- const swr = _optionalChain([rule, 'optionalAccess', _280 => _280.swr]);
12239
- const cache = _optionalChain([rule, 'optionalAccess', _281 => _281.cache]);
12240
- const headers = _optionalChain([rule, 'optionalAccess', _282 => _282.headers]);
12507
+ const swr = _optionalChain([rule, 'optionalAccess', _281 => _281.swr]);
12508
+ const cache = _optionalChain([rule, 'optionalAccess', _282 => _282.cache]);
12509
+ const headers = _optionalChain([rule, 'optionalAccess', _283 => _283.headers]);
12241
12510
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
12242
12511
  });
12243
12512
  }
@@ -12250,10 +12519,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12250
12519
  const nitroBuilder = nitroBuilderResult.value;
12251
12520
  const isVercel = preset === "vercel";
12252
12521
  const isCloudflareWorker = preset === "cloudflare-module";
12253
- const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12522
+ const outputDir = _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12254
12523
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
12255
12524
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
12256
- const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12525
+ const imageRuntime = _chunkCBLRSZQLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12257
12526
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
12258
12527
  (image) => image.sourceType === "module"
12259
12528
  );
@@ -12309,7 +12578,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12309
12578
  const edgeGuardedPrerenderRoutes = [];
12310
12579
  const addPrerenderRoute = (pathname) => {
12311
12580
  prerenderRoutes.push(pathname);
12312
- if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
12581
+ if (_chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
12313
12582
  edgeGuardedPrerenderRoutes.push(pathname);
12314
12583
  }
12315
12584
  };
@@ -12387,7 +12656,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12387
12656
  webEntry: clientJsSrc,
12388
12657
  webBoot: clientBootSrc,
12389
12658
  stylesheet: clientCssHref,
12390
- webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _283 => _283.files]), () => ( []))
12659
+ webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _284 => _284.files]), () => ( []))
12391
12660
  })
12392
12661
  ) : null;
12393
12662
  for (const output of Object.values(ssrBundle)) {
@@ -12604,7 +12873,9 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
12604
12873
  }${hasNitroCacheRouteRules ? `
12605
12874
  const farmCacheControl = response.headers.get('cache-control')
12606
12875
  if (
12607
- farmGuardedResponse &&
12876
+ // A guarded response, or any response Farm kept private under a swr or cache rule: the
12877
+ // rule's cache does not store it, and the rule's public Cache-Control must not reach a CDN.
12878
+ (farmGuardedResponse || event.context?.routeRules?.cache) &&
12608
12879
  farmCacheControl &&
12609
12880
  FARM_PRIVATE_CACHE_DIRECTIVE.test(farmCacheControl)
12610
12881
  ) {
@@ -12701,10 +12972,11 @@ function toFarmNodeResponse(request, response) {
12701
12972
  ssrOutputDir,
12702
12973
  ssrEntryFile
12703
12974
  );
12704
- const configuredNitroRouteRules = _chunkOCNV4CI2cjs.nitroRouteRulesBelowBasePath.call(void 0,
12705
- varyFarmNitroCacheRules(_chunkOCNV4CI2cjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
12975
+ const configuredNitroRouteRules = _chunkMQ4DYVFScjs.nitroRouteRulesBelowBasePath.call(void 0,
12976
+ varyFarmNitroCacheRules(_chunkMQ4DYVFScjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
12706
12977
  ...config.md.enabled ? ["accept"] : [],
12707
- ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
12978
+ ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
12979
+ ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.serverComponents])) === "islands" ? ["f-layouts"] : []
12708
12980
  ]),
12709
12981
  config.basePath,
12710
12982
  _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
@@ -12732,6 +13004,18 @@ function toFarmNodeResponse(request, response) {
12732
13004
  ];
12733
13005
  })
12734
13006
  );
13007
+ const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
13008
+ clientOutputDir,
13009
+ files: await listFarmClientOutputFiles(clientOutputDir),
13010
+ routeRules: configuredNitroRouteRules,
13011
+ routePaths: [
13012
+ ...[...routeManager.getRoutes().keys()].map(
13013
+ (pattern) => _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pattern, config.basePath)
13014
+ ),
13015
+ ...apiRouteManager.getRoutes().keys(),
13016
+ _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
13017
+ ]
13018
+ });
12735
13019
  let nitroConfig = {
12736
13020
  preset,
12737
13021
  ...farmNodeServerEntryPath ? { entry: farmNodeServerEntryPath } : {},
@@ -12750,13 +13034,9 @@ function toFarmNodeResponse(request, response) {
12750
13034
  alias: resolveNitroInternalRuntimeAliases(root),
12751
13035
  compatibilityDate: "2024-12-01",
12752
13036
  output: resolveFarmNitroOutputConfig(preset, outputDir),
12753
- publicAssets: [
12754
- {
12755
- dir: clientOutputDir,
12756
- maxAge: 31536e3,
12757
- baseURL: "/"
12758
- }
12759
- ],
13037
+ // Nitro gives the root directory no Cache-Control on any preset (it falls through to the
13038
+ // app), so public files keep revalidating; the hashed directories carry their own maxAge.
13039
+ publicAssets: [{ dir: clientOutputDir, baseURL: "/" }, ...immutableAssets.publicAssets],
12760
13040
  // A self-hosted Node server sends static files itself, so precompress them
12761
13041
  // with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
12762
13042
  // fixed top quality cost a docs app ~20 s of build CPU for a small further
@@ -12810,6 +13090,7 @@ function toFarmNodeResponse(request, response) {
12810
13090
  "/**": {
12811
13091
  prerender: false
12812
13092
  },
13093
+ ...immutableAssets.routeRules,
12813
13094
  ...configuredNitroRouteRules,
12814
13095
  // Exact user rules must retain their runtime settings without replacing
12815
13096
  // the headers and prerender marker generated for a safe physical page.
@@ -12851,23 +13132,23 @@ function toFarmNodeResponse(request, response) {
12851
13132
  snapshotSSRRebundleOptions(nitroConfig)
12852
13133
  );
12853
13134
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
12854
- const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _284 => _284.rollupConfig, 'optionalAccess', _285 => _285.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _286 => _286.rollupConfig, 'optionalAccess', _287 => _287.plugins])) && customRollupKeys.length === 0 && Boolean(
12855
- _optionalChain([nitroConfig, 'access', _288 => _288.handlers, 'optionalAccess', _289 => _289.some, 'call', _290 => _290(
12856
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _291 => _291.handler]) || "") === nitroEntryPath
13135
+ const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _287 => _287.rollupConfig, 'optionalAccess', _288 => _288.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _289 => _289.rollupConfig, 'optionalAccess', _290 => _290.plugins])) && customRollupKeys.length === 0 && Boolean(
13136
+ _optionalChain([nitroConfig, 'access', _291 => _291.handlers, 'optionalAccess', _292 => _292.some, 'call', _293 => _293(
13137
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _294 => _294.handler]) || "") === nitroEntryPath
12857
13138
  )])
12858
13139
  );
12859
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _292 => _292.output, 'optionalAccess', _293 => _293.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
13140
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _295 => _295.output, 'optionalAccess', _296 => _296.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
12860
13141
  const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
12861
13142
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
12862
13143
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
12863
13144
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
12864
13145
  const shouldMinify = nitroConfig.minify !== false;
12865
- const keepServerNames = !(_optionalChain([config, 'access', _294 => _294.docs, 'optionalAccess', _295 => _295.enabled]) && _optionalChain([config, 'access', _296 => _296.docs, 'access', _297 => _297.adapter, 'optionalAccess', _298 => _298.server]));
13146
+ const keepServerNames = !(_optionalChain([config, 'access', _297 => _297.docs, 'optionalAccess', _298 => _298.enabled]) && _optionalChain([config, 'access', _299 => _299.docs, 'access', _300 => _300.adapter, 'optionalAccess', _301 => _301.server]));
12866
13147
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
12867
13148
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
12868
13149
  const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
12869
13150
  if (ssrRollupPlugin) {
12870
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _299 => _299.rollupConfig, 'optionalAccess', _300 => _300.plugins]);
13151
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _302 => _302.rollupConfig, 'optionalAccess', _303 => _303.plugins]);
12871
13152
  nitroConfig.rollupConfig = {
12872
13153
  ...nitroConfig.rollupConfig,
12873
13154
  plugins: [
@@ -12894,9 +13175,9 @@ function toFarmNodeResponse(request, response) {
12894
13175
  const orderOf = (route) => _nullishCoalesce(prerenderOrder.get(route), () => ( Number.MAX_SAFE_INTEGER));
12895
13176
  prerenderedRoutes.sort((a, b) => orderOf(a.route) - orderOf(b.route));
12896
13177
  });
12897
- if (_optionalChain([config, 'access', _301 => _301.md, 'optionalAccess', _302 => _302.enabled])) {
13178
+ if (_optionalChain([config, 'access', _304 => _304.md, 'optionalAccess', _305 => _305.enabled])) {
12898
13179
  nitroInstance.hooks.hook("prerender:generate", (route) => {
12899
- if (!route.contents || !_optionalChain([route, 'access', _303 => _303.contentType, 'optionalAccess', _304 => _304.toLowerCase, 'call', _305 => _305(), 'access', _306 => _306.includes, 'call', _307 => _307("html")])) return;
13180
+ if (!route.contents || !_optionalChain([route, 'access', _306 => _306.contentType, 'optionalAccess', _307 => _307.toLowerCase, 'call', _308 => _308(), 'access', _309 => _309.includes, 'call', _310 => _310("html")])) return;
12900
13181
  const alternatePath = _chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
12901
13182
  routePathname: (pathname) => routeManager.toRoutePathname(pathname)
12902
13183
  });
@@ -12919,7 +13200,7 @@ function toFarmNodeResponse(request, response) {
12919
13200
  }
12920
13201
  if (config.security.csp && config.security.csp.nonce) {
12921
13202
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
12922
- if (!route.contents || !_optionalChain([route, 'access', _308 => _308.contentType, 'optionalAccess', _309 => _309.toLowerCase, 'call', _310 => _310(), 'access', _311 => _311.includes, 'call', _312 => _312("html")])) return;
13203
+ if (!route.contents || !_optionalChain([route, 'access', _311 => _311.contentType, 'optionalAccess', _312 => _312.toLowerCase, 'call', _313 => _313(), 'access', _314 => _314.includes, 'call', _315 => _315("html")])) return;
12923
13204
  const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
12924
13205
  if (!staticCsp) return;
12925
13206
  route.contents = staticCsp.html;
@@ -12954,7 +13235,7 @@ function toFarmNodeResponse(request, response) {
12954
13235
  await nitroBuilder.copyPublicAssets(nitroInstance);
12955
13236
  if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
12956
13237
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
12957
- const configuredPlugins = _optionalChain([prerendererConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins]);
13238
+ const configuredPlugins = _optionalChain([prerendererConfig, 'access', _316 => _316.rollupConfig, 'optionalAccess', _317 => _317.plugins]);
12958
13239
  const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
12959
13240
  prerendererConfig.rollupConfig = {
12960
13241
  ...prerendererConfig.rollupConfig,
@@ -13011,13 +13292,13 @@ function toFarmNodeResponse(request, response) {
13011
13292
  }
13012
13293
  if (prerenderRoutes.length > 0) {
13013
13294
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
13014
- const previousPrerender = process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
13015
- process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = "1";
13295
+ const previousPrerender = process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV];
13296
+ process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV] = "1";
13016
13297
  try {
13017
13298
  await nitroBuilder.prerender(nitroInstance);
13018
13299
  } finally {
13019
- if (previousPrerender === void 0) delete process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
13020
- else process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = previousPrerender;
13300
+ if (previousPrerender === void 0) delete process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV];
13301
+ else process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV] = previousPrerender;
13021
13302
  }
13022
13303
  }
13023
13304
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -13193,7 +13474,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
13193
13474
  await fs4.rename(src, dest);
13194
13475
  return;
13195
13476
  } catch (error) {
13196
- const code = _optionalChain([error, 'optionalAccess', _315 => _315.code]);
13477
+ const code = _optionalChain([error, 'optionalAccess', _318 => _318.code]);
13197
13478
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
13198
13479
  throw error;
13199
13480
  }
@@ -13219,7 +13500,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13219
13500
  try {
13220
13501
  await moveVercelOutputPath(publicDir, staticDir, fs4);
13221
13502
  } catch (error) {
13222
- if (_optionalChain([error, 'optionalAccess', _316 => _316.code]) !== "ENOENT") throw error;
13503
+ if (_optionalChain([error, 'optionalAccess', _319 => _319.code]) !== "ENOENT") throw error;
13223
13504
  }
13224
13505
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
13225
13506
  await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
@@ -13233,7 +13514,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13233
13514
  config.basePath
13234
13515
  );
13235
13516
  const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
13236
- (route) => edgeMiddleware.guardedPages.some((pathname) => _chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
13517
+ (route) => edgeMiddleware.guardedPages.some((pathname) => _chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
13237
13518
  );
13238
13519
  if (edgeMiddlewareRoutes.length > 0) {
13239
13520
  await writeFarmVercelEdgeMiddlewareFunction({
@@ -13249,7 +13530,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13249
13530
  vercelConfig.routes = buildFarmVercelRoutes({
13250
13531
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
13251
13532
  runtimeRoutes,
13252
- middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : [],
13533
+ middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
13253
13534
  canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
13254
13535
  });
13255
13536
  const vercelConfigWithWorkflowCrons = _chunkFSODPZRTcjs.applyFarmWorkflowVercelCrons.call(void 0,
@@ -13261,7 +13542,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13261
13542
  _chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
13262
13543
  }
13263
13544
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
13264
- if (!_optionalChain([config, 'access', _317 => _317.docs, 'optionalAccess', _318 => _318.enabled])) return;
13545
+ if (!_optionalChain([config, 'access', _320 => _320.docs, 'optionalAccess', _321 => _321.enabled])) return;
13265
13546
  const [mainRoot, ...extraRoots] = _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs);
13266
13547
  await copyFarmDocsRootContent(
13267
13548
  mainRoot,
@@ -13286,7 +13567,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
13286
13567
  const lastModifiedManifest = _chunkNAXKOTPPcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
13287
13568
  fallback: "now"
13288
13569
  });
13289
- const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _319 => _319.unknown, 'optionalAccess', _320 => _320.length]), () => ( 0));
13570
+ const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _322 => _322.unknown, 'optionalAccess', _323 => _323.length]), () => ( 0));
13290
13571
  if (undatedPages > 0) {
13291
13572
  _chunkQMNWKQL4cjs.logger.warn(
13292
13573
  `${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
@@ -13371,7 +13652,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
13371
13652
  try {
13372
13653
  await copyPackage("sharp", sharpRequire);
13373
13654
  if (!copiedPackages.has("sharp")) {
13374
- throw new Error(`Farm image optimization requires sharp. ${_chunkM6U6E4F7cjs.SHARP_INSTALL_HINT}`);
13655
+ throw new Error(`Farm image optimization requires sharp. ${_chunkCBLRSZQLcjs.SHARP_INSTALL_HINT}`);
13375
13656
  }
13376
13657
  } catch (error) {
13377
13658
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -13601,7 +13882,7 @@ async function createFarmProjectModuleSsrEnvironment() {
13601
13882
  // src/build/index.ts
13602
13883
  async function build(config, options = {}) {
13603
13884
  return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
13604
- () => _chunkIEN2EFE5cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13885
+ () => _chunkBE7AQXJBcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13605
13886
  );
13606
13887
  }
13607
13888
  function createBuildTargetBaseline(config) {
@@ -13612,7 +13893,7 @@ function createBuildTargetBaseline(config) {
13612
13893
  preset,
13613
13894
  distDir,
13614
13895
  outputDir,
13615
- outputWasDerived: outputDir === _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13896
+ outputWasDerived: outputDir === _chunk3WG7GJQLcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13616
13897
  };
13617
13898
  }
13618
13899
  function resolveBuildTargets(config, options, baseline) {
@@ -13621,8 +13902,8 @@ function resolveBuildTargets(config, options, baseline) {
13621
13902
  const distDir = config.distDir || ".farm";
13622
13903
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
13623
13904
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
13624
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkXYVPTTUTcjs.getDeployTargetForPreset.call(void 0, preset);
13625
- const outputDir = shouldRefreshDerivedOutput ? _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13905
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunk3WG7GJQLcjs.getDeployTargetForPreset.call(void 0, preset);
13906
+ const outputDir = shouldRefreshDerivedOutput ? _chunk3WG7GJQLcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13626
13907
  return {
13627
13908
  root,
13628
13909
  preset,
@@ -13630,7 +13911,7 @@ function resolveBuildTargets(config, options, baseline) {
13630
13911
  distDir,
13631
13912
  deployTarget,
13632
13913
  outputDir,
13633
- deployOutputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13914
+ deployOutputDir: _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13634
13915
  };
13635
13916
  }
13636
13917
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -13638,7 +13919,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13638
13919
  const targetBaseline = createBuildTargetBaseline(config);
13639
13920
  let targets;
13640
13921
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
13641
- const pluginManager = new (0, _chunkJFPKARWMcjs.PluginManager)({
13922
+ const pluginManager = new (0, _chunkPMU4U2W2cjs.PluginManager)({
13642
13923
  config,
13643
13924
  isDev: false,
13644
13925
  isProd: true
@@ -13667,15 +13948,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13667
13948
  };
13668
13949
  config = {
13669
13950
  ...config,
13670
- images: _chunkM6U6E4F7cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13951
+ images: _chunkCBLRSZQLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13671
13952
  root: targets.root,
13672
13953
  preset: targets.preset
13673
13954
  })
13674
13955
  };
13675
- if (_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
13956
+ if (_optionalChain([config, 'access', _324 => _324.docs, 'optionalAccess', _325 => _325.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
13676
13957
  pluginManager.updateContext({ config });
13677
13958
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
13678
- _chunkIEN2EFE5cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkIEN2EFE5cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13959
+ _chunkBE7AQXJBcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkBE7AQXJBcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13679
13960
  _chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
13680
13961
  await pluginManager.setupPlugins();
13681
13962
  await pluginManager.runHookParallel("beforeBundle", {
@@ -13687,8 +13968,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13687
13968
  });
13688
13969
  _chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
13689
13970
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
13690
- if (_optionalChain([productionViteResult, 'optionalAccess', _323 => _323.status]) === "rejected") throw productionViteResult.reason;
13691
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _324 => _324.value]);
13971
+ if (_optionalChain([productionViteResult, 'optionalAccess', _326 => _326.status]) === "rejected") throw productionViteResult.reason;
13972
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _327 => _327.value]);
13692
13973
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
13693
13974
  projectModuleServer = await createProjectModuleServer(
13694
13975
  createViteServer,
@@ -13696,17 +13977,17 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13696
13977
  root,
13697
13978
  rendererBuild.signal
13698
13979
  );
13699
- const farmApp = _chunkM6U6E4F7cjs.createFarmApp.call(void 0, config, projectModuleServer);
13980
+ const farmApp = _chunkCBLRSZQLcjs.createFarmApp.call(void 0, config, projectModuleServer);
13700
13981
  await farmApp.initialize();
13701
13982
  const routeManager = farmApp.getRouteManager();
13702
13983
  const serverRenderer = farmApp.getServerRenderer();
13703
- const typeArtifacts = _chunkK7JMTAFHcjs.generateFarmTypeArtifacts.call(void 0, {
13984
+ const typeArtifacts = _chunkE3LE6EZHcjs.generateFarmTypeArtifacts.call(void 0, {
13704
13985
  root,
13705
13986
  srcDir,
13706
13987
  layers: config.layers,
13707
13988
  plugins: config.plugins,
13708
13989
  extraRoutes: [
13709
- ..._optionalChain([config, 'access', _325 => _325.openapi, 'optionalAccess', _326 => _326.enabled]) && config.openapi.route ? [config.openapi.route] : [],
13990
+ ..._optionalChain([config, 'access', _328 => _328.openapi, 'optionalAccess', _329 => _329.enabled]) && config.openapi.route ? [config.openapi.route] : [],
13710
13991
  ..._chunkNAXKOTPPcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
13711
13992
  ],
13712
13993
  suppressLintOnLink: config.suppressLintOnLink,
@@ -13716,7 +13997,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13716
13997
  const message = error instanceof Error ? error.message : String(error);
13717
13998
  _chunkQMNWKQL4cjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
13718
13999
  });
13719
- const apiRouteManager = new (0, _chunkK66JILV3cjs.APIRouteManager)(
14000
+ const apiRouteManager = new (0, _chunk5LOARKDPcjs.APIRouteManager)(
13720
14001
  _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config),
13721
14002
  projectModuleServer,
13722
14003
  {
@@ -13791,7 +14072,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13791
14072
  throw error;
13792
14073
  } finally {
13793
14074
  try {
13794
- await _optionalChain([projectModuleServer, 'optionalAccess', _327 => _327.close, 'call', _328 => _328()]);
14075
+ await _optionalChain([projectModuleServer, 'optionalAccess', _330 => _330.close, 'call', _331 => _331()]);
13795
14076
  } finally {
13796
14077
  rendererBuild.abort();
13797
14078
  }
@@ -13803,7 +14084,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13803
14084
  ssr: true,
13804
14085
  buildLifetime
13805
14086
  });
13806
- const viteConfig = _chunkM6U6E4F7cjs.mergeFarmViteConfig.call(void 0,
14087
+ const viteConfig = _chunkCBLRSZQLcjs.mergeFarmViteConfig.call(void 0,
13807
14088
  {
13808
14089
  root,
13809
14090
  appType: "custom",
@@ -13815,12 +14096,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13815
14096
  },
13816
14097
  plugins: [
13817
14098
  ...rendererVitePlugins,
13818
- _chunkM6U6E4F7cjs.farmFontImportsPlugin.call(void 0, {
14099
+ _chunkCBLRSZQLcjs.farmFontImportsPlugin.call(void 0, {
13819
14100
  root,
13820
14101
  basePath: config.basePath,
13821
14102
  publicDir: config.publicDir
13822
14103
  }),
13823
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
14104
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
13824
14105
  // Route modules load here at build time (rendering config, prerendering): `server-only`
13825
14106
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
13826
14107
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -13832,7 +14113,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13832
14113
  hmr: false
13833
14114
  },
13834
14115
  resolve: {
13835
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
14116
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
13836
14117
  dedupe: [...config.renderer.dedupe || []]
13837
14118
  },
13838
14119
  optimizeDeps: {
@@ -13871,10 +14152,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13871
14152
  noDiscovery: true
13872
14153
  },
13873
14154
  // An app or plugin that brings its own SSR environment keeps it.
13874
- environments: _optionalChain([viteConfig, 'access', _329 => _329.environments, 'optionalAccess', _330 => _330.ssr, 'optionalAccess', _331 => _331.dev, 'optionalAccess', _332 => _332.createEnvironment]) ? viteConfig.environments : {
14155
+ environments: _optionalChain([viteConfig, 'access', _332 => _332.environments, 'optionalAccess', _333 => _333.ssr, 'optionalAccess', _334 => _334.dev, 'optionalAccess', _335 => _335.createEnvironment]) ? viteConfig.environments : {
13875
14156
  ...viteConfig.environments,
13876
14157
  ssr: {
13877
- ..._optionalChain([viteConfig, 'access', _333 => _333.environments, 'optionalAccess', _334 => _334.ssr]),
14158
+ ..._optionalChain([viteConfig, 'access', _336 => _336.environments, 'optionalAccess', _337 => _337.ssr]),
13878
14159
  ...await createFarmProjectModuleSsrEnvironment()
13879
14160
  }
13880
14161
  }
@@ -13882,7 +14163,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13882
14163
  }
13883
14164
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
13884
14165
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
13885
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
14166
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
13886
14167
  const pluginManager = new PluginManager2({
13887
14168
  config,
13888
14169
  isDev: false,
@@ -13902,14 +14183,14 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
13902
14183
  farmI18nClientBridgePlugin(),
13903
14184
  farmServerOnlyEntriesPlugin(),
13904
14185
  farmPlugin(config, pluginManager),
13905
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14186
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
13906
14187
  ],
13907
14188
  mode: "production"
13908
14189
  });
13909
14190
  }
13910
14191
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
13911
14192
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
13912
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
14193
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
13913
14194
  const pluginManager = new PluginManager2({
13914
14195
  config,
13915
14196
  isDev: false,
@@ -13930,12 +14211,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
13930
14211
  define: {
13931
14212
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
13932
14213
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
13933
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _335 => _335.env, 'optionalAccess', _336 => _336.public]) || {})
14214
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _338 => _338.env, 'optionalAccess', _339 => _339.public]) || {})
13934
14215
  },
13935
14216
  plugins: [
13936
14217
  farmI18nClientBridgePlugin(),
13937
14218
  farmPlugin(config, pluginManager),
13938
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14219
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
13939
14220
  ],
13940
14221
  mode: "production"
13941
14222
  });
@@ -13950,7 +14231,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
13950
14231
  }
13951
14232
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
13952
14233
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
13953
- import("./nitro-Y3LGITW3.cjs"),
14234
+ import("./nitro-2LMOMIST.cjs"),
13954
14235
  import("nitro/builder")
13955
14236
  ]);
13956
14237
  let nitroConfig = await createNitroConfig(
@@ -13963,7 +14244,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
13963
14244
  if (pluginManager) {
13964
14245
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
13965
14246
  }
13966
- const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
14247
+ const outputDir = _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13967
14248
  const serverOutputDir = _path2.default.join(outputDir, "server");
13968
14249
  const publicOutputDir = _path2.default.join(outputDir, "public");
13969
14250
  const { mkdir, cp } = await import("fs/promises");
@@ -14034,7 +14315,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
14034
14315
  root,
14035
14316
  preset,
14036
14317
  distDir,
14037
- outputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14318
+ outputDir: _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14038
14319
  });
14039
14320
  }
14040
14321
  }