@farm.js/core 0.1.66 → 0.1.68

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 (494) hide show
  1. package/dist/{agent-mcp-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
  3. package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +10 -8
  7. package/dist/agent-runtime.d.ts +10 -8
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/{analyzer-4UFP4HVP.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  10. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  11. package/dist/api/client.cjs +12 -2
  12. package/dist/api/client.d.mts +4 -4
  13. package/dist/api/client.d.ts +4 -4
  14. package/dist/api/client.mjs +12 -2
  15. package/dist/api/client.native.cjs +12 -2
  16. package/dist/api/client.native.d.mts +5 -5
  17. package/dist/api/client.native.d.ts +5 -5
  18. package/dist/api/client.native.mjs +12 -2
  19. package/dist/api/node.cjs +223 -0
  20. package/dist/api/node.d.mts +61 -0
  21. package/dist/api/node.d.ts +61 -0
  22. package/dist/api/node.mjs +223 -0
  23. package/dist/api/route-manager.cjs +11 -11
  24. package/dist/api/route-manager.d.mts +14 -11
  25. package/dist/api/route-manager.d.ts +14 -11
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +11 -9
  29. package/dist/api/runtime.d.ts +11 -9
  30. package/dist/api/runtime.mjs +10 -6
  31. package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
  32. package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
  33. package/dist/api.cjs +17 -13
  34. package/dist/api.d.mts +15 -12
  35. package/dist/api.d.ts +15 -12
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  38. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +15 -15
  41. package/dist/app-markdown.d.ts +15 -15
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BVOpL_f2.d.ts} +52 -11
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-BhiDXex_.d.mts} +52 -11
  45. package/dist/{chunk-RY4ABNPE.cjs → chunk-225APHKC.cjs} +3 -3
  46. package/dist/{chunk-JGAE5XPL.cjs → chunk-23VJEGKC.cjs} +4 -2
  47. package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
  48. package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
  49. package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
  50. package/dist/{chunk-7XGWBPQQ.cjs → chunk-3EEINK7G.cjs} +24 -10
  51. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  52. package/dist/{chunk-HCGWDRZO.mjs → chunk-3Y52TWYU.mjs} +18 -7
  53. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-437QZIC2.cjs} +133 -46
  54. package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
  55. package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
  56. package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  57. package/dist/{chunk-EMNKZGF4.mjs → chunk-4UAQB5LB.mjs} +556 -462
  58. package/dist/{chunk-BQWBHWEW.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  59. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  60. package/dist/{chunk-ZEXE4TGY.mjs → chunk-5FBZJJGA.mjs} +247 -110
  61. package/dist/{chunk-4OSOLDPL.cjs → chunk-5JKDFRTK.cjs} +2 -2
  62. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  63. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  64. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  65. package/dist/chunk-6I4BFRE7.cjs +51 -0
  66. package/dist/{chunk-UBMHQVWN.mjs → chunk-6OFOIMNS.mjs} +1 -1
  67. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  68. package/dist/{chunk-CHYTADNK.cjs → chunk-7LK5CTUM.cjs} +70 -53
  69. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  70. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  71. package/dist/{chunk-BYRZ5VTH.mjs → chunk-A3T445WK.mjs} +47 -34
  72. package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
  73. package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
  74. package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
  75. package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  76. package/dist/chunk-AQIRXBBY.cjs +26 -0
  77. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  78. package/dist/chunk-AZ6IW6SF.mjs +28 -0
  79. package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
  80. package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
  81. package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
  82. package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
  83. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-VQJHT2ND.mjs → chunk-CRVSYDHV.mjs} +2 -2
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  88. package/dist/{chunk-AZUUKA66.mjs → chunk-DIXFKAPM.mjs} +1251 -389
  89. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  90. package/dist/{chunk-NHQM2Q4I.cjs → chunk-DWLNLU55.cjs} +2 -2
  91. package/dist/chunk-DXZ57EPE.mjs +375 -0
  92. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  93. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  94. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  95. package/dist/chunk-EIVGPQN5.mjs +51 -0
  96. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  97. package/dist/{chunk-E4UDLFWR.cjs → chunk-F36LS2C7.cjs} +796 -702
  98. package/dist/{chunk-MPIGW42F.mjs → chunk-F6CMGWAL.mjs} +1 -1
  99. package/dist/{chunk-GL7N5UHF.cjs → chunk-FJMC24KG.cjs} +21 -10
  100. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  101. package/dist/{chunk-3CCAICF7.cjs → chunk-FSODPZRT.cjs} +5 -5
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-WMTBBQHY.cjs → chunk-FVYBEMOD.cjs} +288 -151
  104. package/dist/{chunk-BM2LH2JM.mjs → chunk-G7NBPP7H.mjs} +14 -13
  105. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  106. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  107. package/dist/{chunk-25T5VXOE.mjs → chunk-GFPS7MNE.mjs} +106 -19
  108. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  109. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  110. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  111. package/dist/{chunk-RVGSVQWT.mjs → chunk-HEJM46HQ.mjs} +21 -7
  112. package/dist/chunk-HHLEYA4B.cjs +17 -0
  113. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  114. package/dist/{chunk-E552H232.cjs → chunk-I7J5RLGO.cjs} +16 -2
  115. package/dist/chunk-ICFPTHXM.mjs +97 -0
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-MPJEIHW2.cjs → chunk-IGDYL2IA.cjs} +2 -2
  118. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-E4RDMG3K.mjs → chunk-JL2YW5KX.mjs} +5 -4
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  124. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  125. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  126. package/dist/chunk-K63OWRY2.mjs +22 -0
  127. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  128. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  129. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  130. package/dist/{chunk-TKK5QHKZ.mjs → chunk-KDO6T6OB.mjs} +3 -3
  131. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  132. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  133. package/dist/{chunk-IT6WRNGB.cjs → chunk-KWCZKJYU.cjs} +1541 -679
  134. package/dist/{chunk-DVKH2RVN.cjs → chunk-LDEXTX4I.cjs} +70 -57
  135. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  136. package/dist/{chunk-XBSKPLHF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  137. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  138. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  139. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  140. package/dist/{chunk-TZVUF5JJ.mjs → chunk-MGZVDX4R.mjs} +5 -5
  141. package/dist/{chunk-MGKW5XZE.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  142. package/dist/{chunk-SK7QSNWE.mjs → chunk-MNJDNTGO.mjs} +1 -1
  143. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  144. package/dist/{chunk-FIR62CR3.mjs → chunk-MV7NWU23.mjs} +1 -1
  145. package/dist/{chunk-7ONGIFYX.cjs → chunk-MZ4CRSY7.cjs} +481 -171
  146. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  147. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  148. package/dist/{chunk-XBSLKXBL.mjs → chunk-NT4W4H52.mjs} +52 -35
  149. package/dist/{chunk-UAQD67HM.mjs → chunk-NVOMQLI2.mjs} +16 -2
  150. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  151. package/dist/{chunk-V56632LA.cjs → chunk-OCNV4CI2.cjs} +39 -6
  152. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  153. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  154. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  155. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  156. package/dist/{chunk-27FPUFWR.mjs → chunk-P2NBQ5JI.mjs} +1 -1
  157. package/dist/{chunk-HZPKJRYA.cjs → chunk-PDFFYZAT.cjs} +2 -2
  158. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  159. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  160. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  161. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  162. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  163. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  164. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  165. package/dist/{chunk-X4K7TYN6.cjs → chunk-QOGIZKSO.cjs} +26 -25
  166. package/dist/{chunk-CNNBFGL5.cjs → chunk-QSUYB3RH.cjs} +14 -14
  167. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  168. package/dist/{chunk-X3XUZWRB.mjs → chunk-R2ZHU37O.mjs} +36 -3
  169. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  170. package/dist/{chunk-O75GQVUK.mjs → chunk-RLH5AH2M.mjs} +1 -1
  171. package/dist/chunk-RWR7SMD7.cjs +50 -0
  172. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  173. package/dist/chunk-SD6JGJOM.mjs +50 -0
  174. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  175. package/dist/{chunk-BIF5MLTH.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  176. package/dist/{chunk-WVYRLP5E.mjs → chunk-T5XFZQCL.mjs} +1 -1
  177. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  178. package/dist/{chunk-OP7LHY4Y.cjs → chunk-TNK2TVRS.cjs} +2005 -800
  179. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  180. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  181. package/dist/{chunk-WYAXRIYP.cjs → chunk-UKZ6AWKZ.cjs} +10 -9
  182. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  183. package/dist/{chunk-VBCQ5WOI.cjs → chunk-URN7VFO7.cjs} +105 -16
  184. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  185. package/dist/{chunk-435QJNC2.mjs → chunk-VFNAK6A5.mjs} +4 -4
  186. package/dist/{chunk-WFWFECDW.mjs → chunk-VRGY3X2I.mjs} +100 -11
  187. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  188. package/dist/chunk-W44X6IC2.cjs +97 -0
  189. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  190. package/dist/{chunk-672ISQIG.mjs → chunk-WPB67LE5.mjs} +379 -69
  191. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  192. package/dist/chunk-WVQNXXNE.cjs +28 -0
  193. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  194. package/dist/{chunk-W2ZXMMHA.mjs → chunk-XCAQTCGK.mjs} +1 -1
  195. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  196. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  197. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  198. package/dist/{chunk-D4MRNBVF.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  199. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  200. package/dist/chunk-YFTGIHNC.mjs +26 -0
  201. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  202. package/dist/{chunk-752IHQTD.cjs → chunk-YTNBCXCW.cjs} +12 -12
  203. package/dist/{chunk-RFKTJTWZ.mjs → chunk-YVPX5PI5.mjs} +3 -1
  204. package/dist/{chunk-4TVPYN32.cjs → chunk-Z3PW3DIR.cjs} +7 -7
  205. package/dist/{chunk-OB7VKCUZ.mjs → chunk-Z6SOXHAD.mjs} +1851 -646
  206. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  207. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  208. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  209. package/dist/client/lifecycle.cjs +2 -2
  210. package/dist/client/lifecycle.d.mts +1 -1
  211. package/dist/client/lifecycle.d.ts +1 -1
  212. package/dist/client/lifecycle.mjs +1 -1
  213. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  214. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  215. package/dist/client-plugins.cjs +2 -2
  216. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-CE1lVK2R.d.mts} +116 -373
  217. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CNDqcAuf.d.ts} +116 -373
  218. package/dist/client-plugins.d.mts +10 -8
  219. package/dist/client-plugins.d.ts +10 -8
  220. package/dist/client-plugins.mjs +1 -1
  221. package/dist/client.cjs +11 -9
  222. package/dist/client.d.mts +17 -15
  223. package/dist/client.d.ts +17 -15
  224. package/dist/client.mjs +10 -8
  225. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  226. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  227. package/dist/config.d.mts +10 -8
  228. package/dist/config.d.ts +10 -8
  229. package/dist/cron.cjs +2 -2
  230. package/dist/cron.mjs +1 -1
  231. package/dist/deferred.cjs +2 -2
  232. package/dist/deferred.mjs +1 -1
  233. package/dist/deployment.cjs +4 -2
  234. package/dist/deployment.d.mts +15 -1
  235. package/dist/deployment.d.ts +15 -1
  236. package/dist/deployment.mjs +3 -1
  237. package/dist/desktop.d.mts +11 -9
  238. package/dist/desktop.d.ts +11 -9
  239. package/dist/{devtools-NZUVNUP3.mjs → devtools-2A2GPC7B.mjs} +33 -29
  240. package/dist/{devtools-N2JQCMXB.cjs → devtools-R27T3BRY.cjs} +38 -34
  241. package/dist/docs.cjs +28 -27
  242. package/dist/docs.d.mts +24 -10
  243. package/dist/docs.d.ts +24 -10
  244. package/dist/docs.mjs +27 -26
  245. package/dist/env-types.cjs +3 -3
  246. package/dist/env-types.mjs +2 -2
  247. package/dist/environment/vite.cjs +7 -7
  248. package/dist/environment/vite.d.mts +1 -1
  249. package/dist/environment/vite.d.ts +1 -1
  250. package/dist/environment/vite.mjs +6 -6
  251. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  252. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  253. package/dist/headers.cjs +3 -3
  254. package/dist/headers.mjs +2 -2
  255. package/dist/image/server.d.mts +1 -1
  256. package/dist/image/server.d.ts +1 -1
  257. package/dist/image/sharp.d.mts +1 -1
  258. package/dist/image/sharp.d.ts +1 -1
  259. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  260. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  261. package/dist/image.cjs +6 -6
  262. package/dist/image.d.mts +1 -1
  263. package/dist/image.d.ts +1 -1
  264. package/dist/image.mjs +1 -1
  265. package/dist/index.cjs +148 -128
  266. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  267. package/dist/{index.d-A_x10zGS.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  268. package/dist/index.d.mts +39 -87
  269. package/dist/index.d.ts +39 -87
  270. package/dist/index.mjs +224 -204
  271. package/dist/instrumentation.cjs +3 -3
  272. package/dist/instrumentation.mjs +2 -2
  273. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  274. package/dist/integrations/orm.d.mts +35 -0
  275. package/dist/integrations/orm.d.ts +35 -0
  276. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  277. package/dist/integrations.cjs +6 -5
  278. package/dist/integrations.d.mts +10 -8
  279. package/dist/integrations.d.ts +10 -8
  280. package/dist/integrations.mjs +5 -4
  281. package/dist/internal/app-markdown-runtime.cjs +4 -4
  282. package/dist/internal/app-markdown-runtime.d.mts +27 -11
  283. package/dist/internal/app-markdown-runtime.d.ts +27 -11
  284. package/dist/internal/app-markdown-runtime.mjs +3 -3
  285. package/dist/internal/build-runtime.cjs +76 -71
  286. package/dist/internal/build-runtime.d.mts +12 -10
  287. package/dist/internal/build-runtime.d.ts +12 -10
  288. package/dist/internal/build-runtime.mjs +75 -70
  289. package/dist/internal/cli-runtime.cjs +47 -46
  290. package/dist/internal/cli-runtime.mjs +46 -45
  291. package/dist/internal/client-error-overlay.cjs +6 -6
  292. package/dist/internal/client-error-overlay.mjs +2 -2
  293. package/dist/internal/client-runtime.cjs +85 -36
  294. package/dist/internal/client-runtime.d.mts +44 -13
  295. package/dist/internal/client-runtime.d.ts +44 -13
  296. package/dist/internal/client-runtime.mjs +79 -30
  297. package/dist/internal/compression-runtime.d.mts +10 -8
  298. package/dist/internal/compression-runtime.d.ts +10 -8
  299. package/dist/internal/config-runtime.cjs +27 -26
  300. package/dist/internal/config-runtime.d.mts +14 -12
  301. package/dist/internal/config-runtime.d.ts +14 -12
  302. package/dist/internal/config-runtime.mjs +26 -25
  303. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  304. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  305. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  306. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  307. package/dist/internal/form-actions.cjs +7 -2
  308. package/dist/internal/form-actions.d.mts +10 -3
  309. package/dist/internal/form-actions.d.ts +10 -3
  310. package/dist/internal/form-actions.mjs +8 -3
  311. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  312. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  313. package/dist/internal/islands-boot.cjs +6 -1
  314. package/dist/internal/islands-boot.mjs +6 -1
  315. package/dist/internal/islands-runtime.cjs +33 -4
  316. package/dist/internal/islands-runtime.d.mts +1 -1
  317. package/dist/internal/islands-runtime.d.ts +1 -1
  318. package/dist/internal/islands-runtime.mjs +31 -2
  319. package/dist/internal/native-server-fns.cjs +5 -5
  320. package/dist/internal/native-server-fns.mjs +4 -4
  321. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  322. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  323. package/dist/internal/production-node-env.cjs +4 -2
  324. package/dist/internal/production-node-env.d.mts +22 -1
  325. package/dist/internal/production-node-env.d.ts +22 -1
  326. package/dist/internal/production-node-env.mjs +3 -1
  327. package/dist/internal/production-runtime.cjs +57 -39
  328. package/dist/internal/production-runtime.d.mts +27 -21
  329. package/dist/internal/production-runtime.d.ts +27 -21
  330. package/dist/internal/production-runtime.mjs +72 -54
  331. package/dist/internal/react-cache.cjs +3 -3
  332. package/dist/internal/react-cache.mjs +1 -1
  333. package/dist/internal/server-tree.cjs +2 -2
  334. package/dist/internal/server-tree.d.mts +0 -5
  335. package/dist/internal/server-tree.d.ts +0 -5
  336. package/dist/internal/server-tree.mjs +1 -1
  337. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  338. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  339. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  340. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  341. package/dist/layers-7P4RLKVX.cjs +20 -0
  342. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  343. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  344. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  345. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  346. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  347. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  348. package/dist/manager-JOHU6BQI.cjs +15 -0
  349. package/dist/markdown.cjs +7 -3
  350. package/dist/markdown.d.mts +10 -8
  351. package/dist/markdown.d.ts +10 -8
  352. package/dist/markdown.mjs +6 -2
  353. package/dist/middleware.cjs +11 -11
  354. package/dist/middleware.d.mts +13 -10
  355. package/dist/middleware.d.ts +13 -10
  356. package/dist/middleware.mjs +13 -13
  357. package/dist/mobile.d.mts +6 -6
  358. package/dist/mobile.d.ts +6 -6
  359. package/dist/mount.d-Bki4pOaJ.d.mts +38 -0
  360. package/dist/mount.d-DjR5aerM.d.ts +38 -0
  361. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  362. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  363. package/dist/{native-tree-7LPH57Z4.cjs → native-tree-W2SSJB3Y.cjs} +4 -4
  364. package/dist/{native-tree-VV6WN3GX.mjs → native-tree-Y5YQANW7.mjs} +3 -3
  365. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  366. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  367. package/dist/navigation.cjs +8 -7
  368. package/dist/navigation.d.mts +13 -11
  369. package/dist/navigation.d.ts +13 -11
  370. package/dist/navigation.mjs +7 -6
  371. package/dist/{nitro-DD4QCA66.mjs → nitro-NSTXT7LB.mjs} +11 -11
  372. package/dist/{nitro-VRDX2H4M.cjs → nitro-Y3LGITW3.cjs} +13 -13
  373. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  374. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  375. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  376. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  377. package/dist/plugin.cjs +65 -63
  378. package/dist/plugin.d.mts +12 -10
  379. package/dist/plugin.d.ts +12 -10
  380. package/dist/plugin.mjs +64 -62
  381. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  382. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  383. package/dist/query/client.cjs +9 -7
  384. package/dist/query/client.mjs +5 -3
  385. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  386. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  387. package/dist/renderer/none/server.cjs +35 -0
  388. package/dist/renderer/none/server.d.mts +21 -0
  389. package/dist/renderer/none/server.d.ts +21 -0
  390. package/dist/renderer/none/server.mjs +35 -0
  391. package/dist/renderer/react/server.cjs +3 -3
  392. package/dist/renderer/react/server.mjs +3 -3
  393. package/dist/renderer-client.cjs +8 -6
  394. package/dist/renderer-client.d.mts +13 -11
  395. package/dist/renderer-client.d.ts +13 -11
  396. package/dist/renderer-client.mjs +5 -3
  397. package/dist/renderer.cjs +6 -2
  398. package/dist/renderer.d.mts +25 -2
  399. package/dist/renderer.d.ts +25 -2
  400. package/dist/renderer.mjs +5 -1
  401. package/dist/request.cjs +2 -2
  402. package/dist/{request.d-DarDOCk9.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  403. package/dist/{request.d-B1RnTLri.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  404. package/dist/request.d.mts +11 -9
  405. package/dist/request.d.ts +11 -9
  406. package/dist/request.mjs +1 -1
  407. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  408. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  409. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  410. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  411. package/dist/{router.d-CMANF6da.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  412. package/dist/{router.d-Cuv1jntg.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  413. package/dist/routes.cjs +3 -3
  414. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-9GFFNioh.d.ts} +2 -2
  415. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-CrEy0lJS.d.mts} +2 -2
  416. package/dist/routes.d.mts +10 -8
  417. package/dist/routes.d.ts +10 -8
  418. package/dist/routes.mjs +2 -2
  419. package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-3T7V6OUT.cjs} +30 -28
  420. package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-GA4AQWZI.mjs} +29 -27
  421. package/dist/{runtime-FKFCUHSK.cjs → runtime-REUTNTI5.cjs} +72 -46
  422. package/dist/{runtime-QQHX4BP3.mjs → runtime-ZYCKKY7L.mjs} +60 -34
  423. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-DLRO-ExG.d.mts} +11 -3
  424. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-H7k9hOQE.d.ts} +11 -3
  425. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  426. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  427. package/dist/schema.cjs +6 -2
  428. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  429. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  430. package/dist/schema.d.mts +1 -115
  431. package/dist/schema.d.ts +1 -115
  432. package/dist/schema.mjs +5 -1
  433. package/dist/server-fn-client.d.mts +2 -2
  434. package/dist/server-fn-client.d.ts +2 -2
  435. package/dist/server-fn.cjs +5 -5
  436. package/dist/server-fn.mjs +4 -4
  437. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  438. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  439. package/dist/server-plugins.cjs +7 -7
  440. package/dist/server-plugins.d.mts +20 -12
  441. package/dist/server-plugins.d.ts +20 -12
  442. package/dist/server-plugins.mjs +8 -8
  443. package/dist/server-query.cjs +6 -6
  444. package/dist/server-query.mjs +5 -5
  445. package/dist/server.cjs +168 -126
  446. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  447. package/dist/server.d-DgC8xew5.d.mts +57 -0
  448. package/dist/server.d.mts +24 -16
  449. package/dist/server.d.ts +24 -16
  450. package/dist/server.mjs +144 -102
  451. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-Dr7oanhl.d.ts} +15 -5
  452. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-g4CzhEH1.d.mts} +15 -5
  453. package/dist/testing.cjs +17 -17
  454. package/dist/testing.d.mts +10 -8
  455. package/dist/testing.d.ts +10 -8
  456. package/dist/testing.mjs +13 -13
  457. package/dist/theme/server.cjs +3 -3
  458. package/dist/theme/server.mjs +2 -2
  459. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  460. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  461. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  462. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  463. package/dist/version.cjs +2 -2
  464. package/dist/version.mjs +1 -1
  465. package/dist/vite.cjs +65 -63
  466. package/dist/vite.d.mts +36 -14
  467. package/dist/vite.d.ts +36 -14
  468. package/dist/vite.mjs +64 -62
  469. package/dist/workflows.cjs +4 -4
  470. package/dist/workflows.d.mts +121 -1
  471. package/dist/workflows.d.ts +121 -1
  472. package/dist/workflows.mjs +3 -3
  473. package/package.json +37 -2
  474. package/dist/analyzer-H7SIX6BJ.cjs +0 -16
  475. package/dist/chunk-5YPBFMBN.cjs +0 -19
  476. package/dist/chunk-CLFEQGET.cjs +0 -60
  477. package/dist/chunk-MK5E44WP.mjs +0 -60
  478. package/dist/chunk-OM7WILES.mjs +0 -100
  479. package/dist/chunk-Q5B4LNON.mjs +0 -19
  480. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  481. package/dist/chunk-R53QDV6T.cjs +0 -100
  482. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  483. package/dist/layers-DMRXRL7F.cjs +0 -18
  484. package/dist/manager-2LUKNX2N.cjs +0 -14
  485. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  486. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  487. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  488. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
  489. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  490. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  491. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  492. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  493. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  494. /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
3
+
4
+ var _chunkJSOCDYERcjs = require('./chunk-JSOCDYER.cjs');
4
5
 
5
6
 
6
7
  var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
@@ -8,7 +9,12 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
8
9
 
9
10
 
10
11
 
11
- var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
12
+ var _chunkQOGIZKSOcjs = require('./chunk-QOGIZKSO.cjs');
13
+
14
+
15
+ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
16
+
17
+
12
18
 
13
19
 
14
20
 
@@ -33,23 +39,23 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
33
39
 
34
40
 
35
41
 
42
+ var _chunkUPOYKX4Scjs = require('./chunk-UPOYKX4S.cjs');
36
43
 
37
44
 
38
- var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
45
+ var _chunkYTNBCXCWcjs = require('./chunk-YTNBCXCW.cjs');
39
46
 
40
47
 
41
- var _chunkCLFEQGETcjs = require('./chunk-CLFEQGET.cjs');
42
48
 
43
49
 
44
- var _chunk752IHQTDcjs = require('./chunk-752IHQTD.cjs');
45
50
 
46
51
 
47
52
 
53
+ var _chunkX3MHKLCOcjs = require('./chunk-X3MHKLCO.cjs');
48
54
 
49
55
 
50
56
 
51
57
 
52
- var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
58
+ var _chunkW44X6IC2cjs = require('./chunk-W44X6IC2.cjs');
53
59
 
54
60
 
55
61
 
@@ -69,12 +75,17 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
69
75
 
70
76
 
71
77
 
72
- var _chunk7ONGIFYXcjs = require('./chunk-7ONGIFYX.cjs');
78
+
79
+ var _chunkMZ4CRSY7cjs = require('./chunk-MZ4CRSY7.cjs');
73
80
 
74
81
 
75
82
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
76
83
 
77
84
 
85
+
86
+ var _chunkQIXEU2WVcjs = require('./chunk-QIXEU2WV.cjs');
87
+
88
+
78
89
  var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
79
90
 
80
91
 
@@ -82,7 +93,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
82
93
  var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
83
94
 
84
95
 
85
- var _chunkV56632LAcjs = require('./chunk-V56632LA.cjs');
96
+ var _chunkOCNV4CI2cjs = require('./chunk-OCNV4CI2.cjs');
86
97
 
87
98
 
88
99
  var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
@@ -92,7 +103,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
92
103
 
93
104
 
94
105
 
95
- var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
106
+ var _chunk4E57QHPWcjs = require('./chunk-4E57QHPW.cjs');
96
107
 
97
108
 
98
109
 
@@ -100,24 +111,24 @@ var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
100
111
 
101
112
 
102
113
 
103
- var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
104
114
 
105
115
 
116
+ var _chunkQO43L7Z4cjs = require('./chunk-QO43L7Z4.cjs');
106
117
 
107
118
 
108
119
 
109
120
 
110
- var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
111
121
 
112
122
 
113
- var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
114
123
 
124
+ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
115
125
 
116
126
 
117
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
127
+ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
118
128
 
119
129
 
120
130
 
131
+ var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
121
132
 
122
133
 
123
134
 
@@ -126,58 +137,58 @@ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
126
137
 
127
138
 
128
139
 
129
- var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
130
140
 
131
141
 
132
- var _chunkHEPJIKKQcjs = require('./chunk-HEPJIKKQ.cjs');
133
142
 
134
143
 
144
+ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
135
145
 
136
- var _chunkXBSKPLHFcjs = require('./chunk-XBSKPLHF.cjs');
137
146
 
147
+ var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
138
148
 
139
- var _chunk7XGWBPQQcjs = require('./chunk-7XGWBPQQ.cjs');
140
149
 
150
+ var _chunkYAEN3L2Fcjs = require('./chunk-YAEN3L2F.cjs');
141
151
 
142
152
 
143
- var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
153
+ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
154
+
144
155
 
145
156
 
157
+ var _chunkLR4KP3I7cjs = require('./chunk-LR4KP3I7.cjs');
146
158
 
147
159
 
160
+ var _chunk3EEINK7Gcjs = require('./chunk-3EEINK7G.cjs');
148
161
 
149
162
 
150
163
 
164
+ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
151
165
 
152
- var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
153
166
 
154
167
 
155
- var _chunk3CCAICF7cjs = require('./chunk-3CCAICF7.cjs');
156
168
 
157
169
 
158
- var _chunkBT4SEFLCcjs = require('./chunk-BT4SEFLC.cjs');
159
170
 
160
171
 
161
- var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
162
172
 
173
+ var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
163
174
 
164
175
 
165
- var _chunk4ZJ5C7UJcjs = require('./chunk-4ZJ5C7UJ.cjs');
176
+ var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
166
177
 
167
178
 
168
179
  var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
169
180
 
170
181
 
171
- var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
172
182
 
173
183
 
184
+ var _chunkBDYM2TN3cjs = require('./chunk-BDYM2TN3.cjs');
174
185
 
175
- var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
176
186
 
187
+ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
177
188
 
178
189
 
179
190
 
180
- var _chunkI32V5CZLcjs = require('./chunk-I32V5CZL.cjs');
191
+ var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
181
192
 
182
193
 
183
194
 
@@ -191,7 +202,7 @@ var _chunkYDXLC4DWcjs = require('./chunk-YDXLC4DW.cjs');
191
202
 
192
203
 
193
204
 
194
- var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
205
+ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
195
206
 
196
207
 
197
208
 
@@ -215,7 +226,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
215
226
 
216
227
 
217
228
 
218
- var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
229
+ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
219
230
 
220
231
 
221
232
 
@@ -223,6 +234,9 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
223
234
  var _chunkDMAP4RNDcjs = require('./chunk-DMAP4RND.cjs');
224
235
 
225
236
 
237
+ var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
238
+
239
+
226
240
  var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
227
241
 
228
242
 
@@ -246,32 +260,29 @@ var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
246
260
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
247
261
 
248
262
 
249
-
250
- var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
263
+ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
251
264
 
252
265
 
253
266
 
254
- var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
267
+ var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
255
268
 
256
269
 
257
- var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
258
-
270
+ var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
259
271
 
260
- var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
261
272
 
262
273
 
274
+ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
263
275
 
264
- var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
265
276
 
266
277
 
267
- var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
278
+ var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
268
279
 
269
280
 
270
- var _chunkBIF5MLTHcjs = require('./chunk-BIF5MLTH.cjs');
281
+ var _chunkSQ6IWJ3Hcjs = require('./chunk-SQ6IWJ3H.cjs');
271
282
 
272
283
 
273
284
 
274
- var _chunkJGAE5XPLcjs = require('./chunk-JGAE5XPL.cjs');
285
+ var _chunk23VJEGKCcjs = require('./chunk-23VJEGKC.cjs');
275
286
 
276
287
 
277
288
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
@@ -281,6 +292,9 @@ var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
281
292
  var _chunkVOQ7XZZTcjs = require('./chunk-VOQ7XZZT.cjs');
282
293
 
283
294
 
295
+ var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
296
+
297
+
284
298
 
285
299
 
286
300
 
@@ -291,11 +305,11 @@ var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
291
305
 
292
306
 
293
307
 
294
- var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
308
+ var _chunkI7J5RLGOcjs = require('./chunk-I7J5RLGO.cjs');
295
309
 
296
310
 
297
311
 
298
- var _chunkXQSYOVCWcjs = require('./chunk-XQSYOVCW.cjs');
312
+ var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
299
313
 
300
314
 
301
315
  var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
@@ -304,21 +318,24 @@ var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
304
318
  var _chunkHXNLKCWHcjs = require('./chunk-HXNLKCWH.cjs');
305
319
 
306
320
 
321
+ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
307
322
 
308
323
 
309
- var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
310
324
 
311
325
 
312
326
 
313
327
 
314
328
 
329
+ var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
315
330
 
316
331
 
317
- var _chunkHNAISJFDcjs = require('./chunk-HNAISJFD.cjs');
318
332
 
333
+ var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
319
334
 
320
335
 
321
- var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
336
+
337
+
338
+ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
322
339
 
323
340
 
324
341
 
@@ -342,8 +359,8 @@ var _chunkYTVSWXEZcjs = require('./chunk-YTVSWXEZ.cjs');
342
359
  var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
343
360
 
344
361
  // src/routing/route-manager.ts
345
- var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs6 = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs);
346
- var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path10 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path);
362
+ var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs);
363
+ var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
347
364
 
348
365
  // src/static-metadata-image.ts
349
366
  var _crypto = require('crypto');
@@ -442,7 +459,7 @@ var RouteManager = class {
442
459
  this.redirects = /* @__PURE__ */ new Map();
443
460
  this.programmaticPages = /* @__PURE__ */ new Map();
444
461
  this.programmaticLayouts = /* @__PURE__ */ new Map();
445
- this.programmaticClientRoutes = _chunk7ONGIFYXcjs.mergeProgrammaticClientRoutes.call(void 0, []);
462
+ this.programmaticClientRoutes = _chunkMZ4CRSY7cjs.mergeProgrammaticClientRoutes.call(void 0, []);
446
463
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
447
464
  this.config = config;
448
465
  this.viteServer = viteServer;
@@ -470,11 +487,11 @@ var RouteManager = class {
470
487
  this.programmaticPages.clear();
471
488
  this.programmaticLayouts.clear();
472
489
  const programmaticClientRoutes = [];
473
- for (const source of _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, this.config)) {
490
+ for (const source of _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, this.config)) {
474
491
  await this.discoverFileRoutes(source);
475
492
  await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
476
493
  }
477
- this.programmaticClientRoutes = _chunk7ONGIFYXcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
494
+ this.programmaticClientRoutes = _chunkMZ4CRSY7cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
478
495
  for (const slot of this.routeSlots.values()) {
479
496
  if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
480
497
  throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
@@ -493,8 +510,8 @@ var RouteManager = class {
493
510
  )
494
511
  );
495
512
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
496
- (left, right) => _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
497
- ).map((entry) => ({ entry, groupScope: _chunkUJ3R2AH2cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
513
+ (left, right) => _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, right.pattern)
514
+ ).map((entry) => ({ entry, groupScope: _chunkUPOYKX4Scjs.getRouteGroupScope.call(void 0, entry.pattern) }));
498
515
  for (const slot of this.routeSlots.values()) {
499
516
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
500
517
  this.routeSlotOwnerSegments.set(
@@ -519,9 +536,14 @@ var RouteManager = class {
519
536
  const routePathname = this.toRoutePathname(pathname);
520
537
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
521
538
  const pathParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
539
+ const trimmedPathname = routePathname.replace(/\/+$/, "");
540
+ const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
522
541
  let matchedRoute = null;
523
542
  let params = {};
524
543
  for (const routeEntry of this.routes.values()) {
544
+ if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
545
+ continue;
546
+ }
525
547
  const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
526
548
  if (match.matches) {
527
549
  matchedRoute = routeEntry;
@@ -553,31 +575,36 @@ var RouteManager = class {
553
575
  getRouteSlots() {
554
576
  return new Map(this.routeSlots);
555
577
  }
578
+ /** The layouts that wrap a registered page, root first. */
579
+ getRouteLayouts(pattern) {
580
+ const routeEntry = this.routes.get(pattern);
581
+ return routeEntry ? this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
582
+ }
556
583
  /** Resolve route rules, inherited layouts, and the page export in precedence order. */
557
584
  async resolveRouteRuntimeConfig(pattern) {
558
585
  const routeEntry = this.routes.get(pattern);
559
586
  if (!routeEntry) {
560
587
  throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
561
588
  }
562
- const inherited = _chunkOYZXVBZPcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
589
+ const inherited = _chunkIUKBPBM7cjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
563
590
  const layouts = this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry);
564
591
  const layoutConfigs = [];
565
592
  for (const layout of layouts) {
566
593
  const layoutModule = await this.loadLayoutModule(layout.modulePath);
567
594
  layoutConfigs.push(
568
- _chunkOYZXVBZPcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
569
- _chunkOYZXVBZPcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
595
+ _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0,
596
+ _chunkIUKBPBM7cjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
570
597
  `Layout "${layout.pattern}"`
571
598
  )
572
599
  );
573
600
  }
574
601
  const routeModule = await this.loadRouteModule(routeEntry.modulePath);
575
- const routeConfig = _chunkOYZXVBZPcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
576
- _chunkOYZXVBZPcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
602
+ const routeConfig = _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0,
603
+ _chunkIUKBPBM7cjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
577
604
  `Route "${pattern}"`
578
605
  );
579
- return _chunkOYZXVBZPcjs.resolveFarmRouteRuntimeConfig.call(void 0,
580
- _chunkOYZXVBZPcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
606
+ return _chunkIUKBPBM7cjs.resolveFarmRouteRuntimeConfig.call(void 0,
607
+ _chunkIUKBPBM7cjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
581
608
  `Route "${pattern}"`
582
609
  );
583
610
  }
@@ -605,17 +632,22 @@ var RouteManager = class {
605
632
  matchRedirect(pathname, search = "") {
606
633
  const i18n = this.getI18nConfig();
607
634
  const localeMatch = i18n ? _chunkOWQV6MLMcjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
608
- const routePathname = _optionalChain([localeMatch, 'optionalAccess', _2 => _2.pathname]) || pathname;
635
+ const routePathname = _optionalChain([localeMatch, 'optionalAccess', _2 => _2.pathname]) || this.toRoutePathname(pathname);
609
636
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
637
+ const urlParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
610
638
  for (const redirectEntry of this.redirects.values()) {
611
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, normalizedPath, redirectEntry.route.segments);
639
+ const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
612
640
  if (!match.matches) continue;
613
641
  const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
614
642
  return {
615
643
  redirect: redirectEntry.definition,
616
644
  destination: _chunkHXNLKCWHcjs.appendFarmRedirectQuery.call(void 0,
617
645
  this.localizeRedirectDestination(
618
- interpolateRedirectDestination(redirectEntry.definition.destination, match.params),
646
+ interpolateRedirectDestination(
647
+ redirectEntry.definition.destination,
648
+ match.params,
649
+ getCatchAllParamSegments(redirectEntry.route.segments, urlParts)
650
+ ),
619
651
  _optionalChain([localeMatch, 'optionalAccess', _3 => _3.locale])
620
652
  ),
621
653
  search
@@ -727,6 +759,20 @@ var RouteManager = class {
727
759
  if (_optionalChain([this, 'access', _4 => _4.clientManifestCache, 'optionalAccess', _5 => _5.projectRoot]) === normalizedProjectRoot) {
728
760
  return this.clientManifestCache.manifest;
729
761
  }
762
+ const cacheFile = this.packageClientBoundaryCacheFile;
763
+ return cacheFile ? _chunkMZ4CRSY7cjs.runWithPackageClientBoundaryCacheFile.call(void 0,
764
+ cacheFile,
765
+ () => this.computeClientManifest(normalizedProjectRoot)
766
+ ) : this.computeClientManifest(normalizedProjectRoot);
767
+ }
768
+ /**
769
+ * @internal Keep package client-boundary inspections in `file` between plans, as the dev server
770
+ * does. Without it, each plan outside a production build reads every package's sources again.
771
+ */
772
+ usePackageClientBoundaryCacheFile(file) {
773
+ this.packageClientBoundaryCacheFile = file;
774
+ }
775
+ computeClientManifest(normalizedProjectRoot) {
730
776
  const toUrlPath = (absolutePath) => {
731
777
  const rootRelative = _chunkQMNWKQL4cjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
732
778
  if (rootRelative !== void 0) return rootRelative;
@@ -736,39 +782,39 @@ var RouteManager = class {
736
782
  }
737
783
  return absolutePath;
738
784
  };
739
- const integrationProviders = _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
785
+ const integrationProviders = _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
740
786
  (provider) => provider.component || provider.type === "clerk"
741
787
  );
742
788
  const unsupportedIntegrationProvider = integrationProviders.find(
743
789
  (provider) => provider.supportsIsolatedHydration !== true
744
790
  );
745
- if (_optionalChain([this, 'access', _6 => _6.config, 'access', _7 => _7.experimental, 'optionalAccess', _8 => _8.isolatedClientHydration]) === "enabled" && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _9 => _9.config, 'access', _10 => _10.experimental, 'optionalAccess', _11 => _11.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
791
+ if (_optionalChain([this, 'access', _6 => _6.config, 'access', _7 => _7.experimental, 'optionalAccess', _8 => _8.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _9 => _9.config, 'access', _10 => _10.experimental, 'optionalAccess', _11 => _11.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
746
792
  _chunkQMNWKQL4cjs.logger.warn(
747
793
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
748
794
  );
749
795
  }
750
- const isolatedMode = _chunk7ONGIFYXcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
796
+ const isolatedMode = _chunkMZ4CRSY7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
751
797
  _optionalChain([this, 'access', _12 => _12.config, 'access', _13 => _13.experimental, 'optionalAccess', _14 => _14.isolatedClientHydration]),
752
798
  {
753
- serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
799
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
754
800
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
755
801
  }
756
802
  );
757
- const planOptions = _chunk7ONGIFYXcjs.getFarmClientHydrationPlanOptions.call(void 0,
803
+ const planOptions = _chunkMZ4CRSY7cjs.getFarmClientHydrationPlanOptions.call(void 0,
758
804
  this.config.renderer,
759
805
  Boolean(unsupportedIntegrationProvider)
760
806
  );
761
- const islandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
807
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
762
808
  const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
763
809
  entry,
764
- metadata: _chunk7ONGIFYXcjs.getClientModuleHydrationPlan.call(void 0,
810
+ metadata: _chunkMZ4CRSY7cjs.getClientModuleHydrationPlan.call(void 0,
765
811
  entry.modulePath,
766
812
  normalizedProjectRoot,
767
813
  isolatedMode,
768
814
  islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
769
815
  )
770
816
  }));
771
- const markdownPagePlan = _chunk7ONGIFYXcjs.createMarkdownPageHydrationPlanner.call(void 0,
817
+ const markdownPagePlan = _chunkMZ4CRSY7cjs.createMarkdownPageHydrationPlanner.call(void 0,
772
818
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
773
819
  normalizedProjectRoot,
774
820
  isolatedMode,
@@ -776,13 +822,13 @@ var RouteManager = class {
776
822
  );
777
823
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
778
824
  entry,
779
- metadata: _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunk7ONGIFYXcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
825
+ metadata: _chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunkMZ4CRSY7cjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
780
826
  ...planOptions,
781
- serverOwners: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
827
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
782
828
  })
783
829
  }));
784
830
  const markdownFallback = routeEntries.find(
785
- ({ entry, metadata }) => _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
831
+ ({ entry, metadata }) => _chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
786
832
  );
787
833
  if (markdownFallback) {
788
834
  _chunkQMNWKQL4cjs.logger.warn(
@@ -790,7 +836,7 @@ var RouteManager = class {
790
836
  );
791
837
  }
792
838
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _24 => _24.find, 'call', _25 => _25(
793
- ({ entry, metadata }) => _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
839
+ ({ entry, metadata }) => _chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
794
840
  ), 'optionalAccess', _26 => _26.metadata, 'access', _27 => _27.staticPackageBoundaries]);
795
841
  if (markdownStaticPackages) {
796
842
  _chunkQMNWKQL4cjs.logger.info(
@@ -798,23 +844,23 @@ var RouteManager = class {
798
844
  );
799
845
  }
800
846
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
801
- if (_chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
847
+ if (_chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
802
848
  _chunkQMNWKQL4cjs.logger.info(
803
849
  `[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
804
850
  );
805
851
  }
806
- _chunk7ONGIFYXcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
852
+ _chunkMZ4CRSY7cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
807
853
  layoutEntries.map(({ entry, metadata }) => ({
808
854
  pattern: entry.pattern,
809
- depth: _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
855
+ depth: _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
810
856
  metadata
811
857
  })),
812
858
  routeEntries.map(({ entry, metadata }) => ({
813
859
  pattern: getRouteEntryDirectory(entry),
814
- depth: _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
860
+ depth: _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
815
861
  metadata
816
862
  })),
817
- _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory,
863
+ _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory,
818
864
  { serverOwners: islandsMode }
819
865
  );
820
866
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
@@ -834,7 +880,7 @@ var RouteManager = class {
834
880
  const routes = routeEntries.map(({ entry, metadata }) => {
835
881
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
836
882
  const layoutShouldHydrate = layoutEntries.some(
837
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
883
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
838
884
  );
839
885
  return {
840
886
  pattern: entry.pattern,
@@ -850,8 +896,8 @@ var RouteManager = class {
850
896
  modulePath: toUrlPath(boundary.modulePath)
851
897
  }))
852
898
  } : {},
853
- ..._chunk7ONGIFYXcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
854
- renderPlan: _chunkUJ3R2AH2cjs.createFarmRouteRenderPlan.call(void 0, {
899
+ ..._chunkMZ4CRSY7cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
900
+ renderPlan: _chunkUPOYKX4Scjs.createFarmRouteRenderPlan.call(void 0, {
855
901
  pageShouldHydrate: metadata.shouldHydrate,
856
902
  layoutShouldHydrate,
857
903
  islandStrategy: metadata.islandStrategy
@@ -867,7 +913,7 @@ var RouteManager = class {
867
913
  }))
868
914
  };
869
915
  });
870
- const treeLayoutPatterns = islandsMode ? _chunkUJ3R2AH2cjs.getFarmServerTreeLayoutPatterns.call(void 0,
916
+ const treeLayoutPatterns = islandsMode ? _chunkUPOYKX4Scjs.getFarmServerTreeLayoutPatterns.call(void 0,
871
917
  layoutEntries.map(({ entry, metadata }) => ({
872
918
  pattern: entry.pattern,
873
919
  shouldHydrate: metadata.shouldHydrate,
@@ -892,7 +938,7 @@ var RouteManager = class {
892
938
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
893
939
  }));
894
940
  const slots = Array.from(this.routeSlots.values()).map((entry) => {
895
- const metadata = _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
941
+ const metadata = _chunkMZ4CRSY7cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
896
942
  return {
897
943
  name: entry.name,
898
944
  ownerPattern: entry.ownerPattern,
@@ -901,13 +947,22 @@ var RouteManager = class {
901
947
  containerId: entry.containerId,
902
948
  interception: entry.interception,
903
949
  fallback: entry.fallback,
904
- shouldHydrate: metadata.shouldHydrate,
950
+ // In islands mode a server slot stays on the server; its client components are islands.
951
+ shouldHydrate: metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent),
905
952
  isClientComponent: metadata.isClientComponent,
906
953
  segments: entry.route.segments
907
954
  };
908
955
  });
956
+ const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
957
+ metadata: _chunkMZ4CRSY7cjs.getClientModuleHydrationPlan.call(void 0,
958
+ entry.modulePath,
959
+ normalizedProjectRoot,
960
+ isolatedMode,
961
+ { ...planOptions, serverOwners: true }
962
+ )
963
+ })) : [];
909
964
  const isolatedClientBoundaryModules = /* @__PURE__ */ new Set();
910
- for (const { metadata } of [...layoutEntries, ...routeEntries]) {
965
+ for (const { metadata } of [...layoutEntries, ...routeEntries, ...slotPlans]) {
911
966
  if (!metadata.hasIsolatedClientBoundaries && !metadata.serverTreeLayout) continue;
912
967
  for (const boundary of metadata.isolatedBoundaries) {
913
968
  isolatedClientBoundaryModules.add(path3.default.resolve(boundary.modulePath));
@@ -990,14 +1045,15 @@ var RouteManager = class {
990
1045
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
991
1046
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
992
1047
  }
993
- if (_chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1048
+ if (_chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
994
1049
  const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
995
- const components = await _chunkXBSKPLHFcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
996
- root: this.config.root,
997
- loadModule: this.viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
998
- });
999
- return await _chunkXBSKPLHFcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1000
- components,
1050
+ const viteServer = this.viteServer;
1051
+ return await _chunkLR4KP3I7cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1052
+ // Loaded on render: the route runtime manifest only reads metadata and rendering config.
1053
+ components: () => _chunkLR4KP3I7cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1054
+ root: this.config.root,
1055
+ loadModule: viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
1056
+ }),
1001
1057
  config: mdxConfig
1002
1058
  });
1003
1059
  }
@@ -1046,7 +1102,7 @@ var RouteManager = class {
1046
1102
  */
1047
1103
  createRoutePattern(route) {
1048
1104
  if (route.segments.length === 0) return "/";
1049
- return "/" + route.segments.map(_chunkUJ3R2AH2cjs.formatRouteSegment).join("/");
1105
+ return "/" + route.segments.map(_chunkUPOYKX4Scjs.formatRouteSegment).join("/");
1050
1106
  }
1051
1107
  registerPageRoute(entry) {
1052
1108
  _chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -1065,7 +1121,7 @@ var RouteManager = class {
1065
1121
  }
1066
1122
  async discoverFileRoutes(source) {
1067
1123
  const appDir = _chunkQMNWKQL4cjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
1068
- const componentExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
1124
+ const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
1069
1125
  (extension) => extension.slice(1)
1070
1126
  );
1071
1127
  const componentGlob = componentExtensions.join(",");
@@ -1097,8 +1153,8 @@ var RouteManager = class {
1097
1153
  }
1098
1154
  }
1099
1155
  for (const [pattern, group] of canonicalPageGroups) {
1100
- const componentFiles = group.files.filter((file) => !_chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, file));
1101
- const markdownFiles = group.files.filter(_chunk7XGWBPQQcjs.isFarmMarkdownPageFile);
1156
+ const componentFiles = group.files.filter((file) => !_chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, file));
1157
+ const markdownFiles = group.files.filter(_chunk3EEINK7Gcjs.isFarmMarkdownPageFile);
1102
1158
  if (componentFiles.length > 1) {
1103
1159
  throw new Error(
1104
1160
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
@@ -1140,7 +1196,7 @@ var RouteManager = class {
1140
1196
  for (const file of files) {
1141
1197
  const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1142
1198
  const modulePath = path3.default.join(appDir, file);
1143
- const pattern = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1199
+ const pattern = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1144
1200
  const existing = target.get(pattern);
1145
1201
  if (_optionalChain([existing, 'optionalAccess', _34 => _34.sourceRoot]) === source.root) {
1146
1202
  throw new Error(
@@ -1162,7 +1218,7 @@ var RouteManager = class {
1162
1218
  const modulePath = path3.default.join(appDir, file);
1163
1219
  const pattern = this.createRoutePattern(slot.route);
1164
1220
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
1165
- const ownerDirectory = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1221
+ const ownerDirectory = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1166
1222
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
1167
1223
  const existing = this.routeSlots.get(key);
1168
1224
  if (_optionalChain([existing, 'optionalAccess', _35 => _35.sourceRoot]) === source.root) {
@@ -1239,16 +1295,16 @@ var RouteManager = class {
1239
1295
  }
1240
1296
  async discoverProgrammaticRoutes(source, clientRoutes) {
1241
1297
  if (this.viteServer) _chunkE7QOEV5Zcjs.trackProgrammaticRouteSources.call(void 0, );
1242
- const manifests = await _chunkNWUHS6GVcjs.loadProgrammaticRouteManifests.call(void 0, {
1298
+ const manifests = await _chunkQEJWNXRIcjs.loadProgrammaticRouteManifests.call(void 0, {
1243
1299
  root: source.root,
1244
1300
  srcDir: source.srcDir,
1245
1301
  loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
1246
1302
  });
1247
- const graph = this.viteServer ? _chunk7ONGIFYXcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1303
+ const graph = this.viteServer ? _chunkMZ4CRSY7cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1248
1304
  for (const { filePath, manifest } of manifests) {
1249
1305
  if (graph) {
1250
1306
  clientRoutes.push(
1251
- _chunk7ONGIFYXcjs.resolveProgrammaticClientRoutes.call(void 0, {
1307
+ _chunkMZ4CRSY7cjs.resolveProgrammaticClientRoutes.call(void 0, {
1252
1308
  graph,
1253
1309
  routesFile: toRealPath(filePath),
1254
1310
  routes: manifest.routes,
@@ -1279,7 +1335,7 @@ var RouteManager = class {
1279
1335
  }
1280
1336
  if (definition.kind === "layout") {
1281
1337
  const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
1282
- const pattern = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1338
+ const pattern = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1283
1339
  const existing = this.layouts.get(pattern);
1284
1340
  if (_optionalChain([existing, 'optionalAccess', _39 => _39.sourceRoot]) === source.root) {
1285
1341
  throw new Error(
@@ -1326,7 +1382,7 @@ var RouteManager = class {
1326
1382
  const matchingLayouts = [];
1327
1383
  for (const { entry, groupScope } of this.orderedLayouts) {
1328
1384
  if (!_chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
1329
- if (groupScope !== null && !_chunkUJ3R2AH2cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1385
+ if (groupScope !== null && !_chunkUPOYKX4Scjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1330
1386
  continue;
1331
1387
  }
1332
1388
  matchingLayouts.push(entry);
@@ -1407,14 +1463,14 @@ var RouteManager = class {
1407
1463
  let page = route;
1408
1464
  for (const boundaryEntry of boundaries.values()) {
1409
1465
  if (!_chunkQMNWKQL4cjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
1410
- const groupScope = _chunkUJ3R2AH2cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1466
+ const groupScope = _chunkUPOYKX4Scjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1411
1467
  if (groupScope !== null) {
1412
1468
  if (page === void 0) page = this.matchPageRoute(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath));
1413
- if (!_chunkUJ3R2AH2cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1469
+ if (!_chunkUPOYKX4Scjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1414
1470
  }
1415
1471
  const depth = boundaryEntry.route.segments.length;
1416
1472
  const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _43 => _43.route, 'access', _44 => _44.segments, 'access', _45 => _45.length]), () => ( -1));
1417
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1473
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1418
1474
  bestMatch = boundaryEntry;
1419
1475
  }
1420
1476
  }
@@ -1437,12 +1493,12 @@ var RouteManager = class {
1437
1493
  }
1438
1494
  }
1439
1495
  }
1440
- /** The page routes a docs adapter answers before Farm's own page rendering. */
1496
+ /** The page routes the docs runtime answers before Farm's own page rendering. */
1441
1497
  getDocsAdapterRoutes() {
1442
1498
  const docs = this.config.docs;
1443
- if (!docs || typeof docs !== "object" || !docs.enabled || !docs.adapter || !docs.adapter.server || !docs.adapter.react || !_chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer)) {
1444
- return void 0;
1445
- }
1499
+ if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
1500
+ const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
1501
+ if (usesAdapter && !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) return void 0;
1446
1502
  const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
1447
1503
  return {
1448
1504
  owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
@@ -1464,7 +1520,7 @@ var RouteManager = class {
1464
1520
  }));
1465
1521
  const i18n = this.getI18nConfig();
1466
1522
  const docsAdapterRoutes = this.getDocsAdapterRoutes();
1467
- const result = await _chunkX4K7TYN6cjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1523
+ const result = await _chunkQOGIZKSOcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1468
1524
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
1469
1525
  ...docsAdapterRoutes ? { docsAdapterRoutes } : {}
1470
1526
  });
@@ -1489,16 +1545,17 @@ var RouteManager = class {
1489
1545
  )
1490
1546
  };
1491
1547
  }
1548
+ /** A request pathname as routes see it: without the basePath and, with i18n, the locale. */
1492
1549
  toRoutePathname(pathname) {
1493
1550
  const i18n = this.getI18nConfig();
1494
1551
  return i18n ? _chunkOWQV6MLMcjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, this.config.basePath);
1495
1552
  }
1496
1553
  localizeRedirectDestination(destination, locale) {
1497
- if (!locale || !destination.startsWith("/") || destination.startsWith("//")) {
1554
+ if (!destination.startsWith("/") || destination.startsWith("//")) {
1498
1555
  return destination;
1499
1556
  }
1500
1557
  const i18n = this.getI18nConfig();
1501
- return i18n ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, destination, locale, i18n) : destination;
1558
+ return locale && i18n ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, destination, locale, i18n) : this.config.basePath ? _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, destination, this.config.basePath) : destination;
1502
1559
  }
1503
1560
  getI18nConfig() {
1504
1561
  const i18n = this.config.i18n;
@@ -1510,7 +1567,7 @@ var RouteManager = class {
1510
1567
  async isRouteSSG(modulePath) {
1511
1568
  try {
1512
1569
  const mod = await this.loadRouteModule(modulePath);
1513
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1570
+ const rendering = await _chunkQOGIZKSOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1514
1571
  return rendering.ssg;
1515
1572
  } catch (e) {
1516
1573
  return false;
@@ -1522,7 +1579,7 @@ var RouteManager = class {
1522
1579
  async hasRouteISR(modulePath) {
1523
1580
  try {
1524
1581
  const mod = await this.loadRouteModule(modulePath);
1525
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1582
+ const rendering = await _chunkQOGIZKSOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1526
1583
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
1527
1584
  } catch (e2) {
1528
1585
  return false;
@@ -1534,7 +1591,7 @@ var RouteManager = class {
1534
1591
  async getRouteRevalidateInterval(modulePath) {
1535
1592
  try {
1536
1593
  const mod = await this.loadRouteModule(modulePath);
1537
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1594
+ const rendering = await _chunkQOGIZKSOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1538
1595
  return rendering.revalidate;
1539
1596
  } catch (e3) {
1540
1597
  return void 0;
@@ -1542,12 +1599,14 @@ var RouteManager = class {
1542
1599
  }
1543
1600
  };
1544
1601
  function getPageDirectoryField(route, pattern) {
1545
- const directory = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1602
+ const directory = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1546
1603
  return directory === pattern ? {} : { directory };
1547
1604
  }
1548
- function interpolateRedirectDestination(destination, params) {
1605
+ function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
1549
1606
  let result = destination;
1550
- for (const [key, value] of Object.entries(params)) {
1607
+ for (const [key, rawValue] of Object.entries(params)) {
1608
+ const segments = catchAllSegments[key];
1609
+ const value = segments ? segments.map(_chunkPWKAX5MScjs.encodeConfigRouteSegment).join("/") : _chunkPWKAX5MScjs.encodeConfigRouteSegment.call(void 0, rawValue);
1551
1610
  result = replaceAll(result, `[[...${key}]]`, value);
1552
1611
  result = replaceAll(result, `[...${key}]`, value);
1553
1612
  result = replaceAll(result, `[${key}]`, value);
@@ -1556,6 +1615,10 @@ function interpolateRedirectDestination(destination, params) {
1556
1615
  }
1557
1616
  return result;
1558
1617
  }
1618
+ function getCatchAllParamSegments(segments, urlParts) {
1619
+ const index = segments.findIndex((segment) => segment.isCatchAll);
1620
+ return index === -1 ? {} : { [segments[index].segment]: urlParts.slice(index) };
1621
+ }
1559
1622
  function getMetadataImageSuffix(pathname) {
1560
1623
  if (pathname === "/opengraph-image" || pathname.endsWith("/opengraph-image")) {
1561
1624
  return { kind: "opengraph", fileName: "opengraph-image" };
@@ -1705,7 +1768,8 @@ function farmFontImportsPlugin(options = {}) {
1705
1768
  );
1706
1769
  registry.production = false;
1707
1770
  server.middlewares.use(async (req, res, next) => {
1708
- const pathname = new URL(req.url || "/", "http://farm.local").pathname;
1771
+ const target = req.url || "/";
1772
+ const pathname = (target.startsWith("/") ? new URL(`http://farm.local${target}`) : new URL(target, "http://farm.local")).pathname;
1709
1773
  if (pathname === "/@farm/fonts.css") {
1710
1774
  res.statusCode = 200;
1711
1775
  res.setHeader("Content-Type", "text/css; charset=utf-8");
@@ -2593,7 +2657,7 @@ function isFontLoaderKind(value) {
2593
2657
  return typeof value === "string" && FONT_FUNCTIONS.has(value);
2594
2658
  }
2595
2659
  function containsFontFunction(code) {
2596
- return Array.from(FONT_FUNCTIONS).some((name) => code.includes(name));
2660
+ return code.includes("@farm.js/core") && Array.from(FONT_FUNCTIONS).some((name) => code.includes(name));
2597
2661
  }
2598
2662
  function requireString(value, id, label) {
2599
2663
  if (typeof value !== "string" || value.trim() === "") {
@@ -2668,7 +2732,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
2668
2732
  let hasClerkProvider = false;
2669
2733
  renderedProviders.forEach((provider, index) => {
2670
2734
  let componentExpression = "null";
2671
- if (_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
2735
+ if (_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
2672
2736
  const namespace = `FarmIntegrationProviderModule${index}`;
2673
2737
  imports.push(
2674
2738
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -2725,7 +2789,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
2725
2789
  const entries = [];
2726
2790
  let needsMarkHelper = false;
2727
2791
  providers.forEach((provider, index) => {
2728
- if (!_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
2792
+ if (!_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
2729
2793
  const namespace = `FarmServerIntegrationProviderModule${index}`;
2730
2794
  imports.push(
2731
2795
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -2793,7 +2857,7 @@ function inferFarmIslandStrategy(filePath, root) {
2793
2857
  const result = _compiler.inferStrategy.call(void 0, file, code, {
2794
2858
  parse: parseFarmIslandSource,
2795
2859
  resolve: (specifier, importer) => {
2796
- const resolved = _chunk7ONGIFYXcjs.resolveImportedModule.call(void 0, importer, specifier, root);
2860
+ const resolved = _chunkMZ4CRSY7cjs.resolveImportedModule.call(void 0, importer, specifier, root);
2797
2861
  return resolved.local ? resolved.path : null;
2798
2862
  }
2799
2863
  });
@@ -2807,7 +2871,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2807
2871
  const files = [];
2808
2872
  const modules = [];
2809
2873
  for (const owner of owners) {
2810
- const rendered = _chunk7ONGIFYXcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
2874
+ const rendered = _chunkMZ4CRSY7cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
2811
2875
  if (!rendered) {
2812
2876
  return {
2813
2877
  strategy: null,
@@ -2823,7 +2887,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2823
2887
  source = fs.default.readFileSync(module, "utf8");
2824
2888
  } catch (e10) {
2825
2889
  }
2826
- if (_chunk7ONGIFYXcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
2890
+ if (_chunkMZ4CRSY7cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
2827
2891
  }
2828
2892
  for (const module of modules) {
2829
2893
  const result = inferFarmIslandStrategy(module, root);
@@ -2835,7 +2899,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2835
2899
  function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
2836
2900
  const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
2837
2901
  const onRoute = layouts.filter(
2838
- (layout) => _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
2902
+ (layout) => _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
2839
2903
  );
2840
2904
  const declared = [
2841
2905
  ...page.islandStrategy ? [page.islandStrategy] : [],
@@ -2855,272 +2919,6 @@ function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
2855
2919
  return _nullishCoalesce(inference.strategy, () => ( "load"));
2856
2920
  }
2857
2921
 
2858
- // src/client-plugin-build.ts
2859
-
2860
-
2861
- var CLIENT_KEYS = [
2862
- "public",
2863
- "setup",
2864
- "hydration",
2865
- "navigation",
2866
- "error",
2867
- "performance",
2868
- "close"
2869
- ];
2870
- var HYDRATION_KEYS = ["before", "after"];
2871
- var NAVIGATION_KEYS = ["before", "loaded", "resolved", "rendered", "error"];
2872
- var MOBILE_SHELL_CLIENT_IMPORT = 'import { farmMobileShellClient as __farmMobileShellClient } from "@farm.js/core/internal/client-runtime";';
2873
- var MOBILE_SHELL_CLIENT_REGISTRATION = ` {
2874
- name: "farm:mobile-shell",
2875
- enforce: "pre",
2876
- definition: __farmMobileShellClient,
2877
- }`;
2878
- var APP_CLIENT_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
2879
- function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
2880
- const sourceRoot = path3.default.resolve(root, srcDir);
2881
- for (const extension of APP_CLIENT_EXTENSIONS) {
2882
- const candidate = path3.default.join(sourceRoot, `client.${extension}`);
2883
- if (fs.default.existsSync(candidate) && fs.default.statSync(candidate).isFile()) return candidate;
2884
- }
2885
- return void 0;
2886
- }
2887
- function resolveFarmClientPlugins(plugins, _root) {
2888
- if (!_optionalChain([plugins, 'optionalAccess', _51 => _51.length])) return [];
2889
- return plugins.flatMap((plugin) => {
2890
- if (!plugin.client) return [];
2891
- assertClientLifecycle(plugin.client, plugin.name);
2892
- assertPublicData(plugin.client.public, plugin.name);
2893
- return [
2894
- {
2895
- name: plugin.name,
2896
- version: plugin.version,
2897
- enforce: plugin.enforce,
2898
- definition: plugin.client,
2899
- publicData: plugin.client.public
2900
- }
2901
- ];
2902
- });
2903
- }
2904
- function generateFarmClientPluginEntryCode(plugins, root, srcDir = "src", appPublicData, platform = _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, )) {
2905
- const resolved = resolveFarmClientPlugins(plugins, root);
2906
- const appClientEntry = root ? resolveFarmAppClientEntry(root, srcDir) : void 0;
2907
- const appImport = appClientEntry ? `import farmAppClientDefinition from ${JSON.stringify(appClientEntry.replace(/\\/g, "/"))};` : "";
2908
- const mobileShell = platform === "mobile";
2909
- const imports = mobileShell ? [MOBILE_SHELL_CLIENT_IMPORT, appImport].filter(Boolean).join("\n") : appImport;
2910
- const serializedPlugins = mobileShell ? [MOBILE_SHELL_CLIENT_REGISTRATION] : [];
2911
- serializedPlugins.push(
2912
- ...resolved.map(
2913
- (plugin) => ` {
2914
- name: ${JSON.stringify(plugin.name)},
2915
- version: ${serializeOptionalString(plugin.version)},
2916
- enforce: ${serializeOptionalString(plugin.enforce)},
2917
- definition: ${serializeClientLifecycle(plugin.definition, plugin.name)},
2918
- public: ${serializePublicData(plugin.publicData)},
2919
- }`
2920
- )
2921
- );
2922
- if (appClientEntry) {
2923
- assertPublicData(appPublicData, "farm:app-client");
2924
- serializedPlugins.push(` {
2925
- name: "farm:app-client",
2926
- enforce: "post",
2927
- definition: farmAppClientDefinition,
2928
- public: ${serializePublicData(appPublicData)},
2929
- }`);
2930
- }
2931
- const registrations = `[
2932
- ${serializedPlugins.join(",\n")}
2933
- ]`;
2934
- return { imports, registrations, plugins: resolved };
2935
- }
2936
- function assertClientLifecycle(client, pluginName) {
2937
- assertLifecycleObject(client, pluginName, "client", CLIENT_KEYS);
2938
- assertHook(client.setup, pluginName, "client.setup");
2939
- assertHook(client.error, pluginName, "client.error");
2940
- assertHook(client.performance, pluginName, "client.performance");
2941
- assertHook(client.close, pluginName, "client.close");
2942
- if (client.hydration !== void 0) {
2943
- assertLifecycleObject(client.hydration, pluginName, "client.hydration", HYDRATION_KEYS);
2944
- assertHook(client.hydration.before, pluginName, "client.hydration.before");
2945
- assertHook(client.hydration.after, pluginName, "client.hydration.after");
2946
- }
2947
- if (client.navigation !== void 0) {
2948
- assertLifecycleObject(client.navigation, pluginName, "client.navigation", NAVIGATION_KEYS);
2949
- for (const key of NAVIGATION_KEYS) {
2950
- assertHook(client.navigation[key], pluginName, `client.navigation.${key}`);
2951
- }
2952
- }
2953
- }
2954
- function assertLifecycleObject(value, pluginName, location, allowedKeys) {
2955
- if (!value || typeof value !== "object" || Array.isArray(value)) {
2956
- throw new TypeError(`Client plugin "${pluginName}" ${location} must be an object`);
2957
- }
2958
- const prototype = Object.getPrototypeOf(value);
2959
- if (prototype !== Object.prototype && prototype !== null) {
2960
- throw new TypeError(`Client plugin "${pluginName}" ${location} must be a plain object`);
2961
- }
2962
- for (const key of Reflect.ownKeys(value)) {
2963
- if (typeof key === "symbol") {
2964
- throw new TypeError(`Client plugin "${pluginName}" ${location} cannot contain symbol keys`);
2965
- }
2966
- if (!allowedKeys.includes(key)) {
2967
- throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
2968
- }
2969
- const descriptor = Object.getOwnPropertyDescriptor(value, key);
2970
- if (!_optionalChain([descriptor, 'optionalAccess', _52 => _52.enumerable])) {
2971
- throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
2972
- }
2973
- if (!("value" in descriptor)) {
2974
- throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} cannot be an accessor`);
2975
- }
2976
- }
2977
- }
2978
- function assertHook(value, pluginName, location) {
2979
- if (value === void 0) return;
2980
- if (typeof value !== "function") {
2981
- throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
2982
- }
2983
- functionSource(value, pluginName, location);
2984
- }
2985
- function serializeClientLifecycle(definition, pluginName) {
2986
- const fields = [];
2987
- pushHook(fields, "setup", definition.setup, pluginName, "client.setup", 2);
2988
- pushHookGroup(fields, "hydration", definition.hydration, HYDRATION_KEYS, pluginName, 2);
2989
- pushHookGroup(fields, "navigation", definition.navigation, NAVIGATION_KEYS, pluginName, 2);
2990
- pushHook(fields, "error", definition.error, pluginName, "client.error", 2);
2991
- pushHook(fields, "performance", definition.performance, pluginName, "client.performance", 2);
2992
- pushHook(fields, "close", definition.close, pluginName, "client.close", 2);
2993
- return fields.length ? `{
2994
- ${fields.join(",\n")}
2995
- }` : "{}";
2996
- }
2997
- function pushHookGroup(fields, groupName, group, keys, pluginName, indent) {
2998
- if (!group) return;
2999
- const hooks = [];
3000
- for (const key of keys) {
3001
- pushHook(hooks, key, group[key], pluginName, `client.${groupName}.${key}`, indent + 2);
3002
- }
3003
- fields.push(
3004
- `${" ".repeat(indent)}${JSON.stringify(groupName)}: {
3005
- ${hooks.join(",\n")}
3006
- ${" ".repeat(indent)}}`
3007
- );
3008
- }
3009
- function pushHook(fields, key, hook, pluginName, location, indent) {
3010
- if (hook === void 0) return;
3011
- fields.push(
3012
- `${" ".repeat(indent)}${JSON.stringify(key)}: ${functionSource(hook, pluginName, location)}`
3013
- );
3014
- }
3015
- function functionSource(value, pluginName, location) {
3016
- if (typeof value !== "function") {
3017
- throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
3018
- }
3019
- const source = Function.prototype.toString.call(value).trim();
3020
- if (!source || source.includes("[native code]")) {
3021
- throw new TypeError(
3022
- `Client plugin "${pluginName}" ${location} must be authored inline and cannot be native or bound`
3023
- );
3024
- }
3025
- if (/^(?:async\s+)?function(?:\s*\*)?(?:\s+|\()/.test(source)) {
3026
- return `(${source})`;
3027
- }
3028
- const method = source.match(/^(async\s+)?(\*\s*)?[$A-Z_a-z][$\w]*\s*(\([\s\S]*)$/);
3029
- if (method) {
3030
- const asyncPrefix = _nullishCoalesce(method[1], () => ( ""));
3031
- const generator = method[2] ? "*" : "";
3032
- return `(${asyncPrefix}function${generator}${method[3]})`;
3033
- }
3034
- if (source.includes("=>")) return `(${source})`;
3035
- throw new TypeError(
3036
- `Client plugin "${pluginName}" ${location} must use a function, method, or arrow function`
3037
- );
3038
- }
3039
- function assertPublicData(value, pluginName) {
3040
- if (value === void 0) return;
3041
- const seen = /* @__PURE__ */ new WeakSet();
3042
- const visit = (current, pathSegments) => {
3043
- if (current === null || typeof current === "string" || typeof current === "boolean") {
3044
- return;
3045
- }
3046
- if (typeof current === "number") {
3047
- if (Number.isFinite(current)) return;
3048
- throwPublicDataError(pluginName, pathSegments, "must be a finite number");
3049
- }
3050
- if (typeof current !== "object") {
3051
- throwPublicDataError(pluginName, pathSegments, `cannot contain ${typeof current} values`);
3052
- }
3053
- if (seen.has(current)) {
3054
- throwPublicDataError(pluginName, pathSegments, "cannot contain circular references");
3055
- }
3056
- seen.add(current);
3057
- if (Array.isArray(current)) {
3058
- for (let index = 0; index < current.length; index += 1) {
3059
- if (!Object.prototype.hasOwnProperty.call(current, index)) {
3060
- throwPublicDataError(
3061
- pluginName,
3062
- [...pathSegments, String(index)],
3063
- "cannot contain sparse array slots"
3064
- );
3065
- }
3066
- visit(current[index], [...pathSegments, String(index)]);
3067
- }
3068
- for (const key of Reflect.ownKeys(current)) {
3069
- if (key === "length" || typeof key === "string" && isArrayIndex(key)) continue;
3070
- throwPublicDataError(
3071
- pluginName,
3072
- pathSegments,
3073
- typeof key === "symbol" ? "cannot contain symbol keys" : `cannot contain non-index array property ${key}`
3074
- );
3075
- }
3076
- seen.delete(current);
3077
- return;
3078
- }
3079
- const prototype = Object.getPrototypeOf(current);
3080
- if (prototype !== Object.prototype && prototype !== null) {
3081
- throwPublicDataError(pluginName, pathSegments, "must contain only plain objects and arrays");
3082
- }
3083
- for (const key of Reflect.ownKeys(current)) {
3084
- if (typeof key === "symbol") {
3085
- throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
3086
- }
3087
- const descriptor = Object.getOwnPropertyDescriptor(current, key);
3088
- if (!_optionalChain([descriptor, 'optionalAccess', _53 => _53.enumerable])) {
3089
- throwPublicDataError(
3090
- pluginName,
3091
- [...pathSegments, key],
3092
- "cannot contain non-enumerable properties"
3093
- );
3094
- }
3095
- if (!("value" in descriptor)) {
3096
- throwPublicDataError(
3097
- pluginName,
3098
- [...pathSegments, key],
3099
- "cannot contain accessor properties"
3100
- );
3101
- }
3102
- visit(descriptor.value, [...pathSegments, key]);
3103
- }
3104
- seen.delete(current);
3105
- };
3106
- visit(value, []);
3107
- }
3108
- function throwPublicDataError(pluginName, pathSegments, message) {
3109
- const location = pathSegments.length ? ` at client.public.${pathSegments.join(".")}` : "";
3110
- throw new TypeError(`Client plugin "${pluginName}"${location} ${message}`);
3111
- }
3112
- function serializePublicData(value) {
3113
- if (value === void 0) return "undefined";
3114
- return `JSON.parse(${JSON.stringify(JSON.stringify(value))})`;
3115
- }
3116
- function serializeOptionalString(value) {
3117
- return value === void 0 ? "undefined" : JSON.stringify(value);
3118
- }
3119
- function isArrayIndex(key) {
3120
- const value = Number(key);
3121
- return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
3122
- }
3123
-
3124
2922
  // src/server/renderer.ts
3125
2923
 
3126
2924
  var _https = require('https'); var https = _interopRequireWildcard(_https);
@@ -3133,8 +2931,8 @@ var _stream = require('stream');
3133
2931
 
3134
2932
 
3135
2933
  function resolveFarmNotFoundComponentPath(config, appDirs) {
3136
- const extensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
3137
- const configuredPath = _optionalChain([config, 'access', _54 => _54.notFound, 'optionalAccess', _55 => _55.component, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
2934
+ const extensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
2935
+ const configuredPath = _optionalChain([config, 'access', _51 => _51.notFound, 'optionalAccess', _52 => _52.component, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
3138
2936
  if (configuredPath) {
3139
2937
  const componentPath = path3.default.isAbsolute(configuredPath) ? path3.default.normalize(configuredPath) : path3.default.resolve(config.root, configuredPath);
3140
2938
  if (!extensions.some((extension) => componentPath.endsWith(extension))) {
@@ -3172,11 +2970,11 @@ function getFarmLayoutKey(pattern, params) {
3172
2970
  );
3173
2971
  }
3174
2972
  function countFarmKeptLayouts(layoutsHeader, layouts, params) {
3175
- const chain = _chunkUJ3R2AH2cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
2973
+ const chain = _chunkUPOYKX4Scjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
3176
2974
  if (chain.length === 0) return 0;
3177
2975
  const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
3178
- if (chain[0] === keys[0]) return _chunkUJ3R2AH2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
3179
- return keys.length > 1 ? 1 + _chunkUJ3R2AH2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
2976
+ if (chain[0] === keys[0]) return _chunkUPOYKX4Scjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
2977
+ return keys.length > 1 ? 1 + _chunkUPOYKX4Scjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
3180
2978
  }
3181
2979
  function createFarmFlushToken() {
3182
2980
  const bytes = new Uint8Array(16);
@@ -3356,8 +3154,8 @@ function redactErrorText(value) {
3356
3154
  return value.replace(BEARER_PATTERN, "$1[REDACTED]").replace(SECRET_VALUE_PATTERN, "$1=[REDACTED]");
3357
3155
  }
3358
3156
  function isPathInsideRoot(root, filePath) {
3359
- const relative3 = path9.relative(root, filePath);
3360
- return relative3 === "" || !relative3.startsWith("..") && !path9.isAbsolute(relative3);
3157
+ const relative3 = path8.relative(root, filePath);
3158
+ return relative3 === "" || !relative3.startsWith("..") && !path8.isAbsolute(relative3);
3361
3159
  }
3362
3160
  function normalizeStackPath(value) {
3363
3161
  const withoutQuery = value.replace(/[?#].*$/, "");
@@ -3374,13 +3172,13 @@ function findStackLocation(stack, root) {
3374
3172
  );
3375
3173
  if (!match) continue;
3376
3174
  const candidate = normalizeStackPath(match[1]);
3377
- if (!candidate || candidate.includes(`${path9.sep}node_modules${path9.sep}`)) continue;
3378
- const absolutePath = path9.resolve(candidate);
3379
- if (!isPathInsideRoot(root, absolutePath) || !fs5.existsSync(absolutePath)) continue;
3380
- const relativePath = path9.relative(root, absolutePath).split(path9.sep).join("/");
3175
+ if (!candidate || candidate.includes(`${path8.sep}node_modules${path8.sep}`)) continue;
3176
+ const absolutePath = path8.resolve(candidate);
3177
+ if (!isPathInsideRoot(root, absolutePath) || !fs4.existsSync(absolutePath)) continue;
3178
+ const relativePath = path8.relative(root, absolutePath).split(path8.sep).join("/");
3381
3179
  return {
3382
3180
  absolutePath,
3383
- displayPath: relativePath || path9.basename(absolutePath),
3181
+ displayPath: relativePath || path8.basename(absolutePath),
3384
3182
  line: Number(match[2]),
3385
3183
  column: Number(match[3])
3386
3184
  };
@@ -3389,7 +3187,7 @@ function findStackLocation(stack, root) {
3389
3187
  }
3390
3188
  function createSourceFrame(location) {
3391
3189
  try {
3392
- const sourceLines = fs5.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3190
+ const sourceLines = fs4.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3393
3191
  if (location.line < 1 || location.line > sourceLines.length) return void 0;
3394
3192
  const start = Math.max(1, location.line - 2);
3395
3193
  const end = Math.min(sourceLines.length, location.line + 2);
@@ -3412,13 +3210,13 @@ function createSourceFrame(location) {
3412
3210
  }
3413
3211
  }
3414
3212
  function sanitizeStack(stack, root) {
3415
- const normalizedRoot = path9.resolve(root);
3213
+ const normalizedRoot = path8.resolve(root);
3416
3214
  return redactErrorText(stack).split(normalizedRoot).join("<project>").replace(/<project>[^\s)]*/g, (segment) => segment.split("\\").join("/")).split("\n").filter((line, index) => index === 0 || !line.includes("node:internal")).slice(0, 14).join("\n");
3417
3215
  }
3418
3216
  function createDefaultErrorDiagnostics(error, root) {
3419
3217
  const normalizedError = error instanceof Error ? error : new Error(typeof error === "string" ? error : "Unknown server rendering error");
3420
3218
  const rawStack = normalizedError.stack || `${normalizedError.name}: ${normalizedError.message}`;
3421
- const location = findStackLocation(rawStack, path9.resolve(root));
3219
+ const location = findStackLocation(rawStack, path8.resolve(root));
3422
3220
  return {
3423
3221
  name: redactErrorText(normalizedError.name || "Error"),
3424
3222
  message: redactErrorText(normalizedError.message || "Unknown server rendering error"),
@@ -3431,7 +3229,7 @@ function createDefaultErrorDiagnostics(error, root) {
3431
3229
  function canBootFarmIslandsClient(config) {
3432
3230
  const docs = config.docs;
3433
3231
  const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
3434
- return _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _58 => _58.experimental, 'optionalAccess', _59 => _59.serverComponents])) === "islands" && !docsEnabled && resolveFarmClientPlugins(config.plugins, config.root).length === 0 && !resolveFarmAppClientEntry(config.root, config.srcDir || "src");
3232
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" && !docsEnabled && _chunkJSOCDYERcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkJSOCDYERcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
3435
3233
  }
3436
3234
 
3437
3235
  // src/server/renderer.ts
@@ -3510,7 +3308,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
3510
3308
  function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
3511
3309
  if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
3512
3310
  warnedSuppressedAsyncHydrationModules.add(modulePath);
3513
- _chunkQMNWKQL4cjs.logger.warn(_chunk7ONGIFYXcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3311
+ _chunkQMNWKQL4cjs.logger.warn(_chunkMZ4CRSY7cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3514
3312
  }
3515
3313
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
3516
3314
  var documentLayouts = /* @__PURE__ */ new WeakMap();
@@ -3541,7 +3339,7 @@ function appendResponseHeader(res, name, value) {
3541
3339
  }
3542
3340
  }
3543
3341
  function requestHeader(req, name) {
3544
- const value = _optionalChain([req, 'access', _60 => _60.headers, 'optionalAccess', _61 => _61[name]]);
3342
+ const value = _optionalChain([req, 'access', _57 => _57.headers, 'optionalAccess', _58 => _58[name]]);
3545
3343
  return Array.isArray(value) ? value[0] : value;
3546
3344
  }
3547
3345
  function appendResponseVary(res, value) {
@@ -3555,7 +3353,7 @@ function appendResponseVary(res, value) {
3555
3353
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
3556
3354
  if (snapshot.routing === "none") return "";
3557
3355
  const url = new URL(requestPath, "http://farm.local");
3558
- return _chunkUJ3R2AH2cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3356
+ return _chunkUPOYKX4Scjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3559
3357
  }
3560
3358
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
3561
3359
  function createPPRRefreshScript() {
@@ -3563,7 +3361,7 @@ function createPPRRefreshScript() {
3563
3361
  }
3564
3362
  function createPreHydrationClickQueueScript() {
3565
3363
  const selector = JSON.stringify(_chunk7KJJ4SBScjs.FARM_ISLAND_REPLAYABLE_SELECTOR);
3566
- return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function hold(event,target,kind){if(!queue.some(function(item){return item.target===target})){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
3364
+ return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function submits(target,kind){return kind==="submit"||!!(target.form&&target.type==="submit")}function hold(event,target,kind){if(!(submits(target,kind)&&queue.some(function(item){return item.target===target}))){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
3567
3365
  }
3568
3366
  function rendererRenderOptions() {
3569
3367
  const nonce = _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, );
@@ -3585,7 +3383,7 @@ function createDocumentFooter(options) {
3585
3383
  }
3586
3384
  function createDeferredHydrationScript(records) {
3587
3385
  return `<script data-farm-refresh-state>window.__FARM_DEFERRED_DATA__=${serializeInlineValue(
3588
- _chunkXQSYOVCWcjs.snapshotDeferredData.call(void 0, records)
3386
+ _chunkDBYNZIIQcjs.snapshotDeferredData.call(void 0, records)
3589
3387
  )};</script>`;
3590
3388
  }
3591
3389
  function toMiddlewareMap(input) {
@@ -3650,12 +3448,12 @@ async function parseRouteModuleProps(routeModule, input) {
3650
3448
  }
3651
3449
  const schemas = routeModule.__farmRouteSchemas;
3652
3450
  const params = parseRouteModuleSchema(
3653
- _optionalChain([schemas, 'optionalAccess', _62 => _62.params]),
3451
+ _optionalChain([schemas, 'optionalAccess', _59 => _59.params]),
3654
3452
  input.props.params,
3655
3453
  "params",
3656
3454
  input.routePath
3657
3455
  );
3658
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _63 => _63.search]), input.search, "search", input.routePath);
3456
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _60 => _60.search]), input.search, "search", input.routePath);
3659
3457
  return {
3660
3458
  ...input.props,
3661
3459
  params,
@@ -3687,7 +3485,7 @@ function createRouteStateProps(input) {
3687
3485
  function readAppPackageIdentity(root) {
3688
3486
  try {
3689
3487
  return JSON.parse(
3690
- fs6.readFileSync(path10.join(root || process.cwd(), "package.json"), "utf8")
3488
+ fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
3691
3489
  );
3692
3490
  } catch (e13) {
3693
3491
  return {};
@@ -3713,11 +3511,11 @@ var ServerRenderer = class {
3713
3511
  } else {
3714
3512
  _chunkXGJVRPYLcjs.uninstallFarmIslandValues.call(void 0, );
3715
3513
  }
3716
- if (_optionalChain([this, 'access', _64 => _64.config, 'access', _65 => _65.notFound, 'optionalAccess', _66 => _66.component, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()])) {
3717
- resolveFarmNotFoundComponentPath(this.config, _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config));
3514
+ if (_optionalChain([this, 'access', _61 => _61.config, 'access', _62 => _62.notFound, 'optionalAccess', _63 => _63.component, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()])) {
3515
+ resolveFarmNotFoundComponentPath(this.config, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config));
3718
3516
  }
3719
- const loaded = _chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
3720
- _chunkRD623KW4cjs.resolveFarmRendererModule.call(void 0,
3517
+ const loaded = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
3518
+ _chunk67MZTLTFcjs.resolveFarmRendererModule.call(void 0,
3721
3519
  this.config.root || process.cwd(),
3722
3520
  this.config.renderer.server
3723
3521
  )
@@ -3731,14 +3529,14 @@ var ServerRenderer = class {
3731
3529
  );
3732
3530
  }
3733
3531
  }
3734
- _chunkRD623KW4cjs.assertFarmRendererStreamingRuntime.call(void 0,
3532
+ _chunk67MZTLTFcjs.assertFarmRendererStreamingRuntime.call(void 0,
3735
3533
  this.config.renderer.name,
3736
3534
  this.config.renderer,
3737
3535
  runtime,
3738
3536
  "node"
3739
3537
  );
3740
3538
  this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
3741
- _optionalChain([this, 'access', _69 => _69.routeManager, 'access', _70 => _70.setRendererRuntime, 'optionalCall', _71 => _71(this.rendererRuntime)]);
3539
+ _optionalChain([this, 'access', _66 => _66.routeManager, 'access', _67 => _67.setRendererRuntime, 'optionalCall', _68 => _68(this.rendererRuntime)]);
3742
3540
  await this.applyRendererAppSetup();
3743
3541
  }
3744
3542
  /**
@@ -3747,7 +3545,7 @@ var ServerRenderer = class {
3747
3545
  * re-applied on the next request without restarting.
3748
3546
  */
3749
3547
  async applyRendererAppSetup() {
3750
- const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0,
3548
+ const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0,
3751
3549
  this.config.root || process.cwd(),
3752
3550
  this.config.renderer
3753
3551
  );
@@ -3795,7 +3593,7 @@ var ServerRenderer = class {
3795
3593
  /// Stylesheets the app imported through JS (fontsource packages, component
3796
3594
  /// CSS) that the document must link alongside globals.css — see #658.
3797
3595
  collectDevStyleHrefs() {
3798
- const graph = _optionalChain([this, 'access', _72 => _72.viteServer, 'optionalAccess', _73 => _73.moduleGraph]);
3596
+ const graph = _optionalChain([this, 'access', _69 => _69.viteServer, 'optionalAccess', _70 => _70.moduleGraph]);
3799
3597
  if (!graph) return [];
3800
3598
  return collectDevStylesheetUrls(
3801
3599
  graph.idToModuleMap.values(),
@@ -3820,7 +3618,7 @@ var ServerRenderer = class {
3820
3618
  "data-farm-layout-boundary": "true",
3821
3619
  "data-farm-layout-pattern": pattern,
3822
3620
  ...segment ? { "data-farm-layout-key": segment.key } : {},
3823
- ..._optionalChain([segment, 'optionalAccess', _74 => _74.kept]) ? { "data-farm-layout-kept": "true" } : {},
3621
+ ..._optionalChain([segment, 'optionalAccess', _71 => _71.kept]) ? { "data-farm-layout-kept": "true" } : {},
3824
3622
  style: { display: "contents" }
3825
3623
  },
3826
3624
  layoutElement
@@ -3846,12 +3644,13 @@ var ServerRenderer = class {
3846
3644
  return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
3847
3645
  }
3848
3646
  async renderElementToCompleteHTML(element, options = {}) {
3849
- const streaming = _chunkRD623KW4cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
3647
+ const streaming = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
3850
3648
  const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
3851
3649
  if (renderToPipeableStream) {
3650
+ const inlineBoundaries = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer);
3852
3651
  return await new Promise((resolve3, reject) => {
3853
3652
  const chunks = [];
3854
- let started = false;
3653
+ let shellReady = false;
3855
3654
  let lateNavigation;
3856
3655
  const writable = new (0, _stream.Writable)({
3857
3656
  write(chunk, _encoding, callback) {
@@ -3866,16 +3665,23 @@ var ServerRenderer = class {
3866
3665
  writable.once("error", reject);
3867
3666
  const stream = renderToPipeableStream(element, {
3868
3667
  nonce: _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, ),
3668
+ formState: _chunkW44X6IC2cjs.getFarmFormState.call(void 0, ),
3669
+ ...inlineBoundaries ? {
3670
+ progressiveChunkSize: Number.MAX_SAFE_INTEGER,
3671
+ onAllReady() {
3672
+ stream.pipe(writable);
3673
+ }
3674
+ } : {},
3869
3675
  onShellReady() {
3870
- started = true;
3871
- stream.pipe(writable);
3676
+ shellReady = true;
3677
+ if (!inlineBoundaries) stream.pipe(writable);
3872
3678
  },
3873
3679
  onShellError(error) {
3874
3680
  reject(error);
3875
3681
  },
3876
3682
  onError(error) {
3877
- if (!started) reject(error);
3878
- else if (options.rejectLateNavigation && lateNavigation === void 0 && (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) || _chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error))) {
3683
+ if (!shellReady) reject(error);
3684
+ else if (lateNavigation === void 0 && (options.rejectLateErrors || options.rejectLateRedirects && _chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) || options.rejectLateNavigation && (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) || _chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)))) {
3879
3685
  lateNavigation = error;
3880
3686
  }
3881
3687
  }
@@ -3887,7 +3693,7 @@ var ServerRenderer = class {
3887
3693
  element,
3888
3694
  rendererRenderOptions()
3889
3695
  );
3890
- return await _chunkRD623KW4cjs.readFarmRendererWebStream.call(void 0, stream);
3696
+ return await _chunk67MZTLTFcjs.readFarmRendererWebStream.call(void 0, stream);
3891
3697
  }
3892
3698
  return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
3893
3699
  }
@@ -3907,7 +3713,7 @@ var ServerRenderer = class {
3907
3713
  }
3908
3714
  /** Islands mode sends large prop values once, keyed by content (RFC 0003). */
3909
3715
  islandValues() {
3910
- return _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _75 => _75.config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.serverComponents])) === "islands";
3716
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _72 => _72.config, 'access', _73 => _73.experimental, 'optionalAccess', _74 => _74.serverComponents])) === "islands";
3911
3717
  }
3912
3718
  /**
3913
3719
  * Render the route tree used by client navigation without producing a second
@@ -3918,7 +3724,7 @@ var ServerRenderer = class {
3918
3724
  await this.initialize();
3919
3725
  if (this.viteServer) await this.applyRendererAppSetup();
3920
3726
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
3921
- _chunkJGAE5XPLcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
3727
+ _chunk23VJEGKCcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
3922
3728
  let element = this.rendererRuntime.createElement(input.PageComponent, input.pageProps);
3923
3729
  if (input.LoadingComponent) {
3924
3730
  element = this.rendererRuntime.createElement(
@@ -3956,7 +3762,7 @@ var ServerRenderer = class {
3956
3762
  continue;
3957
3763
  }
3958
3764
  let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
3959
- slotElement = this.wrapClientGraph(slotElement);
3765
+ if (slot.shouldHydrate !== false) slotElement = this.wrapClientGraph(slotElement);
3960
3766
  slotProps[slot.name] = this.rendererRuntime.createElement(
3961
3767
  "div",
3962
3768
  {
@@ -3977,12 +3783,14 @@ var ServerRenderer = class {
3977
3783
  if (input.layoutShouldHydrate) {
3978
3784
  element = this.wrapClientGraph(element);
3979
3785
  }
3980
- return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
3786
+ return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element), {
3787
+ rejectLateRedirects: true
3788
+ });
3981
3789
  }
3982
3790
  async runWithRequestContext(request2, fn) {
3983
- return _chunkHNAISJFDcjs._runWithCurrentRequest.call(void 0,
3791
+ return _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0,
3984
3792
  request2,
3985
- () => _optionalChain([this, 'access', _78 => _78.i18nRuntime, 'optionalAccess', _79 => _79.config, 'access', _80 => _80.enabled]) ? _chunkRVGLYMJMcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
3793
+ () => _optionalChain([this, 'access', _75 => _75.i18nRuntime, 'optionalAccess', _76 => _76.config, 'access', _77 => _77.enabled]) ? _chunkRVGLYMJMcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
3986
3794
  redirect: false
3987
3795
  }) : fn()
3988
3796
  );
@@ -3994,10 +3802,10 @@ var ServerRenderer = class {
3994
3802
  * Load SSG manifest from build output
3995
3803
  */
3996
3804
  loadSSGManifest() {
3997
- const manifestPath = path10.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
3805
+ const manifestPath = path9.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
3998
3806
  let content;
3999
3807
  try {
4000
- content = fs6.readFileSync(manifestPath, "utf-8");
3808
+ content = fs5.readFileSync(manifestPath, "utf-8");
4001
3809
  } catch (error) {
4002
3810
  if (error.code === "ENOENT") {
4003
3811
  return;
@@ -4013,7 +3821,7 @@ var ServerRenderer = class {
4013
3821
  * Check if a path should be served from SSG cache
4014
3822
  */
4015
3823
  async shouldServeSSG(pathname) {
4016
- const ssgPage = _chunkX4K7TYN6cjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
3824
+ const ssgPage = _chunkQOGIZKSOcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
4017
3825
  if (!ssgPage) return null;
4018
3826
  const cached = await this.getCachedSSGPage(pathname);
4019
3827
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -4130,7 +3938,7 @@ var ServerRenderer = class {
4130
3938
  setImmediate(async () => {
4131
3939
  try {
4132
3940
  const mod = await this.routeManager.loadRouteModule(page.filePath);
4133
- if (!_optionalChain([mod, 'optionalAccess', _81 => _81.default])) return;
3941
+ if (!_optionalChain([mod, 'optionalAccess', _78 => _78.default])) return;
4134
3942
  const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
4135
3943
  const layoutModules = await Promise.all(
4136
3944
  layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
@@ -4144,7 +3952,7 @@ var ServerRenderer = class {
4144
3952
  };
4145
3953
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4146
3954
  const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
4147
- (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _82 => _82.pattern])
3955
+ (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _79 => _79.pattern])
4148
3956
  ), () => ( {
4149
3957
  shouldHydrate: false,
4150
3958
  islandStrategy: null
@@ -4216,10 +4024,10 @@ var ServerRenderer = class {
4216
4024
  return true;
4217
4025
  }
4218
4026
  try {
4219
- const htmlPath = page.urlPath === "/" ? path10.join(this.config.root, this.config.outDir, "client", "index.html") : path10.join(this.config.root, this.config.outDir, "client", page.urlPath + ".html");
4220
- if (fs6.existsSync(htmlPath)) {
4221
- const stat = fs6.statSync(htmlPath);
4222
- const html = fs6.readFileSync(htmlPath, "utf-8");
4027
+ const htmlPath = page.urlPath === "/" ? path9.join(this.config.root, this.config.outDir, "client", "index.html") : path9.join(this.config.root, this.config.outDir, "client", page.urlPath + ".html");
4028
+ if (fs5.existsSync(htmlPath)) {
4029
+ const stat = fs5.statSync(htmlPath);
4030
+ const html = fs5.readFileSync(htmlPath, "utf-8");
4223
4031
  await this.cacheSSGPage(page, html, {
4224
4032
  document: true,
4225
4033
  createdAt: stat.mtimeMs
@@ -4246,18 +4054,18 @@ var ServerRenderer = class {
4246
4054
  await this.initialize();
4247
4055
  if (this.viteServer) await this.applyRendererAppSetup();
4248
4056
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
4249
- _chunkJGAE5XPLcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4057
+ _chunk23VJEGKCcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4250
4058
  const cspNonce = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, this.security);
4251
4059
  if (cspNonce) {
4252
4060
  req.__FARM_CSP_NONCE__ = cspNonce;
4253
4061
  const header = _chunk6JHZPB52cjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
4254
4062
  res.setHeader(header.key, header.value);
4255
4063
  }
4256
- const request2 = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4257
- trustProxy: _optionalChain([this, 'access', _83 => _83.config, 'access', _84 => _84.server, 'optionalAccess', _85 => _85.trustProxy])
4064
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4065
+ trustProxy: _optionalChain([this, 'access', _80 => _80.config, 'access', _81 => _81.server, 'optionalAccess', _82 => _82.trustProxy])
4258
4066
  });
4259
4067
  const runtime = this.i18nRuntime;
4260
- if (_optionalChain([runtime, 'optionalAccess', _86 => _86.config, 'access', _87 => _87.enabled])) {
4068
+ if (_optionalChain([runtime, 'optionalAccess', _83 => _83.config, 'access', _84 => _84.enabled])) {
4261
4069
  const resolution = runtime.resolveRequest(request2);
4262
4070
  const varyHeaders = _chunkVOQ7XZZTcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4263
4071
  for (const header of varyHeaders) appendResponseVary(res, header);
@@ -4276,7 +4084,7 @@ var ServerRenderer = class {
4276
4084
  return;
4277
4085
  }
4278
4086
  }
4279
- return _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
4087
+ return _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
4280
4088
  cspNonce,
4281
4089
  () => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
4282
4090
  );
@@ -4303,7 +4111,7 @@ var ServerRenderer = class {
4303
4111
  });
4304
4112
  };
4305
4113
  try {
4306
- const url = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _88 => _88.config, 'access', _89 => _89.server, 'optionalAccess', _90 => _90.trustProxy]) });
4114
+ const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _85 => _85.config, 'access', _86 => _86.server, 'optionalAccess', _87 => _87.trustProxy]) });
4307
4115
  pathname = url.pathname;
4308
4116
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
4309
4117
  searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -4313,18 +4121,19 @@ var ServerRenderer = class {
4313
4121
  completeRender(res.statusCode || 200, pathname);
4314
4122
  return;
4315
4123
  }
4316
- const generatedLlmsKind = this.getGeneratedLlmsKind(pathname);
4124
+ const routePathname = this.routeManager.toRoutePathname(pathname);
4125
+ const generatedLlmsKind = this.getGeneratedLlmsKind(routePathname);
4317
4126
  if (generatedLlmsKind) {
4318
4127
  await this.renderGeneratedLlmsTxt(req, res, generatedLlmsKind);
4319
4128
  completeRender(res.statusCode || 200, pathname);
4320
4129
  return;
4321
4130
  }
4322
- if (pathname === "/robots.txt" && this.getAgentCrawlers().enabled) {
4131
+ if (routePathname === "/robots.txt" && this.getAgentCrawlers().enabled) {
4323
4132
  await this.renderGeneratedRobotsTxt(req, res);
4324
4133
  completeRender(res.statusCode || 200, pathname);
4325
4134
  return;
4326
4135
  }
4327
- if (pathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
4136
+ if (routePathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
4328
4137
  await this.renderGeneratedSitemap(req, res);
4329
4138
  completeRender(res.statusCode || 200, pathname);
4330
4139
  return;
@@ -4342,7 +4151,7 @@ var ServerRenderer = class {
4342
4151
  this.applyDeploymentHeaders(req, res);
4343
4152
  const match = this.routeManager.matchRoute(pathname);
4344
4153
  if (match.route) {
4345
- const redirectLocation = _chunkJGAE5XPLcjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
4154
+ const redirectLocation = _chunk23VJEGKCcjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
4346
4155
  if (redirectLocation) {
4347
4156
  res.statusCode = 308;
4348
4157
  res.setHeader("Location", redirectLocation);
@@ -4366,7 +4175,7 @@ var ServerRenderer = class {
4366
4175
  layouts = match.layouts;
4367
4176
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
4368
4177
  if (!route) {
4369
- if (_chunkY5TOT5F6cjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4178
+ if (_chunkX3MHKLCOcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4370
4179
  await this.renderDefaultMCP(req, res);
4371
4180
  completeRender(res.statusCode || 200, pathname);
4372
4181
  return;
@@ -4383,17 +4192,29 @@ var ServerRenderer = class {
4383
4192
  params
4384
4193
  });
4385
4194
  let actionRequest;
4386
- if (req.method === "POST" && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _91 => _91.config, 'access', _92 => _92.experimental, 'optionalAccess', _93 => _93.serverComponents])) === "islands") {
4195
+ if (req.method === "POST" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _88 => _88.config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.serverComponents])) === "islands") {
4387
4196
  await Promise.all([
4388
4197
  this.routeManager.loadRouteModule(route.modulePath),
4389
4198
  ...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
4390
4199
  ]);
4391
- actionRequest = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4392
- trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy])
4200
+ actionRequest = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4201
+ trustProxy: _optionalChain([this, 'access', _91 => _91.config, 'access', _92 => _92.server, 'optionalAccess', _93 => _93.trustProxy])
4393
4202
  });
4394
- const actionResponse = await _chunkCLFEQGETcjs.handleFarmFormActionRequest.call(void 0,
4395
- actionRequest,
4396
- _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, this.config.serverActions)
4203
+ const formActionRequest = actionRequest;
4204
+ const actionResponse = await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0,
4205
+ toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
4206
+ () => _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0,
4207
+ toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
4208
+ () => _chunkW44X6IC2cjs.handleFarmFormActionRequest.call(void 0,
4209
+ formActionRequest,
4210
+ _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, this.config.serverActions),
4211
+ // Before a rewrite, the URL the browser posted to.
4212
+ new URL(
4213
+ _nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/")),
4214
+ formActionRequest.url
4215
+ ).href
4216
+ )
4217
+ )
4397
4218
  );
4398
4219
  if (actionResponse) {
4399
4220
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, actionResponse);
@@ -4408,8 +4229,8 @@ var ServerRenderer = class {
4408
4229
  pluginExposedContext = _chunkJYT7AN37cjs.getRequestContextSnapshot.call(void 0, req, {
4409
4230
  exposedOnly: true
4410
4231
  });
4411
- const currentRequest = _nullishCoalesce(actionRequest, () => ( _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4412
- trustProxy: _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.server, 'optionalAccess', _99 => _99.trustProxy])
4232
+ const currentRequest = _nullishCoalesce(actionRequest, () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4233
+ trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy])
4413
4234
  })));
4414
4235
  const routeContext = await this.resolveRouteContext({
4415
4236
  request: currentRequest,
@@ -4451,11 +4272,11 @@ var ServerRenderer = class {
4451
4272
  searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
4452
4273
  error
4453
4274
  };
4454
- if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _100 => _100.notFound])) {
4275
+ if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _97 => _97.notFound])) {
4455
4276
  res.statusCode = 404;
4456
4277
  PageComponent = programmaticRouteComponents.notFound;
4457
4278
  pageProps = routeStateProps;
4458
- } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _101 => _101.error])) {
4279
+ } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _98 => _98.error])) {
4459
4280
  res.statusCode = 500;
4460
4281
  PageComponent = programmaticRouteComponents.error;
4461
4282
  pageProps = routeStateProps;
@@ -4463,10 +4284,10 @@ var ServerRenderer = class {
4463
4284
  throw error;
4464
4285
  }
4465
4286
  }
4466
- const renderingConfig = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0,
4287
+ const renderingConfig = await _chunkQOGIZKSOcjs.resolveRouteRenderingConfigFromFile.call(void 0,
4467
4288
  routeModule,
4468
4289
  route.modulePath,
4469
- { experimentalPPR: _optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.ppr]) === true }
4290
+ { experimentalPPR: _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.ppr]) === true }
4470
4291
  );
4471
4292
  const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
4472
4293
  const islandsNavigationRequest = Boolean(
@@ -4477,7 +4298,7 @@ var ServerRenderer = class {
4477
4298
  const pprShellOptions = canCachePPRShell ? {
4478
4299
  pathname,
4479
4300
  search: url.search,
4480
- locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _105 => _105.locale]), () => ( "")),
4301
+ locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _102 => _102.locale]), () => ( "")),
4481
4302
  origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
4482
4303
  revalidate: renderingConfig.revalidate
4483
4304
  } : void 0;
@@ -4527,7 +4348,7 @@ var ServerRenderer = class {
4527
4348
  });
4528
4349
  }
4529
4350
  const outerRequest = _chunk3BIASUGRcjs._peekCurrentRequest.call(void 0, );
4530
- const countRequestReads = () => (outerRequest ? _chunkHNAISJFDcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkHNAISJFDcjs._getRequestReadCount.call(void 0, currentRequest);
4351
+ const countRequestReads = () => (outerRequest ? _chunkHDPT6OYEcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkHDPT6OYEcjs._getRequestReadCount.call(void 0, currentRequest);
4531
4352
  const requestReadsBeforeRender = countRequestReads();
4532
4353
  let LoadingFallbackComponent = null;
4533
4354
  if (loadingBoundaryEntry) {
@@ -4549,7 +4370,7 @@ var ServerRenderer = class {
4549
4370
  const routeManifestEntry = routeManifest.routes.find(
4550
4371
  (entry) => entry.pattern === route.pattern
4551
4372
  );
4552
- const moduleMetadata = routeManifestEntry || _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4373
+ const moduleMetadata = routeManifestEntry || _chunkMZ4CRSY7cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4553
4374
  const isClientComponent = moduleMetadata.isClientComponent;
4554
4375
  const renderedRouteSlots = await Promise.all(
4555
4376
  routeSlots.map(async (slot) => {
@@ -4600,20 +4421,20 @@ var ServerRenderer = class {
4600
4421
  if (moduleMetadata.suppressedAsyncHydration) {
4601
4422
  warnSuppressedAsyncHydrationOnce(
4602
4423
  route.modulePath,
4603
- _optionalChain([routeManifestEntry, 'optionalAccess', _106 => _106.suppressedAsyncHydrationReason])
4424
+ _optionalChain([routeManifestEntry, 'optionalAccess', _103 => _103.suppressedAsyncHydrationReason])
4604
4425
  );
4605
4426
  }
4606
4427
  const layoutHydrationMetadata = layouts.map((layout) => {
4607
4428
  const manifestEntry = routeManifest.layouts.find(
4608
4429
  (entry) => entry.pattern === layout.pattern
4609
4430
  );
4610
- if (_optionalChain([manifestEntry, 'optionalAccess', _107 => _107.suppressedAsyncHydration])) {
4431
+ if (_optionalChain([manifestEntry, 'optionalAccess', _104 => _104.suppressedAsyncHydration])) {
4611
4432
  warnSuppressedAsyncHydrationOnce(
4612
4433
  layout.modulePath,
4613
4434
  manifestEntry.suppressedAsyncHydrationReason
4614
4435
  );
4615
4436
  }
4616
- if (typeof _optionalChain([manifestEntry, 'optionalAccess', _108 => _108.shouldHydrate]) === "boolean") {
4437
+ if (typeof _optionalChain([manifestEntry, 'optionalAccess', _105 => _105.shouldHydrate]) === "boolean") {
4617
4438
  return {
4618
4439
  isClientComponent: manifestEntry.isClientComponent === true,
4619
4440
  shouldHydrate: manifestEntry.shouldHydrate,
@@ -4634,11 +4455,11 @@ var ServerRenderer = class {
4634
4455
  const clientLayouts = layouts.map((layout, index) => ({
4635
4456
  pattern: layout.pattern,
4636
4457
  modulePath: _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
4637
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _109 => _109[index], 'optionalAccess', _110 => _110.shouldHydrate]) === true,
4638
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _111 => _111[index], 'optionalAccess', _112 => _112.islandStrategy]), () => ( null)),
4639
- ..._optionalChain([layoutHydrationMetadata, 'access', _113 => _113[index], 'optionalAccess', _114 => _114.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4458
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _106 => _106[index], 'optionalAccess', _107 => _107.shouldHydrate]) === true,
4459
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _108 => _108[index], 'optionalAccess', _109 => _109.islandStrategy]), () => ( null)),
4460
+ ..._optionalChain([layoutHydrationMetadata, 'access', _110 => _110[index], 'optionalAccess', _111 => _111.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4640
4461
  // Islands mode: the browser rebuilds this layout from its tree, not its module.
4641
- ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _115 => _115[index], 'optionalAccess', _116 => _116.serverTree]) === true ? { serverTree: true } : {}
4462
+ ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _112 => _112[index], 'optionalAccess', _113 => _113.serverTree]) === true ? { serverTree: true } : {}
4642
4463
  }));
4643
4464
  const hydrationStrategies = [
4644
4465
  ...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
@@ -4652,9 +4473,9 @@ var ServerRenderer = class {
4652
4473
  layouts.map((layout, index) => ({
4653
4474
  pattern: layout.pattern,
4654
4475
  modulePath: layout.modulePath,
4655
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _117 => _117[index], 'optionalAccess', _118 => _118.shouldHydrate]) === true,
4656
- hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _119 => _119[index], 'optionalAccess', _120 => _120.hasIsolatedClientBoundaries]) === true,
4657
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _121 => _121[index], 'optionalAccess', _122 => _122.islandStrategy]), () => ( null))
4476
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _114 => _114[index], 'optionalAccess', _115 => _115.shouldHydrate]) === true,
4477
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _116 => _116[index], 'optionalAccess', _117 => _117.hasIsolatedClientBoundaries]) === true,
4478
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.islandStrategy]), () => ( null))
4658
4479
  })),
4659
4480
  this.config.root || process.cwd(),
4660
4481
  true
@@ -4662,7 +4483,7 @@ var ServerRenderer = class {
4662
4483
  const hasHydratableRouteSlots = renderedRouteSlots.some(
4663
4484
  (slot) => slot.isClientComponent || slot.shouldHydrate
4664
4485
  );
4665
- const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _123 => _123.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4486
+ const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _120 => _120.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4666
4487
  req.__FARM_PAGE_PATH__ = route.modulePath;
4667
4488
  req.__FARM_ROUTE__ = pathname;
4668
4489
  req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
@@ -4675,7 +4496,7 @@ var ServerRenderer = class {
4675
4496
  req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
4676
4497
  req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
4677
4498
  req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
4678
- req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _124 => _124.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4499
+ req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _121 => _121.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4679
4500
  req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
4680
4501
  name: slot.name,
4681
4502
  ownerPattern: slot.ownerPattern,
@@ -4724,9 +4545,9 @@ var ServerRenderer = class {
4724
4545
  const middlewareDataForContext = middlewareMap;
4725
4546
  await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
4726
4547
  await _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
4727
- await _chunkHNAISJFDcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
4548
+ await _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
4728
4549
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4729
- if (LoadingFallbackComponent) {
4550
+ if (LoadingFallbackComponent && !islandsNavigationRequest) {
4730
4551
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
4731
4552
  ...createRouteStateProps({
4732
4553
  params,
@@ -4747,7 +4568,7 @@ var ServerRenderer = class {
4747
4568
  } else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
4748
4569
  pageElement = await this.isolateServerPage(
4749
4570
  pageElement,
4750
- _optionalChain([routeManifestEntry, 'optionalAccess', _125 => _125.serverTree]) === true
4571
+ _optionalChain([routeManifestEntry, 'optionalAccess', _122 => _122.serverTree]) === true
4751
4572
  );
4752
4573
  }
4753
4574
  pageElement = this.createPageBoundary(pageElement, {
@@ -4757,7 +4578,27 @@ var ServerRenderer = class {
4757
4578
  });
4758
4579
  const islandsSegments = Boolean(islands && this.islandValues());
4759
4580
  const keptLayoutCount = islandsSegments && !renderingConfig.ssg && !shouldHydrateLayout && renderedRouteSlots.length === 0 ? countFarmKeptLayouts(requestHeader(req, "f-layouts"), layouts, params) : 0;
4760
- const keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
4581
+ let keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
4582
+ if (keptLayouts > 0) {
4583
+ let keptElement = null;
4584
+ for (let i = keptLayouts - 1; i >= 0; i--) {
4585
+ const KeptLayout = _optionalChain([layoutModules, 'access', _123 => _123[i], 'optionalAccess', _124 => _124.default]);
4586
+ if (KeptLayout) {
4587
+ keptElement = this.rendererRuntime.createElement(KeptLayout, {
4588
+ children: keptElement,
4589
+ params
4590
+ });
4591
+ }
4592
+ }
4593
+ try {
4594
+ await this.renderElementToCompleteHTML(
4595
+ await this.wrapWithIntegrationProviders(keptElement),
4596
+ { rejectLateErrors: true }
4597
+ );
4598
+ } catch (e14) {
4599
+ keptLayouts = 0;
4600
+ }
4601
+ }
4761
4602
  let wrappedElement = pageElement;
4762
4603
  for (let i = layoutModules.length - 1; i >= 0; i--) {
4763
4604
  const layoutModule = layoutModules[i];
@@ -4778,7 +4619,7 @@ var ServerRenderer = class {
4778
4619
  slot.module.default,
4779
4620
  slot.props
4780
4621
  );
4781
- slotElement = this.wrapClientGraph(slotElement);
4622
+ if (slot.shouldHydrate) slotElement = this.wrapClientGraph(slotElement);
4782
4623
  slotElement = this.rendererRuntime.createElement(
4783
4624
  "div",
4784
4625
  {
@@ -4790,7 +4631,7 @@ var ServerRenderer = class {
4790
4631
  );
4791
4632
  slotProps[slot.name] = slotElement;
4792
4633
  }
4793
- wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _126 => _126[i], 'optionalAccess', _127 => _127.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4634
+ wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _125 => _125[i], 'optionalAccess', _126 => _126.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4794
4635
  LayoutComponent,
4795
4636
  { params },
4796
4637
  { children: wrappedElement, ...slotProps },
@@ -4925,7 +4766,7 @@ var ServerRenderer = class {
4925
4766
  }
4926
4767
  }
4927
4768
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
4928
- const errorStatus = _chunkUJ3R2AH2cjs.resolveDefaultErrorStatus.call(void 0, error);
4769
+ const errorStatus = _chunkUPOYKX4Scjs.resolveDefaultErrorStatus.call(void 0, error);
4929
4770
  if (pprRefreshRoute) {
4930
4771
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4931
4772
  type: "ppr.refresh.error",
@@ -4961,32 +4802,32 @@ var ServerRenderer = class {
4961
4802
  }
4962
4803
  }
4963
4804
  async wrapWithIntegrationProviders(element) {
4964
- const providers = _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, this.config.integrations);
4805
+ const providers = _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, this.config.integrations);
4965
4806
  let wrapped = element;
4966
4807
  for (let i = providers.length - 1; i >= 0; i--) {
4967
4808
  const provider = providers[i];
4968
4809
  if (provider.component || provider.type === "clerk") {
4969
- const rendererCapabilities = _chunkRD623KW4cjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
4810
+ const rendererCapabilities = _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
4970
4811
  if (!rendererCapabilities.functionComponents) {
4971
4812
  throw new Error(
4972
- `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _128 => _128.config, 'access', _129 => _129.renderer, 'optionalAccess', _130 => _130.name]), () => ( "the configured renderer"))}\` cannot.`
4813
+ `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _127 => _127.config, 'access', _128 => _128.renderer, 'optionalAccess', _129 => _129.name]), () => ( "the configured renderer"))}\` cannot.`
4973
4814
  );
4974
4815
  }
4975
- if (provider.type === "clerk" && !_chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer)) {
4816
+ if (provider.type === "clerk" && !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) {
4976
4817
  throw new Error(
4977
4818
  `Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
4978
4819
  );
4979
4820
  }
4980
4821
  let ProviderComponent;
4981
4822
  let providerSourceModule;
4982
- if (_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4823
+ if (_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4983
4824
  providerSourceModule = provider.component.module;
4984
4825
  const providerModuleId = provider.component.module.startsWith(".") ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0,
4985
- path10.resolve(this.config.root, provider.component.module),
4826
+ path9.resolve(this.config.root, provider.component.module),
4986
4827
  this.config.root
4987
4828
  ) : provider.component.module;
4988
4829
  const providerModule = this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
4989
- provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path10.resolve(this.config.root, provider.component.module)).href : provider.component.module
4830
+ provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
4990
4831
  );
4991
4832
  ProviderComponent = providerModule[provider.component.export || "default"];
4992
4833
  } else if (typeof provider.component === "function") {
@@ -5008,7 +4849,7 @@ var ServerRenderer = class {
5008
4849
  }
5009
4850
  if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
5010
4851
  _nullishCoalesce(providerSourceModule, () => ( "")),
5011
- _chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _131 => _131.config, 'access', _132 => _132.renderer, 'optionalAccess', _133 => _133.componentExtensions]))
4852
+ _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _130 => _130.config, 'access', _131 => _131.renderer, 'optionalAccess', _132 => _132.componentExtensions]))
5012
4853
  )) {
5013
4854
  ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
5014
4855
  }
@@ -5077,7 +4918,9 @@ var ServerRenderer = class {
5077
4918
  );
5078
4919
  metadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
5079
4920
  metadata,
5080
- _chunk2C5L5RPMcjs.getFarmMarkdownAlternatePath.call(void 0, _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
4921
+ _chunkFT6KJHS3cjs.getFarmMarkdownAlternatePath.call(void 0, _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
4922
+ routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
4923
+ })
5081
4924
  );
5082
4925
  return metadata;
5083
4926
  }
@@ -5134,8 +4977,8 @@ var ServerRenderer = class {
5134
4977
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
5135
4978
  );
5136
4979
  }
5137
- const request2 = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5138
- trustProxy: _optionalChain([this, 'access', _134 => _134.config, 'access', _135 => _135.server, 'optionalAccess', _136 => _136.trustProxy])
4980
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4981
+ trustProxy: _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.server, 'optionalAccess', _135 => _135.trustProxy])
5139
4982
  });
5140
4983
  const url = new URL(request2.url);
5141
4984
  const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
@@ -5149,11 +4992,11 @@ var ServerRenderer = class {
5149
4992
  path: match.routePath,
5150
4993
  ...llmsContext
5151
4994
  }) : routeModule.default;
5152
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkFJWN7RV4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
5153
- origin: url.origin,
4995
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkQO43L7Z4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
4996
+ origin: await this.getAgentOrigin(request2),
5154
4997
  readMarkdown: llmsContext.markdown
5155
4998
  }) : value;
5156
- const response = _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
4999
+ const response = _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5157
5000
  method,
5158
5001
  request: request2
5159
5002
  });
@@ -5171,25 +5014,25 @@ var ServerRenderer = class {
5171
5014
  }
5172
5015
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
5173
5016
  getGeneratedLlmsKind(pathname) {
5174
- const config = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _137 => _137.config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.llmsTxt]));
5017
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.agent, 'optionalAccess', _138 => _138.llmsTxt]));
5175
5018
  if (!config.enabled) return null;
5176
5019
  if (pathname === "/llms.txt") return "llms";
5177
5020
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
5178
5021
  }
5179
5022
  async renderGeneratedLlmsTxt(req, res, kind) {
5180
5023
  try {
5181
- const request2 = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5182
- trustProxy: _optionalChain([this, 'access', _140 => _140.config, 'access', _141 => _141.server, 'optionalAccess', _142 => _142.trustProxy])
5024
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5025
+ trustProxy: _optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.server, 'optionalAccess', _141 => _141.trustProxy])
5183
5026
  });
5184
- const config = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _143 => _143.config, 'access', _144 => _144.agent, 'optionalAccess', _145 => _145.llmsTxt]));
5027
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt]));
5185
5028
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
5186
- const body = kind === "llms-full" ? await _chunkFJWN7RV4cjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5187
- origin: new URL(request2.url).origin,
5029
+ const body = kind === "llms-full" ? await _chunkQO43L7Z4cjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5030
+ origin: await this.getAgentOrigin(request2),
5188
5031
  readMarkdown: context.markdown
5189
5032
  }) : context.defaults;
5190
5033
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5191
5034
  res,
5192
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0,
5035
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0,
5193
5036
  kind,
5194
5037
  body,
5195
5038
  { revalidate: config.revalidate },
@@ -5208,23 +5051,23 @@ var ServerRenderer = class {
5208
5051
  }
5209
5052
  }
5210
5053
  getAgentCrawlers() {
5211
- return _chunkO6L3YYPMcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _146 => _146.config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.crawlers]));
5054
+ return _chunk4E57QHPWcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.agent, 'optionalAccess', _147 => _147.crawlers]));
5212
5055
  }
5213
5056
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
5214
5057
  async renderGeneratedRobotsTxt(req, res) {
5215
5058
  try {
5216
- const sitemapPath = _optionalChain([this, 'access', _149 => _149.routeManager, 'access', _150 => _150.matchMetadataRoute, 'call', _151 => _151("/sitemap.xml"), 'optionalAccess', _152 => _152.metadata, 'access', _153 => _153.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5059
+ const sitemapPath = _optionalChain([this, 'access', _148 => _148.routeManager, 'access', _149 => _149.matchMetadataRoute, 'call', _150 => _150("/sitemap.xml"), 'optionalAccess', _151 => _151.metadata, 'access', _152 => _152.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5217
5060
  const rootLayout = this.routeManager.getLayouts().get("/");
5218
5061
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5219
- const robots = _chunkO6L3YYPMcjs.createFarmAgentRobots.call(void 0, {
5062
+ const robots = _chunk4E57QHPWcjs.createFarmAgentRobots.call(void 0, {
5220
5063
  crawlers: this.getAgentCrawlers(),
5221
5064
  sitemapPath,
5222
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _154 => _154.metadataBase]),
5065
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _153 => _153.metadataBase]),
5223
5066
  basePath: this.config.basePath
5224
5067
  });
5225
5068
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5226
5069
  res,
5227
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5070
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5228
5071
  );
5229
5072
  } catch (error) {
5230
5073
  _chunkQMNWKQL4cjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -5238,13 +5081,13 @@ var ServerRenderer = class {
5238
5081
  }
5239
5082
  }
5240
5083
  getAgentSitemap() {
5241
- return _chunkO6L3YYPMcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _155 => _155.config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.sitemap]));
5084
+ return _chunk4E57QHPWcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _154 => _154.config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.sitemap]));
5242
5085
  }
5243
5086
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
5244
5087
  async renderGeneratedSitemap(req, res) {
5245
5088
  try {
5246
- const request2 = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5247
- trustProxy: _optionalChain([this, 'access', _158 => _158.config, 'access', _159 => _159.server, 'optionalAccess', _160 => _160.trustProxy])
5089
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5090
+ trustProxy: _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.server, 'optionalAccess', _159 => _159.trustProxy])
5248
5091
  });
5249
5092
  const sources = await Promise.all(
5250
5093
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5253,22 +5096,26 @@ var ServerRenderer = class {
5253
5096
  _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
5254
5097
  return void 0;
5255
5098
  }),
5256
- fs6.promises.stat(route.modulePath).catch(() => void 0)
5099
+ fs5.promises.stat(route.modulePath).catch(() => void 0)
5257
5100
  ]);
5101
+ if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _160 => _160.metadata]))) return null;
5258
5102
  return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _161 => _161.mtime, 'access', _162 => _162.toISOString, 'call', _163 => _163()]) };
5259
5103
  })
5260
5104
  );
5261
5105
  const rootLayout = this.routeManager.getLayouts().get("/");
5262
5106
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5263
- const sitemap = _chunkO6L3YYPMcjs.createFarmDefaultSitemap.call(void 0, sources, {
5264
- origin: new URL(request2.url).origin,
5265
- config: this.getAgentSitemap(),
5266
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _164 => _164.metadataBase]),
5267
- basePath: this.config.basePath
5268
- });
5107
+ const sitemap = _chunk4E57QHPWcjs.createFarmDefaultSitemap.call(void 0,
5108
+ sources.filter((source) => source !== null),
5109
+ {
5110
+ origin: new URL(request2.url).origin,
5111
+ config: this.getAgentSitemap(),
5112
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _164 => _164.metadataBase]),
5113
+ basePath: this.config.basePath
5114
+ }
5115
+ );
5269
5116
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5270
5117
  res,
5271
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5118
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5272
5119
  );
5273
5120
  } catch (error) {
5274
5121
  _chunkQMNWKQL4cjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -5297,8 +5144,23 @@ var ServerRenderer = class {
5297
5144
  getAgentListedRoutes() {
5298
5145
  const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _165 => _165.middlewareRoutes, 'optionalCall', _166 => _166()]), () => ( [])) };
5299
5146
  return [...this.routeManager.getRoutes()].filter(
5300
- ([pattern]) => !pattern.includes("[") && !_chunkUJ3R2AH2cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5147
+ ([pattern]) => !pattern.includes("[") && !_chunkUPOYKX4Scjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5148
+ );
5149
+ }
5150
+ /**
5151
+ * Whether a listed page renders noindex: its own `robots`, else its nearest layout's, as
5152
+ * the production server decides. A layout that fails to load is surfaced by the page.
5153
+ */
5154
+ async isAgentPageNoIndex(pattern, metadata) {
5155
+ const layoutMetadata = await Promise.all(
5156
+ this.routeManager.getRouteLayouts(pattern).map(
5157
+ (layout) => this.routeManager.loadLayoutModule(layout.modulePath).then(
5158
+ (module) => module.metadata,
5159
+ () => void 0
5160
+ )
5161
+ )
5301
5162
  );
5163
+ return _chunkQO43L7Z4cjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
5302
5164
  }
5303
5165
  /**
5304
5166
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
@@ -5306,38 +5168,40 @@ var ServerRenderer = class {
5306
5168
  * or a registered server such as the docs engine's. Production applies the same rules.
5307
5169
  */
5308
5170
  getDefaultMCPServer() {
5309
- if (_optionalChain([this, 'access', _167 => _167.config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.mcp]) !== true || _chunkY5TOT5F6cjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
5171
+ if (_optionalChain([this, 'access', _167 => _167.config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.mcp]) !== true || _chunkX3MHKLCOcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
5310
5172
  if (_optionalChain([this, 'access', _170 => _170.apiRouteExists, 'optionalCall', _171 => _171("/api/mcp")])) return void 0;
5311
- if (this.routeManager.matchRoute(_chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5312
- _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkY5TOT5F6cjs.createFarmDefaultMCPServer.call(void 0,
5173
+ if (this.routeManager.matchRoute(_chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5174
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkX3MHKLCOcjs.createFarmDefaultMCPServer.call(void 0,
5313
5175
  readAppPackageIdentity(this.config.root),
5314
- _chunkBIF5MLTHcjs.FARM_VERSION
5176
+ _chunkSQ6IWJ3Hcjs.FARM_VERSION
5315
5177
  ))));
5316
- return _chunkY5TOT5F6cjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5178
+ return _chunkX3MHKLCOcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5317
5179
  }
5318
5180
  async renderDefaultMCP(req, res) {
5319
5181
  const server = this.getDefaultMCPServer();
5320
- const request2 = _nullishCoalesce(_chunkHNAISJFDcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) })));
5182
+ const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) })));
5321
5183
  try {
5322
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-OXT73ZBY.cjs");
5184
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-FER4MQDF.cjs");
5323
5185
  const origin = new URL(request2.url).origin;
5324
5186
  const response = await handleFarmDefaultMCPRequest(request2, {
5325
5187
  server,
5326
5188
  basePath: this.config.basePath,
5327
5189
  listPages: async () => {
5328
5190
  const sources = await Promise.all(
5329
- this.getAgentListedRoutes().map(async ([pattern, route]) => ({
5330
- pattern,
5331
- // The page itself surfaces a load error. Without its module a guard cannot
5332
- // be ruled out, so the page is left out.
5333
- module: await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }))
5334
- }))
5191
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
5192
+ const module = await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }));
5193
+ const metadata = module.metadata;
5194
+ return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
5195
+ })
5196
+ );
5197
+ return _chunkX3MHKLCOcjs.collectFarmDefaultMCPPages.call(void 0,
5198
+ sources.filter((source) => source !== null),
5199
+ {
5200
+ origin,
5201
+ basePath: this.config.basePath,
5202
+ markdown: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md)
5203
+ }
5335
5204
  );
5336
- return _chunkY5TOT5F6cjs.collectFarmDefaultMCPPages.call(void 0, sources, {
5337
- origin,
5338
- basePath: this.config.basePath,
5339
- markdown: _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, this.config.md)
5340
- });
5341
5205
  },
5342
5206
  // Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
5343
5207
  readMarkdown: this.createDevMarkdownReader(req)
@@ -5360,13 +5224,14 @@ var ServerRenderer = class {
5360
5224
  }
5361
5225
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
5362
5226
  async createLlmsTxtContext(request2, options = {}) {
5363
- const config = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.llmsTxt]));
5364
- const origin = new URL(request2.url).origin;
5227
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.llmsTxt]));
5228
+ const origin = await this.getAgentOrigin(request2);
5365
5229
  const sources = await Promise.all(
5366
5230
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
5367
5231
  try {
5368
5232
  const module = await this.routeManager.loadRouteModule(route.modulePath);
5369
5233
  if (module.__farmRouteGuard) return null;
5234
+ if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
5370
5235
  return { pattern, metadata: module.metadata };
5371
5236
  } catch (error) {
5372
5237
  _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
@@ -5376,24 +5241,24 @@ var ServerRenderer = class {
5376
5241
  );
5377
5242
  const rootLayout = this.routeManager.getLayouts().get("/");
5378
5243
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5379
- const pages = _chunkFJWN7RV4cjs.collectFarmLlmsTxtPages.call(void 0,
5244
+ const pages = _chunkQO43L7Z4cjs.collectFarmLlmsTxtPages.call(void 0,
5380
5245
  sources.filter((source) => source !== null),
5381
5246
  {
5382
5247
  origin,
5383
5248
  basePath: this.config.basePath,
5384
- markdown: _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5249
+ markdown: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md),
5385
5250
  include: config.include,
5386
5251
  exclude: config.exclude
5387
5252
  }
5388
5253
  );
5389
5254
  return {
5390
5255
  pages,
5391
- defaults: _chunkFJWN7RV4cjs.createFarmDefaultLlmsTxt.call(void 0, {
5256
+ defaults: _chunkQO43L7Z4cjs.createFarmDefaultLlmsTxt.call(void 0, {
5392
5257
  origin,
5393
5258
  pages,
5394
5259
  config,
5395
5260
  rootMetadata,
5396
- mcp: _optionalChain([this, 'access', _178 => _178.config, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.aiCatalog]) === false ? [] : _chunk752IHQTDcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5261
+ mcp: _optionalChain([this, 'access', _178 => _178.config, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.aiCatalog]) === false ? [] : _chunkYTNBCXCWcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5397
5262
  basePath: this.config.basePath,
5398
5263
  apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
5399
5264
  _chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
@@ -5403,9 +5268,27 @@ var ServerRenderer = class {
5403
5268
  defaultMCP: () => this.getDefaultMCPServer()
5404
5269
  })
5405
5270
  }),
5406
- ...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
5271
+ ...options.full ? {
5272
+ markdown: _chunkQO43L7Z4cjs.readFarmLlmsMarkdownFrom.call(void 0,
5273
+ new URL(request2.url).origin,
5274
+ origin,
5275
+ this.createDevMarkdownReader(options.req)
5276
+ )
5277
+ } : {}
5407
5278
  };
5408
5279
  }
5280
+ /**
5281
+ * The origin llms.txt and llms-full.txt link to: the root layout's `metadataBase`, else the
5282
+ * request's origin, as for the sitemap and the production server.
5283
+ */
5284
+ async getAgentOrigin(request2) {
5285
+ const rootLayout = this.routeManager.getLayouts().get("/");
5286
+ const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5287
+ return _chunkQO43L7Z4cjs.resolveFarmAgentOrigin.call(void 0,
5288
+ _optionalChain([rootMetadata, 'optionalAccess', _181 => _181.metadataBase]),
5289
+ new URL(request2.url).origin
5290
+ );
5291
+ }
5409
5292
  /**
5410
5293
  * Reads page mirrors back through this dev server, the way its .md handler
5411
5294
  * renders pages, so Markdown sources and agent overrides are included. Requests
@@ -5416,17 +5299,17 @@ var ServerRenderer = class {
5416
5299
  * body is discarded.
5417
5300
  */
5418
5301
  createDevMarkdownReader(req) {
5419
- const socket = _optionalChain([req, 'optionalAccess', _181 => _181.socket]);
5420
- if (_optionalChain([req, 'optionalAccess', _182 => _182.method, 'optionalAccess', _183 => _183.toUpperCase, 'call', _184 => _184()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _185 => _185.localAddress]) || !socket.localPort) {
5302
+ const socket = _optionalChain([req, 'optionalAccess', _182 => _182.socket]);
5303
+ if (_optionalChain([req, 'optionalAccess', _183 => _183.method, 'optionalAccess', _184 => _184.toUpperCase, 'call', _185 => _185()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _186 => _186.localAddress]) || !socket.localPort) {
5421
5304
  return async () => null;
5422
5305
  }
5423
5306
  if (socket.encrypted) {
5424
5307
  const address = { host: socket.localAddress, port: socket.localPort };
5425
- return _chunkFJWN7RV4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5308
+ return _chunkQO43L7Z4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5426
5309
  }
5427
5310
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
5428
5311
  const localOrigin = `http://${host}:${socket.localPort}`;
5429
- const read = _chunkFJWN7RV4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5312
+ const read = _chunkQO43L7Z4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5430
5313
  return (url) => {
5431
5314
  const target = new URL(url);
5432
5315
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -5469,7 +5352,7 @@ var ServerRenderer = class {
5469
5352
  const response = await _chunkAXVRUDMBcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
5470
5353
  method: req.method,
5471
5354
  ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
5472
- renderer: _chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
5355
+ renderer: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
5473
5356
  });
5474
5357
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
5475
5358
  }
@@ -5482,8 +5365,8 @@ var ServerRenderer = class {
5482
5365
  return;
5483
5366
  }
5484
5367
  const etag = `"${image.staticInfo.hash}"`;
5485
- const requestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
5486
- trustProxy: _optionalChain([this, 'access', _186 => _186.config, 'access', _187 => _187.server, 'optionalAccess', _188 => _188.trustProxy])
5368
+ const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
5369
+ trustProxy: _optionalChain([this, 'access', _187 => _187.config, 'access', _188 => _188.server, 'optionalAccess', _189 => _189.trustProxy])
5487
5370
  });
5488
5371
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
5489
5372
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -5504,7 +5387,7 @@ var ServerRenderer = class {
5504
5387
  res.end();
5505
5388
  return;
5506
5389
  }
5507
- res.write(await fs6.promises.readFile(image.modulePath));
5390
+ res.write(await fs5.promises.readFile(image.modulePath));
5508
5391
  res.end();
5509
5392
  }
5510
5393
  async renderRouteErrorBoundary(req, res, options) {
@@ -5633,7 +5516,7 @@ var ServerRenderer = class {
5633
5516
  modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
5634
5517
  })
5635
5518
  );
5636
- const deferredProps = _chunkXQSYOVCWcjs.prepareDeferredData.call(void 0, {
5519
+ const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
5637
5520
  page: req.__FARM_PROPS__ || {},
5638
5521
  slots: routeSlots
5639
5522
  });
@@ -5658,12 +5541,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
5658
5541
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
5659
5542
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
5660
5543
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5661
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5544
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5662
5545
  window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5663
5546
  </script>`);
5664
5547
  const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
5665
5548
  const rendererHydrationScript = farmScripts(
5666
- _optionalChain([this, 'access', _189 => _189.rendererRuntime, 'access', _190 => _190.generateHydrationScript, 'optionalCall', _191 => _191()]) || ""
5549
+ _optionalChain([this, 'access', _190 => _190.rendererRuntime, 'access', _191 => _191.generateHydrationScript, 'optionalCall', _192 => _192()]) || ""
5667
5550
  );
5668
5551
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
5669
5552
  const farmClientScript = farmScripts(
@@ -5672,8 +5555,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5672
5555
  const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
5673
5556
  element,
5674
5557
  {
5675
- rejectLateNavigation: _chunk2C5L5RPMcjs._isFarmMarkdownPageCheck.call(void 0,
5676
- _optionalChain([req, 'access', _192 => _192.headers, 'optionalAccess', _193 => _193[_chunk2C5L5RPMcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5558
+ rejectLateNavigation: _chunkFT6KJHS3cjs._isFarmMarkdownPageCheck.call(void 0,
5559
+ _optionalChain([req, 'access', _193 => _193.headers, 'optionalAccess', _194 => _194[_chunkFT6KJHS3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5677
5560
  )
5678
5561
  }
5679
5562
  );
@@ -5685,7 +5568,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5685
5568
  viewport: viewportTags
5686
5569
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5687
5570
  pathname: getFarmMetadataPathname(req),
5688
- jsonLd: _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.agent, 'optionalAccess', _196 => _196.jsonLd])
5571
+ jsonLd: _optionalChain([this, 'access', _195 => _195.config, 'access', _196 => _196.agent, 'optionalAccess', _197 => _197.jsonLd])
5689
5572
  });
5690
5573
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
5691
5574
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
@@ -5695,19 +5578,19 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5695
5578
  i18nSnapshot,
5696
5579
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5697
5580
  ) : "";
5698
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
5581
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
5699
5582
  this.config.theme,
5700
5583
  this.config.basePath,
5701
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
5584
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
5702
5585
  );
5703
5586
  themeDocument.head = farmScripts(themeDocument.head);
5704
- const fullDocument = _chunkUJ3R2AH2cjs.extractFarmFullDocument.call(void 0, content);
5587
+ const fullDocument = _chunkUPOYKX4Scjs.extractFarmFullDocument.call(void 0, content);
5705
5588
  let html;
5706
5589
  if (fullDocument) {
5707
5590
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
5708
- const documentHtml = shouldReplaceLayoutTitle ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5709
- const effectiveRendererHead = hasExplicitTitle ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5710
- html = _chunkUJ3R2AH2cjs.composeFarmFullDocument.call(void 0, documentHtml, {
5591
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5592
+ const effectiveRendererHead = hasExplicitTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5593
+ html = _chunkUPOYKX4Scjs.composeFarmFullDocument.call(void 0, documentHtml, {
5711
5594
  fallbackIcon: !hasFavicon,
5712
5595
  viewport: viewportTags,
5713
5596
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -5733,7 +5616,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5733
5616
  });
5734
5617
  } else {
5735
5618
  html = `<!DOCTYPE html>
5736
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _197 => _197.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5619
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _198 => _198.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5737
5620
  <head>
5738
5621
  ${themeDocument.head}
5739
5622
  <meta charset="utf-8">
@@ -5764,7 +5647,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5764
5647
  const securedHtml = this.secureDocumentHTML(req, html);
5765
5648
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
5766
5649
  res.end();
5767
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _198 => _198.onComplete, 'optionalCall', _199 => _199(securedHtml)]);
5650
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _199 => _199.onComplete, 'optionalCall', _200 => _200(securedHtml)]);
5768
5651
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5769
5652
  type: "render.stream.complete",
5770
5653
  route,
@@ -5774,7 +5657,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5774
5657
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
5775
5658
  throw error;
5776
5659
  } finally {
5777
- _optionalChain([clearMiddlewareData, 'optionalCall', _200 => _200()]);
5660
+ _optionalChain([clearMiddlewareData, 'optionalCall', _201 => _201()]);
5778
5661
  }
5779
5662
  }
5780
5663
  /**
@@ -5789,7 +5672,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5789
5672
  if (!rootLayout) return false;
5790
5673
  try {
5791
5674
  const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
5792
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _201 => _201.prototype, 'optionalAccess', _202 => _202.isReactComponent]) || _optionalChain([Layout, 'access', _203 => _203.constructor, 'optionalAccess', _204 => _204.name]) === "AsyncFunction") {
5675
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _202 => _202.prototype, 'optionalAccess', _203 => _203.isReactComponent]) || _optionalChain([Layout, 'access', _204 => _204.constructor, 'optionalAccess', _205 => _205.name]) === "AsyncFunction") {
5793
5676
  return false;
5794
5677
  }
5795
5678
  const cached = documentLayouts.get(Layout);
@@ -5801,12 +5684,12 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5801
5684
  params: {}
5802
5685
  });
5803
5686
  rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
5804
- } catch (e14) {
5687
+ } catch (e15) {
5805
5688
  rendersDocument = false;
5806
5689
  }
5807
5690
  documentLayouts.set(Layout, rendersDocument);
5808
5691
  return rendersDocument;
5809
- } catch (e15) {
5692
+ } catch (e16) {
5810
5693
  return false;
5811
5694
  }
5812
5695
  }
@@ -5814,7 +5697,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5814
5697
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
5815
5698
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
5816
5699
  const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument();
5817
- if (!renderToPipeableStream || _chunk2C5L5RPMcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _205 => _205.headers, 'optionalAccess', _206 => _206[_chunk2C5L5RPMcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer))) {
5700
+ if (!renderToPipeableStream || _chunkFT6KJHS3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _206 => _206.headers, 'optionalAccess', _207 => _207[_chunkFT6KJHS3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
5818
5701
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
5819
5702
  }
5820
5703
  return new Promise((resolve3, reject) => {
@@ -5903,7 +5786,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5903
5786
  modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
5904
5787
  })
5905
5788
  );
5906
- const deferredProps = _chunkXQSYOVCWcjs.prepareDeferredData.call(void 0, {
5789
+ const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
5907
5790
  page: req.__FARM_PROPS__ || {},
5908
5791
  slots: routeSlotPayload
5909
5792
  });
@@ -5930,9 +5813,9 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
5930
5813
  req.__FARM_LOADING_MODULE_PATH__ || null
5931
5814
  )};
5932
5815
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5933
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5816
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5934
5817
  window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5935
- </script>`;
5818
+ </script>${_chunkW44X6IC2cjs.renderFarmFormStateScript.call(void 0, )}`;
5936
5819
  const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
5937
5820
  const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
5938
5821
  const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
@@ -5946,7 +5829,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5946
5829
  viewport: viewportTags
5947
5830
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5948
5831
  pathname: getFarmMetadataPathname(req),
5949
- jsonLd: _optionalChain([this, 'access', _207 => _207.config, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.jsonLd])
5832
+ jsonLd: _optionalChain([this, 'access', _208 => _208.config, 'access', _209 => _209.agent, 'optionalAccess', _210 => _210.jsonLd])
5950
5833
  });
5951
5834
  const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
5952
5835
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -5955,10 +5838,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5955
5838
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5956
5839
  ) : "";
5957
5840
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
5958
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
5841
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
5959
5842
  this.config.theme,
5960
5843
  this.config.basePath,
5961
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
5844
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
5962
5845
  );
5963
5846
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
5964
5847
  const devStyleLinks = this.collectDevStyleLinks();
@@ -5971,9 +5854,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5971
5854
  const earlyClientScript = bootClient ? createFarmDevBootScript(waitingRoot, rootStrategy) : FARM_DEV_EARLY_CLIENT_SCRIPT;
5972
5855
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
5973
5856
  nonce: cspNonce,
5857
+ formState: _chunkW44X6IC2cjs.getFarmFormState.call(void 0, ),
5974
5858
  onShellReady() {
5975
5859
  if (pendingNavigationError) {
5976
- _optionalChain([abort, 'optionalCall', _210 => _210(pendingNavigationError)]);
5860
+ _optionalChain([abort, 'optionalCall', _211 => _211(pendingNavigationError)]);
5977
5861
  if (clearMiddlewareData) {
5978
5862
  clearMiddlewareData();
5979
5863
  }
@@ -5991,7 +5875,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5991
5875
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
5992
5876
  }
5993
5877
  const shell = `<!DOCTYPE html>
5994
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _211 => _211.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5878
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _212 => _212.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5995
5879
  <head>
5996
5880
  ${themeDocument.head}
5997
5881
  <meta charset="utf-8">
@@ -6012,7 +5896,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6012
5896
  const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
6013
5897
  if (securedShell) {
6014
5898
  htmlParts.push(securedShell);
6015
- _optionalChain([staticShellParts, 'optionalAccess', _212 => _212.push, 'call', _213 => _213(securedShell)]);
5899
+ _optionalChain([staticShellParts, 'optionalAccess', _213 => _213.push, 'call', _214 => _214(securedShell)]);
6016
5900
  }
6017
5901
  const withEarlyClient = (document) => earlyClient ? {
6018
5902
  ...document,
@@ -6022,10 +5906,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6022
5906
  ${stampDocumentHTML(earlyClientScript)}`
6023
5907
  )
6024
5908
  } : document;
6025
- const documentTransform = streamDocument ? _chunkUJ3R2AH2cjs.createFarmStreamedDocumentTransform.call(void 0,
5909
+ const documentTransform = streamDocument ? _chunkUPOYKX4Scjs.createFarmStreamedDocumentTransform.call(void 0,
6026
5910
  (opening) => withEarlyClient(
6027
- _chunkUJ3R2AH2cjs.openFarmStreamedDocument.call(void 0,
6028
- hasExplicitTitle ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
5911
+ _chunkUPOYKX4Scjs.openFarmStreamedDocument.call(void 0,
5912
+ hasExplicitTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
6029
5913
  {
6030
5914
  fallbackIcon: !hasFavicon,
6031
5915
  viewport: viewportTags,
@@ -6064,7 +5948,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6064
5948
  const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
6065
5949
  if (!checkedFullDocument && renderedText) {
6066
5950
  documentPrefix += renderedText;
6067
- const prefix = _chunkUJ3R2AH2cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
5951
+ const prefix = _chunkUPOYKX4Scjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6068
5952
  if (prefix !== "pending") {
6069
5953
  checkedFullDocument = true;
6070
5954
  documentPrefix = "";
@@ -6083,7 +5967,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6083
5967
  staticShellClosed = true;
6084
5968
  if (!suspenseHoleEmitted) {
6085
5969
  suspenseHoleEmitted = true;
6086
- _optionalChain([options, 'access', _214 => _214.onSuspenseHoleDetected, 'optionalCall', _215 => _215()]);
5970
+ _optionalChain([options, 'access', _215 => _215.onSuspenseHoleDetected, 'optionalCall', _216 => _216()]);
6087
5971
  }
6088
5972
  } else {
6089
5973
  staticShellParts.push(chunkText);
@@ -6147,8 +6031,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6147
6031
  recordRenderedChunk(tail, rewritten);
6148
6032
  if (tail) res.write(tail);
6149
6033
  }
6150
- const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _216 => _216.end, 'call', _217 => _217()]);
6151
- if (_optionalChain([documentEnd, 'optionalAccess', _218 => _218.text])) {
6034
+ const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _217 => _217.end, 'call', _218 => _218()]);
6035
+ if (_optionalChain([documentEnd, 'optionalAccess', _219 => _219.text])) {
6152
6036
  recordRenderedChunk(documentEnd.text, "");
6153
6037
  res.write(documentEnd.text);
6154
6038
  }
@@ -6159,7 +6043,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6159
6043
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
6160
6044
  earlyClient,
6161
6045
  // A full document: Farm's #root closes only where Farm opened it.
6162
- ..._optionalChain([documentEnd, 'optionalAccess', _219 => _219.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6046
+ ..._optionalChain([documentEnd, 'optionalAccess', _220 => _220.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6163
6047
  })
6164
6048
  );
6165
6049
  htmlParts.push(footer);
@@ -6250,6 +6134,22 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6250
6134
  }
6251
6135
  return false;
6252
6136
  }
6137
+ /**
6138
+ * The redirect a page-data request for `request` ended with. A `redirect()`
6139
+ * target is localized as a document render localizes it; a thrown 3xx
6140
+ * Response keeps its Location as written, as a document render sends it.
6141
+ */
6142
+ async resolvePageDataRedirect(request2, error) {
6143
+ const redirect = _chunkRWR7SMD7cjs.getFarmPageDataRedirect.call(void 0, error);
6144
+ if (!redirect || !_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) return redirect;
6145
+ return {
6146
+ status: redirect.status,
6147
+ location: await this.runWithRequestContext(
6148
+ request2,
6149
+ () => this.localizeRedirectUrl(redirect.location)
6150
+ )
6151
+ };
6152
+ }
6253
6153
  localizeRedirectUrl(url) {
6254
6154
  const snapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
6255
6155
  return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
@@ -6258,13 +6158,13 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6258
6158
  async loadNotFoundModule() {
6259
6159
  const notFoundPath = resolveFarmNotFoundComponentPath(
6260
6160
  this.config,
6261
- _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config)
6161
+ _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config)
6262
6162
  );
6263
6163
  if (!notFoundPath) return null;
6264
6164
  return await this.routeManager.loadRouteModule(notFoundPath);
6265
6165
  }
6266
6166
  async loadNotFoundComponent() {
6267
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _220 => _220.default]), async () => ( null));
6167
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _221 => _221.default]), async () => ( null));
6268
6168
  }
6269
6169
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
6270
6170
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -6287,13 +6187,13 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6287
6187
  */
6288
6188
  async createLateNavigationRecoveryHTML(req, error) {
6289
6189
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
6290
- return _chunkUJ3R2AH2cjs.createLateRedirectRecovery.call(void 0,
6190
+ return _chunkUPOYKX4Scjs.createLateRedirectRecovery.call(void 0,
6291
6191
  this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
6292
6192
  this.getCspNonce(req) || ""
6293
6193
  );
6294
6194
  }
6295
- const pathname = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
6296
- trustProxy: _optionalChain([this, 'access', _221 => _221.config, 'access', _222 => _222.server, 'optionalAccess', _223 => _223.trustProxy])
6195
+ const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6196
+ trustProxy: _optionalChain([this, 'access', _222 => _222.config, 'access', _223 => _223.server, 'optionalAccess', _224 => _224.trustProxy])
6297
6197
  }).pathname;
6298
6198
  let content = this.defaultNotFoundContent();
6299
6199
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -6309,42 +6209,47 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6309
6209
  _chunkQMNWKQL4cjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
6310
6210
  }
6311
6211
  }
6312
- return _chunkUJ3R2AH2cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6212
+ return _chunkUPOYKX4Scjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6313
6213
  }
6314
6214
  async render404(req, res) {
6315
6215
  res.statusCode = 404;
6316
- const pathname = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
6317
- trustProxy: _optionalChain([this, 'access', _224 => _224.config, 'access', _225 => _225.server, 'optionalAccess', _226 => _226.trustProxy])
6216
+ const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6217
+ trustProxy: _optionalChain([this, 'access', _225 => _225.config, 'access', _226 => _226.server, 'optionalAccess', _227 => _227.trustProxy])
6318
6218
  }).pathname;
6219
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6220
+ res.setHeader("Content-Type", "application/json");
6221
+ res.end(JSON.stringify({ error: "Not found", pathname }));
6222
+ return;
6223
+ }
6319
6224
  const acceptHeader = req.headers.accept;
6320
6225
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
6321
- if (_chunk2C5L5RPMcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6322
- res.setHeader("Content-Type", _chunk2C5L5RPMcjs.FARM_MARKDOWN_CONTENT_TYPE);
6226
+ if (_chunkFT6KJHS3cjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6227
+ res.setHeader("Content-Type", _chunkFT6KJHS3cjs.FARM_MARKDOWN_CONTENT_TYPE);
6323
6228
  res.setHeader("X-Farm-Markdown-Error", "404");
6324
6229
  res.setHeader("Cache-Control", "no-store");
6325
- res.end(_chunk2C5L5RPMcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6230
+ res.end(_chunkFT6KJHS3cjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6326
6231
  return;
6327
6232
  }
6328
- const appDir = path10.join(this.config.root, this.config.srcDir, "app");
6329
- const notFoundExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6233
+ const appDir = path9.join(this.config.root, this.config.srcDir, "app");
6234
+ const notFoundExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6330
6235
  let layoutModule = null;
6331
6236
  try {
6332
6237
  for (const ext of notFoundExtensions) {
6333
- const layoutPath = path10.join(appDir, `layout${ext}`);
6334
- if (fs6.existsSync(layoutPath)) {
6238
+ const layoutPath = path9.join(appDir, `layout${ext}`);
6239
+ if (fs5.existsSync(layoutPath)) {
6335
6240
  layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
6336
6241
  break;
6337
6242
  }
6338
6243
  }
6339
6244
  const notFoundPath = resolveFarmNotFoundComponentPath(
6340
6245
  this.config,
6341
- _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config)
6246
+ _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config)
6342
6247
  );
6343
6248
  if (notFoundPath) {
6344
6249
  const notFoundModule = await this.loadNotFoundModule();
6345
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _227 => _227.default]), () => ( null));
6250
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _228 => _228.default]), () => ( null));
6346
6251
  if (NotFoundComponent) {
6347
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _228 => _228.default]), () => ( null));
6252
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _229 => _229.default]), () => ( null));
6348
6253
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
6349
6254
  if (LayoutComponent) {
6350
6255
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -6383,24 +6288,24 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6383
6288
  }
6384
6289
  res.statusCode = statusCode;
6385
6290
  const isDev = process.env.NODE_ENV === "development";
6386
- const requestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
6387
- trustProxy: _optionalChain([this, 'access', _229 => _229.config, 'access', _230 => _230.server, 'optionalAccess', _231 => _231.trustProxy])
6291
+ const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6292
+ trustProxy: _optionalChain([this, 'access', _230 => _230.config, 'access', _231 => _231.server, 'optionalAccess', _232 => _232.trustProxy])
6388
6293
  });
6389
6294
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
6390
- const statusText = _chunkUJ3R2AH2cjs.getDefaultErrorStatusText.call(void 0, statusCode);
6295
+ const statusText = _chunkUPOYKX4Scjs.getDefaultErrorStatusText.call(void 0, statusCode);
6391
6296
  const content = this.stampFarmScripts(
6392
6297
  req,
6393
- _chunkUJ3R2AH2cjs.createDefaultErrorMarkup.call(void 0, {
6298
+ _chunkUPOYKX4Scjs.createDefaultErrorMarkup.call(void 0, {
6394
6299
  statusCode,
6395
6300
  statusText,
6396
6301
  requestPath: requestUrl.pathname,
6397
6302
  method: req.method || "GET",
6398
- message: _optionalChain([diagnostics, 'optionalAccess', _232 => _232.message]),
6399
- errorName: _optionalChain([diagnostics, 'optionalAccess', _233 => _233.name]),
6400
- stack: _optionalChain([diagnostics, 'optionalAccess', _234 => _234.stack]),
6401
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _235 => _235.sourceFrame]),
6303
+ message: _optionalChain([diagnostics, 'optionalAccess', _233 => _233.message]),
6304
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _234 => _234.name]),
6305
+ stack: _optionalChain([diagnostics, 'optionalAccess', _235 => _235.stack]),
6306
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _236 => _236.sourceFrame]),
6402
6307
  development: isDev,
6403
- farmVersion: _chunkBIF5MLTHcjs.FARM_VERSION,
6308
+ farmVersion: _chunkSQ6IWJ3Hcjs.FARM_VERSION,
6404
6309
  nodeVersion: process.version,
6405
6310
  mode: isDev ? "development" : "production"
6406
6311
  })
@@ -6426,8 +6331,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6426
6331
  */
6427
6332
  getI18nAlternateOptions(req, metadata) {
6428
6333
  return {
6429
- metadataBase: _optionalChain([metadata, 'optionalAccess', _236 => _236.metadataBase]),
6430
- origin: req ? _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _237 => _237.config, 'access', _238 => _238.server, 'optionalAccess', _239 => _239.trustProxy]) }).origin : void 0
6334
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _237 => _237.metadataBase]),
6335
+ origin: req ? _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _238 => _238.config, 'access', _239 => _239.server, 'optionalAccess', _240 => _240.trustProxy]) }).origin : void 0
6431
6336
  };
6432
6337
  }
6433
6338
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
@@ -6437,7 +6342,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6437
6342
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
6438
6343
  const integrationManifestScript = farmScripts(`<script>
6439
6344
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
6440
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6345
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6441
6346
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
6442
6347
  </script>`);
6443
6348
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6446,20 +6351,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6446
6351
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
6447
6352
  ) : "";
6448
6353
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6449
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
6354
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
6450
6355
  this.config.theme,
6451
6356
  this.config.basePath,
6452
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
6357
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
6453
6358
  );
6454
6359
  themeDocument.head = farmScripts(themeDocument.head);
6455
6360
  const rendererHydrationScript = farmScripts(
6456
- _optionalChain([this, 'access', _240 => _240.rendererRuntime, 'access', _241 => _241.generateHydrationScript, 'optionalCall', _242 => _242()]) || ""
6361
+ _optionalChain([this, 'access', _241 => _241.rendererRuntime, 'access', _242 => _242.generateHydrationScript, 'optionalCall', _243 => _243()]) || ""
6457
6362
  );
6458
- const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _243 => _243.metadata, 'optionalAccess', _244 => _244.viewport]));
6459
- const fullDocument = _chunkUJ3R2AH2cjs.extractFarmFullDocument.call(void 0, content);
6363
+ const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _244 => _244.metadata, 'optionalAccess', _245 => _245.viewport]));
6364
+ const fullDocument = _chunkUPOYKX4Scjs.extractFarmFullDocument.call(void 0, content);
6460
6365
  if (fullDocument) {
6461
- return _chunkUJ3R2AH2cjs.composeFarmFullDocument.call(void 0,
6462
- metadataHead ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6366
+ return _chunkUPOYKX4Scjs.composeFarmFullDocument.call(void 0,
6367
+ metadataHead ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6463
6368
  {
6464
6369
  fallbackIcon: !metadataHead,
6465
6370
  viewport: viewportTags,
@@ -6485,7 +6390,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6485
6390
  );
6486
6391
  }
6487
6392
  return `<!DOCTYPE html>
6488
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _245 => _245.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6393
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _246 => _246.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6489
6394
  <head>
6490
6395
  ${themeDocument.head}
6491
6396
  <meta charset="utf-8">
@@ -6524,11 +6429,11 @@ ${clientScript}
6524
6429
  }
6525
6430
  applyDeploymentHeaders(req, res) {
6526
6431
  const deploymentId = this.getDeploymentId();
6527
- res.setHeader(_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6432
+ res.setHeader(_chunkI7J5RLGOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6528
6433
  if ((req.method || "GET").toUpperCase() !== "GET") return;
6529
6434
  const forwardedProto = req.headers["x-forwarded-proto"];
6530
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _246 => _246.split, 'call', _247 => _247(","), 'access', _248 => _248[0], 'optionalAccess', _249 => _249.trim, 'call', _250 => _250()]) === "https" || Boolean(_optionalChain([req, 'access', _251 => _251.socket, 'optionalAccess', _252 => _252.encrypted]));
6531
- const cookie = _chunkE552H232cjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
6435
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _247 => _247.split, 'call', _248 => _248(","), 'access', _249 => _249[0], 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]) === "https" || Boolean(_optionalChain([req, 'access', _252 => _252.socket, 'optionalAccess', _253 => _253.encrypted]));
6436
+ const cookie = _chunkI7J5RLGOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
6532
6437
  const existing = res.getHeader("Set-Cookie");
6533
6438
  if (Array.isArray(existing)) {
6534
6439
  res.setHeader("Set-Cookie", [...existing, cookie]);
@@ -6557,7 +6462,7 @@ var FarmApp = class {
6557
6462
  constructor(config = {}, viteServer) {
6558
6463
  this.config = this.normalizeConfig(config);
6559
6464
  _chunkEVIWKPJVcjs.configureFarmObservability.call(void 0, this.config.observability);
6560
- _chunk4ZJ5C7UJcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6465
+ _chunkQIXEU2WVcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6561
6466
  this.i18nRuntime = _chunkRVGLYMJMcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
6562
6467
  _chunkRVGLYMJMcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
6563
6468
  this.viteServer = viteServer;
@@ -6579,6 +6484,7 @@ var FarmApp = class {
6579
6484
  await this.serverRenderer.initialize();
6580
6485
  await this.verifyAppStructure();
6581
6486
  await this.routeManager.discoverRoutes();
6487
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
6582
6488
  this.routeManager.generateClientManifest(this.config.root);
6583
6489
  if (process.env.FARM_VERBOSE) {
6584
6490
  _chunkQMNWKQL4cjs.logger.success("Farm.js application initialized successfully!");
@@ -6607,7 +6513,7 @@ var FarmApp = class {
6607
6513
  outDir: config.outDir || "dist",
6608
6514
  basePath,
6609
6515
  trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
6610
- renderer: _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer),
6516
+ renderer: _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer),
6611
6517
  preset: _nullishCoalesce(config.preset, () => ( "node-server")),
6612
6518
  deploy: config.deploy || {},
6613
6519
  storage: config.storage || {},
@@ -6617,17 +6523,20 @@ var FarmApp = class {
6617
6523
  integrations: config.integrations || {},
6618
6524
  plugins: config.plugins || [],
6619
6525
  migrations: config.migrations || { commands: [] },
6620
- cron: _chunkBT4SEFLCcjs.resolveCronConfig.call(void 0, config.cron),
6621
- workflows: _chunk3CCAICF7cjs.resolveWorkflowsConfig.call(void 0, config.workflows),
6526
+ cron: _chunkYAEN3L2Fcjs.resolveCronConfig.call(void 0, config.cron),
6527
+ workflows: _chunkFSODPZRTcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
6622
6528
  api: normalizeFarmAppAPIConfig(config.api),
6623
6529
  middleware: config.middleware || {},
6624
- routeRules: _chunkV56632LAcjs.normalizeRouteRules.call(void 0, config.routeRules),
6530
+ routeRules: _chunkOCNV4CI2cjs.normalizeRouteRules.call(void 0, config.routeRules),
6625
6531
  context: config.context || (() => void 0),
6626
6532
  server: _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, config.server),
6627
6533
  serverActions: _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, config.serverActions),
6628
6534
  security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
6629
- images: _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, config.images),
6630
- performance: _chunkO6L3YYPMcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6535
+ images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
6536
+ config.images,
6537
+ _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
6538
+ ),
6539
+ performance: _chunk4E57QHPWcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6631
6540
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
6632
6541
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
6633
6542
  root,
@@ -6639,7 +6548,7 @@ var FarmApp = class {
6639
6548
  serverRuntimeConfig: config.serverRuntimeConfig || {},
6640
6549
  publicRuntimeConfig: config.publicRuntimeConfig || {},
6641
6550
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
6642
- md: _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, config.md),
6551
+ md: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, config.md),
6643
6552
  mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
6644
6553
  observability: _nullishCoalesce(config.observability, () => ( false)),
6645
6554
  telemetry: config.telemetry !== false,
@@ -6655,24 +6564,36 @@ var FarmApp = class {
6655
6564
  env: config.env || { server: {}, public: {} },
6656
6565
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
6657
6566
  experimental: {
6658
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _253 => _253.experimental, 'optionalAccess', _254 => _254.serverComponents]), () => ( false)),
6659
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _255 => _255.experimental, 'optionalAccess', _256 => _256.serverActions]), () => ( false)),
6660
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _257 => _257.experimental, 'optionalAccess', _258 => _258.isolatedClientHydration]), () => ( "off")),
6661
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _259 => _259.experimental, 'optionalAccess', _260 => _260.ppr]), () => ( false)),
6567
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _254 => _254.experimental, 'optionalAccess', _255 => _255.serverComponents]), () => ( false)),
6568
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _256 => _256.experimental, 'optionalAccess', _257 => _257.serverActions]), () => ( false)),
6569
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _258 => _258.experimental, 'optionalAccess', _259 => _259.isolatedClientHydration]), () => ( "off")),
6570
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _260 => _260.experimental, 'optionalAccess', _261 => _261.ppr]), () => ( false)),
6662
6571
  ...config.experimental
6663
6572
  },
6664
6573
  agent: _nullishCoalesce(config.agent, () => ( {})),
6665
6574
  vite: config.vite || {}
6666
6575
  };
6667
6576
  }
6577
+ /** `renderer: false` serves no pages, so a page or layout file would silently never answer. */
6578
+ assertNoPageRoutes() {
6579
+ const files = [
6580
+ ...this.routeManager.getRoutes().values(),
6581
+ ...this.routeManager.getLayouts().values()
6582
+ ].map((entry) => path3.default.relative(this.config.root, entry.modulePath).split(path3.default.sep).join("/"));
6583
+ if (files.length === 0) return;
6584
+ throw new Error(
6585
+ `This app sets \`renderer: false\`, which serves API routes only, but it has pages or layouts:
6586
+ ` + [...new Set(files)].map((file) => ` - ${file}`).join("\n") + "\nRemove these files, or remove `renderer: false` to render pages."
6587
+ );
6588
+ }
6668
6589
  async verifyAppStructure() {
6669
- const appDirs = _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config);
6590
+ const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config);
6670
6591
  const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunkQMNWKQL4cjs.fileExists.call(void 0, appDir)))).some(
6671
6592
  Boolean
6672
6593
  );
6673
6594
  if (!hasAppDirectory) {
6674
- const routeFiles = _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
6675
- (source) => _chunkNWUHS6GVcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
6595
+ const routeFiles = _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
6596
+ (source) => _chunkQEJWNXRIcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
6676
6597
  );
6677
6598
  if (routeFiles.length > 0) {
6678
6599
  return;
@@ -6682,14 +6603,14 @@ var FarmApp = class {
6682
6603
  `App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
6683
6604
  );
6684
6605
  }
6685
- const componentExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6606
+ const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6686
6607
  const rootLayoutPaths = appDirs.flatMap(
6687
6608
  (appDir) => componentExtensions.map((extension) => path3.default.join(appDir, `layout${extension}`))
6688
6609
  );
6689
6610
  const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunkQMNWKQL4cjs.fileExists.call(void 0, p))).then(
6690
6611
  (results) => results.some(Boolean)
6691
6612
  );
6692
- if (!hasRootLayout) {
6613
+ if (!hasRootLayout && !_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6693
6614
  _chunkQMNWKQL4cjs.logger.warn(
6694
6615
  `No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
6695
6616
  );
@@ -6705,7 +6626,7 @@ function isResolvedAuthConfig(value) {
6705
6626
  );
6706
6627
  }
6707
6628
  function normalizeFarmAppAPIConfig(config) {
6708
- if (typeof _optionalChain([config, 'optionalAccess', _261 => _261.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _262 => _262.basePath]) === "function") {
6629
+ if (typeof _optionalChain([config, 'optionalAccess', _262 => _262.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _263 => _263.basePath]) === "function") {
6709
6630
  throw new Error(
6710
6631
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
6711
6632
  );
@@ -6720,7 +6641,7 @@ function createFarmApp(config, viteServer) {
6720
6641
  var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
6721
6642
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
6722
6643
  function resolveFarmImageProviderForRuntime(images, options) {
6723
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _263 => _263.provider]), () => ( "auto"));
6644
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _264 => _264.provider]), () => ( "auto"));
6724
6645
  if (provider === "none") return images;
6725
6646
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
6726
6647
  if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -6755,7 +6676,7 @@ function resolveFarmAppPackages(root) {
6755
6676
  let manifest;
6756
6677
  try {
6757
6678
  manifest = JSON.parse(fs.default.readFileSync(path3.default.join(root, "package.json"), "utf8"));
6758
- } catch (e16) {
6679
+ } catch (e17) {
6759
6680
  return {};
6760
6681
  }
6761
6682
  const names = new Set(
@@ -6774,7 +6695,7 @@ function resolveFarmAppPackages(root) {
6774
6695
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
6775
6696
  versions[name] = version;
6776
6697
  break;
6777
- } catch (e17) {
6698
+ } catch (e18) {
6778
6699
  const parent = path3.default.dirname(dir);
6779
6700
  if (parent === dir) break;
6780
6701
  dir = parent;
@@ -6849,9 +6770,9 @@ function staticValue(node) {
6849
6770
  }
6850
6771
  }
6851
6772
  function property(object, name) {
6852
- return _optionalChain([object, 'access', _264 => _264.properties, 'access', _265 => _265.find, 'call', _266 => _266(
6773
+ return _optionalChain([object, 'access', _265 => _265.properties, 'access', _266 => _266.find, 'call', _267 => _267(
6853
6774
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
6854
- ), 'optionalAccess', _267 => _267.value]);
6775
+ ), 'optionalAccess', _268 => _268.value]);
6855
6776
  }
6856
6777
  function toolFromObject(object) {
6857
6778
  const name = staticValue(property(object, "name"));
@@ -6889,7 +6810,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6889
6810
  let program;
6890
6811
  try {
6891
6812
  program = parseAst2(code, { lang });
6892
- } catch (e18) {
6813
+ } catch (e19) {
6893
6814
  return [];
6894
6815
  }
6895
6816
  const locals = /* @__PURE__ */ new Map();
@@ -6897,7 +6818,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6897
6818
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
6898
6819
  continue;
6899
6820
  for (const specifier of statement.specifiers) {
6900
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _268 => _268.imported, 'optionalAccess', _269 => _269.name]), () => ( _optionalChain([specifier, 'access', _270 => _270.imported, 'optionalAccess', _271 => _271.value])));
6821
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _269 => _269.imported, 'optionalAccess', _270 => _270.name]), () => ( _optionalChain([specifier, 'access', _271 => _271.imported, 'optionalAccess', _272 => _272.value])));
6901
6822
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
6902
6823
  locals.set(specifier.local.name, imported);
6903
6824
  }
@@ -6913,7 +6834,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6913
6834
  const [argument] = current.arguments;
6914
6835
  if (definer && argument) {
6915
6836
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
6916
- (element) => _optionalChain([element, 'optionalAccess', _272 => _272.type]) === "ObjectExpression"
6837
+ (element) => _optionalChain([element, 'optionalAccess', _273 => _273.type]) === "ObjectExpression"
6917
6838
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
6918
6839
  for (const object of objects) {
6919
6840
  const tool = toolFromObject(object);
@@ -6938,7 +6859,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6938
6859
  expandDirectories: false,
6939
6860
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
6940
6861
  });
6941
- } catch (e19) {
6862
+ } catch (e20) {
6942
6863
  return [];
6943
6864
  }
6944
6865
  const seen = /* @__PURE__ */ new Set();
@@ -6947,7 +6868,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6947
6868
  let mtimeMs;
6948
6869
  try {
6949
6870
  mtimeMs = fs.default.statSync(file).mtimeMs;
6950
- } catch (e20) {
6871
+ } catch (e21) {
6951
6872
  continue;
6952
6873
  }
6953
6874
  let entry = cache.get(file);
@@ -6955,7 +6876,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6955
6876
  let code = "";
6956
6877
  try {
6957
6878
  code = fs.default.readFileSync(file, "utf8");
6958
- } catch (e21) {
6879
+ } catch (e22) {
6959
6880
  }
6960
6881
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
6961
6882
  cache.set(file, entry);
@@ -6974,8 +6895,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6974
6895
 
6975
6896
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
6976
6897
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
6977
- const client = _optionalChain([cache2, 'optionalAccess', _273 => _273.client]);
6978
- const adapter = _optionalChain([client, 'optionalAccess', _274 => _274.adapter]);
6898
+ const client = _optionalChain([cache2, 'optionalAccess', _274 => _274.client]);
6899
+ const adapter = _optionalChain([client, 'optionalAccess', _275 => _275.adapter]);
6979
6900
  if (adapter === void 0) return void 0;
6980
6901
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
6981
6902
  throw new Error(
@@ -6990,8 +6911,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
6990
6911
  );
6991
6912
  }
6992
6913
  const options = {};
6993
- if (_optionalChain([client, 'optionalAccess', _275 => _275.version]) !== void 0) options.version = client.version;
6994
- if (_optionalChain([client, 'optionalAccess', _276 => _276.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
6914
+ if (_optionalChain([client, 'optionalAccess', _276 => _276.version]) !== void 0) options.version = client.version;
6915
+ if (_optionalChain([client, 'optionalAccess', _277 => _277.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
6995
6916
  return { importPath: found.replace(/\\/g, "/"), options };
6996
6917
  }
6997
6918
  function resolveAdapterFile(resolved) {
@@ -7161,6 +7082,83 @@ async function buildFarmTreeLayouts(layouts, params, source, options) {
7161
7082
  }
7162
7083
  `;
7163
7084
 
7085
+ // src/client/navigation-scripts.ts
7086
+ var FARM_NAVIGATION_SCRIPT_SOURCE = `// The nonce the page's Content Security Policy trusts: the one of the response that loaded the
7087
+ // document, read once, before a navigation adds scripts that carry another response's nonce.
7088
+ const farmDocumentScriptNonce = (function() {
7089
+ if (typeof document === "undefined") return "";
7090
+ const script = document.querySelector("script[data-farm-runtime]") || document.querySelector("script[nonce]");
7091
+ return (script && script.nonce) || "";
7092
+ })();
7093
+
7094
+ // A runnable copy of a script a navigation inserted as markup. A script its response nonced runs
7095
+ // with the page's nonce; one it left without a nonce stays without, so the policy still blocks it.
7096
+ function createFarmNavigationScript(script) {
7097
+ const freshScript = document.createElement("script");
7098
+ for (const attribute of Array.from(script.attributes)) {
7099
+ if (attribute.name !== "nonce") freshScript.setAttribute(attribute.name, attribute.value);
7100
+ }
7101
+ if (farmDocumentScriptNonce && (script.nonce || script.getAttribute("nonce"))) {
7102
+ freshScript.nonce = farmDocumentScriptNonce;
7103
+ }
7104
+ freshScript.textContent = script.textContent || "";
7105
+ return freshScript;
7106
+ }
7107
+ // React streams Suspense content after its fallback, in a hidden segment that a reveal script
7108
+ // ($RC for a boundary, $RS for a segment placeholder) moves into place. This makes the same moves
7109
+ // in a parsed page, before it goes on screen, and drops the calls it made, so the islands in that
7110
+ // content are where the swap looks for them (a refresh keeps them).
7111
+ function revealFarmStreamedContent(root) {
7112
+ const find = function(id) {
7113
+ return root.querySelector('[id="' + id.replace(/"/g, "") + '"]');
7114
+ };
7115
+ for (const script of Array.from(root.querySelectorAll("script:not([type]), script[type='text/javascript']"))) {
7116
+ const source = script.textContent || "";
7117
+ if (source.indexOf("$RC(") === -1 && source.indexOf("$RS(") === -1) continue;
7118
+ let rest = source;
7119
+ for (const call of source.matchAll(/\\$R([CS])\\("([^"]+)","([^"]+)"\\);?/g)) {
7120
+ const [text, kind, first, second] = call;
7121
+ if (kind === "S") {
7122
+ const segment = find(first);
7123
+ const placeholder = find(second);
7124
+ if (!segment || !placeholder) continue;
7125
+ while (segment.firstChild) placeholder.parentNode.insertBefore(segment.firstChild, placeholder);
7126
+ placeholder.remove();
7127
+ segment.remove();
7128
+ } else {
7129
+ const boundary = find(first);
7130
+ const segment = find(second);
7131
+ if (!boundary || !segment) continue;
7132
+ const parent = boundary.parentNode;
7133
+ const start = boundary.previousSibling;
7134
+ // The fallback goes, up to the boundary's closing comment (nested boundaries skipped).
7135
+ let node = boundary;
7136
+ let depth = 0;
7137
+ while (node) {
7138
+ if (node.nodeType === 8) {
7139
+ const data = node.data;
7140
+ if (data === "/$" || data === "/&") {
7141
+ if (depth === 0) break;
7142
+ depth--;
7143
+ } else if (data === "$" || data === "$?" || data === "$~" || data === "$!" || data === "&") {
7144
+ depth++;
7145
+ }
7146
+ }
7147
+ const next = node.nextSibling;
7148
+ parent.removeChild(node);
7149
+ node = next;
7150
+ }
7151
+ while (segment.firstChild) parent.insertBefore(segment.firstChild, node);
7152
+ segment.remove();
7153
+ if (start && start.nodeType === 8) start.data = "$";
7154
+ }
7155
+ rest = rest.replace(text, "");
7156
+ }
7157
+ script.textContent = rest;
7158
+ }
7159
+ }
7160
+ `;
7161
+
7164
7162
  // src/client/navigation-stream-client.ts
7165
7163
  var FARM_NAVIGATION_STREAM_READER_SOURCE = `// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
7166
7164
  // with each later flush as it ends, and null at the end; a document without a marker is all shell.
@@ -7205,6 +7203,91 @@ async function readFarmNavigationStream(body, flushToken) {
7205
7203
  };
7206
7204
  }`;
7207
7205
 
7206
+ // src/client/refresh-fields.ts
7207
+ var FARM_REFRESH_FIELDS_SOURCE = `// The server-rendered fields of a tree: islands keep their own.
7208
+ function listFarmServerFields(root) {
7209
+ return Array.from(root.querySelectorAll("input, textarea, select")).filter(function(field) {
7210
+ return !field.closest("f-island");
7211
+ });
7212
+ }
7213
+
7214
+ // Reads the fields of a tree about to be replaced: their order, and which one has the focus.
7215
+ function captureFarmServerFields(root) {
7216
+ const fields = listFarmServerFields(root);
7217
+ const focused = fields.indexOf(document.activeElement);
7218
+ const field = fields[focused];
7219
+ let selection = null;
7220
+ try {
7221
+ if (field && typeof field.selectionStart === "number") {
7222
+ selection = [field.selectionStart, field.selectionEnd, field.selectionDirection];
7223
+ }
7224
+ } catch {}
7225
+ return { fields, focused, selection };
7226
+ }
7227
+
7228
+ function isSameFarmField(current, next) {
7229
+ return current.tagName === next.tagName &&
7230
+ current.type === next.type &&
7231
+ current.name === next.name &&
7232
+ current.id === next.id;
7233
+ }
7234
+
7235
+ // Gives the replacing tree's fields what the user changed in the replaced one, and the focus.
7236
+ function restoreFarmServerFields(captured, root) {
7237
+ const fields = listFarmServerFields(root);
7238
+ captured.fields.forEach(function(current, index) {
7239
+ const next = fields[index];
7240
+ if (!next || !isSameFarmField(current, next)) return;
7241
+ if (current.form && current.form.getAttribute("aria-busy") === "true") return;
7242
+ if (current.tagName === "SELECT") {
7243
+ const changed = Array.from(current.options).some(function(option) {
7244
+ return option.selected !== option.defaultSelected;
7245
+ });
7246
+ if (!changed) return;
7247
+ const values = new Set(Array.from(current.selectedOptions, function(option) {
7248
+ return option.value;
7249
+ }));
7250
+ Array.from(next.options).forEach(function(option) {
7251
+ option.selected = values.has(option.value);
7252
+ });
7253
+ } else if (current.type === "checkbox" || current.type === "radio") {
7254
+ if (current.checked !== current.defaultChecked) next.checked = current.checked;
7255
+ } else if (current.type !== "file" && current.value !== current.defaultValue) {
7256
+ next.value = current.value;
7257
+ }
7258
+ });
7259
+ const focused = fields[captured.focused];
7260
+ if (!focused || !isSameFarmField(captured.fields[captured.focused], focused)) return;
7261
+ focused.focus({ preventScroll: true });
7262
+ if (captured.selection) {
7263
+ try {
7264
+ focused.setSelectionRange(captured.selection[0], captured.selection[1], captured.selection[2]);
7265
+ } catch {}
7266
+ }
7267
+ }
7268
+ `;
7269
+
7270
+ // src/utils/hook-filters.ts
7271
+
7272
+
7273
+ function escapeRegExp(value) {
7274
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7275
+ }
7276
+ function exactIdPattern(ids) {
7277
+ return new RegExp(`^(?:${ids.map(escapeRegExp).join("|")})(?:\\?.*)?$`);
7278
+ }
7279
+ function fileNamePattern(files) {
7280
+ const names = /* @__PURE__ */ new Set();
7281
+ for (const file of files) {
7282
+ names.add(path3.default.basename(file));
7283
+ try {
7284
+ names.add(path3.default.basename(_fs.realpathSync.call(void 0, file)));
7285
+ } catch (e23) {
7286
+ }
7287
+ }
7288
+ return new RegExp(`(?:^|/)(?:${[...names].map(escapeRegExp).join("|")})(?:\\?.*)?$`);
7289
+ }
7290
+
7208
7291
  // src/docs/client-config.ts
7209
7292
 
7210
7293
 
@@ -7235,7 +7318,7 @@ function redactFarmDocsClientConfig(code, filename) {
7235
7318
  const current = node;
7236
7319
  if (current.type === "Property") {
7237
7320
  const name = propertyKeyName(current);
7238
- const valueType = _optionalChain([current, 'access', _277 => _277.value, 'optionalAccess', _278 => _278.type]);
7321
+ const valueType = _optionalChain([current, 'access', _278 => _278.value, 'optionalAccess', _279 => _279.type]);
7239
7322
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
7240
7323
  if (name && credential) {
7241
7324
  edits.push(
@@ -7266,7 +7349,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
7266
7349
  if (file === configModule) return true;
7267
7350
  try {
7268
7351
  return file === _fs.realpathSync.call(void 0, configModule).replace(/\\/g, "/");
7269
- } catch (e22) {
7352
+ } catch (e24) {
7270
7353
  return false;
7271
7354
  }
7272
7355
  }
@@ -7274,10 +7357,14 @@ function farmDocsClientConfigPlugin(configModule) {
7274
7357
  return {
7275
7358
  name: "farm:docs-client-config",
7276
7359
  enforce: "pre",
7277
- transform(code, id, options) {
7278
- if (_optionalChain([options, 'optionalAccess', _279 => _279.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7279
- const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7280
- return redacted === null ? null : { code: redacted, map: null };
7360
+ transform: {
7361
+ // Never matches without a docs config module, so the bundler never calls the handler.
7362
+ filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
7363
+ handler(code, id, options) {
7364
+ if (_optionalChain([options, 'optionalAccess', _280 => _280.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7365
+ const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7366
+ return redacted === null ? null : { code: redacted, map: null };
7367
+ }
7281
7368
  }
7282
7369
  };
7283
7370
  }
@@ -7306,7 +7393,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
7306
7393
  ];
7307
7394
  function getFarmClientOptimizeDepsInclude(renderer) {
7308
7395
  return Array.from(
7309
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _280 => _280.optimizeDeps]) || []])
7396
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _281 => _281.optimizeDeps]) || []])
7310
7397
  );
7311
7398
  }
7312
7399
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
@@ -7318,6 +7405,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
7318
7405
  });
7319
7406
  }
7320
7407
  function createFarmClientOptimizeDepsConfig(entries, renderer) {
7408
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
7321
7409
  return {
7322
7410
  // Keep normal application dependency discovery for CJS-only packages, but
7323
7411
  // seed every Farm browser runtime so React is present in the first crawl.
@@ -7325,11 +7413,11 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
7325
7413
  // Waiting for the crawl avoids serving a partial optimizer generation and
7326
7414
  // then changing browser hashes while hydration is already in progress.
7327
7415
  holdUntilCrawlEnd: true,
7328
- include: getFarmClientOptimizeDepsInclude(renderer),
7416
+ include: getFarmClientOptimizeDepsInclude(renderer || void 0),
7329
7417
  // Farm's HTML boots through a virtual module and imports route UI lazily.
7330
7418
  // Explicit entries let Vite finish that crawl before a navigation can
7331
7419
  // rotate the optimizer hash underneath a hydrated React runtime.
7332
- ..._optionalChain([entries, 'optionalAccess', _281 => _281.length]) ? { entries: [...entries] } : {}
7420
+ ..._optionalChain([entries, 'optionalAccess', _282 => _282.length]) ? { entries: [...entries] } : {}
7333
7421
  };
7334
7422
  }
7335
7423
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
@@ -7355,8 +7443,8 @@ function mergeAlias(farmValue, userValue) {
7355
7443
  return [...normalize(userValue), ...normalize(farmValue)];
7356
7444
  }
7357
7445
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7358
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _282 => _282.optimizeDeps, 'optionalAccess', _283 => _283.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _284 => _284.optimizeDeps, 'optionalAccess', _285 => _285.noDiscovery])));
7359
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _286 => _286.optimizeDeps, 'optionalAccess', _287 => _287.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _288 => _288.optimizeDeps, 'optionalAccess', _289 => _289.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _290 => _290.optimizeDeps, 'optionalAccess', _291 => _291.holdUntilCrawlEnd]))));
7446
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _283 => _283.optimizeDeps, 'optionalAccess', _284 => _284.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _285 => _285.optimizeDeps, 'optionalAccess', _286 => _286.noDiscovery])));
7447
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _287 => _287.optimizeDeps, 'optionalAccess', _288 => _288.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _289 => _289.optimizeDeps, 'optionalAccess', _290 => _290.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _291 => _291.optimizeDeps, 'optionalAccess', _292 => _292.holdUntilCrawlEnd]))));
7360
7448
  return {
7361
7449
  ...farmConfig,
7362
7450
  ...userConfig,
@@ -7368,9 +7456,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7368
7456
  resolve: {
7369
7457
  ...farmConfig.resolve,
7370
7458
  ...userConfig.resolve,
7371
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _292 => _292.resolve, 'optionalAccess', _293 => _293.alias]), _optionalChain([userConfig, 'access', _294 => _294.resolve, 'optionalAccess', _295 => _295.alias])),
7459
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _293 => _293.resolve, 'optionalAccess', _294 => _294.alias]), _optionalChain([userConfig, 'access', _295 => _295.resolve, 'optionalAccess', _296 => _296.alias])),
7372
7460
  dedupe: Array.from(
7373
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _296 => _296.resolve, 'optionalAccess', _297 => _297.dedupe]) || [], ..._optionalChain([userConfig, 'access', _298 => _298.resolve, 'optionalAccess', _299 => _299.dedupe]) || []])
7461
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _297 => _297.resolve, 'optionalAccess', _298 => _298.dedupe]) || [], ..._optionalChain([userConfig, 'access', _299 => _299.resolve, 'optionalAccess', _300 => _300.dedupe]) || []])
7374
7462
  )
7375
7463
  },
7376
7464
  optimizeDeps: {
@@ -7380,21 +7468,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7380
7468
  holdUntilCrawlEnd,
7381
7469
  include: Array.from(
7382
7470
  /* @__PURE__ */ new Set([
7383
- ..._optionalChain([farmConfig, 'access', _300 => _300.optimizeDeps, 'optionalAccess', _301 => _301.include]) || [],
7384
- ..._optionalChain([userConfig, 'access', _302 => _302.optimizeDeps, 'optionalAccess', _303 => _303.include]) || []
7471
+ ..._optionalChain([farmConfig, 'access', _301 => _301.optimizeDeps, 'optionalAccess', _302 => _302.include]) || [],
7472
+ ..._optionalChain([userConfig, 'access', _303 => _303.optimizeDeps, 'optionalAccess', _304 => _304.include]) || []
7385
7473
  ])
7386
7474
  ),
7387
7475
  exclude: Array.from(
7388
7476
  /* @__PURE__ */ new Set([
7389
- ..._optionalChain([farmConfig, 'access', _304 => _304.optimizeDeps, 'optionalAccess', _305 => _305.exclude]) || [],
7390
- ..._optionalChain([userConfig, 'access', _306 => _306.optimizeDeps, 'optionalAccess', _307 => _307.exclude]) || []
7477
+ ..._optionalChain([farmConfig, 'access', _305 => _305.optimizeDeps, 'optionalAccess', _306 => _306.exclude]) || [],
7478
+ ..._optionalChain([userConfig, 'access', _307 => _307.optimizeDeps, 'optionalAccess', _308 => _308.exclude]) || []
7391
7479
  ])
7392
7480
  )
7393
7481
  },
7394
7482
  ssr: {
7395
7483
  ...farmConfig.ssr,
7396
7484
  ...userConfig.ssr,
7397
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _308 => _308.ssr, 'optionalAccess', _309 => _309.noExternal]), _optionalChain([userConfig, 'access', _310 => _310.ssr, 'optionalAccess', _311 => _311.noExternal]))
7485
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _309 => _309.ssr, 'optionalAccess', _310 => _310.noExternal]), _optionalChain([userConfig, 'access', _311 => _311.ssr, 'optionalAccess', _312 => _312.noExternal]))
7398
7486
  }
7399
7487
  };
7400
7488
  }
@@ -7446,7 +7534,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7446
7534
  ...farmConfig.build,
7447
7535
  rollupOptions: {
7448
7536
  ...userBundlerOptions,
7449
- ..._optionalChain([farmConfig, 'access', _312 => _312.build, 'optionalAccess', _313 => _313.rollupOptions])
7537
+ ..._optionalChain([farmConfig, 'access', _313 => _313.build, 'optionalAccess', _314 => _314.rollupOptions])
7450
7538
  }
7451
7539
  },
7452
7540
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -7454,7 +7542,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7454
7542
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
7455
7543
  ssr: {
7456
7544
  ...merged.ssr,
7457
- external: mergeExternal(_optionalChain([farmConfig, 'access', _314 => _314.ssr, 'optionalAccess', _315 => _315.external]), _optionalChain([userConfig, 'access', _316 => _316.ssr, 'optionalAccess', _317 => _317.external]))
7545
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _315 => _315.ssr, 'optionalAccess', _316 => _316.external]), _optionalChain([userConfig, 'access', _317 => _317.ssr, 'optionalAccess', _318 => _318.external]))
7458
7546
  }
7459
7547
  };
7460
7548
  }
@@ -7466,17 +7554,20 @@ function createFarmThemeCssPlugin(input, basePath = "/") {
7466
7554
  return {
7467
7555
  name: "farm:theme-css",
7468
7556
  enforce: "pre",
7469
- transform(code, id) {
7470
- if (!config.enabled || !/\.css(?:\?.*)?$/.test(id) || !/@import\s+["']tailwindcss["']/.test(code) || /@custom-variant\s+dark\b/.test(code)) {
7471
- return null;
7472
- }
7473
- return {
7474
- code: `${code.trimEnd()}
7557
+ transform: {
7558
+ filter: { id: /\.css(?:\?.*)?$/, code: /@import\s+["']tailwindcss["']/ },
7559
+ handler(code, id) {
7560
+ if (!config.enabled || !/\.css(?:\?.*)?$/.test(id) || !/@import\s+["']tailwindcss["']/.test(code) || /@custom-variant\s+dark\b/.test(code)) {
7561
+ return null;
7562
+ }
7563
+ return {
7564
+ code: `${code.trimEnd()}
7475
7565
 
7476
7566
  ${FARM_DARK_VARIANT}
7477
7567
  `,
7478
- map: null
7479
- };
7568
+ map: null
7569
+ };
7570
+ }
7480
7571
  }
7481
7572
  };
7482
7573
  }
@@ -7517,4 +7608,7 @@ ${FARM_DARK_VARIANT}
7517
7608
 
7518
7609
 
7519
7610
 
7520
- exports.RouteManager = RouteManager; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
7611
+
7612
+
7613
+
7614
+ exports.RouteManager = RouteManager; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;