@farm.js/core 0.1.51-beta.3 → 0.1.60

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 (320) hide show
  1. package/dist/{agent-mcp-handler-7JSKGSOW.mjs → agent-mcp-handler-7QMX2LUY.mjs} +7 -7
  2. package/dist/agent-mcp-handler-OV4WRFBL.cjs +18 -0
  3. package/dist/{agent-mcp.d-BJKChOrO.d.mts → agent-mcp.d-C-2S9bnP.d.mts} +1 -1
  4. package/dist/{agent-mcp.d-BAR9njbJ.d.ts → agent-mcp.d-SIoCUP1I.d.ts} +1 -1
  5. package/dist/agent-runtime.cjs +5 -5
  6. package/dist/agent-runtime.d.mts +2 -2
  7. package/dist/agent-runtime.d.ts +2 -2
  8. package/dist/agent-runtime.mjs +4 -4
  9. package/dist/{analyzer-OTPEWH5W.mjs → analyzer-22BEYV7S.mjs} +116 -13
  10. package/dist/{analyzer-TSQXZCZN.cjs → analyzer-LCSI3NSH.cjs} +123 -20
  11. package/dist/api/client.cjs +5 -4
  12. package/dist/api/client.d.mts +1 -1
  13. package/dist/api/client.d.ts +1 -1
  14. package/dist/api/client.mjs +3 -2
  15. package/dist/api/client.native.cjs +45 -0
  16. package/dist/api/client.native.d.mts +23 -0
  17. package/dist/api/client.native.d.ts +23 -0
  18. package/dist/api/client.native.mjs +45 -0
  19. package/dist/api/route-manager.cjs +7 -7
  20. package/dist/api/route-manager.d.mts +4 -4
  21. package/dist/api/route-manager.d.ts +4 -4
  22. package/dist/api/route-manager.mjs +6 -6
  23. package/dist/api/runtime.cjs +5 -5
  24. package/dist/api/runtime.d.mts +3 -3
  25. package/dist/api/runtime.d.ts +3 -3
  26. package/dist/api/runtime.mjs +4 -4
  27. package/dist/{api-client.d-CeA6tNA6.d.mts → api-client.d-BNLXNCXJ.d.mts} +1 -1
  28. package/dist/{api-client.d-BWcqZciH.d.ts → api-client.d-ddQBNGtu.d.ts} +1 -1
  29. package/dist/api.cjs +11 -11
  30. package/dist/api.d.mts +5 -5
  31. package/dist/api.d.ts +5 -5
  32. package/dist/api.mjs +10 -10
  33. package/dist/{app-manifest.d-DEQNnNhV.d.mts → app-manifest.d-DrSAHskY.d.mts} +1 -1
  34. package/dist/{app-manifest.d-BLFbaqx8.d.ts → app-manifest.d-Tb3CJpL4.d.ts} +1 -1
  35. package/dist/app-markdown.cjs +7 -7
  36. package/dist/app-markdown.d.mts +3 -3
  37. package/dist/app-markdown.d.ts +3 -3
  38. package/dist/app-markdown.mjs +6 -6
  39. package/dist/{app.d-CNPaUYaa.d.ts → app.d-CmWlYpZJ.d.ts} +9 -4
  40. package/dist/{app.d-CT7xDkj2.d.mts → app.d-D6QQM_kk.d.mts} +9 -4
  41. package/dist/{chunk-SN5VSO3Q.mjs → chunk-25T5VXOE.mjs} +7 -9
  42. package/dist/{chunk-OAMUSC7H.cjs → chunk-2FRLSDBT.cjs} +1 -1
  43. package/dist/{chunk-LM2YOGDK.mjs → chunk-2I6PUKWJ.mjs} +1 -1
  44. package/dist/{chunk-ZD2VKAUI.mjs → chunk-2KTYMMWT.mjs} +1 -1
  45. package/dist/{chunk-B5BBTPJQ.cjs → chunk-2OF5RPVU.cjs} +14 -14
  46. package/dist/{chunk-UQF3OJVE.mjs → chunk-37PYUEK5.mjs} +173 -29
  47. package/dist/{chunk-VSLM6BHX.cjs → chunk-3OJNNCDL.cjs} +9 -9
  48. package/dist/{chunk-X3JNB2TB.mjs → chunk-3PX4AIXO.mjs} +36 -5
  49. package/dist/{chunk-UQHIWZZ6.cjs → chunk-3TL3AH25.cjs} +12 -6
  50. package/dist/chunk-3YMLUNL2.cjs +251 -0
  51. package/dist/chunk-4JTQPOKO.cjs +137 -0
  52. package/dist/{chunk-7MD37P5V.cjs → chunk-4P23B7DU.cjs} +5 -5
  53. package/dist/{chunk-3BLEXUGE.mjs → chunk-55U5QIXQ.mjs} +1 -1
  54. package/dist/{chunk-TWHXBMLJ.cjs → chunk-5JNUYGNF.cjs} +4 -4
  55. package/dist/{chunk-53SACYBY.cjs → chunk-6BJJYOFL.cjs} +7 -7
  56. package/dist/chunk-6UUH4N4J.mjs +251 -0
  57. package/dist/{chunk-2NHOYYUT.mjs → chunk-7H45IJWO.mjs} +2 -2
  58. package/dist/{chunk-NN3MOPSI.mjs → chunk-A2MN5PQJ.mjs} +7 -7
  59. package/dist/{chunk-KY32FWK7.mjs → chunk-BHJAYPYU.mjs} +2 -2
  60. package/dist/{chunk-VAHBCI6X.mjs → chunk-BQWBHWEW.mjs} +26 -1
  61. package/dist/{chunk-KJMWAUKE.mjs → chunk-C7GJDVN4.mjs} +1 -1
  62. package/dist/{chunk-OYNNA4DD.cjs → chunk-CBKRS3M4.cjs} +9 -9
  63. package/dist/{chunk-I2DQGS56.cjs → chunk-CBOEJ5Z4.cjs} +39 -41
  64. package/dist/{chunk-UJL4JOXV.cjs → chunk-CI4UNQHO.cjs} +2 -2
  65. package/dist/{chunk-S5AQ7CAC.cjs → chunk-CNNBFGL5.cjs} +39 -14
  66. package/dist/chunk-D2X5MUF5.cjs +1457 -0
  67. package/dist/{chunk-LEIXUFJN.cjs → chunk-D4MRNBVF.cjs} +10 -9
  68. package/dist/{chunk-2KVDHNQS.mjs → chunk-D7LTCK3U.mjs} +2 -2
  69. package/dist/{chunk-4SEHMBL4.cjs → chunk-DPJ66FSI.cjs} +22 -22
  70. package/dist/{chunk-FFE2EMF7.cjs → chunk-DZPR2W6U.cjs} +5 -5
  71. package/dist/{chunk-3Z63X45F.mjs → chunk-E72UD6ME.mjs} +1 -1
  72. package/dist/{chunk-XXXRRVY6.mjs → chunk-EGVC4LIG.mjs} +5 -5
  73. package/dist/{chunk-72NBDVWQ.mjs → chunk-EXUONJYV.mjs} +3 -3
  74. package/dist/{chunk-VS7EHLLW.mjs → chunk-EZ34EHQP.mjs} +1 -1
  75. package/dist/{chunk-5FXPJIOT.mjs → chunk-F6Y7ZAPQ.mjs} +2 -2
  76. package/dist/{chunk-LMFJCXDD.mjs → chunk-FN5UEC7I.mjs} +1 -1
  77. package/dist/{chunk-3SMXQNFD.mjs → chunk-FORSVMEJ.mjs} +2 -2
  78. package/dist/{chunk-R4PHCZ3G.mjs → chunk-HPWB57PZ.mjs} +1 -1
  79. package/dist/{chunk-Y2G5SJFB.mjs → chunk-IFHPDLIS.mjs} +1 -1
  80. package/dist/{chunk-3XQ57EFI.cjs → chunk-IFXSBJPN.cjs} +16 -16
  81. package/dist/{chunk-3WSIYBMG.mjs → chunk-ILMTRGBG.mjs} +279 -48
  82. package/dist/{chunk-HLWOWZFX.cjs → chunk-JBK7UJOI.cjs} +14 -11
  83. package/dist/chunk-JI5D7MXY.mjs +137 -0
  84. package/dist/{chunk-QXJADAQB.cjs → chunk-JIBEFLQ7.cjs} +6 -2
  85. package/dist/{chunk-LZ4SB57H.mjs → chunk-JPIUGDK4.mjs} +1 -1
  86. package/dist/{chunk-Y3N5BFRJ.mjs → chunk-JSDV2NUN.mjs} +1 -1
  87. package/dist/{chunk-IRSS4HS4.mjs → chunk-K3RU5MOR.mjs} +1 -1
  88. package/dist/chunk-KPOMS5RO.cjs +237 -0
  89. package/dist/{chunk-YAJTD3ZG.mjs → chunk-KVW2M6PI.mjs} +1 -1
  90. package/dist/{chunk-5IONBVJY.cjs → chunk-LB3DPQP6.cjs} +22 -22
  91. package/dist/{chunk-CZ35L6PL.mjs → chunk-LJVNMGE3.mjs} +10 -4
  92. package/dist/{chunk-X2AMN2WV.cjs → chunk-LQNW3ABP.cjs} +10 -10
  93. package/dist/{chunk-6ONBZGVH.cjs → chunk-LRB5OVRT.cjs} +3 -3
  94. package/dist/{chunk-D7UQC4O6.cjs → chunk-LT4VAF5Z.cjs} +2 -2
  95. package/dist/{chunk-F6TLUMH7.mjs → chunk-M53MIIXY.mjs} +1 -1
  96. package/dist/{chunk-H33PJEXN.cjs → chunk-MEQN6DDA.cjs} +5 -5
  97. package/dist/{chunk-XLRLSTJ6.cjs → chunk-MGKW5XZE.cjs} +7 -7
  98. package/dist/{chunk-B3GZAQSC.cjs → chunk-MHLNWRCJ.cjs} +3 -3
  99. package/dist/{chunk-5ENW27SL.mjs → chunk-MMK4MZUN.mjs} +1 -1
  100. package/dist/{chunk-WGUHDWT5.cjs → chunk-MTWXOEI4.cjs} +527 -366
  101. package/dist/chunk-NHD7BAKD.mjs +1457 -0
  102. package/dist/{chunk-KLNFJDFM.cjs → chunk-NQJDO7K7.cjs} +31 -31
  103. package/dist/{chunk-TSFMFPRU.cjs → chunk-O27PLNQZ.cjs} +10 -10
  104. package/dist/{chunk-PIHKO25G.mjs → chunk-OM7WILES.mjs} +1 -1
  105. package/dist/{chunk-YUEYBL35.mjs → chunk-PCXIJKPM.mjs} +8 -8
  106. package/dist/{chunk-IWFV5ZED.cjs → chunk-PMJSG4JS.cjs} +1 -1
  107. package/dist/{chunk-B3GM5I6N.cjs → chunk-PRFNLQSP.cjs} +4 -4
  108. package/dist/{chunk-46KXZBOG.cjs → chunk-QAS7KE7J.cjs} +7 -7
  109. package/dist/chunk-QGOZLGVP.mjs +0 -0
  110. package/dist/{chunk-VQJYGZNX.cjs → chunk-QMNWKQL4.cjs} +1 -1
  111. package/dist/{chunk-XB24LZWI.cjs → chunk-QRX4JRBO.cjs} +3 -3
  112. package/dist/{chunk-LNM57D3H.cjs → chunk-R53QDV6T.cjs} +4 -4
  113. package/dist/{chunk-SUV6YO4Q.cjs → chunk-RAWWCDCT.cjs} +5 -5
  114. package/dist/{chunk-LJDIFIJ2.mjs → chunk-RPUJHJHE.mjs} +4 -4
  115. package/dist/{chunk-G2KTRMWA.mjs → chunk-RSEAX5MW.mjs} +4 -0
  116. package/dist/chunk-SJRCWF4Z.mjs +237 -0
  117. package/dist/{chunk-4353ZRE5.mjs → chunk-SX7EECTS.mjs} +8 -5
  118. package/dist/{chunk-LDNSSHEG.mjs → chunk-T4TBK5NY.mjs} +2 -2
  119. package/dist/{chunk-NOTSHVRN.mjs → chunk-T7I62A4C.mjs} +293 -132
  120. package/dist/{chunk-E36C43IX.cjs → chunk-U4BJKNIR.cjs} +6 -6
  121. package/dist/{chunk-4CGOMZP3.cjs → chunk-UDJY2ZGY.cjs} +487 -256
  122. package/dist/{chunk-SHS6KXOZ.mjs → chunk-UR25Z5Z6.mjs} +1 -1
  123. package/dist/{chunk-TQMI6BYO.cjs → chunk-UYSTTPYJ.cjs} +1262 -936
  124. package/dist/{chunk-E5DXF5GE.mjs → chunk-UZZ6IEQP.mjs} +3 -3
  125. package/dist/{chunk-EKJYE4Y7.cjs → chunk-VGG74PSU.cjs} +25 -25
  126. package/dist/{chunk-GAO7MS5O.mjs → chunk-VPTWKOCY.mjs} +19 -19
  127. package/dist/{chunk-UN6N623E.mjs → chunk-VQJHT2ND.mjs} +2 -2
  128. package/dist/{chunk-SJ23LJ3N.cjs → chunk-VVTJTMGQ.cjs} +3 -3
  129. package/dist/{chunk-KHXAJ2KA.cjs → chunk-W2RZ73IU.cjs} +12 -12
  130. package/dist/{chunk-JWI5PUO2.mjs → chunk-W2ZXMMHA.mjs} +2 -1
  131. package/dist/{chunk-BLD5GVCG.mjs → chunk-W6QLRQ3V.mjs} +1 -1
  132. package/dist/{chunk-AV26KHTG.mjs → chunk-X2CZTWQA.mjs} +2 -2
  133. package/dist/chunk-XPIPMWY3.cjs +1 -0
  134. package/dist/{chunk-JXEPLIXD.cjs → chunk-XTG73QZA.cjs} +183 -39
  135. package/dist/{chunk-XPMC4E2G.cjs → chunk-XVSBALOY.cjs} +3 -3
  136. package/dist/{chunk-XYL4HSVC.cjs → chunk-YI6FKTTN.cjs} +38 -7
  137. package/dist/{chunk-LPDKG6RA.mjs → chunk-YSXTNSXS.mjs} +1 -1
  138. package/dist/{chunk-EHB77D5U.cjs → chunk-ZDAEHG2O.cjs} +3 -3
  139. package/dist/{chunk-3TLKUBXG.mjs → chunk-ZFUKPWFC.mjs} +912 -586
  140. package/dist/{chunk-4TKAIO2F.mjs → chunk-ZMHAFH4R.mjs} +8 -8
  141. package/dist/{chunk-ZOWNWHK6.cjs → chunk-ZNH6NR3H.cjs} +2 -2
  142. package/dist/{chunk-PFV2KPDZ.cjs → chunk-ZOYKJBP5.cjs} +3 -3
  143. package/dist/{chunk-CECUDGXQ.cjs → chunk-ZP32GNJQ.cjs} +13 -13
  144. package/dist/{chunk-MRNDAJEV.mjs → chunk-ZZ2QKCKW.mjs} +1 -1
  145. package/dist/{client-plugins.d-DllmH8eM.d.mts → client-plugins.d-CgQQ-EAv.d.mts} +10 -2
  146. package/dist/{client-plugins.d-n3iWY1EJ.d.ts → client-plugins.d-vXrbcfJ1.d.ts} +10 -2
  147. package/dist/client-plugins.d.mts +2 -2
  148. package/dist/client-plugins.d.ts +2 -2
  149. package/dist/client.cjs +9 -9
  150. package/dist/client.d.mts +9 -9
  151. package/dist/client.d.ts +9 -9
  152. package/dist/client.mjs +9 -9
  153. package/dist/{config.d-DqKaCr1r.d.ts → config.d-DqZkLwef.d.mts} +139 -1
  154. package/dist/{config.d-DqKaCr1r.d.mts → config.d-DqZkLwef.d.ts} +139 -1
  155. package/dist/config.d.mts +2 -2
  156. package/dist/config.d.ts +2 -2
  157. package/dist/cron.cjs +3 -3
  158. package/dist/cron.d.mts +10 -0
  159. package/dist/cron.d.ts +10 -0
  160. package/dist/cron.mjs +2 -2
  161. package/dist/desktop.d.mts +3 -3
  162. package/dist/desktop.d.ts +3 -3
  163. package/dist/{devtools-UESYARTF.mjs → devtools-KQZ6SRCJ.mjs} +16 -16
  164. package/dist/{devtools-TO6TAO32.cjs → devtools-UF6JYHUN.cjs} +18 -18
  165. package/dist/docs.cjs +19 -19
  166. package/dist/docs.d.mts +3 -3
  167. package/dist/docs.d.ts +3 -3
  168. package/dist/docs.mjs +18 -18
  169. package/dist/index.cjs +96 -96
  170. package/dist/{index.d-BXsAXm1U.d.ts → index.d-DlCELfhf.d.ts} +1 -1
  171. package/dist/{index.d-BL7KKiwa.d.mts → index.d-Dmfb7Kb_.d.mts} +1 -1
  172. package/dist/index.d.mts +18 -18
  173. package/dist/index.d.ts +18 -18
  174. package/dist/index.mjs +139 -139
  175. package/dist/integrations.cjs +5 -5
  176. package/dist/integrations.d.mts +2 -2
  177. package/dist/integrations.d.ts +2 -2
  178. package/dist/integrations.mjs +4 -4
  179. package/dist/internal/app-markdown-runtime.cjs +6 -6
  180. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  181. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  182. package/dist/internal/app-markdown-runtime.mjs +5 -5
  183. package/dist/internal/build-runtime.cjs +50 -50
  184. package/dist/internal/build-runtime.d.mts +4 -4
  185. package/dist/internal/build-runtime.d.ts +4 -4
  186. package/dist/internal/build-runtime.mjs +49 -49
  187. package/dist/internal/cli-runtime.cjs +28 -28
  188. package/dist/internal/cli-runtime.mjs +28 -28
  189. package/dist/internal/client-error-overlay.cjs +4 -4
  190. package/dist/internal/client-error-overlay.mjs +1 -1
  191. package/dist/internal/client-runtime.cjs +20 -15
  192. package/dist/internal/client-runtime.d.mts +5 -5
  193. package/dist/internal/client-runtime.d.ts +5 -5
  194. package/dist/internal/client-runtime.mjs +8 -3
  195. package/dist/internal/compression-runtime.d.mts +2 -2
  196. package/dist/internal/compression-runtime.d.ts +2 -2
  197. package/dist/internal/config-runtime.cjs +18 -18
  198. package/dist/internal/config-runtime.d.mts +94 -6
  199. package/dist/internal/config-runtime.d.ts +94 -6
  200. package/dist/internal/config-runtime.mjs +17 -17
  201. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  202. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  203. package/dist/internal/islands-boot.cjs +211 -0
  204. package/dist/internal/islands-boot.d.mts +8 -0
  205. package/dist/internal/islands-boot.d.ts +8 -0
  206. package/dist/internal/islands-boot.mjs +211 -0
  207. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  208. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  209. package/dist/internal/production-runtime.cjs +37 -101
  210. package/dist/internal/production-runtime.d.mts +17 -11
  211. package/dist/internal/production-runtime.d.ts +17 -11
  212. package/dist/internal/production-runtime.mjs +47 -111
  213. package/dist/markdown.cjs +5 -5
  214. package/dist/markdown.d.mts +2 -2
  215. package/dist/markdown.d.ts +2 -2
  216. package/dist/markdown.mjs +4 -4
  217. package/dist/middleware.cjs +10 -10
  218. package/dist/middleware.d.mts +4 -4
  219. package/dist/middleware.d.ts +4 -4
  220. package/dist/middleware.mjs +9 -9
  221. package/dist/mobile.d.mts +27 -5
  222. package/dist/mobile.d.ts +27 -5
  223. package/dist/modules-VHD7BELU.mjs +13 -0
  224. package/dist/modules-WT5D3AWY.cjs +13 -0
  225. package/dist/native-specs-BD7HOTMJ.mjs +15 -0
  226. package/dist/native-specs-IQQRJOOW.cjs +15 -0
  227. package/dist/native-tree-6G5O53O3.cjs +27 -0
  228. package/dist/{native-tree-EBPDFTRW.mjs → native-tree-VWNW2MQ2.mjs} +10 -8
  229. package/dist/native.cjs +87 -0
  230. package/dist/native.d.mts +72 -0
  231. package/dist/native.d.ts +72 -0
  232. package/dist/native.mjs +87 -0
  233. package/dist/{navigation-delegate.d-C76gXTmO.d.mts → navigation-delegate.d-CnOTWOyi.d.mts} +1 -1
  234. package/dist/{navigation-delegate.d-DIyDslxt.d.ts → navigation-delegate.d-JXx40JzR.d.ts} +1 -1
  235. package/dist/navigation.cjs +5 -5
  236. package/dist/navigation.d.mts +5 -5
  237. package/dist/navigation.d.ts +5 -5
  238. package/dist/navigation.mjs +4 -4
  239. package/dist/{nitro-R444AF3O.mjs → nitro-FLN6DRGJ.mjs} +7 -7
  240. package/dist/{nitro-CK7M4RMY.cjs → nitro-HXAZZQKY.cjs} +12 -12
  241. package/dist/plugin.cjs +42 -42
  242. package/dist/plugin.d.mts +4 -4
  243. package/dist/plugin.d.ts +4 -4
  244. package/dist/plugin.mjs +41 -41
  245. package/dist/port-C6GBH4C6.cjs +419 -0
  246. package/dist/port-WOOQ3V56.mjs +419 -0
  247. package/dist/{production-runtime.d-CDHztggO.d.mts → production-runtime.d-CP5s6RuY.d.mts} +1 -1
  248. package/dist/{production-runtime.d-tyaGdbk6.d.ts → production-runtime.d-N-cE3pmy.d.ts} +1 -1
  249. package/dist/{programmatic-routes-client.d-XfmIrCK1.d.ts → programmatic-routes-client.d-CLG2N1yH.d.ts} +2 -2
  250. package/dist/{programmatic-routes-client.d-aAWiDd64.d.mts → programmatic-routes-client.d-CPbNqtIi.d.mts} +2 -2
  251. package/dist/query/client.cjs +6 -6
  252. package/dist/query/client.mjs +2 -2
  253. package/dist/{render-plan.d-Dr5WRjoV.d.ts → render-plan.d-B9lAP3uX.d.ts} +1 -1
  254. package/dist/{render-plan.d-Diwybxo8.d.mts → render-plan.d-DZ-qjjdG.d.mts} +1 -1
  255. package/dist/renderer/react/server.cjs +2 -2
  256. package/dist/renderer/react/server.mjs +3 -3
  257. package/dist/renderer-client.cjs +6 -6
  258. package/dist/renderer-client.d.mts +5 -5
  259. package/dist/renderer-client.d.ts +5 -5
  260. package/dist/renderer-client.mjs +2 -2
  261. package/dist/{request.d-D01fRn--.d.ts → request.d-BiicaNxb.d.ts} +1 -1
  262. package/dist/{request.d-Dd3AFR79.d.mts → request.d-DV0oeUit.d.mts} +1 -1
  263. package/dist/request.d.mts +3 -3
  264. package/dist/request.d.ts +3 -3
  265. package/dist/{route-rendering.d-BQ53lJ_D.d.mts → route-rendering.d-BrIKA51A.d.mts} +1 -1
  266. package/dist/{route-rendering.d-Bhx4QoJt.d.ts → route-rendering.d-Iss0C7GR.d.ts} +1 -1
  267. package/dist/{router.d-DQ3k7EYn.d.ts → router.d-DjGn_al7.d.ts} +1 -1
  268. package/dist/{router.d-Bi23a6Xc.d.mts → router.d-mNTbOGV_.d.mts} +1 -1
  269. package/dist/{routes.d-C7jMJFvP.d.ts → routes.d-BKSjHuH9.d.ts} +25 -2
  270. package/dist/{routes.d-BgTd7vI4.d.mts → routes.d-qd8Qf4LG.d.mts} +25 -2
  271. package/dist/routes.d.mts +2 -2
  272. package/dist/routes.d.ts +2 -2
  273. package/dist/{rsc-pipeline-OCZIT5OF.cjs → rsc-pipeline-SVLBTY7H.cjs} +21 -21
  274. package/dist/{rsc-pipeline-K3ER3Q4N.mjs → rsc-pipeline-WBLBDQXA.mjs} +20 -20
  275. package/dist/{runtime-DKNSIH7V.cjs → runtime-DGUOWSMF.cjs} +293 -41
  276. package/dist/{runtime-MKYDEUZT.mjs → runtime-HFZTVNFF.mjs} +283 -31
  277. package/dist/{runtime.d-B2Js6qZ2.d.mts → runtime.d-BNVbojF1.d.mts} +1 -1
  278. package/dist/{runtime.d-BL-CGwoi.d.ts → runtime.d-Bm_4hP5T.d.ts} +1 -1
  279. package/dist/{schema-dev-notice-F6QYSOAI.mjs → schema-dev-notice-JMXEQWIQ.mjs} +3 -3
  280. package/dist/{schema-dev-notice-UU7DMZEU.cjs → schema-dev-notice-PLBFDTOF.cjs} +6 -6
  281. package/dist/server-fn-client.d.mts +1 -1
  282. package/dist/server-fn-client.d.ts +1 -1
  283. package/dist/server-plugins.cjs +1 -1
  284. package/dist/server-plugins.d.mts +3 -3
  285. package/dist/server-plugins.d.ts +3 -3
  286. package/dist/server-plugins.mjs +1 -1
  287. package/dist/server.cjs +81 -81
  288. package/dist/server.d.mts +11 -11
  289. package/dist/server.d.ts +11 -11
  290. package/dist/server.mjs +64 -64
  291. package/dist/session-2Q72D4QV.cjs +23 -0
  292. package/dist/{session-IGEDQ5PY.mjs → session-QZXZOPR2.mjs} +2 -2
  293. package/dist/shell-render.d-CG6bPiiA.d.mts +41 -0
  294. package/dist/shell-render.d-CG6bPiiA.d.ts +41 -0
  295. package/dist/{spa-router.d-DqZ6Lfs0.d.ts → spa-router.d-DAtnNoBe.d.ts} +11 -2
  296. package/dist/{spa-router.d-B2rIFGs0.d.mts → spa-router.d-DHDoXxDE.d.mts} +11 -2
  297. package/dist/testing.cjs +7 -7
  298. package/dist/testing.d.mts +2 -2
  299. package/dist/testing.d.ts +2 -2
  300. package/dist/testing.mjs +6 -6
  301. package/dist/{utils.d-Bv2MPeLR.d.ts → utils.d-DwZ-KLSB.d.ts} +7 -1
  302. package/dist/{utils.d-fqXe8lNc.d.mts → utils.d-uKZcKJk4.d.mts} +7 -1
  303. package/dist/version.cjs +2 -2
  304. package/dist/version.mjs +1 -1
  305. package/dist/vite.cjs +42 -42
  306. package/dist/vite.d.mts +10 -5
  307. package/dist/vite.d.ts +10 -5
  308. package/dist/vite.mjs +41 -41
  309. package/dist/workflows.cjs +3 -3
  310. package/dist/workflows.mjs +2 -2
  311. package/package.json +17 -3
  312. package/dist/agent-mcp-handler-YE4AGWHN.cjs +0 -18
  313. package/dist/chunk-MIGFX2FN.mjs +0 -758
  314. package/dist/chunk-P6MHI5O2.cjs +0 -758
  315. package/dist/native-tree-MMZS7S6W.cjs +0 -25
  316. package/dist/session-AAU7RNRO.cjs +0 -23
  317. package/dist/{chunk-7FVVQEVL.cjs → chunk-4BS3HSY7.cjs} +2 -2
  318. package/dist/{chunk-N7JQXQAV.cjs → chunk-5OJVKXFV.cjs} +2 -2
  319. package/dist/{chunk-WSDKXV4E.mjs → chunk-72KABRWN.mjs} +4 -4
  320. package/dist/{chunk-C3BOESDW.mjs → chunk-B4CWYGCG.mjs} +3 -3
@@ -24,14 +24,14 @@ var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
24
24
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
25
25
 
26
26
 
27
- var _chunk7FVVQEVLcjs = require('./chunk-7FVVQEVL.cjs');
27
+ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
28
28
 
29
29
 
30
30
 
31
31
 
32
32
 
33
33
 
34
- var _chunk3XQ57EFIcjs = require('./chunk-3XQ57EFI.cjs');
34
+ var _chunkIFXSBJPNcjs = require('./chunk-IFXSBJPN.cjs');
35
35
 
36
36
 
37
37
 
@@ -43,7 +43,7 @@ var _chunk3XQ57EFIcjs = require('./chunk-3XQ57EFI.cjs');
43
43
 
44
44
 
45
45
 
46
- var _chunkTWHXBMLJcjs = require('./chunk-TWHXBMLJ.cjs');
46
+ var _chunk5JNUYGNFcjs = require('./chunk-5JNUYGNF.cjs');
47
47
 
48
48
 
49
49
 
@@ -51,22 +51,26 @@ var _chunkTWHXBMLJcjs = require('./chunk-TWHXBMLJ.cjs');
51
51
  var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
52
52
 
53
53
 
54
- var _chunk7MD37P5Vcjs = require('./chunk-7MD37P5V.cjs');
54
+ var _chunk4P23B7DUcjs = require('./chunk-4P23B7DU.cjs');
55
55
 
56
56
 
57
- var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
57
+ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
58
58
 
59
59
 
60
- var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
61
60
 
62
61
 
63
- var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
62
+
63
+ var _chunkNQJDO7K7cjs = require('./chunk-NQJDO7K7.cjs');
64
+
65
+
66
+ var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
64
67
 
65
68
 
69
+ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
70
+
66
71
 
67
72
 
68
73
 
69
- var _chunkKLNFJDFMcjs = require('./chunk-KLNFJDFM.cjs');
70
74
 
71
75
 
72
76
 
@@ -100,10 +104,10 @@ var _chunkKLNFJDFMcjs = require('./chunk-KLNFJDFM.cjs');
100
104
 
101
105
 
102
106
 
103
- var _chunkTQMI6BYOcjs = require('./chunk-TQMI6BYO.cjs');
107
+ var _chunkUYSTTPYJcjs = require('./chunk-UYSTTPYJ.cjs');
104
108
 
105
109
 
106
- var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
110
+ var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
107
111
 
108
112
 
109
113
  var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
@@ -111,7 +115,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
111
115
 
112
116
 
113
117
 
114
- var _chunkUQHIWZZ6cjs = require('./chunk-UQHIWZZ6.cjs');
118
+ var _chunk3TL3AH25cjs = require('./chunk-3TL3AH25.cjs');
115
119
 
116
120
 
117
121
 
@@ -124,7 +128,7 @@ var _chunkUQHIWZZ6cjs = require('./chunk-UQHIWZZ6.cjs');
124
128
 
125
129
 
126
130
 
127
- var _chunkTSFMFPRUcjs = require('./chunk-TSFMFPRU.cjs');
131
+ var _chunkO27PLNQZcjs = require('./chunk-O27PLNQZ.cjs');
128
132
 
129
133
 
130
134
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -141,20 +145,17 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
141
145
 
142
146
 
143
147
 
144
- var _chunk4SEHMBL4cjs = require('./chunk-4SEHMBL4.cjs');
148
+ var _chunkDPJ66FSIcjs = require('./chunk-DPJ66FSI.cjs');
145
149
 
146
150
 
147
151
 
148
152
 
149
- var _chunk46KXZBOGcjs = require('./chunk-46KXZBOG.cjs');
153
+ var _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
150
154
 
151
155
 
152
156
  var _chunkNK2VWS7Pcjs = require('./chunk-NK2VWS7P.cjs');
153
157
 
154
158
 
155
- var _chunkB3GM5I6Ncjs = require('./chunk-B3GM5I6N.cjs');
156
-
157
-
158
159
 
159
160
  var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
160
161
 
@@ -182,48 +183,51 @@ var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
182
183
  var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
183
184
 
184
185
 
186
+ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
187
+
188
+
185
189
  var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
186
190
 
187
191
 
188
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
192
+ var _chunkPRFNLQSPcjs = require('./chunk-PRFNLQSP.cjs');
189
193
 
190
194
 
191
195
 
192
196
  var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
193
197
 
194
198
 
199
+ var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
195
200
 
196
- var _chunkXB24LZWIcjs = require('./chunk-XB24LZWI.cjs');
197
201
 
198
202
 
203
+ var _chunkQRX4JRBOcjs = require('./chunk-QRX4JRBO.cjs');
199
204
 
200
205
 
201
206
 
202
- var _chunkXYL4HSVCcjs = require('./chunk-XYL4HSVC.cjs');
203
207
 
204
208
 
205
- var _chunkFK25QSVCcjs = require('./chunk-FK25QSVC.cjs');
209
+ var _chunkYI6FKTTNcjs = require('./chunk-YI6FKTTN.cjs');
206
210
 
207
211
 
208
- var _chunkD7UQC4O6cjs = require('./chunk-D7UQC4O6.cjs');
212
+ var _chunkFK25QSVCcjs = require('./chunk-FK25QSVC.cjs');
209
213
 
210
214
 
211
215
  var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
212
216
 
213
217
 
214
218
 
215
- var _chunkCECUDGXQcjs = require('./chunk-CECUDGXQ.cjs');
219
+ var _chunkZP32GNJQcjs = require('./chunk-ZP32GNJQ.cjs');
216
220
 
217
221
 
218
- var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
222
+ var _chunkZOYKJBP5cjs = require('./chunk-ZOYKJBP5.cjs');
219
223
 
220
224
 
221
225
 
222
226
 
223
- var _chunkB3GZAQSCcjs = require('./chunk-B3GZAQSC.cjs');
227
+ var _chunkMHLNWRCJcjs = require('./chunk-MHLNWRCJ.cjs');
224
228
 
225
229
 
226
- var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
230
+ var _chunkW2RZ73IUcjs = require('./chunk-W2RZ73IU.cjs');
227
231
 
228
232
 
229
233
  var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
@@ -243,14 +247,14 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
243
247
 
244
248
 
245
249
 
246
- var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
250
+ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
247
251
 
248
252
 
249
253
 
250
- var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
254
+ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
251
255
 
252
256
 
253
- var _chunkOAMUSC7Hcjs = require('./chunk-OAMUSC7H.cjs');
257
+ var _chunk2FRLSDBTcjs = require('./chunk-2FRLSDBT.cjs');
254
258
 
255
259
 
256
260
  var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
@@ -275,6 +279,7 @@ var _crypto = require('crypto');
275
279
 
276
280
  var FARM_CLIENT_CSS_HREF_PLACEHOLDER = "/__farm_client_css_href__";
277
281
  var FARM_CLIENT_JS_SRC_PLACEHOLDER = "/__farm_client_js_src__";
282
+ var FARM_CLIENT_BOOT_SRC_PLACEHOLDER = "/__farm_client_boot_src__";
278
283
  async function hashAndCopy(sourcePath, destinationDir, hashedName) {
279
284
  const fs4 = await import("fs/promises");
280
285
  try {
@@ -307,6 +312,16 @@ async function findFingerprintedClientEntry(clientOutputDir) {
307
312
  return null;
308
313
  }
309
314
  }
315
+ async function resolveClientBootSrc(clientOutputDir) {
316
+ const fs4 = await import("fs/promises");
317
+ try {
318
+ const entries = await fs4.readdir(clientOutputDir);
319
+ const name = entries.find((entry) => /^farm-client-boot-h[0-9a-f]+\.js$/.test(entry));
320
+ return name ? `/${name}` : null;
321
+ } catch (e3) {
322
+ return null;
323
+ }
324
+ }
310
325
  async function resolveHashedClientJsSrc(clientOutputDir) {
311
326
  const entryName = await findFingerprintedClientEntry(clientOutputDir);
312
327
  if (!entryName) return "/farm-client.js";
@@ -357,14 +372,14 @@ function getDocsTitle(docs) {
357
372
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
358
373
  }
359
374
  function loadPages(contentDir, docs) {
360
- return _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkTWHXBMLJcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
375
+ return _chunk5JNUYGNFcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk5JNUYGNFcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
361
376
  }
362
377
  function findSocialImagePath(html) {
363
378
  const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
364
379
  if (!_optionalChain([match, 'optionalAccess', _ => _[1]])) return null;
365
380
  try {
366
381
  return new URL(match[1], FARM_DOCS_COMPILED_ORIGIN).pathname;
367
- } catch (e3) {
382
+ } catch (e4) {
368
383
  return null;
369
384
  }
370
385
  }
@@ -375,14 +390,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
375
390
  return response;
376
391
  }
377
392
  async function compileFarmDocsManifest(docs, options) {
378
- const contentDir = _chunkTWHXBMLJcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
393
+ const contentDir = _chunk5JNUYGNFcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
379
394
  const pages = loadPages(contentDir, docs);
380
395
  const absolutePaths = [
381
396
  _path2.default.resolve(options.root),
382
397
  _path2.default.resolve(contentDir),
383
398
  docs.configPath || ""
384
399
  ];
385
- const handler = _chunkTWHXBMLJcjs.createFarmDocsHandler.call(void 0, docs, {
400
+ const handler = _chunk5JNUYGNFcjs.createFarmDocsHandler.call(void 0, docs, {
386
401
  root: options.root,
387
402
  srcDir: options.srcDir,
388
403
  clientEntry: options.clientEntry,
@@ -391,7 +406,7 @@ async function compileFarmDocsManifest(docs, options) {
391
406
  globalStylesheetHref: options.globalStylesheetHref,
392
407
  isPathGuarded: options.isPathGuarded
393
408
  });
394
- const apiHandler = _chunk3XQ57EFIcjs.createFarmDocsAPIHandler.call(void 0, {
409
+ const apiHandler = _chunkIFXSBJPNcjs.createFarmDocsAPIHandler.call(void 0, {
395
410
  rootDir: options.root,
396
411
  srcDir: options.srcDir,
397
412
  docs,
@@ -402,7 +417,7 @@ async function compileFarmDocsManifest(docs, options) {
402
417
  const apiMarkdown = {};
403
418
  for (const page of pages) {
404
419
  const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
405
- const markdownPath = _chunkTWHXBMLJcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
420
+ const markdownPath = _chunk5JNUYGNFcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
406
421
  await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
407
422
  if (htmlResponse) {
408
423
  const socialImagePath = findSocialImagePath(await htmlResponse.text());
@@ -486,7 +501,7 @@ async function compileFarmDocsManifest(docs, options) {
486
501
  post: await compileResponse(postResponse, absolutePaths),
487
502
  search: {
488
503
  pages: publicPages.map((page) => ({
489
- ..._chunkTWHXBMLJcjs.toFarmDocsMarkdownPage.call(void 0, page),
504
+ ..._chunk5JNUYGNFcjs.toFarmDocsMarkdownPage.call(void 0, page),
490
505
  sourcePath: `farm-docs:${page.slug || "index"}`
491
506
  })),
492
507
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -539,7 +554,7 @@ function collectFarmClientModulePreloads(bundle, options) {
539
554
  const moduleId = chunk.facadeModuleId.split("?")[0];
540
555
  if (!_path2.default.isAbsolute(moduleId)) continue;
541
556
  const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
542
- modules[_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
557
+ modules[_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
543
558
  chunk.fileName,
544
559
  ...staticImports(chunk, loaded, [])
545
560
  ].map(index);
@@ -563,7 +578,7 @@ async function readFarmClientModulePreloads(buildDir) {
563
578
  return JSON.parse(
564
579
  await _promises2.default.readFile(_path2.default.join(buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE), "utf8")
565
580
  );
566
- } catch (e4) {
581
+ } catch (e5) {
567
582
  return null;
568
583
  }
569
584
  }
@@ -648,7 +663,7 @@ async function readFarmDocsModulePreloads(buildDir) {
648
663
  return JSON.parse(
649
664
  await _promises2.default.readFile(_path2.default.join(buildDir, FARM_DOCS_MODULE_PRELOADS_FILE), "utf8")
650
665
  );
651
- } catch (e5) {
666
+ } catch (e6) {
652
667
  return null;
653
668
  }
654
669
  }
@@ -664,7 +679,7 @@ async function createFarmRouteRuntimeManifest(options) {
664
679
  const routes = [];
665
680
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
666
681
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
667
- const rendering = await _chunkUQHIWZZ6cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
682
+ const rendering = await _chunk3TL3AH25cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
668
683
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
669
684
  routes.push({
670
685
  kind: "page",
@@ -675,9 +690,9 @@ async function createFarmRouteRuntimeManifest(options) {
675
690
  });
676
691
  }
677
692
  for (const [pattern, route] of options.apiRouteManager.getRoutes()) {
678
- const publicPattern = _chunkB5BBTPJQcjs.resolveFarmAPIServerRoutePath.call(void 0,
693
+ const publicPattern = _chunk2OF5RPVUcjs.resolveFarmAPIServerRoutePath.call(void 0,
679
694
  pattern,
680
- _chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, options.config.api)
695
+ _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, options.config.api)
681
696
  );
682
697
  const inherited = _chunkOYZXVBZPcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, publicPattern, options.config.routeRules);
683
698
  const own = _chunkOYZXVBZPcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
@@ -1048,7 +1063,7 @@ function stripPlatformConfigSource(code, parse) {
1048
1063
  function realPath(file) {
1049
1064
  try {
1050
1065
  return _fs.realpathSync.call(void 0, file);
1051
- } catch (e6) {
1066
+ } catch (e7) {
1052
1067
  return _path2.default.resolve(file);
1053
1068
  }
1054
1069
  }
@@ -1166,12 +1181,26 @@ async function readMiddlewareFileConfig(filePath) {
1166
1181
  const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1167
1182
  if (_optionalChain([parsed, 'access', _32 => _32.errors, 'optionalAccess', _33 => _33.length])) return "unknown";
1168
1183
  return readStaticMiddlewareConfig(parsed.program);
1169
- } catch (e7) {
1184
+ } catch (e8) {
1170
1185
  return "unknown";
1171
1186
  }
1172
1187
  }
1173
1188
 
1174
1189
  // src/nitro/universal-build.ts
1190
+ var FARM_NATIVE_STYLESHEETS_PLACEHOLDER = "__FARM_NATIVE_STYLESHEETS__";
1191
+ async function readFarmNativeStylesheets(clientOutputDir, clientCssHref) {
1192
+ const fs4 = await import("fs/promises");
1193
+ try {
1194
+ return {
1195
+ [clientCssHref]: await fs4.readFile(
1196
+ _path2.default.join(clientOutputDir, clientCssHref.slice(1)),
1197
+ "utf8"
1198
+ )
1199
+ };
1200
+ } catch (e9) {
1201
+ return {};
1202
+ }
1203
+ }
1175
1204
  function preloadFarmNitroBuilder() {
1176
1205
  return import("nitro/builder").then(
1177
1206
  (value) => ({ status: "fulfilled", value }),
@@ -1187,7 +1216,7 @@ function findFarmCoreRoot(from) {
1187
1216
  if (_fs.existsSync.call(void 0, manifest)) {
1188
1217
  try {
1189
1218
  if (JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core") return dir;
1190
- } catch (e8) {
1219
+ } catch (e10) {
1191
1220
  }
1192
1221
  }
1193
1222
  dir = _path2.default.dirname(dir);
@@ -1205,7 +1234,7 @@ function findInstalledPackageDir(name, from) {
1205
1234
  if (_fs.existsSync.call(void 0, _path2.default.join(candidate, "package.json"))) {
1206
1235
  try {
1207
1236
  return _fs.realpathSync.call(void 0, candidate);
1208
- } catch (e9) {
1237
+ } catch (e11) {
1209
1238
  return null;
1210
1239
  }
1211
1240
  }
@@ -1221,7 +1250,7 @@ function collectFarmDependencyDirs(root) {
1221
1250
  let manifest;
1222
1251
  try {
1223
1252
  manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(dir, "package.json"), "utf8"));
1224
- } catch (e10) {
1253
+ } catch (e12) {
1225
1254
  return;
1226
1255
  }
1227
1256
  for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
@@ -1237,7 +1266,7 @@ function collectFarmDependencyDirs(root) {
1237
1266
  if (name.startsWith("@farm.js/")) queue.push({ name, from: root });
1238
1267
  }
1239
1268
  }
1240
- } catch (e11) {
1269
+ } catch (e13) {
1241
1270
  }
1242
1271
  for (let next = queue.pop(); next; next = queue.pop()) {
1243
1272
  const dir = findInstalledPackageDir(next.name, next.from);
@@ -1334,7 +1363,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1334
1363
  if (nitroEntry === void 0) {
1335
1364
  try {
1336
1365
  nitroEntry = resolveNitroEntry(root);
1337
- } catch (e12) {
1366
+ } catch (e14) {
1338
1367
  nitroEntry = null;
1339
1368
  }
1340
1369
  }
@@ -1355,7 +1384,7 @@ function createFarmStorageModuleRegistration(config) {
1355
1384
  let runtimeRequire = projectRequire;
1356
1385
  try {
1357
1386
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1358
- } catch (e13) {
1387
+ } catch (e15) {
1359
1388
  }
1360
1389
  const loaders = [];
1361
1390
  for (const specifier of modules) {
@@ -1364,7 +1393,7 @@ function createFarmStorageModuleRegistration(config) {
1364
1393
  try {
1365
1394
  resolved = require2.resolve(specifier);
1366
1395
  break;
1367
- } catch (e14) {
1396
+ } catch (e16) {
1368
1397
  }
1369
1398
  }
1370
1399
  if (resolved) {
@@ -1382,7 +1411,7 @@ function resolveNitroPackageEntry(root) {
1382
1411
  let runtimeRequire = projectRequire;
1383
1412
  try {
1384
1413
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1385
- } catch (e15) {
1414
+ } catch (e17) {
1386
1415
  }
1387
1416
  return runtimeRequire.resolve("nitro");
1388
1417
  }
@@ -1436,7 +1465,7 @@ async function canUseRolldownBuilder() {
1436
1465
  try {
1437
1466
  await import("rolldown");
1438
1467
  return true;
1439
- } catch (e16) {
1468
+ } catch (e18) {
1440
1469
  return false;
1441
1470
  }
1442
1471
  }
@@ -1450,7 +1479,7 @@ function hasReactDomEdgeServerBuild(root) {
1450
1479
  try {
1451
1480
  _module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
1452
1481
  return true;
1453
- } catch (e17) {
1482
+ } catch (e19) {
1454
1483
  return false;
1455
1484
  }
1456
1485
  }
@@ -1488,7 +1517,7 @@ function isFarmCoreModule(file) {
1488
1517
  if (_fs.existsSync.call(void 0, manifest)) {
1489
1518
  try {
1490
1519
  return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
1491
- } catch (e18) {
1520
+ } catch (e20) {
1492
1521
  return false;
1493
1522
  }
1494
1523
  }
@@ -1735,7 +1764,7 @@ function hasProjectPostcssConfig(root) {
1735
1764
  try {
1736
1765
  projectRequire.resolve(`./${file}`);
1737
1766
  return true;
1738
- } catch (e19) {
1767
+ } catch (e21) {
1739
1768
  return false;
1740
1769
  }
1741
1770
  });
@@ -1757,14 +1786,14 @@ async function findFarmConfigPath(root) {
1757
1786
  try {
1758
1787
  await fs4.access(resolvedPath);
1759
1788
  return resolvedPath;
1760
- } catch (e20) {
1789
+ } catch (e22) {
1761
1790
  }
1762
1791
  }
1763
1792
  return null;
1764
1793
  }
1765
1794
  function hasFarmServerRuntimePlugins(config) {
1766
1795
  return (config.plugins || []).some((plugin) => {
1767
- if (_chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1796
+ if (_chunkZP32GNJQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1768
1797
  return Boolean(
1769
1798
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1770
1799
  );
@@ -1775,9 +1804,9 @@ function hasFarmPluginRoutes(config) {
1775
1804
  }
1776
1805
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1777
1806
  return (config.plugins || []).some(
1778
- (plugin) => _chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
1807
+ (plugin) => _chunkZP32GNJQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
1779
1808
  // prerendered file never answers or sends; its endpoints live under /__farm/.
1780
- plugin.name !== _chunk7FVVQEVLcjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1809
+ plugin.name !== _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1781
1810
  );
1782
1811
  }
1783
1812
  async function discoverMiddlewareRoutes(appDir) {
@@ -1788,7 +1817,7 @@ async function discoverMiddlewareRoutes(appDir) {
1788
1817
  let entries;
1789
1818
  try {
1790
1819
  entries = await fs4.readdir(dir, { withFileTypes: true });
1791
- } catch (e21) {
1820
+ } catch (e23) {
1792
1821
  return;
1793
1822
  }
1794
1823
  const middlewareFile = entries.find(
@@ -1807,8 +1836,8 @@ async function discoverMiddlewareRoutes(appDir) {
1807
1836
  }
1808
1837
  await walk(
1809
1838
  _path2.default.join(dir, entry.name),
1810
- _chunkB3GZAQSCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1811
- _chunkB3GZAQSCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1839
+ _chunkMHLNWRCJcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1840
+ _chunkMHLNWRCJcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1812
1841
  discovered
1813
1842
  );
1814
1843
  }
@@ -1820,7 +1849,7 @@ async function discoverMiddlewareRoutes(appDir) {
1820
1849
  routes.set(route.directory, route);
1821
1850
  }
1822
1851
  }
1823
- return Array.from(routes.values()).sort(_chunkB3GZAQSCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1852
+ return Array.from(routes.values()).sort(_chunkMHLNWRCJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1824
1853
  }
1825
1854
  function assertFarmDocsRuntimeSupported(config, preset) {
1826
1855
  if (!_optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled]) || !_optionalChain([config, 'access', _50 => _50.docs, 'access', _51 => _51.adapter, 'optionalAccess', _52 => _52.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
@@ -1836,13 +1865,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1836
1865
  assertFarmDocsRuntimeSupported(config, preset);
1837
1866
  const srcDir = config.srcDir || "src";
1838
1867
  const distDir = config.distDir || ".farm";
1839
- const deployOutputDir = _chunkKLNFJDFMcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1868
+ const deployOutputDir = _chunkNQJDO7K7cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1840
1869
  const lifecyclePluginManager = options.pluginManager;
1841
1870
  const productionViteResultPromise = Promise.allSettled([
1842
1871
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
1843
1872
  ]);
1844
1873
  const nitroBuilderResultPromise = preloadFarmNitroBuilder();
1845
- _chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
1874
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
1846
1875
  const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
1847
1876
  const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
1848
1877
  try {
@@ -1855,7 +1884,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1855
1884
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1856
1885
  const pageRoutes = [];
1857
1886
  for (const [pattern, entry] of routeManager.getRoutes()) {
1858
- const markdownSourcePath = entry.markdownSourcePath || (_chunkB3GM5I6Ncjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1887
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkPRFNLQSPcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1859
1888
  pageRoutes.push({
1860
1889
  pattern,
1861
1890
  ...entry.directory ? { directory: entry.directory } : {},
@@ -1879,7 +1908,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1879
1908
  fallback: entry.fallback
1880
1909
  })
1881
1910
  );
1882
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1911
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1883
1912
  const fs4 = await import("fs/promises");
1884
1913
  const layoutRoutes = [];
1885
1914
  const appDir = _path2.default.join(root, srcDir, "app");
@@ -1897,7 +1926,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1897
1926
  await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
1898
1927
  }
1899
1928
  }
1900
- } catch (e22) {
1929
+ } catch (e24) {
1901
1930
  }
1902
1931
  }
1903
1932
  await findLayoutsForClient(appDir);
@@ -1907,7 +1936,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1907
1936
  seenLayoutPatterns.add(pattern);
1908
1937
  layoutRoutes.push({ pattern, modulePath: entry.modulePath });
1909
1938
  }
1910
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
1939
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
1911
1940
  const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
1912
1941
  const islandsErrors = routeManager.getIslandsErrors(root);
1913
1942
  if (islandsErrors.length > 0) {
@@ -1925,7 +1954,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1925
1954
  throw productionViteResult.reason;
1926
1955
  }
1927
1956
  const productionVite = productionViteResult.value;
1928
- _chunkVQJYGZNXcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
1957
+ _chunkQMNWKQL4cjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
1929
1958
  const mobileClient = shouldBuildFarmMobileClient(config);
1930
1959
  const buildClientBundle = () => buildClient(
1931
1960
  productionVite,
@@ -1960,11 +1989,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1960
1989
  let clientBuildResult;
1961
1990
  let ssrBuildResult;
1962
1991
  if (config.renderer.buildConcurrency === "serial") {
1963
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
1992
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
1964
1993
  [clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
1965
1994
  [ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
1966
1995
  } else {
1967
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
1996
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
1968
1997
  [clientBuildResult, ssrBuildResult] = await Promise.allSettled([
1969
1998
  buildClientBundle(),
1970
1999
  buildSSRBundle()
@@ -1979,7 +2008,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1979
2008
  if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
1980
2009
  throw clientBuildResult.reason;
1981
2010
  }
1982
- _chunkVQJYGZNXcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
2011
+ _chunkQMNWKQL4cjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
1983
2012
  try {
1984
2013
  await buildClient(
1985
2014
  productionVite,
@@ -2007,14 +2036,14 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2007
2036
  const routeRuntimeManifest = routeRuntimeManifestResult.value;
2008
2037
  const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
2009
2038
  for (const warning of runtimeValidation.warnings) {
2010
- _chunkVQJYGZNXcjs.logger.warn(warning);
2039
+ _chunkQMNWKQL4cjs.logger.warn(warning);
2011
2040
  }
2012
2041
  const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
2013
2042
  await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
2014
2043
  if (config.docs.enabled) {
2015
2044
  await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
2016
2045
  }
2017
- _chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
2046
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
2018
2047
  await buildNitroUniversal(
2019
2048
  config,
2020
2049
  routeManager,
@@ -2035,7 +2064,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2035
2064
  _path2.default.join(root, distDir),
2036
2065
  routeRuntimeManifest
2037
2066
  );
2038
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
2067
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
2039
2068
  } catch (error) {
2040
2069
  if (lifecyclePluginManager) {
2041
2070
  await lifecyclePluginManager.runHookParallel("onError", {
@@ -2047,26 +2076,19 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2047
2076
  }
2048
2077
  });
2049
2078
  }
2050
- _chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
2079
+ _chunkQMNWKQL4cjs.logger.error(`\u274C Build failed: ${error}`);
2051
2080
  throw error;
2052
2081
  } finally {
2053
2082
  _optionalChain([rendererBuild, 'optionalAccess', _53 => _53.abort, 'call', _54 => _54()]);
2054
2083
  }
2055
2084
  }
2056
- function shouldBuildFarmMobileClient(config, options = {}) {
2057
- if (!config.mobileClient || config.desktop) return false;
2058
- const mode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents]));
2059
- if (mode === void 0) return true;
2060
- if (!options.quiet)
2061
- _chunkVQJYGZNXcjs.logger.info(
2062
- `\u{1F4F1} No mobile client for experimental.serverComponents (${mode}) yet; a mobile shell loads the web client.`
2063
- );
2064
- return false;
2085
+ function shouldBuildFarmMobileClient(config) {
2086
+ return Boolean(config.mobileClient) && !config.desktop;
2065
2087
  }
2066
2088
  function varyFarmNitroCacheRulesByShell(rules) {
2067
2089
  return Object.fromEntries(
2068
2090
  Object.entries(rules).map(([source, rule]) => {
2069
- const cached = _optionalChain([rule, 'optionalAccess', _57 => _57.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _58 => _58.cache]) !== void 0 && rule.cache !== false;
2091
+ const cached = _optionalChain([rule, 'optionalAccess', _55 => _55.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _56 => _56.cache]) !== void 0 && rule.cache !== false;
2070
2092
  if (!cached || rule.cache === false) return [source, rule];
2071
2093
  const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
2072
2094
  const varies = [...Array.isArray(cache.varies) ? cache.varies : [], "x-farm-shell"];
@@ -2104,7 +2126,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
2104
2126
  if (fontCss === void 0) {
2105
2127
  try {
2106
2128
  fontCss = await fs4.readFile(fontCssPath);
2107
- } catch (e23) {
2129
+ } catch (e25) {
2108
2130
  return;
2109
2131
  }
2110
2132
  }
@@ -2112,11 +2134,11 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
2112
2134
  let clientCss = "";
2113
2135
  try {
2114
2136
  clientCss = await fs4.readFile(clientCssPath, "utf8");
2115
- } catch (e24) {
2137
+ } catch (e26) {
2116
2138
  }
2117
2139
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
2118
2140
  await fs4.writeFile(fontCssPath, normalizedFontCss);
2119
- await fs4.writeFile(clientCssPath, _chunkTQMI6BYOcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2141
+ await fs4.writeFile(clientCssPath, _chunkUYSTTPYJcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2120
2142
  }
2121
2143
  var IncompleteClientBuildOutputError = class extends Error {
2122
2144
  constructor(detail) {
@@ -2132,7 +2154,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
2132
2154
  try {
2133
2155
  const clientEntry = await fs4.stat(clientEntryPath);
2134
2156
  if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
2135
- } catch (e25) {
2157
+ } catch (e27) {
2136
2158
  }
2137
2159
  if (clientEntrySize === 0) {
2138
2160
  throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
@@ -2143,7 +2165,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
2143
2165
  try {
2144
2166
  const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
2145
2167
  expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
2146
- } catch (e26) {
2168
+ } catch (e28) {
2147
2169
  }
2148
2170
  try {
2149
2171
  const clientCss = await fs4.stat(clientCssPath);
@@ -2162,7 +2184,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2162
2184
  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)}`;
2163
2185
  let plan = cache.get(key);
2164
2186
  if (!plan) {
2165
- plan = _chunkTQMI6BYOcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2187
+ plan = _chunkUYSTTPYJcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2166
2188
  cache.set(key, plan);
2167
2189
  }
2168
2190
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2180,31 +2202,31 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2180
2202
  });
2181
2203
  pluginManager.addPlugins(config.plugins || []);
2182
2204
  const clientPages = [];
2183
- const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2205
+ const integrationProviders = _chunkZP32GNJQcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2184
2206
  (provider) => provider.component || provider.type === "clerk"
2185
2207
  );
2186
2208
  const unsupportedIntegrationProvider = integrationProviders.find(
2187
2209
  (provider) => provider.supportsIsolatedHydration !== true
2188
2210
  );
2189
- if (_optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2190
- _chunkVQJYGZNXcjs.logger.warn(
2211
+ if (_optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2212
+ _chunkQMNWKQL4cjs.logger.warn(
2191
2213
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2192
2214
  );
2193
2215
  }
2194
- const isolatedMode = _chunkTQMI6BYOcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2195
- _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.isolatedClientHydration]),
2216
+ const isolatedMode = _chunkUYSTTPYJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2217
+ _optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.isolatedClientHydration]),
2196
2218
  {
2197
- serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverComponents])) === "rsc",
2219
+ serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "rsc",
2198
2220
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2199
2221
  }
2200
2222
  );
2201
- const planOptions = _chunkTQMI6BYOcjs.getFarmClientHydrationPlanOptions.call(void 0,
2223
+ const planOptions = _chunkUYSTTPYJcjs.getFarmClientHydrationPlanOptions.call(void 0,
2202
2224
  config.renderer,
2203
2225
  Boolean(unsupportedIntegrationProvider)
2204
2226
  );
2205
2227
  const pagePlanOptions = {
2206
2228
  ...planOptions,
2207
- serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands"
2229
+ serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverComponents])) === "islands"
2208
2230
  };
2209
2231
  const layoutPlanOptions = {
2210
2232
  ...planOptions,
@@ -2236,7 +2258,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2236
2258
  serverTreeLayout: metadata.serverTreeLayout
2237
2259
  };
2238
2260
  } catch (error) {
2239
- _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
2261
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
2240
2262
  return {
2241
2263
  ...layout,
2242
2264
  shouldHydrate: false,
@@ -2255,12 +2277,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2255
2277
  };
2256
2278
  }
2257
2279
  });
2258
- const layoutAppliesToRoute = _chunkTSFMFPRUcjs.routeBoundaryCoversDirectory;
2280
+ const layoutAppliesToRoute = _chunkO27PLNQZcjs.routeBoundaryCoversDirectory;
2259
2281
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2282
+ const islandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands";
2260
2283
  const adapterOwnsDocsRuntime = Boolean(
2261
2284
  _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _69 => _69.docs, 'optionalAccess', _70 => _70.enabled]) && _optionalChain([config, 'access', _71 => _71.docs, 'access', _72 => _72.adapter, 'optionalAccess', _73 => _73.server]) && config.docs.adapter.react
2262
2285
  );
2263
- const docsEntries = _optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) ? _chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2286
+ const docsEntries = _optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) ? _chunk5JNUYGNFcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2264
2287
  (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
2265
2288
  ) : [];
2266
2289
  const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
@@ -2269,7 +2292,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2269
2292
  );
2270
2293
  const syntheticDocsEntry = _optionalChain([config, 'access', _76 => _76.docs, 'optionalAccess', _77 => _77.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2271
2294
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2272
- const markdownPagePlan = _chunkTQMI6BYOcjs.createMarkdownPageHydrationPlanner.call(void 0,
2295
+ const markdownPagePlan = _chunkUYSTTPYJcjs.createMarkdownPageHydrationPlanner.call(void 0,
2273
2296
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2274
2297
  root,
2275
2298
  isolatedMode,
@@ -2277,7 +2300,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2277
2300
  );
2278
2301
  const routePlans = pageRoutes.map((route) => ({
2279
2302
  route,
2280
- metadata: _chunkB3GM5I6Ncjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2303
+ metadata: _chunkPRFNLQSPcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2281
2304
  route.modulePath,
2282
2305
  root,
2283
2306
  isolatedMode,
@@ -2285,7 +2308,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2285
2308
  pagePlanOptions
2286
2309
  )
2287
2310
  }));
2288
- _chunkTQMI6BYOcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2311
+ _chunkUYSTTPYJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2289
2312
  clientLayouts.map((layout) => ({
2290
2313
  pattern: layout.pattern,
2291
2314
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2294,7 +2317,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2294
2317
  [
2295
2318
  ...routePlans.map(({ route, metadata }) => ({
2296
2319
  pattern: routeDirectory(route),
2297
- depth: _chunkTSFMFPRUcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2320
+ depth: _chunkO27PLNQZcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2298
2321
  metadata
2299
2322
  })),
2300
2323
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2312,12 +2335,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2312
2335
  }
2313
2336
  }))
2314
2337
  ],
2315
- layoutAppliesToRoute
2338
+ layoutAppliesToRoute,
2339
+ { serverOwners: islandsMode }
2316
2340
  );
2317
2341
  for (const layout of clientLayouts) {
2318
2342
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
2319
2343
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2320
- _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${_chunkTQMI6BYOcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2344
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkUYSTTPYJcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2321
2345
  }
2322
2346
  }
2323
2347
  if (isolatedMode === "analyze") {
@@ -2328,7 +2352,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2328
2352
  if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
2329
2353
  continue;
2330
2354
  }
2331
- _chunkVQJYGZNXcjs.logger.info(
2355
+ _chunkQMNWKQL4cjs.logger.info(
2332
2356
  `\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
2333
2357
  );
2334
2358
  }
@@ -2340,21 +2364,19 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2340
2364
  (layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
2341
2365
  );
2342
2366
  if (metadata.suppressedAsyncHydration) {
2343
- _chunkVQJYGZNXcjs.logger.warn(
2344
- `\u26A0\uFE0F ${_chunkTQMI6BYOcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2367
+ _chunkQMNWKQL4cjs.logger.warn(
2368
+ `\u26A0\uFE0F ${_chunkUYSTTPYJcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2345
2369
  );
2346
2370
  }
2347
2371
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
2348
2372
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
2349
- const hydrationStrategies = [
2350
- ...metadata.islandStrategy ? [metadata.islandStrategy] : [],
2351
- ...applicableClientLayouts.flatMap(
2352
- (layout) => layout.islandStrategy ? [layout.islandStrategy] : []
2353
- )
2354
- ];
2355
- const islandStrategy = hydrationStrategies.every(
2356
- (strategy) => strategy === hydrationStrategies[0]
2357
- ) ? _nullishCoalesce(hydrationStrategies[0], () => ( "load")) : "load";
2373
+ const islandStrategy = _chunkUYSTTPYJcjs.resolveFarmRouteRootStrategy.call(void 0,
2374
+ route,
2375
+ metadata,
2376
+ clientLayouts,
2377
+ root,
2378
+ islandsMode
2379
+ );
2358
2380
  clientPages.push({
2359
2381
  ...route,
2360
2382
  relativePath,
@@ -2366,12 +2388,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2366
2388
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2367
2389
  ],
2368
2390
  // The server renders a server tree only below a hydrating layout.
2369
- ..._chunkTQMI6BYOcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2391
+ ..._chunkUYSTTPYJcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2370
2392
  });
2371
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2393
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2372
2394
  }
2373
2395
  } catch (error) {
2374
- _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
2396
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
2375
2397
  }
2376
2398
  }
2377
2399
  if (syntheticDocsEntry) {
@@ -2402,13 +2424,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2402
2424
  }
2403
2425
  const clientRouteSlots = routeSlots.filter((slot) => {
2404
2426
  try {
2405
- return _chunkTQMI6BYOcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2427
+ return _chunkUYSTTPYJcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2406
2428
  } catch (error) {
2407
- _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2429
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2408
2430
  return false;
2409
2431
  }
2410
2432
  });
2411
- _chunkVQJYGZNXcjs.logger.info(
2433
+ _chunkQMNWKQL4cjs.logger.info(
2412
2434
  `\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
2413
2435
  );
2414
2436
  const buildTarget = async (platform) => {
@@ -2424,22 +2446,38 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2424
2446
  srcDir,
2425
2447
  adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2426
2448
  adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2427
- _optionalChain([config, 'access', _78 => _78.docs, 'optionalAccess', _79 => _79.enabled]) ? _chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2449
+ _optionalChain([config, 'access', _78 => _78.docs, 'optionalAccess', _79 => _79.enabled]) ? _chunk5JNUYGNFcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2428
2450
  adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _80 => _80.docs, 'access', _81 => _81.adapter, 'optionalAccess', _82 => _82.react]) : void 0,
2429
2451
  config.i18n,
2430
2452
  config.plugins,
2431
2453
  config.renderer,
2432
2454
  config.publicRuntimeConfig,
2433
2455
  config.trailingSlash,
2434
- _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations),
2456
+ _chunkZP32GNJQcjs.getIntegrationProviders.call(void 0, config.integrations),
2435
2457
  config.basePath,
2436
- _chunkTQMI6BYOcjs.generateClientCachePersistenceCode.call(void 0, _chunkTQMI6BYOcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2458
+ _chunkUYSTTPYJcjs.generateClientCachePersistenceCode.call(void 0, _chunkUYSTTPYJcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2437
2459
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2438
2460
  _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _83 => _83.experimental, 'optionalAccess', _84 => _84.serverComponents])) === "islands",
2439
- platform
2461
+ platform,
2462
+ islandsMode ? _chunkUYSTTPYJcjs.collectFarmServerStylesheets.call(void 0,
2463
+ [
2464
+ ...layoutRoutes.map((layout) => layout.modulePath),
2465
+ ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
2466
+ ],
2467
+ root
2468
+ ) : []
2440
2469
  );
2441
2470
  const entryName = platform === "mobile" ? _chunkEFZGB7JCcjs.FARM_MOBILE_CLIENT_ENTRY_NAME : "farm-client";
2442
2471
  await fs4.writeFile(clientEntryPath, clientHydrationCode);
2472
+ const clientInput = { [entryName]: clientEntryPath };
2473
+ if (platform === "web" && _chunkUYSTTPYJcjs.canBootFarmIslandsClient.call(void 0, config)) {
2474
+ const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
2475
+ await fs4.writeFile(
2476
+ clientBootPath,
2477
+ 'import { startFarmIslandsBoot } from "@farm.js/core/internal/islands-boot";\nstartFarmIslandsBoot();\n'
2478
+ );
2479
+ clientInput[`${entryName}-boot`] = clientBootPath;
2480
+ }
2443
2481
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
2444
2482
  let postcssSearchPath;
2445
2483
  let tailwindVitePlugin = void 0;
@@ -2448,12 +2486,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2448
2486
  buildLifetime: rendererBuildLifetime
2449
2487
  });
2450
2488
  if (hasScopedPostcssConfig) {
2451
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2489
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2452
2490
  } else {
2453
2491
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2454
2492
  await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2455
2493
  postcssSearchPath = clientEntryDir;
2456
- tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
2494
+ tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, {
2457
2495
  builder: productionVite.builder,
2458
2496
  announce: true
2459
2497
  });
@@ -2480,9 +2518,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2480
2518
  cssCodeSplit: false,
2481
2519
  // Bundle all CSS into one file
2482
2520
  rollupOptions: {
2483
- input: {
2484
- [entryName]: clientEntryPath
2485
- },
2521
+ input: clientInput,
2486
2522
  output: {
2487
2523
  entryFileNames: "[name]-h[hash].js",
2488
2524
  chunkFileNames: "chunks/[name]-h[hash].js",
@@ -2506,7 +2542,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2506
2542
  }
2507
2543
  },
2508
2544
  plugins: [
2509
- _chunkTQMI6BYOcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2545
+ _chunkUYSTTPYJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2510
2546
  createFarmPrivateClientSourcemapsPlugin({
2511
2547
  outDir: _path2.default.join(
2512
2548
  _path2.default.dirname(outputDir),
@@ -2538,7 +2574,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2538
2574
  ...rendererVitePlugins,
2539
2575
  ...config.vite.plugins || [],
2540
2576
  farmServerOnlyEntriesPlugin({ platform }),
2541
- _chunkTQMI6BYOcjs.farmDocsClientConfigPlugin.call(void 0,
2577
+ _chunkUYSTTPYJcjs.farmDocsClientConfigPlugin.call(void 0,
2542
2578
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2543
2579
  ),
2544
2580
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2600,7 +2636,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2600
2636
  } : void 0,
2601
2637
  // Ensure React is bundled for client
2602
2638
  resolve: {
2603
- alias: _chunkTQMI6BYOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2639
+ alias: _chunkUYSTTPYJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2604
2640
  dedupe: [...config.renderer.dedupe || []]
2605
2641
  },
2606
2642
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2613,7 +2649,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2613
2649
  ]
2614
2650
  }
2615
2651
  };
2616
- await viteBuild(_chunkTQMI6BYOcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2652
+ await viteBuild(_chunkUYSTTPYJcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2617
2653
  if (platform === "mobile") {
2618
2654
  await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
2619
2655
  if (!await _chunkEFZGB7JCcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
@@ -2628,7 +2664,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2628
2664
  } finally {
2629
2665
  try {
2630
2666
  await fs4.rm(clientEntryDir, { recursive: true, force: true });
2631
- } catch (e27) {
2667
+ } catch (e29) {
2632
2668
  }
2633
2669
  }
2634
2670
  };
@@ -2712,48 +2748,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
2712
2748
  return response;
2713
2749
  }
2714
2750
 
2715
- ${streamNavigations ? `// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
2716
- // with each later flush as it ends, and null at the end; a document without a marker is all shell.
2717
- // The marker carries the random token the server sent in the F-Flush header, so page content
2718
- // cannot forge a boundary; a response without a valid token is all shell.
2719
- async function readFarmNavigationStream(body, flushToken) {
2720
- const reader = body.getReader();
2721
- const decoder = new TextDecoder();
2722
- const marker = typeof flushToken === "string" && /^[0-9a-f]{32}$/.test(flushToken)
2723
- ? "<!--farm-flush:" + flushToken + "-->"
2724
- : "";
2725
- let text = "";
2726
- let done = false;
2727
- const next = async function() {
2728
- for (;;) {
2729
- const at = marker ? text.indexOf(marker) : -1;
2730
- if (at !== -1) {
2731
- const flush = text.slice(0, at);
2732
- text = text.slice(at + marker.length);
2733
- return flush;
2734
- }
2735
- if (done) {
2736
- const flush = text;
2737
- text = "";
2738
- return flush ? flush : null;
2739
- }
2740
- const result = await reader.read();
2741
- if (result.done) {
2742
- done = true;
2743
- text += decoder.decode();
2744
- } else {
2745
- text += decoder.decode(result.value, { stream: true });
2746
- }
2747
- }
2748
- };
2749
- const shell = await next();
2750
- if (done && !text) return { shell: shell || "" };
2751
- return {
2752
- shell: shell,
2753
- next: next,
2754
- cancel: function() { reader.cancel().catch(function() {}); },
2755
- };
2756
- }` : ""}
2751
+ ${streamNavigations ? _chunkUYSTTPYJcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
2757
2752
 
2758
2753
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
2759
2754
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -3509,9 +3504,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3509
3504
  secure: false
3510
3505
  },
3511
3506
  direction: {}
3512
- }, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform) {
3507
+ }, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
3513
3508
  const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
3514
- const clientPluginEntry = _chunkTQMI6BYOcjs.generateFarmClientPluginEntryCode.call(void 0,
3509
+ const clientPluginEntry = _chunkUYSTTPYJcjs.generateFarmClientPluginEntryCode.call(void 0,
3515
3510
  plugins,
3516
3511
  root,
3517
3512
  srcDir,
@@ -3521,30 +3516,43 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3521
3516
  const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
3522
3517
  const rendererClientImports = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
3523
3518
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3524
- import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
3519
+ import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
3525
3520
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3526
- const providerClientCode = _chunkTQMI6BYOcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3521
+ const providerClientCode = _chunkUYSTTPYJcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3527
3522
  integrationProviders,
3528
3523
  root,
3529
3524
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
3530
3525
  );
3531
3526
  const globalsCssPath = _path2.default.join(root, srcDir, "app", "globals.css");
3532
- const cssImport = _fs.existsSync.call(void 0, globalsCssPath) ? `import ${JSON.stringify(toImportPath(globalsCssPath))};` : "";
3527
+ const serverStyleModules = [];
3528
+ const cssImport = [
3529
+ ..._fs.existsSync.call(void 0, globalsCssPath) ? [globalsCssPath] : [],
3530
+ ...serverStylesheets.filter((stylesheet) => stylesheet !== globalsCssPath)
3531
+ ].map((stylesheet) => {
3532
+ if (!/\.module\.[a-z]+$/.test(stylesheet)) {
3533
+ return `import ${JSON.stringify(toImportPath(stylesheet))};`;
3534
+ }
3535
+ const binding = `__farmServerStyle${serverStyleModules.length}`;
3536
+ serverStyleModules.push(binding);
3537
+ return `import * as ${binding} from ${JSON.stringify(toImportPath(stylesheet))};`;
3538
+ }).concat(
3539
+ serverStyleModules.length > 0 ? [`globalThis.__FARM_SERVER_STYLES__ = [${serverStyleModules.join(", ")}];`] : []
3540
+ ).join("\n");
3533
3541
  const layoutImportStatements = [];
3534
3542
  const layoutRegistrations = [];
3535
3543
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3536
- const treeLayoutPatterns = islandValues ? _chunkTSFMFPRUcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3544
+ const treeLayoutPatterns = islandValues ? _chunkO27PLNQZcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3537
3545
  layoutRoutes.forEach((layout, index) => {
3538
3546
  const relativePath = toImportPath(layout.modulePath);
3539
3547
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
3540
3548
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
3541
- (pattern) => _chunkTSFMFPRUcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3549
+ (pattern) => _chunkO27PLNQZcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3542
3550
  );
3543
3551
  if (rendersOnClient && !treeLayout) {
3544
3552
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3545
3553
  }
3546
- const groupScope = _chunkTSFMFPRUcjs.getRouteGroupScope.call(void 0, layout.pattern);
3547
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkTSFMFPRUcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3554
+ const groupScope = _chunkO27PLNQZcjs.getRouteGroupScope.call(void 0, layout.pattern);
3555
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkO27PLNQZcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3548
3556
  layoutRegistrations.push(
3549
3557
  ` { 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" : ""} }`
3550
3558
  );
@@ -3905,7 +3913,7 @@ document.addEventListener("click", function(e) {
3905
3913
  clientPages.forEach((page) => {
3906
3914
  for (const boundary of page.isolatedBoundaries) {
3907
3915
  isolatedBoundaryModules.set(
3908
- _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
3916
+ _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, boundary.modulePath, root),
3909
3917
  toImportPath(boundary.modulePath)
3910
3918
  );
3911
3919
  }
@@ -4067,7 +4075,7 @@ function hasHydratableLayout(pathname) {
4067
4075
  });
4068
4076
  }
4069
4077
 
4070
- ${_chunkTQMI6BYOcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4078
+ ${_chunkUYSTTPYJcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4071
4079
  // Wrap a page element with applicable layouts
4072
4080
  function wrapWithLayouts(pageElement, pathname, params) {
4073
4081
  const layouts = getApplicableLayouts(pathname);
@@ -4102,7 +4110,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
4102
4110
  return React.createElement("div", props, pageElement);
4103
4111
  }
4104
4112
  let farmLastRouteState = null;
4105
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkTQMI6BYOcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4113
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkUYSTTPYJcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4106
4114
  function farmTreeLayoutsOf(pathname) {
4107
4115
  return getApplicableLayouts(pathname).filter(function(layout) {
4108
4116
  return layout.serverTree === true;
@@ -4469,9 +4477,9 @@ async function hydrate() {
4469
4477
  !matched.route.pageShouldHydrate &&
4470
4478
  !hasHydratableLayout(pathname)
4471
4479
  ) {
4472
- const hydrationController = new AbortController();
4473
- pendingPageHydrationController = hydrationController;
4474
- await hydrateFarmIsolatedClientBoundaries(document, hydrationController.signal);
4480
+ // Not cancelled by a navigation: an island it removes is disposed with its DOM, and one in a
4481
+ // layout it keeps still waits for its trigger, with any click it already holds.
4482
+ await hydrateFarmIsolatedClientBoundaries(document);
4475
4483
  return;
4476
4484
  }` : ""}
4477
4485
 
@@ -5232,7 +5240,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5232
5240
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
5233
5241
  "module.exports = { plugins: [] };\n"
5234
5242
  );
5235
- tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
5243
+ tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, {
5236
5244
  builder: productionVite.builder,
5237
5245
  label: "for SSR"
5238
5246
  });
@@ -5306,6 +5314,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5306
5314
  modulePath: entry.modulePath
5307
5315
  })
5308
5316
  );
5317
+ const mobileShellLoadingRoutes = config.mobileShells ? Array.from(routeManager.getLoadings().values(), (entry) => ({
5318
+ pattern: entry.pattern,
5319
+ modulePath: entry.modulePath
5320
+ })) : [];
5309
5321
  const i18nCatalogs = config.i18n.enabled ? (await _chunkBBPDJGCUcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
5310
5322
  const appDirs = _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config);
5311
5323
  let openAPIReference = null;
@@ -5328,14 +5340,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5328
5340
  }
5329
5341
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
5330
5342
  const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
5331
- const notFoundPath = _chunkTQMI6BYOcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5332
- if (notFoundPath) _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
5343
+ const notFoundPath = _chunkUYSTTPYJcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5344
+ if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
5333
5345
  layoutRoutes.sort((a, b) => {
5334
5346
  const depthA = a.pattern.split("/").filter(Boolean).length;
5335
5347
  const depthB = b.pattern.split("/").filter(Boolean).length;
5336
5348
  return depthA - depthB;
5337
5349
  });
5338
- _chunkVQJYGZNXcjs.logger.info(
5350
+ _chunkQMNWKQL4cjs.logger.info(
5339
5351
  `\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
5340
5352
  );
5341
5353
  const configuredIntegrationValues = Object.values(config.integrations || {});
@@ -5345,13 +5357,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5345
5357
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
5346
5358
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
5347
5359
  );
5348
- const hasIntegrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).some(
5360
+ const hasIntegrationProviders = _chunkZP32GNJQcjs.getIntegrationProviders.call(void 0, config.integrations).some(
5349
5361
  (provider) => provider.component || provider.type === "clerk"
5350
5362
  );
5351
5363
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
5352
5364
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _91 => _91.mdx, 'optionalAccess', _92 => _92.components]));
5353
- const hasMiddlewareConfig = _chunkTSFMFPRUcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5354
- const hasRouteContextConfig = _chunkKLNFJDFMcjs.hasCustomFarmRouteContext.call(void 0, config);
5365
+ const hasMiddlewareConfig = _chunkO27PLNQZcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5366
+ const hasRouteContextConfig = _chunkNQJDO7K7cjs.hasCustomFarmRouteContext.call(void 0, config);
5355
5367
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
5356
5368
  const hasPluginRoutes = hasFarmPluginRoutes(config);
5357
5369
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -5361,9 +5373,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5361
5373
  const hasConfiguredRuntimePlugins = Boolean(
5362
5374
  hasRuntimeConfigModule && (config.plugins || []).length > 0
5363
5375
  );
5364
- if (_chunk3XQ57EFIcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5376
+ if (_chunkIFXSBJPNcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5365
5377
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
5366
- _chunk3XQ57EFIcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5378
+ _chunkIFXSBJPNcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5367
5379
  config.docs,
5368
5380
  { root, srcDir: config.srcDir },
5369
5381
  (pathname) => adapterGuardedPaths.has(pathname)
@@ -5372,7 +5384,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5372
5384
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
5373
5385
  const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
5374
5386
  farmDocsCspNonceMarker,
5375
- async () => _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) ? await _chunk3XQ57EFIcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5387
+ async () => _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) ? await _chunkIFXSBJPNcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5376
5388
  root,
5377
5389
  srcDir: config.srcDir,
5378
5390
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -5419,7 +5431,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5419
5431
  preset,
5420
5432
  i18nCatalogs,
5421
5433
  isolatedClientBoundaryModules,
5422
- hydrationPlanCache
5434
+ hydrationPlanCache,
5435
+ mobileShellLoadingRoutes
5423
5436
  );
5424
5437
  const virtualEntryId = "\0virtual:farm-ssr-entry";
5425
5438
  const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
@@ -5534,7 +5547,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5534
5547
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _103 => _103.env, 'optionalAccess', _104 => _104.public]) || {})
5535
5548
  },
5536
5549
  plugins: [
5537
- _chunkTQMI6BYOcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5550
+ _chunkUYSTTPYJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5538
5551
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
5539
5552
  ...rendererVitePlugins,
5540
5553
  ...config.vite.plugins || [],
@@ -5595,7 +5608,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5595
5608
  resolve: {
5596
5609
  alias: [
5597
5610
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
5598
- ...Object.entries(_chunkTQMI6BYOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5611
+ ...Object.entries(_chunkUYSTTPYJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5599
5612
  ([find, replacement]) => ({ find, replacement })
5600
5613
  )
5601
5614
  ],
@@ -5603,12 +5616,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5603
5616
  dedupe: [...config.renderer.dedupe || []]
5604
5617
  }
5605
5618
  };
5606
- await viteBuild(_chunkTQMI6BYOcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5619
+ await viteBuild(_chunkUYSTTPYJcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5607
5620
  } finally {
5608
5621
  if (postcssConfigDir) {
5609
5622
  try {
5610
5623
  await fs4.rm(postcssConfigDir, { recursive: true, force: true });
5611
- } catch (e28) {
5624
+ } catch (e30) {
5612
5625
  }
5613
5626
  }
5614
5627
  }
@@ -5621,7 +5634,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5621
5634
  function readFarmAppPackageIdentity(root) {
5622
5635
  try {
5623
5636
  return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
5624
- } catch (e29) {
5637
+ } catch (e31) {
5625
5638
  return {};
5626
5639
  }
5627
5640
  }
@@ -5633,7 +5646,7 @@ function readFarmPageLastModified(pageRoutes) {
5633
5646
  lastModified[route.pattern] = _fs.statSync.call(void 0,
5634
5647
  _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
5635
5648
  ).mtime.toISOString();
5636
- } catch (e30) {
5649
+ } catch (e32) {
5637
5650
  }
5638
5651
  }
5639
5652
  return lastModified;
@@ -5645,9 +5658,9 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5645
5658
  config: { middleware: config.middleware, integrations: config.integrations },
5646
5659
  middlewareRoutes
5647
5660
  };
5648
- return _chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
5649
- (docsRoot) => _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, _chunkTWHXBMLJcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
5650
- ).flatMap((page) => [page.href, _chunkTWHXBMLJcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkTSFMFPRUcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5661
+ return _chunk5JNUYGNFcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
5662
+ (docsRoot) => _chunk5JNUYGNFcjs.discoverFarmDocsPages.call(void 0, _chunk5JNUYGNFcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
5663
+ ).flatMap((page) => [page.href, _chunk5JNUYGNFcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkO27PLNQZcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5651
5664
  }
5652
5665
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5653
5666
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _107 => _107.llmsTxt]);
@@ -6019,15 +6032,17 @@ function generateFarmRendererAppSetupServerCode(config) {
6019
6032
  const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
6020
6033
  if (!appSetupPath) return "";
6021
6034
  return `
6022
- import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
6035
+ import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
6023
6036
  if (typeof ReactDOMServer.configureApp !== "function") {
6024
6037
  throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
6025
6038
  }
6026
6039
  ReactDOMServer.configureApp(__farmAppSetup);`;
6027
6040
  }
6028
- 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) {
6041
+ 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 = []) {
6029
6042
  const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _121 => _121.experimental, 'optionalAccess', _122 => _122.serverComponents])) === "islands";
6030
- const farmMobileClient = shouldBuildFarmMobileClient(config, { quiet: true });
6043
+ const farmClientBoot = _chunkUYSTTPYJcjs.canBootFarmIslandsClient.call(void 0, config);
6044
+ const farmMobileClient = shouldBuildFarmMobileClient(config);
6045
+ const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
6031
6046
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
6032
6047
  const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _123 => _123.agent, 'optionalAccess', _124 => _124.crawlers, 'optionalAccess', _125 => _125.enabled])) && !applicationMetadataRoutes.some(
6033
6048
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
@@ -6035,7 +6050,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
6035
6050
  const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _126 => _126.agent, 'optionalAccess', _127 => _127.sitemap, 'optionalAccess', _128 => _128.enabled])) && !applicationMetadataRoutes.some(
6036
6051
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
6037
6052
  );
6038
- const servesDefaultMCP = _optionalChain([config, 'access', _129 => _129.agent, 'optionalAccess', _130 => _130.mcp]) === true && !_chunk46KXZBOGcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6053
+ const servesDefaultMCP = _optionalChain([config, 'access', _129 => _129.agent, 'optionalAccess', _130 => _130.mcp]) === true && !_chunkQAS7KE7Jcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6039
6054
  const servesAiCatalog = _optionalChain([config, 'access', _131 => _131.agent, 'optionalAccess', _132 => _132.aiCatalog]) !== false;
6040
6055
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
6041
6056
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
@@ -6092,9 +6107,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6092
6107
  const hasGeneratedMetadataImages = metadataImageRoutes.some(
6093
6108
  (image) => image.sourceType === "module"
6094
6109
  );
6095
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkTSFMFPRUcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6110
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkO27PLNQZcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6096
6111
  const farmDocsFontAssets = _optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
6097
- const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations);
6112
+ const integrationProviders = _chunkZP32GNJQcjs.getIntegrationProviders.call(void 0, config.integrations);
6098
6113
  const renderedIntegrationProviders = integrationProviders.filter(
6099
6114
  (provider) => provider.component || provider.type === "clerk"
6100
6115
  );
@@ -6103,7 +6118,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6103
6118
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
6104
6119
  );
6105
6120
  }
6106
- const providerServerModules = _chunkTQMI6BYOcjs.generateFarmIntegrationProviderServerModules.call(void 0,
6121
+ const providerServerModules = _chunkUYSTTPYJcjs.generateFarmIntegrationProviderServerModules.call(void 0,
6107
6122
  renderedIntegrationProviders,
6108
6123
  config.root,
6109
6124
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -6123,14 +6138,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6123
6138
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
6124
6139
  (provider) => provider.supportsIsolatedHydration !== true
6125
6140
  );
6126
- const isolatedHydrationMode = _chunkTQMI6BYOcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
6141
+ const isolatedHydrationMode = _chunkUYSTTPYJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
6127
6142
  _optionalChain([config, 'access', _147 => _147.experimental, 'optionalAccess', _148 => _148.isolatedClientHydration]),
6128
6143
  {
6129
6144
  serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.serverComponents])) === "rsc",
6130
6145
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
6131
6146
  }
6132
6147
  );
6133
- const hydrationPlanOptions = _chunkTQMI6BYOcjs.getFarmClientHydrationPlanOptions.call(void 0,
6148
+ const hydrationPlanOptions = _chunkUYSTTPYJcjs.getFarmClientHydrationPlanOptions.call(void 0,
6134
6149
  config.renderer,
6135
6150
  Boolean(unsupportedIntegrationProvider)
6136
6151
  );
@@ -6148,7 +6163,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6148
6163
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
6149
6164
  )
6150
6165
  }));
6151
- const markdownPagePlan = _chunkTQMI6BYOcjs.createMarkdownPageHydrationPlanner.call(void 0,
6166
+ const markdownPagePlan = _chunkUYSTTPYJcjs.createMarkdownPageHydrationPlanner.call(void 0,
6152
6167
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
6153
6168
  config.root,
6154
6169
  isolatedHydrationMode,
@@ -6157,7 +6172,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6157
6172
  const pageHydrationPlans = new Map(
6158
6173
  pageRoutes.map((route) => [
6159
6174
  route.modulePath,
6160
- _chunkB3GM5I6Ncjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
6175
+ _chunkPRFNLQSPcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
6161
6176
  route.modulePath,
6162
6177
  config.root,
6163
6178
  isolatedHydrationMode,
@@ -6166,7 +6181,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6166
6181
  )
6167
6182
  ])
6168
6183
  );
6169
- _chunkTQMI6BYOcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
6184
+ _chunkUYSTTPYJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
6170
6185
  layoutHydrationPlans.map((layout) => ({
6171
6186
  pattern: layout.pattern,
6172
6187
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -6175,10 +6190,11 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6175
6190
  pageRoutes.map((route) => ({
6176
6191
  // Compared by directory so a grouped layout applies only inside its group.
6177
6192
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
6178
- depth: _chunkTSFMFPRUcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
6193
+ depth: _chunkO27PLNQZcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
6179
6194
  metadata: pageHydrationPlans.get(route.modulePath)
6180
6195
  })),
6181
- _chunkTSFMFPRUcjs.routeBoundaryCoversDirectory
6196
+ _chunkO27PLNQZcjs.routeBoundaryCoversDirectory,
6197
+ { serverOwners: pageHydrationPlanOptions.serverOwners }
6182
6198
  );
6183
6199
  const providerServerImports = [
6184
6200
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -6208,7 +6224,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6208
6224
  }).map(({ route }) => route);
6209
6225
  orderedPageRoutes.forEach((route, index) => {
6210
6226
  const varName = `pageRoute${index}`;
6211
- if (_chunkB3GM5I6Ncjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
6227
+ if (_chunkPRFNLQSPcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
6212
6228
  pageRegistrations.push(`
6213
6229
  {
6214
6230
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -6232,15 +6248,25 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6232
6248
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
6233
6249
  );
6234
6250
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
6235
- const renderingDirective = _chunkUQHIWZZ6cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
6251
+ const renderingDirective = _chunk3TL3AH25cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
6236
6252
  pageRegistrations.push(`
6237
6253
  {
6238
6254
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
6239
6255
  directory: ${JSON.stringify(route.directory)},` : ""}
6240
6256
  module: ${varName},
6241
6257
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
6242
- clientModule: ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
6243
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkTQMI6BYOcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
6258
+ clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
6259
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkUYSTTPYJcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
6260
+ const rootStrategy = _chunkUYSTTPYJcjs.resolveFarmRouteRootStrategy.call(void 0,
6261
+ route,
6262
+ clientMetadata,
6263
+ layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
6264
+ config.root,
6265
+ pageHydrationPlanOptions.serverOwners
6266
+ );
6267
+ return rootStrategy === "load" ? "" : `
6268
+ rootStrategy: ${JSON.stringify(rootStrategy)},`;
6269
+ })()}${renderingDirective ? `
6244
6270
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
6245
6271
  ${route.source !== void 0 ? `markdownSource: {
6246
6272
  source: ${JSON.stringify(route.source)},
@@ -6250,7 +6276,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6250
6276
  });
6251
6277
  const layoutImports = [];
6252
6278
  const layoutRegistrations = [];
6253
- const treeLayoutPatterns = farmIslandsMode ? _chunkTSFMFPRUcjs.getFarmServerTreeLayoutPatterns.call(void 0,
6279
+ const treeLayoutPatterns = farmIslandsMode ? _chunkO27PLNQZcjs.getFarmServerTreeLayoutPatterns.call(void 0,
6254
6280
  layoutHydrationPlans.map((layout) => ({
6255
6281
  pattern: layout.pattern,
6256
6282
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -6304,15 +6330,33 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6304
6330
  errorImports.push(
6305
6331
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
6306
6332
  );
6307
- const groupScope = _chunkTSFMFPRUcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
6333
+ const groupScope = _chunkO27PLNQZcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
6308
6334
  errorRegistrations.push(`
6309
6335
  {
6310
- pattern: ${JSON.stringify(_chunkTSFMFPRUcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
6336
+ pattern: ${JSON.stringify(_chunkO27PLNQZcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
6311
6337
  groupScope: ${JSON.stringify(groupScope)},
6312
- directoryDepth: ${_chunkTSFMFPRUcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
6338
+ directoryDepth: ${_chunkO27PLNQZcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
6313
6339
  module: ${varName},
6314
6340
  }`);
6315
6341
  });
6342
+ const loadingImports = [];
6343
+ const loadingRegistrations = [];
6344
+ if (farmMobileShells) {
6345
+ mobileShellLoadingRoutes.forEach((loadingRoute, index) => {
6346
+ const varName = `loadingRoute${index}`;
6347
+ loadingImports.push(
6348
+ `import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
6349
+ );
6350
+ const groupScope = _chunkO27PLNQZcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
6351
+ loadingRegistrations.push(`
6352
+ {
6353
+ pattern: ${JSON.stringify(_chunkO27PLNQZcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
6354
+ groupScope: ${JSON.stringify(groupScope)},
6355
+ directoryDepth: ${_chunkO27PLNQZcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
6356
+ module: ${varName},
6357
+ }`);
6358
+ });
6359
+ }
6316
6360
  const metadataImageImports = [];
6317
6361
  const metadataImageRegistrations = [];
6318
6362
  metadataImageRoutes.forEach((image, index) => {
@@ -6471,7 +6515,45 @@ function applyFarmMobileShellResponse(request, response, context) {
6471
6515
  // No mobile block: no mobile client, and documents ignore X-Farm-Shell.
6472
6516
  function applyFarmMobileShellResponse(request, response) {
6473
6517
  return response;
6474
- }`}${farmIslandsMode ? `
6518
+ }`}${farmMobileShells ? `
6519
+ import {
6520
+ _checkFarmMobileShellRoute,
6521
+ _isFarmMobileShellRenderRequest,
6522
+ } from "@farm.js/core/internal/production-runtime";
6523
+ // farm build --mobile with mobile.shells (RFC 0004, 7.2): this server renders a page shell, the
6524
+ // route's layouts around its loading file, for requests that carry this build's token. A web
6525
+ // build has no token and none of this.
6526
+ const farmMobileShellToken = ${JSON.stringify(farmMobileShells.token)};
6527
+ const loadingRoutes = [${loadingRegistrations.join(",")}
6528
+ ];
6529
+
6530
+ /**
6531
+ * A request for a page shell: the loading component it renders in place of the page, or a
6532
+ * Response saying why the route has none. Null for every other request.
6533
+ */
6534
+ function resolveFarmMobileShellRender(request, route, routePathname) {
6535
+ if (!_isFarmMobileShellRenderRequest(request, farmMobileShellToken)) return null;
6536
+ const loading = getMatchingErrorBoundary(routePathname, loadingRoutes);
6537
+ const reason = _checkFarmMobileShellRoute({
6538
+ requested: request.headers.get("x-farm-shell-route"),
6539
+ route: route.pattern,
6540
+ layouts: getApplicableLayouts(routePathname, route.directory || route.pattern).map(
6541
+ (layout) => layout.pattern,
6542
+ ),
6543
+ loading: loading && loading.route.module.default ? loading.route.pattern : null,
6544
+ });
6545
+ if (reason) {
6546
+ return farmOwnedResponse(reason, {
6547
+ status: 404,
6548
+ headers: {
6549
+ "Content-Type": "text/plain; charset=utf-8",
6550
+ "Cache-Control": "private, no-store",
6551
+ "X-Farm-Shell-Render": "none",
6552
+ },
6553
+ });
6554
+ }
6555
+ return loading.route.module.default;
6556
+ }` : ""}${farmIslandsMode ? `
6475
6557
  import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
6476
6558
  import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
6477
6559
  installFarmIslandsServer();
@@ -6523,7 +6605,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
6523
6605
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
6524
6606
  const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
6525
6607
  const mobileSession = (config.plugins || []).some(
6526
- (plugin) => _optionalChain([plugin, 'optionalAccess', _170 => _170.name]) === _chunk7FVVQEVLcjs.FARM_MOBILE_SESSION_PLUGIN
6608
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _170 => _170.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
6527
6609
  );
6528
6610
  const integrationImports = `
6529
6611
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -6533,7 +6615,7 @@ ${nativeAuth.importSource}
6533
6615
  ${nativeMCP.importSource}
6534
6616
  ${mobileSession ? `import { createFarmMobileSessionPlugin as __farmCreateMobileSessionPlugin } from "@farm.js/core/internal/production-runtime";` : ""}
6535
6617
  `;
6536
- const imageRuntime = _chunkTQMI6BYOcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6618
+ const imageRuntime = _chunkUYSTTPYJcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6537
6619
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
6538
6620
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
6539
6621
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -6633,7 +6715,8 @@ ${apiImports.join("\n")}
6633
6715
  ${pageImports.join("\n")}
6634
6716
  ${layoutImports.join("\n")}
6635
6717
  ${routeSlotImports.join("\n")}
6636
- ${errorImports.join("\n")}
6718
+ ${errorImports.join("\n")}${loadingImports.length > 0 ? `
6719
+ ${loadingImports.join("\n")}` : ""}
6637
6720
  ${metadataImageImports.join("\n")}
6638
6721
  ${applicationMetadataImports.join("\n")}
6639
6722
  ${middlewareImports.join("\n")}
@@ -6712,7 +6795,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
6712
6795
 
6713
6796
  function FarmDefault404Page() {
6714
6797
  return React.createElement(React.Fragment, null,
6715
- React.createElement("style", null, ${JSON.stringify(_chunkTQMI6BYOcjs.DEFAULT_NOT_FOUND_STYLES)}),
6798
+ React.createElement("style", null, ${JSON.stringify(_chunkUYSTTPYJcjs.DEFAULT_NOT_FOUND_STYLES)}),
6716
6799
  React.createElement("main", {
6717
6800
  className: "farm-default-not-found",
6718
6801
  "aria-labelledby": "farm-default-not-found-title",
@@ -6805,7 +6888,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
6805
6888
  );
6806
6889
  const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
6807
6890
  integrations: configuredIntegrations,
6808
- ${JSON.stringify(_chunkPFV2KPDZcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6891
+ ${JSON.stringify(_chunkZOYKJBP5cjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6809
6892
  });
6810
6893
  const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
6811
6894
  const configuredPlugins = [
@@ -7026,14 +7109,14 @@ function fetchFarmInnerRequest(request, context) {
7026
7109
  headers.delete("accept-encoding");
7027
7110
  return fetch(new Request(request, { headers }), context);
7028
7111
  }
7029
- const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
7112
+ const farmLocalAPIBasePath = ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
7030
7113
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
7031
- ${_optionalChain([config, 'access', _191 => _191.agent, 'optionalAccess', _192 => _192.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk4SEHMBL4cjs.resolveFarmApiCatalogInput.call(void 0, config))};
7114
+ ${_optionalChain([config, 'access', _191 => _191.agent, 'optionalAccess', _192 => _192.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkDPJ66FSIcjs.resolveFarmApiCatalogInput.call(void 0, config))};
7032
7115
  ` : ""}${_optionalChain([config, 'access', _193 => _193.agent, 'optionalAccess', _194 => _194.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
7033
- _chunk4SEHMBL4cjs.resolveFarmAppManifestInput.call(void 0, config, {
7116
+ _chunkDPJ66FSIcjs.resolveFarmAppManifestInput.call(void 0, config, {
7034
7117
  build: config.deploymentId,
7035
- packages: _chunkTQMI6BYOcjs.resolveFarmAppPackages.call(void 0, config.root),
7036
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkTQMI6BYOcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
7118
+ packages: _chunkUYSTTPYJcjs.resolveFarmAppPackages.call(void 0, config.root),
7119
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkUYSTTPYJcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
7037
7120
  })
7038
7121
  )};
7039
7122
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -7160,6 +7243,32 @@ function renderFarmClientEntryScript(early) {
7160
7243
  return stampFarmCspNonce('<script type="module"' + (early ? ' async' : '') + ' src="/__farm_client_js_src__"></script>');
7161
7244
  }
7162
7245
 
7246
+ // Islands mode: a whole document in which nothing hydrates at load (no island with \`load\`, and no
7247
+ // page, layout or route slot hydrating as a root) starts with the boot entry, which loads the
7248
+ // client runtime on an island's own trigger, a link or a form (RFC 0003, section 10).
7249
+ const FARM_CLIENT_BOOT = ${JSON.stringify(farmClientBoot)};
7250
+ const FARM_ISLAND_OPENING_TAG = /<f-island\\b[^>]*>/g;
7251
+ const FARM_DEFERRED_ISLAND_STRATEGY = /\\sstrategy="(?:interaction|visible|idle)"/;
7252
+
7253
+ function farmDocumentBootsClient(markup, hydratesAtLoad, routeSlots) {
7254
+ if (!FARM_CLIENT_BOOT || hydratesAtLoad || typeof markup !== "string") return false;
7255
+ if (routeSlots && routeSlots.length > 0) return false;
7256
+ // A Suspense boundary the server gave up on, which the browser renders.
7257
+ if (markup.includes("<!--$!-->") || markup.includes("<!--$?-->")) return false;
7258
+ for (const match of markup.matchAll(FARM_ISLAND_OPENING_TAG)) {
7259
+ if (!FARM_DEFERRED_ISLAND_STRATEGY.test(match[0])) return false;
7260
+ }
7261
+ return true;
7262
+ }
7263
+
7264
+ // The boot entry runs the client entry from the URL on its script. A root that waits (the element
7265
+ // a hydrating layout or client page hydrates) is named with its strategy, for the boot to watch.
7266
+ function renderFarmClientBootScript(root, rootStrategy) {
7267
+ return stampFarmCspNonce('<script type="module" src="${farmClientBoot ? FARM_CLIENT_BOOT_SRC_PLACEHOLDER : ""}" data-farm-runtime="/__farm_client_js_src__"' +
7268
+ (root ? ' data-farm-root="' + root + '" data-farm-root-strategy="' + rootStrategy + '"' : '') +
7269
+ '></script>');
7270
+ }
7271
+
7163
7272
  // Renderer options for the response being rendered: its CSP nonce, which the
7164
7273
  // renderer puts on the inline scripts it emits.
7165
7274
  function getFarmRendererRenderOptions() {
@@ -7633,7 +7742,7 @@ function peelFarmDocumentPrefix(markup) {
7633
7742
  let inner = markup.replace(/^\\s+/, "");
7634
7743
  let hoisted = "";
7635
7744
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
7636
- const hoistable = /${_chunkTSFMFPRUcjs.HOISTED_HEAD_ELEMENT.source}/i;
7745
+ const hoistable = /${_chunkO27PLNQZcjs.HOISTED_HEAD_ELEMENT.source}/i;
7637
7746
  let match;
7638
7747
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
7639
7748
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7930,12 +8039,13 @@ function withFarmDocsRequestCache(response, request, farmLocaleResolution, middl
7930
8039
 
7931
8040
  ${generateRuntimePathMatcherSource()}
7932
8041
 
7933
- function getMatchingErrorBoundary(pathname) {
8042
+ // The nearest boundary file for a page path. Page shells pass their loading files.
8043
+ function getMatchingErrorBoundary(pathname, boundaries = errorRoutes) {
7934
8044
  const pathSegments = splitRuntimePath(pathname);
7935
8045
  let bestMatch = null;
7936
8046
  let directory;
7937
8047
 
7938
- for (const errorRoute of errorRoutes) {
8048
+ for (const errorRoute of boundaries) {
7939
8049
  const patternDepth = splitRuntimePath(errorRoute.pattern).length;
7940
8050
  if (patternDepth > pathSegments.length) continue;
7941
8051
  const candidatePath = patternDepth === 0
@@ -8164,7 +8274,7 @@ function createFarmAgentRobotsResponse(request) {
8164
8274
  // a route guard.
8165
8275
  const farmAgentGuardedPages = new Set(${JSON.stringify(
8166
8276
  pageRoutes.map((route) => route.pattern).filter(
8167
- (pattern) => !pattern.includes("[") && _chunkTSFMFPRUcjs.farmPathGuardCoversPage.call(void 0,
8277
+ (pattern) => !pattern.includes("[") && _chunkO27PLNQZcjs.farmPathGuardCoversPage.call(void 0,
8168
8278
  {
8169
8279
  config: { middleware: config.middleware, integrations: config.integrations },
8170
8280
  middlewareRoutes
@@ -8211,12 +8321,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
8211
8321
  // aside for a page route that answers /mcp and for any MCP server published or
8212
8322
  // registered at runtime, such as the docs engine's.
8213
8323
  const farmDefaultMCPServer = ${JSON.stringify(
8214
- _chunk46KXZBOGcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkOAMUSC7Hcjs.FARM_VERSION)
8324
+ _chunkQAS7KE7Jcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunk2FRLSDBTcjs.FARM_VERSION)
8215
8325
  )};
8216
8326
  let farmDefaultMCPRouteFree;
8217
8327
  function getFarmDefaultMCPServer() {
8218
8328
  if (farmDefaultMCPRouteFree === undefined) {
8219
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunk46KXZBOGcjs.FARM_DEFAULT_MCP_PATH)});
8329
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH)});
8220
8330
  }
8221
8331
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
8222
8332
  }
@@ -8621,7 +8731,7 @@ ${hasInfraAnalyticsRuntime ? `
8621
8731
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
8622
8732
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
8623
8733
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
8624
- _chunk4SEHMBL4cjs.listFarmBuiltInRoutePaths.call(void 0, {
8734
+ _chunkDPJ66FSIcjs.listFarmBuiltInRoutePaths.call(void 0, {
8625
8735
  agent: {
8626
8736
  ...config.agent,
8627
8737
  aiCatalog: servesAiCatalog,
@@ -9209,6 +9319,7 @@ ${hasServerRuntimeIntegrations ? `
9209
9319
  ${config.mobileClient ? `
9210
9320
  // The mobile app's native-tier screens: the page, rendered as for a browser, read into a
9211
9321
  // tree of native views.
9322
+ const farmNativeStylesheets = JSON.parse(${JSON.stringify(FARM_NATIVE_STYLESHEETS_PLACEHOLDER)});
9212
9323
  if (
9213
9324
  (request.method === "GET" || request.method === "HEAD") &&
9214
9325
  request.headers.get("accept")?.includes(${JSON.stringify(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)})
@@ -9216,6 +9327,8 @@ ${hasServerRuntimeIntegrations ? `
9216
9327
  const treeResponse = await createFarmNativeTreeResponse({
9217
9328
  request,
9218
9329
  renderPage: (targetRequest) => fetchFarmInnerRequest(targetRequest, adapterContext),
9330
+ // The client CSS this build emitted, embedded once it settled (FARM_NATIVE_STYLESHEETS).
9331
+ loadStylesheet: (href) => farmNativeStylesheets[href],
9219
9332
  });
9220
9333
  return applyProductionMiddlewareHeaders(treeResponse, middlewareHeaders);
9221
9334
  }
@@ -9324,7 +9437,7 @@ ${hasServerRuntimeIntegrations ? `
9324
9437
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
9325
9438
  // public manifest, the same document for every request.
9326
9439
  if (
9327
- [${JSON.stringify(_chunk4SEHMBL4cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk4SEHMBL4cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
9440
+ [${JSON.stringify(_chunkDPJ66FSIcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkDPJ66FSIcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
9328
9441
  normalizeRuntimePath(routePathname),
9329
9442
  )
9330
9443
  ) {
@@ -9336,7 +9449,7 @@ ${hasServerRuntimeIntegrations ? `
9336
9449
  ` : ""}
9337
9450
  ${_optionalChain([config, 'access', _221 => _221.agent, 'optionalAccess', _222 => _222.apiCatalog]) ? `
9338
9451
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
9339
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk4SEHMBL4cjs.FARM_API_CATALOG_PATH)}) {
9452
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkDPJ66FSIcjs.FARM_API_CATALOG_PATH)}) {
9340
9453
  return applyProductionMiddlewareHeaders(
9341
9454
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
9342
9455
  middlewareHeaders,
@@ -9426,8 +9539,12 @@ ${hasServerRuntimeIntegrations ? `
9426
9539
  const actionResponse = await handleFarmFormActionRequest(request, farmFormActionsConfig);
9427
9540
  if (actionResponse) return applyProductionMiddlewareHeaders(actionResponse, middlewareHeaders);
9428
9541
  }` : ""}
9429
- if (matchedRoute) {
9430
- const trailingSlashLocation = resolveFarmTrailingSlashRedirect(
9542
+ if (matchedRoute) {${farmMobileShells ? `
9543
+ // A page shell request renders the route's loading file in place of its page, with no params,
9544
+ // data, slots, or page metadata; a route without a shell answers why.
9545
+ const farmShellLoading = resolveFarmMobileShellRender(request, matchedRoute.route, routePathname);
9546
+ if (farmShellLoading instanceof Response) return farmShellLoading;` : ""}
9547
+ const trailingSlashLocation = ${farmMobileShells ? "farmShellLoading ? null : " : ""}resolveFarmTrailingSlashRedirect(
9431
9548
  url,
9432
9549
  ${JSON.stringify(config.trailingSlash)}
9433
9550
  );
@@ -9440,7 +9557,19 @@ ${hasServerRuntimeIntegrations ? `
9440
9557
  middlewareHeaders
9441
9558
  );
9442
9559
  }
9443
- const { route, params } = matchedRoute;
9560
+ const { route, params } = ${farmMobileShells ? `farmShellLoading
9561
+ ? {
9562
+ route: {
9563
+ ...matchedRoute.route,
9564
+ module: { default: farmShellLoading, viewport: matchedRoute.route.module.viewport },
9565
+ shouldHydrate: false,
9566
+ serverTree: false,
9567
+ rendering: undefined,
9568
+ markdownSource: undefined,
9569
+ },
9570
+ params: {},
9571
+ }
9572
+ : matchedRoute` : "matchedRoute"};
9444
9573
  emitFarmEvent({ type: "route.matched", pathname, route: route.pattern, params });
9445
9574
 
9446
9575
  try {
@@ -9459,7 +9588,7 @@ ${hasServerRuntimeIntegrations ? `
9459
9588
  : countFarmKeptLayouts(request, farmSegmentLayouts, params);
9460
9589
  // The root layout always renders, so keeping one layout keeps nothing.
9461
9590
  const farmKeptLayouts = farmKeptLayoutCount > 1 ? farmKeptLayoutCount : 0;` : `const farmKeptLayouts = 0;`}
9462
- const pprConfig = resolvePPRConfig(route);
9591
+ ${farmMobileShells ? "const pprConfig = farmShellLoading ? { enabled: false } : resolvePPRConfig(route);" : "const pprConfig = resolvePPRConfig(route);"}
9463
9592
  const pprBypassReason = pprConfig.enabled
9464
9593
  ? getPPRShellBypassReason(request, middlewareData, middlewareContext)
9465
9594
  : undefined;
@@ -9530,12 +9659,13 @@ ${hasServerRuntimeIntegrations ? `
9530
9659
  layout.shouldHydrate && layout.islandStrategy ? [layout.islandStrategy] : [],
9531
9660
  ),
9532
9661
  ];
9533
- const hydrationIslandStrategy = hydrationStrategies.every(
9662
+ // A root that waits carries its resolved strategy, inferred ones included.
9663
+ const hydrationIslandStrategy = route.rootStrategy || (hydrationStrategies.every(
9534
9664
  (strategy) => strategy === hydrationStrategies[0],
9535
9665
  )
9536
9666
  ? (hydrationStrategies[0] || "load")
9537
- : "load";
9538
- const selectedRouteSlots = matchRouteSlots(
9667
+ : "load");
9668
+ const selectedRouteSlots = ${farmMobileShells ? "farmShellLoading ? [] : " : ""}matchRouteSlots(
9539
9669
  routePathname,
9540
9670
  request.headers.get("x-farm-intercept-from"),
9541
9671
  );
@@ -9856,9 +9986,12 @@ ${hasServerRuntimeIntegrations ? `
9856
9986
  {
9857
9987
  "data-farm-layout-boundary": "true",
9858
9988
  "data-farm-layout-pattern": layout.pattern,
9859
- "data-farm-layout-key": farmLayoutKeyOf
9860
- ? farmLayoutKeyOf(layout.pattern, params)
9861
- : undefined,
9989
+ // A layout chain that hydrates is drawn by React in the browser
9990
+ // (document-layout-client.ts), without a key; it renders whole anyway.
9991
+ "data-farm-layout-key":
9992
+ farmLayoutKeyOf && !shouldHydrateLayout
9993
+ ? farmLayoutKeyOf(layout.pattern, params)
9994
+ : undefined,
9862
9995
  style: { display: "contents" },
9863
9996
  },
9864
9997
  wrappedElement,
@@ -10007,6 +10140,9 @@ ${hasServerRuntimeIntegrations ? `
10007
10140
  // renderer-emitted one; explicit metadata titles still come first.
10008
10141
  const suppressDefaultTitle =
10009
10142
  !renderedMetadata.hasExplicitTitle && rendererHasTitle;
10143
+ // Set once the whole document is rendered: whether it starts with the boot entry, which
10144
+ // preloads nothing.
10145
+ let farmBootsClient = false;
10010
10146
  // A layout's own <html> document with Farm's head assets merged in and the #root the client
10011
10147
  // hydrates opening its body: the whole document, or a streamed one's opening.
10012
10148
  const composeFarmFullDocument = function(markup) {
@@ -10016,7 +10152,7 @@ ${hasServerRuntimeIntegrations ? `
10016
10152
  );
10017
10153
  composed = composed
10018
10154
  // Inject CSS link after opening head tag or first meta tag
10019
- .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + renderFarmClientModulePreloads(composed, route.clientModule); })
10155
+ .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule)); })
10020
10156
  .replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
10021
10157
  // Explicit metadata wins over renderer and layout titles. Without
10022
10158
  // explicit metadata, a renderer title wins over the layout title.
@@ -10192,7 +10328,20 @@ ${hasServerRuntimeIntegrations ? `
10192
10328
  throw renderedPage.streamErrors[0];
10193
10329
  }
10194
10330
  }
10195
-
10331
+ // A route that hydrates as one root starts with the boot entry only when that root waits.
10332
+ const farmHydratesRoot = route.shouldHydrate || shouldHydrateLayout;
10333
+ farmBootsClient = farmDocumentBootsClient(
10334
+ html,
10335
+ (farmHydratesRoot && !route.rootStrategy) || Boolean(pprCacheKey),
10336
+ routeSlotPayload
10337
+ );
10338
+ const farmEntryScript = farmBootsClient
10339
+ ? renderFarmClientBootScript(
10340
+ farmHydratesRoot ? (shouldHydrateLayout ? "root" : "__farm_page__") : "",
10341
+ route.rootStrategy
10342
+ )
10343
+ : renderFarmClientEntryScript();
10344
+
10196
10345
  let fullHtml;
10197
10346
  if (hasFullDocument) {
10198
10347
  // Layout provides full HTML structure - inject CSS and client script
@@ -10208,7 +10357,7 @@ ${hasServerRuntimeIntegrations ? `
10208
10357
  routeSlotPayload,
10209
10358
  clientPageProps
10210
10359
  ) + '\\n' +
10211
- ' ' + renderFarmClientEntryScript() + '\\n</body>',
10360
+ ' ' + farmEntryScript + '\\n</body>',
10212
10361
  );
10213
10362
  } else {
10214
10363
  // No layout with full document - wrap in HTML structure
@@ -10219,13 +10368,13 @@ ${hasServerRuntimeIntegrations ? `
10219
10368
  \${viewportTags}
10220
10369
  \${hasFavicon ? "" : '<link rel="icon" href="data:,">'}
10221
10370
  \${suppressDefaultTitle ? "" : "<title>" + title + "</title>"}\${metaTags}\${rendererHead ? "\\n " + rendererHead : ""}
10222
- <link rel="stylesheet" href="/__farm_client_css_href__">\${renderFarmClientModulePreloads(html, route.clientModule)}
10371
+ <link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule)}
10223
10372
  \${renderFarmRendererHydrationScript()}
10224
10373
  </head>
10225
10374
  <body>
10226
10375
  <div id="root">\${html}</div>
10227
10376
  \${renderFarmClientBootstrapScript(pageProps.__farmCanonicalPath, routeSlotPayload, clientPageProps)}
10228
- \${renderFarmClientEntryScript()}
10377
+ \${farmEntryScript}
10229
10378
  </body>
10230
10379
  </html>\`;
10231
10380
  }
@@ -10436,7 +10585,7 @@ ${hasServerRuntimeIntegrations ? `
10436
10585
  ${servesDefaultMCP ? `
10437
10586
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
10438
10587
  if (
10439
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk46KXZBOGcjs.FARM_DEFAULT_MCP_PATH)} &&
10588
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH)} &&
10440
10589
  getFarmDefaultMCPServer()
10441
10590
  ) {
10442
10591
  return applyProductionMiddlewareHeaders(
@@ -10848,9 +10997,9 @@ function getPhysicalPrerenderBypassReason(options) {
10848
10997
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
10849
10998
  return "rewrite";
10850
10999
  }
10851
- if (_chunkTSFMFPRUcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
10852
- if (_chunkTSFMFPRUcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
10853
- if (_chunkKLNFJDFMcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
11000
+ if (_chunkO27PLNQZcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
11001
+ if (_chunkO27PLNQZcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
11002
+ if (_chunkNQJDO7K7cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
10854
11003
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
10855
11004
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
10856
11005
  if (_optionalChain([manifestEntry, 'optionalAccess', _239 => _239.rendering]) === "dynamic") return "dynamic runtime manifest";
@@ -10868,21 +11017,21 @@ function getPhysicalPrerenderBypassReason(options) {
10868
11017
  }
10869
11018
  async function getFarmDocsPrerenderPages(config, root, preset) {
10870
11019
  if (!_optionalChain([config, 'access', _242 => _242.docs, 'optionalAccess', _243 => _243.enabled]) || !config.docs.prerender) return [];
10871
- if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !_chunk3XQ57EFIcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
10872
- _chunkVQJYGZNXcjs.logger.warn(
11020
+ if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !_chunkIFXSBJPNcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
11021
+ _chunkQMNWKQL4cjs.logger.warn(
10873
11022
  "docs.prerender needs a docs adapter such as @farming-labs/farmjs; Farm's built-in docs renderer keeps rendering docs pages on request."
10874
11023
  );
10875
11024
  return [];
10876
11025
  }
10877
11026
  if (_chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
10878
- _chunkVQJYGZNXcjs.logger.info(
11027
+ _chunkQMNWKQL4cjs.logger.info(
10879
11028
  `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
10880
11029
  );
10881
11030
  return [];
10882
11031
  }
10883
- const pages = await _chunk3XQ57EFIcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
11032
+ const pages = await _chunkIFXSBJPNcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
10884
11033
  if (!pages) {
10885
- _chunkVQJYGZNXcjs.logger.warn(
11034
+ _chunkQMNWKQL4cjs.logger.warn(
10886
11035
  `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.`
10887
11036
  );
10888
11037
  return [];
@@ -10906,10 +11055,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10906
11055
  const nitroBuilder = nitroBuilderResult.value;
10907
11056
  const isVercel = preset === "vercel" || preset === "vercel-edge";
10908
11057
  const isCloudflareWorker = preset === "cloudflare-module";
10909
- const outputDir = _chunkKLNFJDFMcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11058
+ const outputDir = _chunkNQJDO7K7cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10910
11059
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
10911
11060
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
10912
- const imageRuntime = _chunkTQMI6BYOcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
11061
+ const imageRuntime = _chunkUYSTTPYJcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
10913
11062
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
10914
11063
  (image) => image.sourceType === "module"
10915
11064
  );
@@ -10924,15 +11073,15 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10924
11073
  ...useExternalMetadataImageRuntime ? ["@vercel/og"] : []
10925
11074
  ]);
10926
11075
  const isPrebuiltSSRCandidate = preset === "node-server" && [...ssrExternalPackages].every((packageName) => copiedRuntimePackages.has(packageName));
10927
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
10928
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
10929
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
11076
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
11077
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
11078
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
10930
11079
  const ssgCollectionPromise = routeManager.collectSSGPages();
10931
11080
  const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
10932
11081
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
10933
11082
  const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
10934
- const farmWorkflows = await _chunkXB24LZWIcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
10935
- const farmCron = await _chunkXYL4HSVCcjs.prepareFarmCronForNitro.call(void 0, config);
11083
+ const farmWorkflows = await _chunkQRX4JRBOcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
11084
+ const farmCron = await _chunkYI6FKTTNcjs.prepareFarmCronForNitro.call(void 0, config);
10936
11085
  const [
10937
11086
  { ssg: ssgPages },
10938
11087
  middlewareRoutes,
@@ -10995,30 +11144,32 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10995
11144
  prerenderRoutes.push(pathname);
10996
11145
  }
10997
11146
  for (const skipped of skippedPrerenderRoutes) {
10998
- _chunkVQJYGZNXcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
11147
+ _chunkQMNWKQL4cjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
10999
11148
  }
11000
11149
  if (farmWorkflows.workflows.length > 0) {
11001
- _chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
11150
+ _chunkQMNWKQL4cjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
11002
11151
  }
11003
11152
  if (farmCron.jobs.length > 0) {
11004
- _chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
11153
+ _chunkQMNWKQL4cjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
11005
11154
  }
11006
11155
  if (preset === "cloudflare-pages" && farmCron.jobs.length > 0) {
11007
- _chunkVQJYGZNXcjs.logger.warn(
11156
+ _chunkQMNWKQL4cjs.logger.warn(
11008
11157
  "Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
11009
11158
  );
11010
11159
  }
11011
- const scheduledTasks = _chunkXYL4HSVCcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
11012
- const cloudflareCronConfig = _chunkXYL4HSVCcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
11013
- const [clientCssHref, clientJsSrc, docsModulePreloads, clientModulePreloads] = await Promise.all([
11160
+ const scheduledTasks = _chunkYI6FKTTNcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
11161
+ const cloudflareCronConfig = _chunkYI6FKTTNcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
11162
+ const [clientCssHref, clientJsSrc, clientBootSrc, docsModulePreloads, clientModulePreloads] = await Promise.all([
11014
11163
  resolveHashedClientCssHref(clientOutputDir),
11015
11164
  resolveHashedClientJsSrc(clientOutputDir),
11165
+ resolveClientBootSrc(clientOutputDir),
11016
11166
  readFarmDocsModulePreloads(_path2.default.join(root, distDir)),
11017
11167
  readFarmClientModulePreloads(_path2.default.join(root, distDir))
11018
11168
  ]);
11169
+ let nativeStylesheets;
11019
11170
  const encodedDocsModulePreloads = encodeFarmDocsModulePreloads(docsModulePreloads);
11020
11171
  const encodedClientModulePreloads = encodeFarmClientModulePreloads(clientModulePreloads);
11021
- const encodedMobileShellClient = shouldBuildFarmMobileClient(config, { quiet: true }) ? _chunkEFZGB7JCcjs.encodeFarmMobileShellClient.call(void 0,
11172
+ const encodedMobileShellClient = shouldBuildFarmMobileClient(config) ? _chunkEFZGB7JCcjs.encodeFarmMobileShellClient.call(void 0,
11022
11173
  await _chunkEFZGB7JCcjs.finalizeFarmMobileClient.call(void 0, {
11023
11174
  buildDir: _path2.default.join(root, distDir),
11024
11175
  clientOutputDir,
@@ -11044,6 +11195,16 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
11044
11195
  if (output.code.includes(FARM_CLIENT_JS_SRC_PLACEHOLDER)) {
11045
11196
  output.code = output.code.split(FARM_CLIENT_JS_SRC_PLACEHOLDER).join(clientJsSrc);
11046
11197
  }
11198
+ if (output.code.includes(FARM_CLIENT_BOOT_SRC_PLACEHOLDER)) {
11199
+ if (!clientBootSrc) {
11200
+ throw new IncompleteClientBuildOutputError("farm-client-boot is missing");
11201
+ }
11202
+ output.code = output.code.split(FARM_CLIENT_BOOT_SRC_PLACEHOLDER).join(clientBootSrc);
11203
+ }
11204
+ if (config.mobileClient && output.code.includes(JSON.stringify(FARM_NATIVE_STYLESHEETS_PLACEHOLDER))) {
11205
+ await _asyncNullishCoalesce(nativeStylesheets, async () => ( (nativeStylesheets = await readFarmNativeStylesheets(clientOutputDir, clientCssHref))));
11206
+ output.code = output.code.split(JSON.stringify(FARM_NATIVE_STYLESHEETS_PLACEHOLDER)).join(JSON.stringify(JSON.stringify(nativeStylesheets)));
11207
+ }
11047
11208
  }
11048
11209
  await fs4.mkdir(ssrOutputDir, { recursive: true });
11049
11210
  await Promise.all(
@@ -11309,7 +11470,7 @@ function toFarmNodeResponse(request, response) {
11309
11470
  ssrOutputDir,
11310
11471
  ssrEntryFile
11311
11472
  );
11312
- const configuredNitroRouteRules = shouldBuildFarmMobileClient(config, { quiet: true }) ? varyFarmNitroCacheRulesByShell(_chunkV56632LAcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules)) : _chunkV56632LAcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules);
11473
+ const configuredNitroRouteRules = shouldBuildFarmMobileClient(config) ? varyFarmNitroCacheRulesByShell(_chunkV56632LAcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules)) : _chunkV56632LAcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules);
11313
11474
  const prerenderNitroRouteRules = Object.fromEntries(
11314
11475
  prerenderRoutes.map((route) => {
11315
11476
  const configuredRule = configuredNitroRouteRules[route] || {};
@@ -11396,7 +11557,7 @@ function toFarmNodeResponse(request, response) {
11396
11557
  ] : [],
11397
11558
  {
11398
11559
  route: "/**",
11399
- handler: _chunkVQJYGZNXcjs.toPosixPath.call(void 0, nitroEntryPath)
11560
+ handler: _chunkQMNWKQL4cjs.toPosixPath.call(void 0, nitroEntryPath)
11400
11561
  }
11401
11562
  ],
11402
11563
  routeRules: {
@@ -11471,7 +11632,7 @@ function toFarmNodeResponse(request, response) {
11471
11632
  Array.from(routes, (route, index) => {
11472
11633
  try {
11473
11634
  return [decodeURI(route), index];
11474
- } catch (e31) {
11635
+ } catch (e33) {
11475
11636
  return [route, index];
11476
11637
  }
11477
11638
  })
@@ -11484,7 +11645,7 @@ function toFarmNodeResponse(request, response) {
11484
11645
  if (_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled])) {
11485
11646
  nitroInstance.hooks.hook("prerender:generate", (route) => {
11486
11647
  if (!route.contents || !_optionalChain([route, 'access', _267 => _267.contentType, 'optionalAccess', _268 => _268.toLowerCase, 'call', _269 => _269(), 'access', _270 => _270.includes, 'call', _271 => _271("html")])) return;
11487
- const alternatePath = _chunkD7UQC4O6cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
11648
+ const alternatePath = _chunkLT4VAF5Zcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
11488
11649
  if (!alternatePath) return;
11489
11650
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
11490
11651
  const alternate = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
@@ -11578,14 +11739,14 @@ function toFarmNodeResponse(request, response) {
11578
11739
  });
11579
11740
  }
11580
11741
  if (prerenderRoutes.length > 0) {
11581
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
11582
- const previousPrerender = process.env[_chunk7MD37P5Vcjs.FARM_PRERENDER_ENV];
11583
- process.env[_chunk7MD37P5Vcjs.FARM_PRERENDER_ENV] = "1";
11742
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
11743
+ const previousPrerender = process.env[_chunk4P23B7DUcjs.FARM_PRERENDER_ENV];
11744
+ process.env[_chunk4P23B7DUcjs.FARM_PRERENDER_ENV] = "1";
11584
11745
  try {
11585
11746
  await nitroBuilder.prerender(nitroInstance);
11586
11747
  } finally {
11587
- if (previousPrerender === void 0) delete process.env[_chunk7MD37P5Vcjs.FARM_PRERENDER_ENV];
11588
- else process.env[_chunk7MD37P5Vcjs.FARM_PRERENDER_ENV] = previousPrerender;
11748
+ if (previousPrerender === void 0) delete process.env[_chunk4P23B7DUcjs.FARM_PRERENDER_ENV];
11749
+ else process.env[_chunk4P23B7DUcjs.FARM_PRERENDER_ENV] = previousPrerender;
11589
11750
  }
11590
11751
  }
11591
11752
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -11637,10 +11798,10 @@ function toFarmNodeResponse(request, response) {
11637
11798
  if (failedCopy) throw failedCopy.reason;
11638
11799
  if (canReusePrebuiltSSR) {
11639
11800
  await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
11640
- _chunkVQJYGZNXcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
11801
+ _chunkQMNWKQL4cjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
11641
11802
  }
11642
11803
  if (useRolldownBuilder) {
11643
- _chunkVQJYGZNXcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
11804
+ _chunkQMNWKQL4cjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
11644
11805
  }
11645
11806
  if (pluginManager) {
11646
11807
  await pluginManager.runHookParallel("afterNitroBuild", {
@@ -11653,7 +11814,7 @@ function toFarmNodeResponse(request, response) {
11653
11814
  if (isVercel) {
11654
11815
  await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
11655
11816
  }
11656
- _chunkVQJYGZNXcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
11817
+ _chunkQMNWKQL4cjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
11657
11818
  }
11658
11819
  function resolveFarmNitroOutputConfig(preset, outputDir) {
11659
11820
  const isVercel = preset === "vercel" || preset === "vercel-edge";
@@ -11753,20 +11914,20 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
11753
11914
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
11754
11915
  runtimeRoutes
11755
11916
  });
11756
- const vercelConfigWithWorkflowCrons = _chunkXB24LZWIcjs.applyFarmWorkflowVercelCrons.call(void 0,
11917
+ const vercelConfigWithWorkflowCrons = _chunkQRX4JRBOcjs.applyFarmWorkflowVercelCrons.call(void 0,
11757
11918
  vercelConfig,
11758
11919
  farmWorkflows.workflows
11759
11920
  );
11760
- const vercelConfigWithCrons = _chunkXYL4HSVCcjs.applyFarmCronVercelCrons.call(void 0,
11921
+ const vercelConfigWithCrons = _chunkYI6FKTTNcjs.applyFarmCronVercelCrons.call(void 0,
11761
11922
  vercelConfigWithWorkflowCrons,
11762
11923
  config.cron.jobs
11763
11924
  );
11764
11925
  await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
11765
- _chunkVQJYGZNXcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
11926
+ _chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
11766
11927
  }
11767
11928
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11768
11929
  if (!_optionalChain([config, 'access', _279 => _279.docs, 'optionalAccess', _280 => _280.enabled])) return;
11769
- const [mainRoot, ...extraRoots] = _chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, config.docs);
11930
+ const [mainRoot, ...extraRoots] = _chunk5JNUYGNFcjs.getFarmDocsRoots.call(void 0, config.docs);
11770
11931
  await copyFarmDocsRootContent(
11771
11932
  mainRoot,
11772
11933
  root,
@@ -11787,7 +11948,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11787
11948
  async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs4) {
11788
11949
  const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
11789
11950
  if (!docsContentDir) return;
11790
- const lastModifiedManifest = _chunkTWHXBMLJcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11951
+ const lastModifiedManifest = _chunk5JNUYGNFcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11791
11952
  fallback: "now"
11792
11953
  });
11793
11954
  await fs4.rm(bundledContentDir, { recursive: true, force: true });
@@ -11797,11 +11958,11 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
11797
11958
  force: true
11798
11959
  });
11799
11960
  await fs4.writeFile(
11800
- _path2.default.join(bundledContentDir, _chunkTWHXBMLJcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11961
+ _path2.default.join(bundledContentDir, _chunk5JNUYGNFcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11801
11962
  `${JSON.stringify(lastModifiedManifest, null, 2)}
11802
11963
  `
11803
11964
  );
11804
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
11965
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
11805
11966
  }
11806
11967
  function resolveServerFunctionPlatform(preset) {
11807
11968
  return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
@@ -11823,7 +11984,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
11823
11984
  if (!resolvePackageJson(projectRequire, "sharp")) {
11824
11985
  try {
11825
11986
  sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
11826
- } catch (e32) {
11987
+ } catch (e34) {
11827
11988
  }
11828
11989
  }
11829
11990
  const copiedPackages = /* @__PURE__ */ new Map();
@@ -11868,7 +12029,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
11868
12029
  try {
11869
12030
  await copyPackage("sharp", sharpRequire);
11870
12031
  if (!copiedPackages.has("sharp")) {
11871
- throw new Error(`Farm image optimization requires sharp. ${_chunkTQMI6BYOcjs.SHARP_INSTALL_HINT}`);
12032
+ throw new Error(`Farm image optimization requires sharp. ${_chunkUYSTTPYJcjs.SHARP_INSTALL_HINT}`);
11872
12033
  }
11873
12034
  } catch (error) {
11874
12035
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -11895,7 +12056,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
11895
12056
  } finally {
11896
12057
  await fs4.rm(staged.stageDir, { recursive: true, force: true });
11897
12058
  }
11898
- _chunkVQJYGZNXcjs.logger.info(
12059
+ _chunkQMNWKQL4cjs.logger.info(
11899
12060
  `\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
11900
12061
  );
11901
12062
  }
@@ -11939,7 +12100,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
11939
12100
  function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
11940
12101
  const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
11941
12102
  if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
11942
- const file = generated.modulePath ? _chunkVQJYGZNXcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
12103
+ const file = generated.modulePath ? _chunkQMNWKQL4cjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
11943
12104
  throw new Error(
11944
12105
  `${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
11945
12106
  );
@@ -11950,7 +12111,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
11950
12111
  if (packageJsonPath) return packageJsonPath;
11951
12112
  try {
11952
12113
  return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
11953
- } catch (e33) {
12114
+ } catch (e35) {
11954
12115
  return null;
11955
12116
  }
11956
12117
  }
@@ -11973,7 +12134,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
11973
12134
  "@vercel/og": String(packageJson.version || "0.11.1")
11974
12135
  };
11975
12136
  await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
11976
- _chunkVQJYGZNXcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
12137
+ _chunkQMNWKQL4cjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
11977
12138
  }
11978
12139
  async function readNitroOutputPackage(outputDir, fs4) {
11979
12140
  const packagePath = _path2.default.join(outputDir, "package.json");
@@ -11997,7 +12158,7 @@ function resolvePackageJson(parentRequire, packageName) {
11997
12158
  const resolved = parentRequire.resolve(request);
11998
12159
  if (resolved.endsWith(".json")) return resolved;
11999
12160
  _nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
12000
- } catch (e34) {
12161
+ } catch (e36) {
12001
12162
  }
12002
12163
  }
12003
12164
  try {
@@ -12008,13 +12169,13 @@ function resolvePackageJson(parentRequire, packageName) {
12008
12169
  try {
12009
12170
  const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
12010
12171
  if (manifest.name === packageName) return candidate;
12011
- } catch (e35) {
12172
+ } catch (e37) {
12012
12173
  }
12013
12174
  }
12014
12175
  if (_path2.default.basename(directory) === "node_modules") break;
12015
12176
  directory = _path2.default.dirname(directory);
12016
12177
  }
12017
- } catch (e36) {
12178
+ } catch (e38) {
12018
12179
  }
12019
12180
  return null;
12020
12181
  }
@@ -12023,13 +12184,13 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
12023
12184
  let prismaClientDir;
12024
12185
  try {
12025
12186
  prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
12026
- } catch (e37) {
12187
+ } catch (e39) {
12027
12188
  return;
12028
12189
  }
12029
12190
  const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
12030
12191
  try {
12031
12192
  await fs4.access(generatedClientDir);
12032
- } catch (e38) {
12193
+ } catch (e40) {
12033
12194
  return;
12034
12195
  }
12035
12196
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
@@ -12089,7 +12250,7 @@ async function createFarmProjectModuleSsrEnvironment() {
12089
12250
  // src/build/index.ts
12090
12251
  async function build(config, options = {}) {
12091
12252
  return _chunkVZY7MAVScjs.withProductionNodeEnv.call(void 0,
12092
- () => _chunkTQMI6BYOcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
12253
+ () => _chunkUYSTTPYJcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
12093
12254
  );
12094
12255
  }
12095
12256
  function createBuildTargetBaseline(config) {
@@ -12100,7 +12261,7 @@ function createBuildTargetBaseline(config) {
12100
12261
  preset,
12101
12262
  distDir,
12102
12263
  outputDir,
12103
- outputWasDerived: outputDir === _chunkKLNFJDFMcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
12264
+ outputWasDerived: outputDir === _chunkNQJDO7K7cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
12104
12265
  };
12105
12266
  }
12106
12267
  function resolveBuildTargets(config, options, baseline) {
@@ -12109,8 +12270,8 @@ function resolveBuildTargets(config, options, baseline) {
12109
12270
  const distDir = config.distDir || ".farm";
12110
12271
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
12111
12272
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
12112
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkKLNFJDFMcjs.getDeployTargetForPreset.call(void 0, preset);
12113
- const outputDir = shouldRefreshDerivedOutput ? _chunkKLNFJDFMcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
12273
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkNQJDO7K7cjs.getDeployTargetForPreset.call(void 0, preset);
12274
+ const outputDir = shouldRefreshDerivedOutput ? _chunkNQJDO7K7cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
12114
12275
  return {
12115
12276
  root,
12116
12277
  preset,
@@ -12118,7 +12279,7 @@ function resolveBuildTargets(config, options, baseline) {
12118
12279
  distDir,
12119
12280
  deployTarget,
12120
12281
  outputDir,
12121
- deployOutputDir: _chunkKLNFJDFMcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
12282
+ deployOutputDir: _chunkNQJDO7K7cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
12122
12283
  };
12123
12284
  }
12124
12285
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -12155,7 +12316,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12155
12316
  };
12156
12317
  config = {
12157
12318
  ...config,
12158
- images: _chunkTQMI6BYOcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
12319
+ images: _chunkUYSTTPYJcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
12159
12320
  root: targets.root,
12160
12321
  preset: targets.preset
12161
12322
  })
@@ -12163,10 +12324,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12163
12324
  if (_optionalChain([config, 'access', _281 => _281.docs, 'optionalAccess', _282 => _282.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
12164
12325
  pluginManager.updateContext({ config });
12165
12326
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
12166
- _chunkTQMI6BYOcjs.usePackageClientBoundaryCacheFile.call(void 0,
12327
+ _chunkUYSTTPYJcjs.usePackageClientBoundaryCacheFile.call(void 0,
12167
12328
  _path2.default.resolve(root, distDir, "cache", "client-boundaries.json")
12168
12329
  );
12169
- _chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
12330
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
12170
12331
  await pluginManager.setupPlugins();
12171
12332
  await pluginManager.runHookParallel("beforeBundle", {
12172
12333
  root,
@@ -12175,7 +12336,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12175
12336
  distDir,
12176
12337
  outputDir: deployOutputDir
12177
12338
  });
12178
- _chunkVQJYGZNXcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
12339
+ _chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
12179
12340
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
12180
12341
  if (_optionalChain([productionViteResult, 'optionalAccess', _283 => _283.status]) === "rejected") throw productionViteResult.reason;
12181
12342
  const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _284 => _284.value]);
@@ -12186,27 +12347,27 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12186
12347
  root,
12187
12348
  rendererBuild.signal
12188
12349
  );
12189
- const farmApp = _chunkTQMI6BYOcjs.createFarmApp.call(void 0, config, projectModuleServer);
12350
+ const farmApp = _chunkUYSTTPYJcjs.createFarmApp.call(void 0, config, projectModuleServer);
12190
12351
  await farmApp.initialize();
12191
12352
  const routeManager = farmApp.getRouteManager();
12192
12353
  const serverRenderer = farmApp.getServerRenderer();
12193
- const typeArtifacts = _chunkUQHIWZZ6cjs.generateFarmTypeArtifacts.call(void 0, {
12354
+ const typeArtifacts = _chunk3TL3AH25cjs.generateFarmTypeArtifacts.call(void 0, {
12194
12355
  root,
12195
12356
  srcDir,
12196
12357
  layers: config.layers,
12197
12358
  plugins: config.plugins,
12198
12359
  extraRoutes: [
12199
12360
  ..._optionalChain([config, 'access', _285 => _285.openapi, 'optionalAccess', _286 => _286.enabled]) && config.openapi.route ? [config.openapi.route] : [],
12200
- ..._chunkTWHXBMLJcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
12361
+ ..._chunk5JNUYGNFcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
12201
12362
  ],
12202
12363
  suppressLintOnLink: config.suppressLintOnLink,
12203
12364
  componentExtensions: config.renderer.componentExtensions,
12204
12365
  i18nConfig: config.i18n
12205
12366
  }).catch((error) => {
12206
12367
  const message = error instanceof Error ? error.message : String(error);
12207
- _chunkVQJYGZNXcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
12368
+ _chunkQMNWKQL4cjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
12208
12369
  });
12209
- const apiRouteManager = new (0, _chunkKHXAJ2KAcjs.APIRouteManager)(
12370
+ const apiRouteManager = new (0, _chunkW2RZ73IUcjs.APIRouteManager)(
12210
12371
  _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config),
12211
12372
  projectModuleServer,
12212
12373
  {
@@ -12214,7 +12375,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12214
12375
  plugins: config.plugins,
12215
12376
  i18n: farmApp.getI18nRuntime(),
12216
12377
  bodySizeLimit: config.server.bodySizeLimit,
12217
- basePath: _chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
12378
+ basePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
12218
12379
  }
12219
12380
  );
12220
12381
  const [, apiDiscovery] = await Promise.allSettled([
@@ -12232,11 +12393,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12232
12393
  });
12233
12394
  } else {
12234
12395
  const { build: legacyViteBuild } = await import("vite");
12235
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client bundle...");
12396
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Building client bundle...");
12236
12397
  await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
12237
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building SSR bundle...");
12398
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Building SSR bundle...");
12238
12399
  await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
12239
- _chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
12400
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
12240
12401
  await buildNitro(
12241
12402
  config,
12242
12403
  routeManager,
@@ -12257,8 +12418,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12257
12418
  outputDir: deployOutputDir,
12258
12419
  success: true
12259
12420
  });
12260
- _chunkVQJYGZNXcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
12261
- _chunkVQJYGZNXcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
12421
+ _chunkQMNWKQL4cjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
12422
+ _chunkQMNWKQL4cjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
12262
12423
  } catch (error) {
12263
12424
  const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
12264
12425
  await pluginManager.runHookParallel("onError", {
@@ -12277,7 +12438,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
12277
12438
  outputDir: deployOutputDir,
12278
12439
  success: false
12279
12440
  });
12280
- _chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
12441
+ _chunkQMNWKQL4cjs.logger.error(`\u274C Build failed: ${error}`);
12281
12442
  throw error;
12282
12443
  } finally {
12283
12444
  try {
@@ -12292,7 +12453,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
12292
12453
  ssr: true,
12293
12454
  buildLifetime
12294
12455
  });
12295
- const viteConfig = _chunkTQMI6BYOcjs.mergeFarmViteConfig.call(void 0,
12456
+ const viteConfig = _chunkUYSTTPYJcjs.mergeFarmViteConfig.call(void 0,
12296
12457
  {
12297
12458
  root,
12298
12459
  appType: "custom",
@@ -12304,7 +12465,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
12304
12465
  },
12305
12466
  plugins: [
12306
12467
  ...rendererVitePlugins,
12307
- _chunkTQMI6BYOcjs.farmFontImportsPlugin.call(void 0, {
12468
+ _chunkUYSTTPYJcjs.farmFontImportsPlugin.call(void 0, {
12308
12469
  root,
12309
12470
  basePath: config.basePath,
12310
12471
  publicDir: config.publicDir
@@ -12316,7 +12477,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
12316
12477
  hmr: false
12317
12478
  },
12318
12479
  resolve: {
12319
- alias: _chunkTQMI6BYOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
12480
+ alias: _chunkUYSTTPYJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
12320
12481
  dedupe: [...config.renderer.dedupe || []]
12321
12482
  },
12322
12483
  optimizeDeps: {
@@ -12428,7 +12589,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
12428
12589
  }
12429
12590
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
12430
12591
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
12431
- import("./nitro-CK7M4RMY.cjs"),
12592
+ import("./nitro-HXAZZQKY.cjs"),
12432
12593
  import("nitro/builder")
12433
12594
  ]);
12434
12595
  let nitroConfig = await createNitroConfig(
@@ -12441,7 +12602,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12441
12602
  if (pluginManager) {
12442
12603
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
12443
12604
  }
12444
- const outputDir = _chunkKLNFJDFMcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12605
+ const outputDir = _chunkNQJDO7K7cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12445
12606
  const serverOutputDir = _path2.default.join(outputDir, "server");
12446
12607
  const publicOutputDir = _path2.default.join(outputDir, "public");
12447
12608
  const { mkdir, cp } = await import("fs/promises");
@@ -12451,7 +12612,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12451
12612
  try {
12452
12613
  await mkdir(publicOutputDir, { recursive: true });
12453
12614
  await cp(clientDir, publicOutputDir, { recursive: true });
12454
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
12615
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Copied client assets to public directory");
12455
12616
  const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
12456
12617
  const assetsDir = _path2.default.join(publicOutputDir, "assets");
12457
12618
  const manifestExists = await import("fs/promises").then(
@@ -12461,12 +12622,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12461
12622
  (fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
12462
12623
  );
12463
12624
  if (manifestExists && assetsExist) {
12464
- _chunkVQJYGZNXcjs.logger.info("\u2705 Verified client assets are present");
12625
+ _chunkQMNWKQL4cjs.logger.info("\u2705 Verified client assets are present");
12465
12626
  } else {
12466
- _chunkVQJYGZNXcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
12627
+ _chunkQMNWKQL4cjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
12467
12628
  }
12468
12629
  } catch (error) {
12469
- _chunkVQJYGZNXcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
12630
+ _chunkQMNWKQL4cjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
12470
12631
  throw error;
12471
12632
  }
12472
12633
  const serverDir = _path2.default.join(root, distDir, "server");
@@ -12474,9 +12635,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12474
12635
  try {
12475
12636
  await mkdir(nitroServerDir, { recursive: true });
12476
12637
  await cp(serverDir, nitroServerDir, { recursive: true });
12477
- _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
12638
+ _chunkQMNWKQL4cjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
12478
12639
  } catch (error) {
12479
- _chunkVQJYGZNXcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
12640
+ _chunkQMNWKQL4cjs.logger.warn(`Could not copy SSR bundles: ${error}`);
12480
12641
  }
12481
12642
  const nitro = await createNitro(nitroConfig);
12482
12643
  const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
@@ -12500,11 +12661,11 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12500
12661
  const { readFile } = await import("fs/promises");
12501
12662
  const manifestContent = await readFile(clientManifestPath, "utf-8");
12502
12663
  farmRegistry.clientManifest = JSON.parse(manifestContent);
12503
- } catch (e39) {
12664
+ } catch (e41) {
12504
12665
  farmRegistry.clientManifest = {};
12505
12666
  }
12506
12667
  } catch (error) {
12507
- _chunkVQJYGZNXcjs.logger.warn(`Could not populate registry: ${error}`);
12668
+ _chunkQMNWKQL4cjs.logger.warn(`Could not populate registry: ${error}`);
12508
12669
  }
12509
12670
  await nitroBuild(nitro);
12510
12671
  if (pluginManager) {
@@ -12512,7 +12673,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12512
12673
  root,
12513
12674
  preset,
12514
12675
  distDir,
12515
- outputDir: _chunkKLNFJDFMcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
12676
+ outputDir: _chunkNQJDO7K7cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
12516
12677
  });
12517
12678
  }
12518
12679
  }