@farm.js/core 0.1.65 → 0.1.67

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 (439) 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-BFu9xHAi.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +6 -6
  7. package/dist/agent-runtime.d.ts +6 -6
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/analyzer-KVZGVY5Q.cjs +16 -0
  10. package/dist/{analyzer-PE33SK5W.mjs → analyzer-TTIIXXMQ.mjs} +3 -3
  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 +59 -0
  21. package/dist/api/node.d.ts +59 -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 +10 -9
  25. package/dist/api/route-manager.d.ts +10 -9
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +7 -7
  29. package/dist/api/runtime.d.ts +7 -7
  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 +11 -10
  35. package/dist/api.d.ts +11 -10
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
  38. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +7 -7
  41. package/dist/app-markdown.d.ts +7 -7
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
  45. package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
  46. package/dist/{chunk-CZF4XIRZ.cjs → chunk-23PVOIPT.cjs} +3 -3
  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-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
  51. package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
  52. package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
  53. package/dist/{chunk-7QVRWGBL.cjs → chunk-4DRINDGN.cjs} +319 -138
  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-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
  57. package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  58. package/dist/{chunk-IMK32ERL.cjs → chunk-556H7JCE.cjs} +65 -48
  59. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  60. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  61. package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
  62. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  63. package/dist/chunk-6I4BFRE7.cjs +51 -0
  64. package/dist/{chunk-OSFIUSYK.cjs → chunk-6R53ZWX2.cjs} +7 -7
  65. package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
  66. package/dist/{chunk-WNXVWXG3.cjs → chunk-6V5YWI4W.cjs} +2 -2
  67. package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
  68. package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
  69. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  70. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  71. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  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-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
  76. package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  77. package/dist/chunk-AQIRXBBY.cjs +26 -0
  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-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-ZX2JHEWW.mjs → chunk-CO3YMZFD.mjs} +20 -9
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
  88. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  89. package/dist/{chunk-32RPJAAS.cjs → chunk-DCXSIEFE.cjs} +40 -41
  90. package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
  91. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  92. package/dist/chunk-DXZ57EPE.mjs +375 -0
  93. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  94. package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
  95. package/dist/{chunk-HKNYNSOK.mjs → chunk-E6CD45JK.mjs} +30 -31
  96. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  97. package/dist/chunk-EIVGPQN5.mjs +51 -0
  98. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  99. package/dist/{chunk-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
  100. package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
  101. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  104. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  105. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  106. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  107. package/dist/{chunk-ZAUOOGER.mjs → chunk-GTV2ABO7.mjs} +218 -37
  108. package/dist/{chunk-72JSHQQQ.mjs → chunk-H37MDCPR.mjs} +1 -1
  109. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  110. package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
  111. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  112. package/dist/{chunk-A3G5IY2W.cjs → chunk-HM7AGSKU.cjs} +1 -1
  113. package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
  114. package/dist/{chunk-GRBJ7VKH.mjs → chunk-HP2DQGQH.mjs} +1 -1
  115. package/dist/{chunk-E2TSYUHV.mjs → chunk-HRPTMX5C.mjs} +4 -4
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  118. package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-YUW7F6SK.mjs → chunk-JVM3DKZE.mjs} +3 -3
  124. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  125. package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
  126. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  127. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  128. package/dist/chunk-K63OWRY2.mjs +22 -0
  129. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  130. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  131. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  132. package/dist/{chunk-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
  133. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  134. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  135. package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
  136. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  137. package/dist/{chunk-C7DCMGC4.cjs → chunk-LPIZMU7D.cjs} +12 -12
  138. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  139. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  140. package/dist/{chunk-3KJPIO5D.cjs → chunk-N5DQMOAG.cjs} +589 -678
  141. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  142. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
  143. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  144. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  145. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  146. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  147. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  148. package/dist/{chunk-IP2KHSGF.mjs → chunk-P2NBQ5JI.mjs} +57 -4
  149. package/dist/{chunk-ZQQK4U66.cjs → chunk-PDFFYZAT.cjs} +72 -19
  150. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  151. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  152. package/dist/{chunk-YD4J37RN.cjs → chunk-PL6RTBDE.cjs} +30 -19
  153. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  154. package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
  155. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  156. package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
  157. package/dist/{chunk-T4M52BA5.cjs → chunk-Q5UX55YA.cjs} +1457 -612
  158. package/dist/{chunk-53ZCZ46B.cjs → chunk-QGQP6QKO.cjs} +4 -3
  159. package/dist/{chunk-TZOGZKI7.cjs → chunk-QITSS4TD.cjs} +1381 -626
  160. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  161. package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
  162. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  163. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  164. package/dist/chunk-RWR7SMD7.cjs +50 -0
  165. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  166. package/dist/chunk-SD6JGJOM.mjs +50 -0
  167. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  168. package/dist/{chunk-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
  169. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  170. package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
  171. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  172. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  173. package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
  174. package/dist/{chunk-6X5NKNBE.mjs → chunk-UHNSY2PQ.mjs} +1304 -459
  175. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  176. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  177. package/dist/{chunk-Q75QPLBA.mjs → chunk-V5MQMQ2P.mjs} +1 -1
  178. package/dist/{chunk-TRIDJQ6A.cjs → chunk-V5RTHYJB.cjs} +30 -10
  179. package/dist/{chunk-QHRCR44V.mjs → chunk-VK54PDQ6.mjs} +25 -5
  180. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  181. package/dist/{chunk-2L54YV25.mjs → chunk-WDD5CTZW.mjs} +49 -32
  182. package/dist/{chunk-7GYCZRTH.mjs → chunk-WGHY3OL5.mjs} +355 -444
  183. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  184. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  185. package/dist/chunk-WVQNXXNE.cjs +28 -0
  186. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  187. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  188. package/dist/{chunk-VHHLKIDZ.mjs → chunk-XNZWMXCF.mjs} +1090 -335
  189. package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
  190. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  191. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  192. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  193. package/dist/chunk-YFTGIHNC.mjs +26 -0
  194. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  195. package/dist/{chunk-UYRI6U3P.mjs → chunk-YQYTQJZN.mjs} +3 -2
  196. package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
  197. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  198. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  199. package/dist/client/lifecycle.cjs +2 -2
  200. package/dist/client/lifecycle.d.mts +1 -1
  201. package/dist/client/lifecycle.d.ts +1 -1
  202. package/dist/client/lifecycle.mjs +1 -1
  203. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-CDRvRmbU.d.mts} +2 -2
  204. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
  205. package/dist/client-plugins.cjs +2 -2
  206. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
  207. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
  208. package/dist/client-plugins.d.mts +6 -6
  209. package/dist/client-plugins.d.ts +6 -6
  210. package/dist/client-plugins.mjs +1 -1
  211. package/dist/client.cjs +11 -9
  212. package/dist/client.d.mts +13 -13
  213. package/dist/client.d.ts +13 -13
  214. package/dist/client.mjs +10 -8
  215. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  216. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  217. package/dist/config.d.mts +6 -6
  218. package/dist/config.d.ts +6 -6
  219. package/dist/cron.cjs +2 -2
  220. package/dist/cron.mjs +1 -1
  221. package/dist/deferred.cjs +2 -2
  222. package/dist/deferred.mjs +1 -1
  223. package/dist/deployment.cjs +2 -2
  224. package/dist/deployment.mjs +1 -1
  225. package/dist/desktop.d.mts +7 -7
  226. package/dist/desktop.d.ts +7 -7
  227. package/dist/{devtools-SGYOG36E.cjs → devtools-RZVT4JVN.cjs} +36 -32
  228. package/dist/{devtools-PUVZB3F2.mjs → devtools-UFQYT3VA.mjs} +31 -27
  229. package/dist/docs.cjs +26 -25
  230. package/dist/docs.d.mts +20 -8
  231. package/dist/docs.d.ts +20 -8
  232. package/dist/docs.mjs +25 -24
  233. package/dist/env-types.cjs +3 -3
  234. package/dist/env-types.mjs +2 -2
  235. package/dist/environment/vite.cjs +5 -5
  236. package/dist/environment/vite.mjs +4 -4
  237. package/dist/headers.cjs +3 -3
  238. package/dist/headers.mjs +2 -2
  239. package/dist/image/server.d.mts +1 -1
  240. package/dist/image/server.d.ts +1 -1
  241. package/dist/image/sharp.d.mts +1 -1
  242. package/dist/image/sharp.d.ts +1 -1
  243. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  244. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  245. package/dist/image.cjs +6 -6
  246. package/dist/image.d.mts +1 -1
  247. package/dist/image.d.ts +1 -1
  248. package/dist/image.mjs +1 -1
  249. package/dist/index.cjs +143 -128
  250. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
  251. package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
  252. package/dist/index.d.mts +31 -82
  253. package/dist/index.d.ts +31 -82
  254. package/dist/index.mjs +214 -199
  255. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  256. package/dist/integrations/orm.d.mts +33 -0
  257. package/dist/integrations/orm.d.ts +33 -0
  258. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  259. package/dist/integrations.cjs +6 -5
  260. package/dist/integrations.d.mts +6 -6
  261. package/dist/integrations.d.ts +6 -6
  262. package/dist/integrations.mjs +5 -4
  263. package/dist/internal/app-markdown-runtime.cjs +4 -4
  264. package/dist/internal/app-markdown-runtime.d.mts +17 -8
  265. package/dist/internal/app-markdown-runtime.d.ts +17 -8
  266. package/dist/internal/app-markdown-runtime.mjs +3 -3
  267. package/dist/internal/build-runtime.cjs +70 -68
  268. package/dist/internal/build-runtime.d.mts +8 -8
  269. package/dist/internal/build-runtime.d.ts +8 -8
  270. package/dist/internal/build-runtime.mjs +69 -67
  271. package/dist/internal/cli-runtime.cjs +45 -44
  272. package/dist/internal/cli-runtime.mjs +44 -43
  273. package/dist/internal/client-error-overlay.cjs +6 -6
  274. package/dist/internal/client-error-overlay.mjs +2 -2
  275. package/dist/internal/client-runtime.cjs +60 -6
  276. package/dist/internal/client-runtime.d.mts +40 -11
  277. package/dist/internal/client-runtime.d.ts +40 -11
  278. package/dist/internal/client-runtime.mjs +58 -4
  279. package/dist/internal/compression-runtime.d.mts +6 -6
  280. package/dist/internal/compression-runtime.d.ts +6 -6
  281. package/dist/internal/config-runtime.cjs +25 -24
  282. package/dist/internal/config-runtime.d.mts +9 -9
  283. package/dist/internal/config-runtime.d.ts +9 -9
  284. package/dist/internal/config-runtime.mjs +24 -23
  285. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  286. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  287. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  288. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  289. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  290. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  291. package/dist/internal/islands-runtime.cjs +33 -4
  292. package/dist/internal/islands-runtime.d.mts +1 -1
  293. package/dist/internal/islands-runtime.d.ts +1 -1
  294. package/dist/internal/islands-runtime.mjs +31 -2
  295. package/dist/internal/native-server-fns.cjs +6 -6
  296. package/dist/internal/native-server-fns.mjs +5 -5
  297. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  298. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  299. package/dist/internal/production-runtime.cjs +54 -40
  300. package/dist/internal/production-runtime.d.mts +23 -15
  301. package/dist/internal/production-runtime.d.ts +23 -15
  302. package/dist/internal/production-runtime.mjs +69 -55
  303. package/dist/internal/react-cache.cjs +3 -3
  304. package/dist/internal/react-cache.mjs +1 -1
  305. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  306. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  307. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  308. package/dist/manager-JOHU6BQI.cjs +15 -0
  309. package/dist/markdown.cjs +7 -3
  310. package/dist/markdown.d.mts +6 -6
  311. package/dist/markdown.d.ts +6 -6
  312. package/dist/markdown.mjs +6 -2
  313. package/dist/middleware.cjs +10 -10
  314. package/dist/middleware.d.mts +8 -8
  315. package/dist/middleware.d.ts +8 -8
  316. package/dist/middleware.mjs +9 -9
  317. package/dist/mobile.d.mts +4 -4
  318. package/dist/mobile.d.ts +4 -4
  319. package/dist/mount.d-BP0nLYQO.d.mts +38 -0
  320. package/dist/mount.d-CkiPky_F.d.ts +38 -0
  321. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  322. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  323. package/dist/{native-tree-HE2FLS72.cjs → native-tree-W2SSJB3Y.cjs} +5 -5
  324. package/dist/{native-tree-YF2DSPKM.mjs → native-tree-Y5YQANW7.mjs} +4 -4
  325. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
  326. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
  327. package/dist/navigation.cjs +8 -7
  328. package/dist/navigation.d.mts +9 -9
  329. package/dist/navigation.d.ts +9 -9
  330. package/dist/navigation.mjs +7 -6
  331. package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
  332. package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
  333. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  334. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  335. package/dist/plugin.cjs +61 -59
  336. package/dist/plugin.d.mts +8 -8
  337. package/dist/plugin.d.ts +8 -8
  338. package/dist/plugin.mjs +60 -58
  339. package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
  340. package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
  341. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
  342. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
  343. package/dist/query/client.cjs +9 -7
  344. package/dist/query/client.mjs +5 -3
  345. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
  346. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +1 -1
  347. package/dist/renderer/none/server.cjs +35 -0
  348. package/dist/renderer/none/server.d.mts +21 -0
  349. package/dist/renderer/none/server.d.ts +21 -0
  350. package/dist/renderer/none/server.mjs +35 -0
  351. package/dist/renderer/react/server.cjs +2 -2
  352. package/dist/renderer/react/server.mjs +3 -3
  353. package/dist/renderer-client.cjs +8 -6
  354. package/dist/renderer-client.d.mts +9 -9
  355. package/dist/renderer-client.d.ts +9 -9
  356. package/dist/renderer-client.mjs +5 -3
  357. package/dist/renderer.cjs +6 -2
  358. package/dist/renderer.d.mts +20 -2
  359. package/dist/renderer.d.ts +20 -2
  360. package/dist/renderer.mjs +5 -1
  361. package/dist/request.cjs +2 -2
  362. package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
  363. package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
  364. package/dist/request.d.mts +7 -7
  365. package/dist/request.d.ts +7 -7
  366. package/dist/request.mjs +1 -1
  367. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
  368. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.d.mts} +1 -1
  369. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  370. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  371. package/dist/{router.d-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
  372. package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
  373. package/dist/routes.cjs +3 -3
  374. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
  375. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
  376. package/dist/routes.d.mts +6 -6
  377. package/dist/routes.d.ts +6 -6
  378. package/dist/routes.mjs +2 -2
  379. package/dist/{rsc-pipeline-T3PWURLJ.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
  380. package/dist/{rsc-pipeline-V4ANLRAA.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
  381. package/dist/{runtime-LRIQ3XH7.mjs → runtime-U7O3HZOZ.mjs} +62 -36
  382. package/dist/{runtime-5AROV2C3.cjs → runtime-X52Q7JFR.cjs} +72 -46
  383. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
  384. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.d.ts} +11 -3
  385. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  386. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  387. package/dist/schema.cjs +6 -2
  388. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  389. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  390. package/dist/schema.d.mts +1 -115
  391. package/dist/schema.d.ts +1 -115
  392. package/dist/schema.mjs +5 -1
  393. package/dist/server-fn-client.d.mts +2 -2
  394. package/dist/server-fn-client.d.ts +2 -2
  395. package/dist/server-fn.cjs +5 -5
  396. package/dist/server-fn.mjs +4 -4
  397. package/dist/server-plugins.cjs +7 -7
  398. package/dist/server-plugins.d.mts +16 -10
  399. package/dist/server-plugins.d.ts +16 -10
  400. package/dist/server-plugins.mjs +8 -8
  401. package/dist/server-query.cjs +6 -6
  402. package/dist/server-query.mjs +5 -5
  403. package/dist/server.cjs +160 -120
  404. package/dist/server.d.mts +20 -14
  405. package/dist/server.d.ts +20 -14
  406. package/dist/server.mjs +138 -98
  407. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
  408. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
  409. package/dist/testing.cjs +17 -17
  410. package/dist/testing.d.mts +6 -6
  411. package/dist/testing.d.ts +6 -6
  412. package/dist/testing.mjs +13 -13
  413. package/dist/theme/server.cjs +3 -3
  414. package/dist/theme/server.mjs +2 -2
  415. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
  416. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
  417. package/dist/version.cjs +2 -2
  418. package/dist/version.mjs +1 -1
  419. package/dist/vite.cjs +63 -61
  420. package/dist/vite.d.mts +32 -12
  421. package/dist/vite.d.ts +32 -12
  422. package/dist/vite.mjs +62 -60
  423. package/dist/workflows.cjs +4 -4
  424. package/dist/workflows.mjs +3 -3
  425. package/package.json +31 -1
  426. package/dist/analyzer-GHWK46LX.cjs +0 -16
  427. package/dist/chunk-5YPBFMBN.cjs +0 -19
  428. package/dist/chunk-OM7WILES.mjs +0 -100
  429. package/dist/chunk-Q5B4LNON.mjs +0 -19
  430. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  431. package/dist/chunk-R53QDV6T.cjs +0 -100
  432. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  433. package/dist/manager-2LUKNX2N.cjs +0 -14
  434. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  435. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  436. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  437. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  438. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  439. /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
@@ -1,17 +1,18 @@
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');
4
3
 
4
+ var _chunkJSOCDYERcjs = require('./chunk-JSOCDYER.cjs');
5
5
 
6
- var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
7
6
 
8
7
 
9
8
 
9
+ var _chunkYVTS3S3Fcjs = require('./chunk-YVTS3S3F.cjs');
10
10
 
11
- var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
12
11
 
12
+ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
13
13
 
14
14
 
15
+ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
15
16
 
16
17
 
17
18
 
@@ -35,21 +36,24 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
35
36
 
36
37
 
37
38
 
38
- var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
39
39
 
40
40
 
41
- var _chunkCLFEQGETcjs = require('./chunk-CLFEQGET.cjs');
42
41
 
42
+ var _chunkUPOYKX4Scjs = require('./chunk-UPOYKX4S.cjs');
43
43
 
44
- var _chunkC7DCMGC4cjs = require('./chunk-C7DCMGC4.cjs');
45
44
 
45
+ var _chunkLPIZMU7Dcjs = require('./chunk-LPIZMU7D.cjs');
46
46
 
47
47
 
48
48
 
49
49
 
50
50
 
51
51
 
52
- var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
52
+
53
+ var _chunkX3MHKLCOcjs = require('./chunk-X3MHKLCO.cjs');
54
+
55
+
56
+ var _chunkCLFEQGETcjs = require('./chunk-CLFEQGET.cjs');
53
57
 
54
58
 
55
59
 
@@ -69,12 +73,17 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
69
73
 
70
74
 
71
75
 
72
- var _chunk7QVRWGBLcjs = require('./chunk-7QVRWGBL.cjs');
76
+
77
+ var _chunk4DRINDGNcjs = require('./chunk-4DRINDGN.cjs');
73
78
 
74
79
 
75
80
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
76
81
 
77
82
 
83
+
84
+ var _chunkQIXEU2WVcjs = require('./chunk-QIXEU2WV.cjs');
85
+
86
+
78
87
  var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
79
88
 
80
89
 
@@ -82,7 +91,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
82
91
  var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
83
92
 
84
93
 
85
- var _chunkV56632LAcjs = require('./chunk-V56632LA.cjs');
94
+ var _chunk22IWL4YDcjs = require('./chunk-22IWL4YD.cjs');
86
95
 
87
96
 
88
97
  var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
@@ -92,7 +101,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
92
101
 
93
102
 
94
103
 
95
- var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
104
+ var _chunk4E57QHPWcjs = require('./chunk-4E57QHPW.cjs');
96
105
 
97
106
 
98
107
 
@@ -100,24 +109,24 @@ var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
100
109
 
101
110
 
102
111
 
103
- var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
104
112
 
105
113
 
114
+ var _chunkQO43L7Z4cjs = require('./chunk-QO43L7Z4.cjs');
106
115
 
107
116
 
108
117
 
109
118
 
110
- var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
111
119
 
112
120
 
113
- var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
114
121
 
122
+ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
115
123
 
116
124
 
117
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
125
+ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
118
126
 
119
127
 
120
128
 
129
+ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
121
130
 
122
131
 
123
132
 
@@ -126,58 +135,58 @@ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
126
135
 
127
136
 
128
137
 
129
- var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
130
138
 
131
139
 
132
- var _chunkHEPJIKKQcjs = require('./chunk-HEPJIKKQ.cjs');
133
140
 
134
141
 
142
+ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
135
143
 
136
- var _chunkXBSKPLHFcjs = require('./chunk-XBSKPLHF.cjs');
137
144
 
145
+ var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
138
146
 
139
- var _chunk7XGWBPQQcjs = require('./chunk-7XGWBPQQ.cjs');
140
147
 
148
+ var _chunkYAEN3L2Fcjs = require('./chunk-YAEN3L2F.cjs');
141
149
 
142
150
 
143
- var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
151
+ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
144
152
 
145
153
 
146
154
 
155
+ var _chunk3T7ALZJFcjs = require('./chunk-3T7ALZJF.cjs');
147
156
 
148
157
 
158
+ var _chunkQ37INCXGcjs = require('./chunk-Q37INCXG.cjs');
149
159
 
150
160
 
151
161
 
152
- var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
162
+ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
153
163
 
154
164
 
155
- var _chunk3CCAICF7cjs = require('./chunk-3CCAICF7.cjs');
156
165
 
157
166
 
158
- var _chunkBT4SEFLCcjs = require('./chunk-BT4SEFLC.cjs');
159
167
 
160
168
 
161
- var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
162
169
 
163
170
 
171
+ var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
164
172
 
165
- var _chunk4ZJ5C7UJcjs = require('./chunk-4ZJ5C7UJ.cjs');
173
+
174
+ var _chunkKCY52OUQcjs = require('./chunk-KCY52OUQ.cjs');
166
175
 
167
176
 
168
177
  var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
169
178
 
170
179
 
171
- var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
172
180
 
173
181
 
182
+ var _chunkBDYM2TN3cjs = require('./chunk-BDYM2TN3.cjs');
174
183
 
175
- var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
176
184
 
185
+ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
177
186
 
178
187
 
179
188
 
180
- var _chunkI32V5CZLcjs = require('./chunk-I32V5CZL.cjs');
189
+ var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
181
190
 
182
191
 
183
192
 
@@ -191,7 +200,7 @@ var _chunkYDXLC4DWcjs = require('./chunk-YDXLC4DW.cjs');
191
200
 
192
201
 
193
202
 
194
- var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
203
+ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
195
204
 
196
205
 
197
206
 
@@ -215,7 +224,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
215
224
 
216
225
 
217
226
 
218
- var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
227
+ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
219
228
 
220
229
 
221
230
 
@@ -223,6 +232,9 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
223
232
  var _chunkDMAP4RNDcjs = require('./chunk-DMAP4RND.cjs');
224
233
 
225
234
 
235
+ var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
236
+
237
+
226
238
  var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
227
239
 
228
240
 
@@ -246,32 +258,29 @@ var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
246
258
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
247
259
 
248
260
 
249
-
250
- var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
251
-
261
+ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
252
262
 
253
263
 
254
- var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
255
264
 
265
+ var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
256
266
 
257
- var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
258
267
 
268
+ var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
259
269
 
260
- var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
261
270
 
262
271
 
272
+ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
263
273
 
264
- var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
265
274
 
266
275
 
267
- var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
276
+ var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
268
277
 
269
278
 
270
- var _chunkA3G5IY2Wcjs = require('./chunk-A3G5IY2W.cjs');
279
+ var _chunkHM7AGSKUcjs = require('./chunk-HM7AGSKU.cjs');
271
280
 
272
281
 
273
282
 
274
- var _chunkJGAE5XPLcjs = require('./chunk-JGAE5XPL.cjs');
283
+ var _chunk4JX3M4C6cjs = require('./chunk-4JX3M4C6.cjs');
275
284
 
276
285
 
277
286
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
@@ -281,6 +290,9 @@ var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
281
290
  var _chunkVOQ7XZZTcjs = require('./chunk-VOQ7XZZT.cjs');
282
291
 
283
292
 
293
+ var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
294
+
295
+
284
296
 
285
297
 
286
298
 
@@ -291,11 +303,11 @@ var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
291
303
 
292
304
 
293
305
 
294
- var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
306
+ var _chunkF43OG25Pcjs = require('./chunk-F43OG25P.cjs');
295
307
 
296
308
 
297
309
 
298
- var _chunkXQSYOVCWcjs = require('./chunk-XQSYOVCW.cjs');
310
+ var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
299
311
 
300
312
 
301
313
  var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
@@ -304,21 +316,24 @@ var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
304
316
  var _chunkHXNLKCWHcjs = require('./chunk-HXNLKCWH.cjs');
305
317
 
306
318
 
319
+ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
307
320
 
308
321
 
309
- var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
310
322
 
311
323
 
312
324
 
313
325
 
314
326
 
327
+ var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
315
328
 
316
329
 
317
- var _chunkHNAISJFDcjs = require('./chunk-HNAISJFD.cjs');
318
330
 
331
+ var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
319
332
 
320
333
 
321
- var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
334
+
335
+
336
+ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
322
337
 
323
338
 
324
339
 
@@ -342,8 +357,8 @@ var _chunkYTVSWXEZcjs = require('./chunk-YTVSWXEZ.cjs');
342
357
  var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
343
358
 
344
359
  // 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);
360
+ var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs);
361
+ var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
347
362
 
348
363
  // src/static-metadata-image.ts
349
364
  var _crypto = require('crypto');
@@ -442,7 +457,7 @@ var RouteManager = class {
442
457
  this.redirects = /* @__PURE__ */ new Map();
443
458
  this.programmaticPages = /* @__PURE__ */ new Map();
444
459
  this.programmaticLayouts = /* @__PURE__ */ new Map();
445
- this.programmaticClientRoutes = _chunk7QVRWGBLcjs.mergeProgrammaticClientRoutes.call(void 0, []);
460
+ this.programmaticClientRoutes = _chunk4DRINDGNcjs.mergeProgrammaticClientRoutes.call(void 0, []);
446
461
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
447
462
  this.config = config;
448
463
  this.viteServer = viteServer;
@@ -474,7 +489,7 @@ var RouteManager = class {
474
489
  await this.discoverFileRoutes(source);
475
490
  await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
476
491
  }
477
- this.programmaticClientRoutes = _chunk7QVRWGBLcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
492
+ this.programmaticClientRoutes = _chunk4DRINDGNcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
478
493
  for (const slot of this.routeSlots.values()) {
479
494
  if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
480
495
  throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
@@ -493,8 +508,8 @@ var RouteManager = class {
493
508
  )
494
509
  );
495
510
  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) }));
511
+ (left, right) => _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, right.pattern)
512
+ ).map((entry) => ({ entry, groupScope: _chunkUPOYKX4Scjs.getRouteGroupScope.call(void 0, entry.pattern) }));
498
513
  for (const slot of this.routeSlots.values()) {
499
514
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
500
515
  this.routeSlotOwnerSegments.set(
@@ -519,9 +534,14 @@ var RouteManager = class {
519
534
  const routePathname = this.toRoutePathname(pathname);
520
535
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
521
536
  const pathParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
537
+ const trimmedPathname = routePathname.replace(/\/+$/, "");
538
+ const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
522
539
  let matchedRoute = null;
523
540
  let params = {};
524
541
  for (const routeEntry of this.routes.values()) {
542
+ if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
543
+ continue;
544
+ }
525
545
  const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
526
546
  if (match.matches) {
527
547
  matchedRoute = routeEntry;
@@ -553,31 +573,36 @@ var RouteManager = class {
553
573
  getRouteSlots() {
554
574
  return new Map(this.routeSlots);
555
575
  }
576
+ /** The layouts that wrap a registered page, root first. */
577
+ getRouteLayouts(pattern) {
578
+ const routeEntry = this.routes.get(pattern);
579
+ return routeEntry ? this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
580
+ }
556
581
  /** Resolve route rules, inherited layouts, and the page export in precedence order. */
557
582
  async resolveRouteRuntimeConfig(pattern) {
558
583
  const routeEntry = this.routes.get(pattern);
559
584
  if (!routeEntry) {
560
585
  throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
561
586
  }
562
- const inherited = _chunkOYZXVBZPcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
587
+ const inherited = _chunkIUKBPBM7cjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
563
588
  const layouts = this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry);
564
589
  const layoutConfigs = [];
565
590
  for (const layout of layouts) {
566
591
  const layoutModule = await this.loadLayoutModule(layout.modulePath);
567
592
  layoutConfigs.push(
568
- _chunkOYZXVBZPcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
569
- _chunkOYZXVBZPcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
593
+ _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0,
594
+ _chunkIUKBPBM7cjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
570
595
  `Layout "${layout.pattern}"`
571
596
  )
572
597
  );
573
598
  }
574
599
  const routeModule = await this.loadRouteModule(routeEntry.modulePath);
575
- const routeConfig = _chunkOYZXVBZPcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
576
- _chunkOYZXVBZPcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
600
+ const routeConfig = _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0,
601
+ _chunkIUKBPBM7cjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
577
602
  `Route "${pattern}"`
578
603
  );
579
- return _chunkOYZXVBZPcjs.resolveFarmRouteRuntimeConfig.call(void 0,
580
- _chunkOYZXVBZPcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
604
+ return _chunkIUKBPBM7cjs.resolveFarmRouteRuntimeConfig.call(void 0,
605
+ _chunkIUKBPBM7cjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
581
606
  `Route "${pattern}"`
582
607
  );
583
608
  }
@@ -605,17 +630,22 @@ var RouteManager = class {
605
630
  matchRedirect(pathname, search = "") {
606
631
  const i18n = this.getI18nConfig();
607
632
  const localeMatch = i18n ? _chunkOWQV6MLMcjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
608
- const routePathname = _optionalChain([localeMatch, 'optionalAccess', _2 => _2.pathname]) || pathname;
633
+ const routePathname = _optionalChain([localeMatch, 'optionalAccess', _2 => _2.pathname]) || this.toRoutePathname(pathname);
609
634
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
635
+ const urlParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
610
636
  for (const redirectEntry of this.redirects.values()) {
611
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, normalizedPath, redirectEntry.route.segments);
637
+ const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
612
638
  if (!match.matches) continue;
613
639
  const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
614
640
  return {
615
641
  redirect: redirectEntry.definition,
616
642
  destination: _chunkHXNLKCWHcjs.appendFarmRedirectQuery.call(void 0,
617
643
  this.localizeRedirectDestination(
618
- interpolateRedirectDestination(redirectEntry.definition.destination, match.params),
644
+ interpolateRedirectDestination(
645
+ redirectEntry.definition.destination,
646
+ match.params,
647
+ getCatchAllParamSegments(redirectEntry.route.segments, urlParts)
648
+ ),
619
649
  _optionalChain([localeMatch, 'optionalAccess', _3 => _3.locale])
620
650
  ),
621
651
  search
@@ -727,6 +757,20 @@ var RouteManager = class {
727
757
  if (_optionalChain([this, 'access', _4 => _4.clientManifestCache, 'optionalAccess', _5 => _5.projectRoot]) === normalizedProjectRoot) {
728
758
  return this.clientManifestCache.manifest;
729
759
  }
760
+ const cacheFile = this.packageClientBoundaryCacheFile;
761
+ return cacheFile ? _chunk4DRINDGNcjs.runWithPackageClientBoundaryCacheFile.call(void 0,
762
+ cacheFile,
763
+ () => this.computeClientManifest(normalizedProjectRoot)
764
+ ) : this.computeClientManifest(normalizedProjectRoot);
765
+ }
766
+ /**
767
+ * @internal Keep package client-boundary inspections in `file` between plans, as the dev server
768
+ * does. Without it, each plan outside a production build reads every package's sources again.
769
+ */
770
+ usePackageClientBoundaryCacheFile(file) {
771
+ this.packageClientBoundaryCacheFile = file;
772
+ }
773
+ computeClientManifest(normalizedProjectRoot) {
730
774
  const toUrlPath = (absolutePath) => {
731
775
  const rootRelative = _chunkQMNWKQL4cjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
732
776
  if (rootRelative !== void 0) return rootRelative;
@@ -736,39 +780,39 @@ var RouteManager = class {
736
780
  }
737
781
  return absolutePath;
738
782
  };
739
- const integrationProviders = _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
783
+ const integrationProviders = _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
740
784
  (provider) => provider.component || provider.type === "clerk"
741
785
  );
742
786
  const unsupportedIntegrationProvider = integrationProviders.find(
743
787
  (provider) => provider.supportsIsolatedHydration !== true
744
788
  );
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) {
789
+ 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
790
  _chunkQMNWKQL4cjs.logger.warn(
747
791
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
748
792
  );
749
793
  }
750
- const isolatedMode = _chunk7QVRWGBLcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
794
+ const isolatedMode = _chunk4DRINDGNcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
751
795
  _optionalChain([this, 'access', _12 => _12.config, 'access', _13 => _13.experimental, 'optionalAccess', _14 => _14.isolatedClientHydration]),
752
796
  {
753
- serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
797
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
754
798
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
755
799
  }
756
800
  );
757
- const planOptions = _chunk7QVRWGBLcjs.getFarmClientHydrationPlanOptions.call(void 0,
801
+ const planOptions = _chunk4DRINDGNcjs.getFarmClientHydrationPlanOptions.call(void 0,
758
802
  this.config.renderer,
759
803
  Boolean(unsupportedIntegrationProvider)
760
804
  );
761
- const islandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
805
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
762
806
  const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
763
807
  entry,
764
- metadata: _chunk7QVRWGBLcjs.getClientModuleHydrationPlan.call(void 0,
808
+ metadata: _chunk4DRINDGNcjs.getClientModuleHydrationPlan.call(void 0,
765
809
  entry.modulePath,
766
810
  normalizedProjectRoot,
767
811
  isolatedMode,
768
812
  islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
769
813
  )
770
814
  }));
771
- const markdownPagePlan = _chunk7QVRWGBLcjs.createMarkdownPageHydrationPlanner.call(void 0,
815
+ const markdownPagePlan = _chunk4DRINDGNcjs.createMarkdownPageHydrationPlanner.call(void 0,
772
816
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
773
817
  normalizedProjectRoot,
774
818
  isolatedMode,
@@ -776,13 +820,13 @@ var RouteManager = class {
776
820
  );
777
821
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
778
822
  entry,
779
- metadata: _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunk7QVRWGBLcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
823
+ metadata: _chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunk4DRINDGNcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
780
824
  ...planOptions,
781
- serverOwners: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
825
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
782
826
  })
783
827
  }));
784
828
  const markdownFallback = routeEntries.find(
785
- ({ entry, metadata }) => _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
829
+ ({ entry, metadata }) => _chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
786
830
  );
787
831
  if (markdownFallback) {
788
832
  _chunkQMNWKQL4cjs.logger.warn(
@@ -790,7 +834,7 @@ var RouteManager = class {
790
834
  );
791
835
  }
792
836
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _24 => _24.find, 'call', _25 => _25(
793
- ({ entry, metadata }) => _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
837
+ ({ entry, metadata }) => _chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
794
838
  ), 'optionalAccess', _26 => _26.metadata, 'access', _27 => _27.staticPackageBoundaries]);
795
839
  if (markdownStaticPackages) {
796
840
  _chunkQMNWKQL4cjs.logger.info(
@@ -798,23 +842,23 @@ var RouteManager = class {
798
842
  );
799
843
  }
800
844
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
801
- if (_chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
845
+ if (_chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
802
846
  _chunkQMNWKQL4cjs.logger.info(
803
847
  `[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
804
848
  );
805
849
  }
806
- _chunk7QVRWGBLcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
850
+ _chunk4DRINDGNcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
807
851
  layoutEntries.map(({ entry, metadata }) => ({
808
852
  pattern: entry.pattern,
809
- depth: _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
853
+ depth: _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
810
854
  metadata
811
855
  })),
812
856
  routeEntries.map(({ entry, metadata }) => ({
813
857
  pattern: getRouteEntryDirectory(entry),
814
- depth: _chunkUJ3R2AH2cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
858
+ depth: _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
815
859
  metadata
816
860
  })),
817
- _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory,
861
+ _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory,
818
862
  { serverOwners: islandsMode }
819
863
  );
820
864
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
@@ -834,7 +878,7 @@ var RouteManager = class {
834
878
  const routes = routeEntries.map(({ entry, metadata }) => {
835
879
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
836
880
  const layoutShouldHydrate = layoutEntries.some(
837
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
881
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
838
882
  );
839
883
  return {
840
884
  pattern: entry.pattern,
@@ -850,8 +894,8 @@ var RouteManager = class {
850
894
  modulePath: toUrlPath(boundary.modulePath)
851
895
  }))
852
896
  } : {},
853
- ..._chunk7QVRWGBLcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
854
- renderPlan: _chunkUJ3R2AH2cjs.createFarmRouteRenderPlan.call(void 0, {
897
+ ..._chunk4DRINDGNcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
898
+ renderPlan: _chunkUPOYKX4Scjs.createFarmRouteRenderPlan.call(void 0, {
855
899
  pageShouldHydrate: metadata.shouldHydrate,
856
900
  layoutShouldHydrate,
857
901
  islandStrategy: metadata.islandStrategy
@@ -867,7 +911,7 @@ var RouteManager = class {
867
911
  }))
868
912
  };
869
913
  });
870
- const treeLayoutPatterns = islandsMode ? _chunkUJ3R2AH2cjs.getFarmServerTreeLayoutPatterns.call(void 0,
914
+ const treeLayoutPatterns = islandsMode ? _chunkUPOYKX4Scjs.getFarmServerTreeLayoutPatterns.call(void 0,
871
915
  layoutEntries.map(({ entry, metadata }) => ({
872
916
  pattern: entry.pattern,
873
917
  shouldHydrate: metadata.shouldHydrate,
@@ -892,7 +936,7 @@ var RouteManager = class {
892
936
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
893
937
  }));
894
938
  const slots = Array.from(this.routeSlots.values()).map((entry) => {
895
- const metadata = _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
939
+ const metadata = _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
896
940
  return {
897
941
  name: entry.name,
898
942
  ownerPattern: entry.ownerPattern,
@@ -901,13 +945,22 @@ var RouteManager = class {
901
945
  containerId: entry.containerId,
902
946
  interception: entry.interception,
903
947
  fallback: entry.fallback,
904
- shouldHydrate: metadata.shouldHydrate,
948
+ // In islands mode a server slot stays on the server; its client components are islands.
949
+ shouldHydrate: metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent),
905
950
  isClientComponent: metadata.isClientComponent,
906
951
  segments: entry.route.segments
907
952
  };
908
953
  });
954
+ const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
955
+ metadata: _chunk4DRINDGNcjs.getClientModuleHydrationPlan.call(void 0,
956
+ entry.modulePath,
957
+ normalizedProjectRoot,
958
+ isolatedMode,
959
+ { ...planOptions, serverOwners: true }
960
+ )
961
+ })) : [];
909
962
  const isolatedClientBoundaryModules = /* @__PURE__ */ new Set();
910
- for (const { metadata } of [...layoutEntries, ...routeEntries]) {
963
+ for (const { metadata } of [...layoutEntries, ...routeEntries, ...slotPlans]) {
911
964
  if (!metadata.hasIsolatedClientBoundaries && !metadata.serverTreeLayout) continue;
912
965
  for (const boundary of metadata.isolatedBoundaries) {
913
966
  isolatedClientBoundaryModules.add(path3.default.resolve(boundary.modulePath));
@@ -990,13 +1043,13 @@ var RouteManager = class {
990
1043
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
991
1044
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
992
1045
  }
993
- if (_chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1046
+ if (_chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
994
1047
  const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
995
- const components = await _chunkXBSKPLHFcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1048
+ const components = await _chunk3T7ALZJFcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
996
1049
  root: this.config.root,
997
1050
  loadModule: this.viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
998
1051
  });
999
- return await _chunkXBSKPLHFcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1052
+ return await _chunk3T7ALZJFcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1000
1053
  components,
1001
1054
  config: mdxConfig
1002
1055
  });
@@ -1046,7 +1099,7 @@ var RouteManager = class {
1046
1099
  */
1047
1100
  createRoutePattern(route) {
1048
1101
  if (route.segments.length === 0) return "/";
1049
- return "/" + route.segments.map(_chunkUJ3R2AH2cjs.formatRouteSegment).join("/");
1102
+ return "/" + route.segments.map(_chunkUPOYKX4Scjs.formatRouteSegment).join("/");
1050
1103
  }
1051
1104
  registerPageRoute(entry) {
1052
1105
  _chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -1065,7 +1118,7 @@ var RouteManager = class {
1065
1118
  }
1066
1119
  async discoverFileRoutes(source) {
1067
1120
  const appDir = _chunkQMNWKQL4cjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
1068
- const componentExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
1121
+ const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
1069
1122
  (extension) => extension.slice(1)
1070
1123
  );
1071
1124
  const componentGlob = componentExtensions.join(",");
@@ -1097,8 +1150,8 @@ var RouteManager = class {
1097
1150
  }
1098
1151
  }
1099
1152
  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);
1153
+ const componentFiles = group.files.filter((file) => !_chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, file));
1154
+ const markdownFiles = group.files.filter(_chunkQ37INCXGcjs.isFarmMarkdownPageFile);
1102
1155
  if (componentFiles.length > 1) {
1103
1156
  throw new Error(
1104
1157
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
@@ -1140,7 +1193,7 @@ var RouteManager = class {
1140
1193
  for (const file of files) {
1141
1194
  const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1142
1195
  const modulePath = path3.default.join(appDir, file);
1143
- const pattern = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1196
+ const pattern = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1144
1197
  const existing = target.get(pattern);
1145
1198
  if (_optionalChain([existing, 'optionalAccess', _34 => _34.sourceRoot]) === source.root) {
1146
1199
  throw new Error(
@@ -1162,7 +1215,7 @@ var RouteManager = class {
1162
1215
  const modulePath = path3.default.join(appDir, file);
1163
1216
  const pattern = this.createRoutePattern(slot.route);
1164
1217
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
1165
- const ownerDirectory = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1218
+ const ownerDirectory = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1166
1219
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
1167
1220
  const existing = this.routeSlots.get(key);
1168
1221
  if (_optionalChain([existing, 'optionalAccess', _35 => _35.sourceRoot]) === source.root) {
@@ -1239,16 +1292,16 @@ var RouteManager = class {
1239
1292
  }
1240
1293
  async discoverProgrammaticRoutes(source, clientRoutes) {
1241
1294
  if (this.viteServer) _chunkE7QOEV5Zcjs.trackProgrammaticRouteSources.call(void 0, );
1242
- const manifests = await _chunkNWUHS6GVcjs.loadProgrammaticRouteManifests.call(void 0, {
1295
+ const manifests = await _chunkQEJWNXRIcjs.loadProgrammaticRouteManifests.call(void 0, {
1243
1296
  root: source.root,
1244
1297
  srcDir: source.srcDir,
1245
1298
  loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
1246
1299
  });
1247
- const graph = this.viteServer ? _chunk7QVRWGBLcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1300
+ const graph = this.viteServer ? _chunk4DRINDGNcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1248
1301
  for (const { filePath, manifest } of manifests) {
1249
1302
  if (graph) {
1250
1303
  clientRoutes.push(
1251
- _chunk7QVRWGBLcjs.resolveProgrammaticClientRoutes.call(void 0, {
1304
+ _chunk4DRINDGNcjs.resolveProgrammaticClientRoutes.call(void 0, {
1252
1305
  graph,
1253
1306
  routesFile: toRealPath(filePath),
1254
1307
  routes: manifest.routes,
@@ -1279,7 +1332,7 @@ var RouteManager = class {
1279
1332
  }
1280
1333
  if (definition.kind === "layout") {
1281
1334
  const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
1282
- const pattern = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1335
+ const pattern = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1283
1336
  const existing = this.layouts.get(pattern);
1284
1337
  if (_optionalChain([existing, 'optionalAccess', _39 => _39.sourceRoot]) === source.root) {
1285
1338
  throw new Error(
@@ -1326,7 +1379,7 @@ var RouteManager = class {
1326
1379
  const matchingLayouts = [];
1327
1380
  for (const { entry, groupScope } of this.orderedLayouts) {
1328
1381
  if (!_chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
1329
- if (groupScope !== null && !_chunkUJ3R2AH2cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1382
+ if (groupScope !== null && !_chunkUPOYKX4Scjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1330
1383
  continue;
1331
1384
  }
1332
1385
  matchingLayouts.push(entry);
@@ -1407,14 +1460,14 @@ var RouteManager = class {
1407
1460
  let page = route;
1408
1461
  for (const boundaryEntry of boundaries.values()) {
1409
1462
  if (!_chunkQMNWKQL4cjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
1410
- const groupScope = _chunkUJ3R2AH2cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1463
+ const groupScope = _chunkUPOYKX4Scjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1411
1464
  if (groupScope !== null) {
1412
1465
  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;
1466
+ if (!_chunkUPOYKX4Scjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1414
1467
  }
1415
1468
  const depth = boundaryEntry.route.segments.length;
1416
1469
  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)) {
1470
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkUPOYKX4Scjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1418
1471
  bestMatch = boundaryEntry;
1419
1472
  }
1420
1473
  }
@@ -1440,7 +1493,7 @@ var RouteManager = class {
1440
1493
  /** The page routes a docs adapter answers before Farm's own page rendering. */
1441
1494
  getDocsAdapterRoutes() {
1442
1495
  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)) {
1496
+ if (!docs || typeof docs !== "object" || !docs.enabled || !docs.adapter || !docs.adapter.server || !docs.adapter.react || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) {
1444
1497
  return void 0;
1445
1498
  }
1446
1499
  const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
@@ -1464,7 +1517,7 @@ var RouteManager = class {
1464
1517
  }));
1465
1518
  const i18n = this.getI18nConfig();
1466
1519
  const docsAdapterRoutes = this.getDocsAdapterRoutes();
1467
- const result = await _chunkX4K7TYN6cjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1520
+ const result = await _chunkYVTS3S3Fcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1468
1521
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
1469
1522
  ...docsAdapterRoutes ? { docsAdapterRoutes } : {}
1470
1523
  });
@@ -1489,16 +1542,17 @@ var RouteManager = class {
1489
1542
  )
1490
1543
  };
1491
1544
  }
1545
+ /** A request pathname as routes see it: without the basePath and, with i18n, the locale. */
1492
1546
  toRoutePathname(pathname) {
1493
1547
  const i18n = this.getI18nConfig();
1494
1548
  return i18n ? _chunkOWQV6MLMcjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, this.config.basePath);
1495
1549
  }
1496
1550
  localizeRedirectDestination(destination, locale) {
1497
- if (!locale || !destination.startsWith("/") || destination.startsWith("//")) {
1551
+ if (!destination.startsWith("/") || destination.startsWith("//")) {
1498
1552
  return destination;
1499
1553
  }
1500
1554
  const i18n = this.getI18nConfig();
1501
- return i18n ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, destination, locale, i18n) : destination;
1555
+ 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
1556
  }
1503
1557
  getI18nConfig() {
1504
1558
  const i18n = this.config.i18n;
@@ -1510,7 +1564,7 @@ var RouteManager = class {
1510
1564
  async isRouteSSG(modulePath) {
1511
1565
  try {
1512
1566
  const mod = await this.loadRouteModule(modulePath);
1513
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1567
+ const rendering = await _chunkYVTS3S3Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1514
1568
  return rendering.ssg;
1515
1569
  } catch (e) {
1516
1570
  return false;
@@ -1522,7 +1576,7 @@ var RouteManager = class {
1522
1576
  async hasRouteISR(modulePath) {
1523
1577
  try {
1524
1578
  const mod = await this.loadRouteModule(modulePath);
1525
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1579
+ const rendering = await _chunkYVTS3S3Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1526
1580
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
1527
1581
  } catch (e2) {
1528
1582
  return false;
@@ -1534,7 +1588,7 @@ var RouteManager = class {
1534
1588
  async getRouteRevalidateInterval(modulePath) {
1535
1589
  try {
1536
1590
  const mod = await this.loadRouteModule(modulePath);
1537
- const rendering = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1591
+ const rendering = await _chunkYVTS3S3Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1538
1592
  return rendering.revalidate;
1539
1593
  } catch (e3) {
1540
1594
  return void 0;
@@ -1542,12 +1596,14 @@ var RouteManager = class {
1542
1596
  }
1543
1597
  };
1544
1598
  function getPageDirectoryField(route, pattern) {
1545
- const directory = _chunkUJ3R2AH2cjs.createRouteDirectoryPattern.call(void 0, route);
1599
+ const directory = _chunkUPOYKX4Scjs.createRouteDirectoryPattern.call(void 0, route);
1546
1600
  return directory === pattern ? {} : { directory };
1547
1601
  }
1548
- function interpolateRedirectDestination(destination, params) {
1602
+ function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
1549
1603
  let result = destination;
1550
- for (const [key, value] of Object.entries(params)) {
1604
+ for (const [key, rawValue] of Object.entries(params)) {
1605
+ const segments = catchAllSegments[key];
1606
+ const value = segments ? segments.map(_chunkPWKAX5MScjs.encodeConfigRouteSegment).join("/") : _chunkPWKAX5MScjs.encodeConfigRouteSegment.call(void 0, rawValue);
1551
1607
  result = replaceAll(result, `[[...${key}]]`, value);
1552
1608
  result = replaceAll(result, `[...${key}]`, value);
1553
1609
  result = replaceAll(result, `[${key}]`, value);
@@ -1556,6 +1612,10 @@ function interpolateRedirectDestination(destination, params) {
1556
1612
  }
1557
1613
  return result;
1558
1614
  }
1615
+ function getCatchAllParamSegments(segments, urlParts) {
1616
+ const index = segments.findIndex((segment) => segment.isCatchAll);
1617
+ return index === -1 ? {} : { [segments[index].segment]: urlParts.slice(index) };
1618
+ }
1559
1619
  function getMetadataImageSuffix(pathname) {
1560
1620
  if (pathname === "/opengraph-image" || pathname.endsWith("/opengraph-image")) {
1561
1621
  return { kind: "opengraph", fileName: "opengraph-image" };
@@ -1705,7 +1765,8 @@ function farmFontImportsPlugin(options = {}) {
1705
1765
  );
1706
1766
  registry.production = false;
1707
1767
  server.middlewares.use(async (req, res, next) => {
1708
- const pathname = new URL(req.url || "/", "http://farm.local").pathname;
1768
+ const target = req.url || "/";
1769
+ const pathname = (target.startsWith("/") ? new URL(`http://farm.local${target}`) : new URL(target, "http://farm.local")).pathname;
1709
1770
  if (pathname === "/@farm/fonts.css") {
1710
1771
  res.statusCode = 200;
1711
1772
  res.setHeader("Content-Type", "text/css; charset=utf-8");
@@ -2668,7 +2729,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
2668
2729
  let hasClerkProvider = false;
2669
2730
  renderedProviders.forEach((provider, index) => {
2670
2731
  let componentExpression = "null";
2671
- if (_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
2732
+ if (_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
2672
2733
  const namespace = `FarmIntegrationProviderModule${index}`;
2673
2734
  imports.push(
2674
2735
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -2725,7 +2786,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
2725
2786
  const entries = [];
2726
2787
  let needsMarkHelper = false;
2727
2788
  providers.forEach((provider, index) => {
2728
- if (!_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
2789
+ if (!_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
2729
2790
  const namespace = `FarmServerIntegrationProviderModule${index}`;
2730
2791
  imports.push(
2731
2792
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -2793,7 +2854,7 @@ function inferFarmIslandStrategy(filePath, root) {
2793
2854
  const result = _compiler.inferStrategy.call(void 0, file, code, {
2794
2855
  parse: parseFarmIslandSource,
2795
2856
  resolve: (specifier, importer) => {
2796
- const resolved = _chunk7QVRWGBLcjs.resolveImportedModule.call(void 0, importer, specifier, root);
2857
+ const resolved = _chunk4DRINDGNcjs.resolveImportedModule.call(void 0, importer, specifier, root);
2797
2858
  return resolved.local ? resolved.path : null;
2798
2859
  }
2799
2860
  });
@@ -2807,7 +2868,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2807
2868
  const files = [];
2808
2869
  const modules = [];
2809
2870
  for (const owner of owners) {
2810
- const rendered = _chunk7QVRWGBLcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
2871
+ const rendered = _chunk4DRINDGNcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
2811
2872
  if (!rendered) {
2812
2873
  return {
2813
2874
  strategy: null,
@@ -2823,7 +2884,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2823
2884
  source = fs.default.readFileSync(module, "utf8");
2824
2885
  } catch (e10) {
2825
2886
  }
2826
- if (_chunk7QVRWGBLcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
2887
+ if (_chunk4DRINDGNcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
2827
2888
  }
2828
2889
  for (const module of modules) {
2829
2890
  const result = inferFarmIslandStrategy(module, root);
@@ -2835,7 +2896,7 @@ function inferFarmRouteRootStrategy(owners, root) {
2835
2896
  function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
2836
2897
  const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
2837
2898
  const onRoute = layouts.filter(
2838
- (layout) => _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
2899
+ (layout) => _chunkUPOYKX4Scjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
2839
2900
  );
2840
2901
  const declared = [
2841
2902
  ...page.islandStrategy ? [page.islandStrategy] : [],
@@ -2855,272 +2916,6 @@ function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
2855
2916
  return _nullishCoalesce(inference.strategy, () => ( "load"));
2856
2917
  }
2857
2918
 
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
2919
  // src/server/renderer.ts
3125
2920
 
3126
2921
  var _https = require('https'); var https = _interopRequireWildcard(_https);
@@ -3133,8 +2928,8 @@ var _stream = require('stream');
3133
2928
 
3134
2929
 
3135
2930
  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()]);
2931
+ const extensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
2932
+ const configuredPath = _optionalChain([config, 'access', _51 => _51.notFound, 'optionalAccess', _52 => _52.component, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
3138
2933
  if (configuredPath) {
3139
2934
  const componentPath = path3.default.isAbsolute(configuredPath) ? path3.default.normalize(configuredPath) : path3.default.resolve(config.root, configuredPath);
3140
2935
  if (!extensions.some((extension) => componentPath.endsWith(extension))) {
@@ -3172,11 +2967,11 @@ function getFarmLayoutKey(pattern, params) {
3172
2967
  );
3173
2968
  }
3174
2969
  function countFarmKeptLayouts(layoutsHeader, layouts, params) {
3175
- const chain = _chunkUJ3R2AH2cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
2970
+ const chain = _chunkUPOYKX4Scjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
3176
2971
  if (chain.length === 0) return 0;
3177
2972
  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;
2973
+ if (chain[0] === keys[0]) return _chunkUPOYKX4Scjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
2974
+ return keys.length > 1 ? 1 + _chunkUPOYKX4Scjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
3180
2975
  }
3181
2976
  function createFarmFlushToken() {
3182
2977
  const bytes = new Uint8Array(16);
@@ -3356,8 +3151,8 @@ function redactErrorText(value) {
3356
3151
  return value.replace(BEARER_PATTERN, "$1[REDACTED]").replace(SECRET_VALUE_PATTERN, "$1=[REDACTED]");
3357
3152
  }
3358
3153
  function isPathInsideRoot(root, filePath) {
3359
- const relative3 = path9.relative(root, filePath);
3360
- return relative3 === "" || !relative3.startsWith("..") && !path9.isAbsolute(relative3);
3154
+ const relative3 = path8.relative(root, filePath);
3155
+ return relative3 === "" || !relative3.startsWith("..") && !path8.isAbsolute(relative3);
3361
3156
  }
3362
3157
  function normalizeStackPath(value) {
3363
3158
  const withoutQuery = value.replace(/[?#].*$/, "");
@@ -3374,13 +3169,13 @@ function findStackLocation(stack, root) {
3374
3169
  );
3375
3170
  if (!match) continue;
3376
3171
  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("/");
3172
+ if (!candidate || candidate.includes(`${path8.sep}node_modules${path8.sep}`)) continue;
3173
+ const absolutePath = path8.resolve(candidate);
3174
+ if (!isPathInsideRoot(root, absolutePath) || !fs4.existsSync(absolutePath)) continue;
3175
+ const relativePath = path8.relative(root, absolutePath).split(path8.sep).join("/");
3381
3176
  return {
3382
3177
  absolutePath,
3383
- displayPath: relativePath || path9.basename(absolutePath),
3178
+ displayPath: relativePath || path8.basename(absolutePath),
3384
3179
  line: Number(match[2]),
3385
3180
  column: Number(match[3])
3386
3181
  };
@@ -3389,7 +3184,7 @@ function findStackLocation(stack, root) {
3389
3184
  }
3390
3185
  function createSourceFrame(location) {
3391
3186
  try {
3392
- const sourceLines = fs5.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3187
+ const sourceLines = fs4.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3393
3188
  if (location.line < 1 || location.line > sourceLines.length) return void 0;
3394
3189
  const start = Math.max(1, location.line - 2);
3395
3190
  const end = Math.min(sourceLines.length, location.line + 2);
@@ -3412,13 +3207,13 @@ function createSourceFrame(location) {
3412
3207
  }
3413
3208
  }
3414
3209
  function sanitizeStack(stack, root) {
3415
- const normalizedRoot = path9.resolve(root);
3210
+ const normalizedRoot = path8.resolve(root);
3416
3211
  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
3212
  }
3418
3213
  function createDefaultErrorDiagnostics(error, root) {
3419
3214
  const normalizedError = error instanceof Error ? error : new Error(typeof error === "string" ? error : "Unknown server rendering error");
3420
3215
  const rawStack = normalizedError.stack || `${normalizedError.name}: ${normalizedError.message}`;
3421
- const location = findStackLocation(rawStack, path9.resolve(root));
3216
+ const location = findStackLocation(rawStack, path8.resolve(root));
3422
3217
  return {
3423
3218
  name: redactErrorText(normalizedError.name || "Error"),
3424
3219
  message: redactErrorText(normalizedError.message || "Unknown server rendering error"),
@@ -3431,7 +3226,7 @@ function createDefaultErrorDiagnostics(error, root) {
3431
3226
  function canBootFarmIslandsClient(config) {
3432
3227
  const docs = config.docs;
3433
3228
  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");
3229
+ 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
3230
  }
3436
3231
 
3437
3232
  // src/server/renderer.ts
@@ -3510,7 +3305,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
3510
3305
  function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
3511
3306
  if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
3512
3307
  warnedSuppressedAsyncHydrationModules.add(modulePath);
3513
- _chunkQMNWKQL4cjs.logger.warn(_chunk7QVRWGBLcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3308
+ _chunkQMNWKQL4cjs.logger.warn(_chunk4DRINDGNcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3514
3309
  }
3515
3310
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
3516
3311
  var documentLayouts = /* @__PURE__ */ new WeakMap();
@@ -3541,7 +3336,7 @@ function appendResponseHeader(res, name, value) {
3541
3336
  }
3542
3337
  }
3543
3338
  function requestHeader(req, name) {
3544
- const value = _optionalChain([req, 'access', _60 => _60.headers, 'optionalAccess', _61 => _61[name]]);
3339
+ const value = _optionalChain([req, 'access', _57 => _57.headers, 'optionalAccess', _58 => _58[name]]);
3545
3340
  return Array.isArray(value) ? value[0] : value;
3546
3341
  }
3547
3342
  function appendResponseVary(res, value) {
@@ -3555,7 +3350,7 @@ function appendResponseVary(res, value) {
3555
3350
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
3556
3351
  if (snapshot.routing === "none") return "";
3557
3352
  const url = new URL(requestPath, "http://farm.local");
3558
- return _chunkUJ3R2AH2cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3353
+ return _chunkUPOYKX4Scjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3559
3354
  }
3560
3355
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
3561
3356
  function createPPRRefreshScript() {
@@ -3585,7 +3380,7 @@ function createDocumentFooter(options) {
3585
3380
  }
3586
3381
  function createDeferredHydrationScript(records) {
3587
3382
  return `<script data-farm-refresh-state>window.__FARM_DEFERRED_DATA__=${serializeInlineValue(
3588
- _chunkXQSYOVCWcjs.snapshotDeferredData.call(void 0, records)
3383
+ _chunkDBYNZIIQcjs.snapshotDeferredData.call(void 0, records)
3589
3384
  )};</script>`;
3590
3385
  }
3591
3386
  function toMiddlewareMap(input) {
@@ -3650,12 +3445,12 @@ async function parseRouteModuleProps(routeModule, input) {
3650
3445
  }
3651
3446
  const schemas = routeModule.__farmRouteSchemas;
3652
3447
  const params = parseRouteModuleSchema(
3653
- _optionalChain([schemas, 'optionalAccess', _62 => _62.params]),
3448
+ _optionalChain([schemas, 'optionalAccess', _59 => _59.params]),
3654
3449
  input.props.params,
3655
3450
  "params",
3656
3451
  input.routePath
3657
3452
  );
3658
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _63 => _63.search]), input.search, "search", input.routePath);
3453
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _60 => _60.search]), input.search, "search", input.routePath);
3659
3454
  return {
3660
3455
  ...input.props,
3661
3456
  params,
@@ -3687,7 +3482,7 @@ function createRouteStateProps(input) {
3687
3482
  function readAppPackageIdentity(root) {
3688
3483
  try {
3689
3484
  return JSON.parse(
3690
- fs6.readFileSync(path10.join(root || process.cwd(), "package.json"), "utf8")
3485
+ fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
3691
3486
  );
3692
3487
  } catch (e13) {
3693
3488
  return {};
@@ -3713,11 +3508,11 @@ var ServerRenderer = class {
3713
3508
  } else {
3714
3509
  _chunkXGJVRPYLcjs.uninstallFarmIslandValues.call(void 0, );
3715
3510
  }
3716
- if (_optionalChain([this, 'access', _64 => _64.config, 'access', _65 => _65.notFound, 'optionalAccess', _66 => _66.component, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()])) {
3511
+ if (_optionalChain([this, 'access', _61 => _61.config, 'access', _62 => _62.notFound, 'optionalAccess', _63 => _63.component, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()])) {
3717
3512
  resolveFarmNotFoundComponentPath(this.config, _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config));
3718
3513
  }
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,
3514
+ 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,
3515
+ _chunk67MZTLTFcjs.resolveFarmRendererModule.call(void 0,
3721
3516
  this.config.root || process.cwd(),
3722
3517
  this.config.renderer.server
3723
3518
  )
@@ -3731,14 +3526,14 @@ var ServerRenderer = class {
3731
3526
  );
3732
3527
  }
3733
3528
  }
3734
- _chunkRD623KW4cjs.assertFarmRendererStreamingRuntime.call(void 0,
3529
+ _chunk67MZTLTFcjs.assertFarmRendererStreamingRuntime.call(void 0,
3735
3530
  this.config.renderer.name,
3736
3531
  this.config.renderer,
3737
3532
  runtime,
3738
3533
  "node"
3739
3534
  );
3740
3535
  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)]);
3536
+ _optionalChain([this, 'access', _66 => _66.routeManager, 'access', _67 => _67.setRendererRuntime, 'optionalCall', _68 => _68(this.rendererRuntime)]);
3742
3537
  await this.applyRendererAppSetup();
3743
3538
  }
3744
3539
  /**
@@ -3747,7 +3542,7 @@ var ServerRenderer = class {
3747
3542
  * re-applied on the next request without restarting.
3748
3543
  */
3749
3544
  async applyRendererAppSetup() {
3750
- const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0,
3545
+ const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0,
3751
3546
  this.config.root || process.cwd(),
3752
3547
  this.config.renderer
3753
3548
  );
@@ -3795,7 +3590,7 @@ var ServerRenderer = class {
3795
3590
  /// Stylesheets the app imported through JS (fontsource packages, component
3796
3591
  /// CSS) that the document must link alongside globals.css — see #658.
3797
3592
  collectDevStyleHrefs() {
3798
- const graph = _optionalChain([this, 'access', _72 => _72.viteServer, 'optionalAccess', _73 => _73.moduleGraph]);
3593
+ const graph = _optionalChain([this, 'access', _69 => _69.viteServer, 'optionalAccess', _70 => _70.moduleGraph]);
3799
3594
  if (!graph) return [];
3800
3595
  return collectDevStylesheetUrls(
3801
3596
  graph.idToModuleMap.values(),
@@ -3820,7 +3615,7 @@ var ServerRenderer = class {
3820
3615
  "data-farm-layout-boundary": "true",
3821
3616
  "data-farm-layout-pattern": pattern,
3822
3617
  ...segment ? { "data-farm-layout-key": segment.key } : {},
3823
- ..._optionalChain([segment, 'optionalAccess', _74 => _74.kept]) ? { "data-farm-layout-kept": "true" } : {},
3618
+ ..._optionalChain([segment, 'optionalAccess', _71 => _71.kept]) ? { "data-farm-layout-kept": "true" } : {},
3824
3619
  style: { display: "contents" }
3825
3620
  },
3826
3621
  layoutElement
@@ -3846,12 +3641,13 @@ var ServerRenderer = class {
3846
3641
  return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
3847
3642
  }
3848
3643
  async renderElementToCompleteHTML(element, options = {}) {
3849
- const streaming = _chunkRD623KW4cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
3644
+ const streaming = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
3850
3645
  const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
3851
3646
  if (renderToPipeableStream) {
3647
+ const inlineBoundaries = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer);
3852
3648
  return await new Promise((resolve3, reject) => {
3853
3649
  const chunks = [];
3854
- let started = false;
3650
+ let shellReady = false;
3855
3651
  let lateNavigation;
3856
3652
  const writable = new (0, _stream.Writable)({
3857
3653
  write(chunk, _encoding, callback) {
@@ -3866,16 +3662,22 @@ var ServerRenderer = class {
3866
3662
  writable.once("error", reject);
3867
3663
  const stream = renderToPipeableStream(element, {
3868
3664
  nonce: _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, ),
3665
+ ...inlineBoundaries ? {
3666
+ progressiveChunkSize: Number.MAX_SAFE_INTEGER,
3667
+ onAllReady() {
3668
+ stream.pipe(writable);
3669
+ }
3670
+ } : {},
3869
3671
  onShellReady() {
3870
- started = true;
3871
- stream.pipe(writable);
3672
+ shellReady = true;
3673
+ if (!inlineBoundaries) stream.pipe(writable);
3872
3674
  },
3873
3675
  onShellError(error) {
3874
3676
  reject(error);
3875
3677
  },
3876
3678
  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))) {
3679
+ if (!shellReady) reject(error);
3680
+ 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
3681
  lateNavigation = error;
3880
3682
  }
3881
3683
  }
@@ -3887,7 +3689,7 @@ var ServerRenderer = class {
3887
3689
  element,
3888
3690
  rendererRenderOptions()
3889
3691
  );
3890
- return await _chunkRD623KW4cjs.readFarmRendererWebStream.call(void 0, stream);
3692
+ return await _chunk67MZTLTFcjs.readFarmRendererWebStream.call(void 0, stream);
3891
3693
  }
3892
3694
  return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
3893
3695
  }
@@ -3907,7 +3709,7 @@ var ServerRenderer = class {
3907
3709
  }
3908
3710
  /** Islands mode sends large prop values once, keyed by content (RFC 0003). */
3909
3711
  islandValues() {
3910
- return _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _75 => _75.config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.serverComponents])) === "islands";
3712
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _72 => _72.config, 'access', _73 => _73.experimental, 'optionalAccess', _74 => _74.serverComponents])) === "islands";
3911
3713
  }
3912
3714
  /**
3913
3715
  * Render the route tree used by client navigation without producing a second
@@ -3918,7 +3720,7 @@ var ServerRenderer = class {
3918
3720
  await this.initialize();
3919
3721
  if (this.viteServer) await this.applyRendererAppSetup();
3920
3722
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
3921
- _chunkJGAE5XPLcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
3723
+ _chunk4JX3M4C6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
3922
3724
  let element = this.rendererRuntime.createElement(input.PageComponent, input.pageProps);
3923
3725
  if (input.LoadingComponent) {
3924
3726
  element = this.rendererRuntime.createElement(
@@ -3956,7 +3758,7 @@ var ServerRenderer = class {
3956
3758
  continue;
3957
3759
  }
3958
3760
  let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
3959
- slotElement = this.wrapClientGraph(slotElement);
3761
+ if (slot.shouldHydrate !== false) slotElement = this.wrapClientGraph(slotElement);
3960
3762
  slotProps[slot.name] = this.rendererRuntime.createElement(
3961
3763
  "div",
3962
3764
  {
@@ -3977,12 +3779,14 @@ var ServerRenderer = class {
3977
3779
  if (input.layoutShouldHydrate) {
3978
3780
  element = this.wrapClientGraph(element);
3979
3781
  }
3980
- return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
3782
+ return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element), {
3783
+ rejectLateRedirects: true
3784
+ });
3981
3785
  }
3982
3786
  async runWithRequestContext(request2, fn) {
3983
- return _chunkHNAISJFDcjs._runWithCurrentRequest.call(void 0,
3787
+ return _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0,
3984
3788
  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, {
3789
+ () => _optionalChain([this, 'access', _75 => _75.i18nRuntime, 'optionalAccess', _76 => _76.config, 'access', _77 => _77.enabled]) ? _chunkRVGLYMJMcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
3986
3790
  redirect: false
3987
3791
  }) : fn()
3988
3792
  );
@@ -3994,10 +3798,10 @@ var ServerRenderer = class {
3994
3798
  * Load SSG manifest from build output
3995
3799
  */
3996
3800
  loadSSGManifest() {
3997
- const manifestPath = path10.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
3801
+ const manifestPath = path9.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
3998
3802
  let content;
3999
3803
  try {
4000
- content = fs6.readFileSync(manifestPath, "utf-8");
3804
+ content = fs5.readFileSync(manifestPath, "utf-8");
4001
3805
  } catch (error) {
4002
3806
  if (error.code === "ENOENT") {
4003
3807
  return;
@@ -4013,7 +3817,7 @@ var ServerRenderer = class {
4013
3817
  * Check if a path should be served from SSG cache
4014
3818
  */
4015
3819
  async shouldServeSSG(pathname) {
4016
- const ssgPage = _chunkX4K7TYN6cjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
3820
+ const ssgPage = _chunkYVTS3S3Fcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
4017
3821
  if (!ssgPage) return null;
4018
3822
  const cached = await this.getCachedSSGPage(pathname);
4019
3823
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -4130,7 +3934,7 @@ var ServerRenderer = class {
4130
3934
  setImmediate(async () => {
4131
3935
  try {
4132
3936
  const mod = await this.routeManager.loadRouteModule(page.filePath);
4133
- if (!_optionalChain([mod, 'optionalAccess', _81 => _81.default])) return;
3937
+ if (!_optionalChain([mod, 'optionalAccess', _78 => _78.default])) return;
4134
3938
  const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
4135
3939
  const layoutModules = await Promise.all(
4136
3940
  layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
@@ -4144,7 +3948,7 @@ var ServerRenderer = class {
4144
3948
  };
4145
3949
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4146
3950
  const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
4147
- (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _82 => _82.pattern])
3951
+ (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _79 => _79.pattern])
4148
3952
  ), () => ( {
4149
3953
  shouldHydrate: false,
4150
3954
  islandStrategy: null
@@ -4216,10 +4020,10 @@ var ServerRenderer = class {
4216
4020
  return true;
4217
4021
  }
4218
4022
  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");
4023
+ 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");
4024
+ if (fs5.existsSync(htmlPath)) {
4025
+ const stat = fs5.statSync(htmlPath);
4026
+ const html = fs5.readFileSync(htmlPath, "utf-8");
4223
4027
  await this.cacheSSGPage(page, html, {
4224
4028
  document: true,
4225
4029
  createdAt: stat.mtimeMs
@@ -4246,18 +4050,18 @@ var ServerRenderer = class {
4246
4050
  await this.initialize();
4247
4051
  if (this.viteServer) await this.applyRendererAppSetup();
4248
4052
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
4249
- _chunkJGAE5XPLcjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4053
+ _chunk4JX3M4C6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4250
4054
  const cspNonce = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, this.security);
4251
4055
  if (cspNonce) {
4252
4056
  req.__FARM_CSP_NONCE__ = cspNonce;
4253
4057
  const header = _chunk6JHZPB52cjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
4254
4058
  res.setHeader(header.key, header.value);
4255
4059
  }
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])
4060
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4061
+ trustProxy: _optionalChain([this, 'access', _80 => _80.config, 'access', _81 => _81.server, 'optionalAccess', _82 => _82.trustProxy])
4258
4062
  });
4259
4063
  const runtime = this.i18nRuntime;
4260
- if (_optionalChain([runtime, 'optionalAccess', _86 => _86.config, 'access', _87 => _87.enabled])) {
4064
+ if (_optionalChain([runtime, 'optionalAccess', _83 => _83.config, 'access', _84 => _84.enabled])) {
4261
4065
  const resolution = runtime.resolveRequest(request2);
4262
4066
  const varyHeaders = _chunkVOQ7XZZTcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4263
4067
  for (const header of varyHeaders) appendResponseVary(res, header);
@@ -4276,7 +4080,7 @@ var ServerRenderer = class {
4276
4080
  return;
4277
4081
  }
4278
4082
  }
4279
- return _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
4083
+ return _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
4280
4084
  cspNonce,
4281
4085
  () => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
4282
4086
  );
@@ -4303,7 +4107,7 @@ var ServerRenderer = class {
4303
4107
  });
4304
4108
  };
4305
4109
  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]) });
4110
+ const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _85 => _85.config, 'access', _86 => _86.server, 'optionalAccess', _87 => _87.trustProxy]) });
4307
4111
  pathname = url.pathname;
4308
4112
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
4309
4113
  searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -4313,18 +4117,19 @@ var ServerRenderer = class {
4313
4117
  completeRender(res.statusCode || 200, pathname);
4314
4118
  return;
4315
4119
  }
4316
- const generatedLlmsKind = this.getGeneratedLlmsKind(pathname);
4120
+ const routePathname = this.routeManager.toRoutePathname(pathname);
4121
+ const generatedLlmsKind = this.getGeneratedLlmsKind(routePathname);
4317
4122
  if (generatedLlmsKind) {
4318
4123
  await this.renderGeneratedLlmsTxt(req, res, generatedLlmsKind);
4319
4124
  completeRender(res.statusCode || 200, pathname);
4320
4125
  return;
4321
4126
  }
4322
- if (pathname === "/robots.txt" && this.getAgentCrawlers().enabled) {
4127
+ if (routePathname === "/robots.txt" && this.getAgentCrawlers().enabled) {
4323
4128
  await this.renderGeneratedRobotsTxt(req, res);
4324
4129
  completeRender(res.statusCode || 200, pathname);
4325
4130
  return;
4326
4131
  }
4327
- if (pathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
4132
+ if (routePathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
4328
4133
  await this.renderGeneratedSitemap(req, res);
4329
4134
  completeRender(res.statusCode || 200, pathname);
4330
4135
  return;
@@ -4342,7 +4147,7 @@ var ServerRenderer = class {
4342
4147
  this.applyDeploymentHeaders(req, res);
4343
4148
  const match = this.routeManager.matchRoute(pathname);
4344
4149
  if (match.route) {
4345
- const redirectLocation = _chunkJGAE5XPLcjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
4150
+ const redirectLocation = _chunk4JX3M4C6cjs.resolveFarmTrailingSlashRedirect.call(void 0, url, this.config.trailingSlash);
4346
4151
  if (redirectLocation) {
4347
4152
  res.statusCode = 308;
4348
4153
  res.setHeader("Location", redirectLocation);
@@ -4366,7 +4171,7 @@ var ServerRenderer = class {
4366
4171
  layouts = match.layouts;
4367
4172
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
4368
4173
  if (!route) {
4369
- if (_chunkY5TOT5F6cjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4174
+ if (_chunkX3MHKLCOcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4370
4175
  await this.renderDefaultMCP(req, res);
4371
4176
  completeRender(res.statusCode || 200, pathname);
4372
4177
  return;
@@ -4383,17 +4188,24 @@ var ServerRenderer = class {
4383
4188
  params
4384
4189
  });
4385
4190
  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") {
4191
+ 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
4192
  await Promise.all([
4388
4193
  this.routeManager.loadRouteModule(route.modulePath),
4389
4194
  ...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
4390
4195
  ]);
4391
- actionRequest = _chunkHNAISJFDcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4392
- trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy])
4196
+ actionRequest = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4197
+ trustProxy: _optionalChain([this, 'access', _91 => _91.config, 'access', _92 => _92.server, 'optionalAccess', _93 => _93.trustProxy])
4393
4198
  });
4394
- const actionResponse = await _chunkCLFEQGETcjs.handleFarmFormActionRequest.call(void 0,
4395
- actionRequest,
4396
- _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, this.config.serverActions)
4199
+ const formActionRequest = actionRequest;
4200
+ const actionResponse = await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0,
4201
+ toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
4202
+ () => _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0,
4203
+ toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
4204
+ () => _chunkCLFEQGETcjs.handleFarmFormActionRequest.call(void 0,
4205
+ formActionRequest,
4206
+ _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, this.config.serverActions)
4207
+ )
4208
+ )
4397
4209
  );
4398
4210
  if (actionResponse) {
4399
4211
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, actionResponse);
@@ -4408,8 +4220,8 @@ var ServerRenderer = class {
4408
4220
  pluginExposedContext = _chunkJYT7AN37cjs.getRequestContextSnapshot.call(void 0, req, {
4409
4221
  exposedOnly: true
4410
4222
  });
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])
4223
+ const currentRequest = _nullishCoalesce(actionRequest, () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4224
+ trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy])
4413
4225
  })));
4414
4226
  const routeContext = await this.resolveRouteContext({
4415
4227
  request: currentRequest,
@@ -4451,11 +4263,11 @@ var ServerRenderer = class {
4451
4263
  searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
4452
4264
  error
4453
4265
  };
4454
- if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _100 => _100.notFound])) {
4266
+ if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _97 => _97.notFound])) {
4455
4267
  res.statusCode = 404;
4456
4268
  PageComponent = programmaticRouteComponents.notFound;
4457
4269
  pageProps = routeStateProps;
4458
- } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _101 => _101.error])) {
4270
+ } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _98 => _98.error])) {
4459
4271
  res.statusCode = 500;
4460
4272
  PageComponent = programmaticRouteComponents.error;
4461
4273
  pageProps = routeStateProps;
@@ -4463,10 +4275,10 @@ var ServerRenderer = class {
4463
4275
  throw error;
4464
4276
  }
4465
4277
  }
4466
- const renderingConfig = await _chunkX4K7TYN6cjs.resolveRouteRenderingConfigFromFile.call(void 0,
4278
+ const renderingConfig = await _chunkYVTS3S3Fcjs.resolveRouteRenderingConfigFromFile.call(void 0,
4467
4279
  routeModule,
4468
4280
  route.modulePath,
4469
- { experimentalPPR: _optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.ppr]) === true }
4281
+ { experimentalPPR: _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.ppr]) === true }
4470
4282
  );
4471
4283
  const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
4472
4284
  const islandsNavigationRequest = Boolean(
@@ -4477,7 +4289,7 @@ var ServerRenderer = class {
4477
4289
  const pprShellOptions = canCachePPRShell ? {
4478
4290
  pathname,
4479
4291
  search: url.search,
4480
- locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _105 => _105.locale]), () => ( "")),
4292
+ locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _102 => _102.locale]), () => ( "")),
4481
4293
  origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
4482
4294
  revalidate: renderingConfig.revalidate
4483
4295
  } : void 0;
@@ -4527,7 +4339,7 @@ var ServerRenderer = class {
4527
4339
  });
4528
4340
  }
4529
4341
  const outerRequest = _chunk3BIASUGRcjs._peekCurrentRequest.call(void 0, );
4530
- const countRequestReads = () => (outerRequest ? _chunkHNAISJFDcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkHNAISJFDcjs._getRequestReadCount.call(void 0, currentRequest);
4342
+ const countRequestReads = () => (outerRequest ? _chunkHDPT6OYEcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkHDPT6OYEcjs._getRequestReadCount.call(void 0, currentRequest);
4531
4343
  const requestReadsBeforeRender = countRequestReads();
4532
4344
  let LoadingFallbackComponent = null;
4533
4345
  if (loadingBoundaryEntry) {
@@ -4549,7 +4361,7 @@ var ServerRenderer = class {
4549
4361
  const routeManifestEntry = routeManifest.routes.find(
4550
4362
  (entry) => entry.pattern === route.pattern
4551
4363
  );
4552
- const moduleMetadata = routeManifestEntry || _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4364
+ const moduleMetadata = routeManifestEntry || _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4553
4365
  const isClientComponent = moduleMetadata.isClientComponent;
4554
4366
  const renderedRouteSlots = await Promise.all(
4555
4367
  routeSlots.map(async (slot) => {
@@ -4600,20 +4412,20 @@ var ServerRenderer = class {
4600
4412
  if (moduleMetadata.suppressedAsyncHydration) {
4601
4413
  warnSuppressedAsyncHydrationOnce(
4602
4414
  route.modulePath,
4603
- _optionalChain([routeManifestEntry, 'optionalAccess', _106 => _106.suppressedAsyncHydrationReason])
4415
+ _optionalChain([routeManifestEntry, 'optionalAccess', _103 => _103.suppressedAsyncHydrationReason])
4604
4416
  );
4605
4417
  }
4606
4418
  const layoutHydrationMetadata = layouts.map((layout) => {
4607
4419
  const manifestEntry = routeManifest.layouts.find(
4608
4420
  (entry) => entry.pattern === layout.pattern
4609
4421
  );
4610
- if (_optionalChain([manifestEntry, 'optionalAccess', _107 => _107.suppressedAsyncHydration])) {
4422
+ if (_optionalChain([manifestEntry, 'optionalAccess', _104 => _104.suppressedAsyncHydration])) {
4611
4423
  warnSuppressedAsyncHydrationOnce(
4612
4424
  layout.modulePath,
4613
4425
  manifestEntry.suppressedAsyncHydrationReason
4614
4426
  );
4615
4427
  }
4616
- if (typeof _optionalChain([manifestEntry, 'optionalAccess', _108 => _108.shouldHydrate]) === "boolean") {
4428
+ if (typeof _optionalChain([manifestEntry, 'optionalAccess', _105 => _105.shouldHydrate]) === "boolean") {
4617
4429
  return {
4618
4430
  isClientComponent: manifestEntry.isClientComponent === true,
4619
4431
  shouldHydrate: manifestEntry.shouldHydrate,
@@ -4634,11 +4446,11 @@ var ServerRenderer = class {
4634
4446
  const clientLayouts = layouts.map((layout, index) => ({
4635
4447
  pattern: layout.pattern,
4636
4448
  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 } : {},
4449
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _106 => _106[index], 'optionalAccess', _107 => _107.shouldHydrate]) === true,
4450
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _108 => _108[index], 'optionalAccess', _109 => _109.islandStrategy]), () => ( null)),
4451
+ ..._optionalChain([layoutHydrationMetadata, 'access', _110 => _110[index], 'optionalAccess', _111 => _111.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4640
4452
  // 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 } : {}
4453
+ ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _112 => _112[index], 'optionalAccess', _113 => _113.serverTree]) === true ? { serverTree: true } : {}
4642
4454
  }));
4643
4455
  const hydrationStrategies = [
4644
4456
  ...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
@@ -4652,9 +4464,9 @@ var ServerRenderer = class {
4652
4464
  layouts.map((layout, index) => ({
4653
4465
  pattern: layout.pattern,
4654
4466
  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))
4467
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _114 => _114[index], 'optionalAccess', _115 => _115.shouldHydrate]) === true,
4468
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _116 => _116[index], 'optionalAccess', _117 => _117.hasIsolatedClientBoundaries]) === true,
4469
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.islandStrategy]), () => ( null))
4658
4470
  })),
4659
4471
  this.config.root || process.cwd(),
4660
4472
  true
@@ -4662,7 +4474,7 @@ var ServerRenderer = class {
4662
4474
  const hasHydratableRouteSlots = renderedRouteSlots.some(
4663
4475
  (slot) => slot.isClientComponent || slot.shouldHydrate
4664
4476
  );
4665
- const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _123 => _123.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4477
+ const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _120 => _120.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4666
4478
  req.__FARM_PAGE_PATH__ = route.modulePath;
4667
4479
  req.__FARM_ROUTE__ = pathname;
4668
4480
  req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
@@ -4675,7 +4487,7 @@ var ServerRenderer = class {
4675
4487
  req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
4676
4488
  req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
4677
4489
  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;
4490
+ req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _121 => _121.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4679
4491
  req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
4680
4492
  name: slot.name,
4681
4493
  ownerPattern: slot.ownerPattern,
@@ -4724,9 +4536,9 @@ var ServerRenderer = class {
4724
4536
  const middlewareDataForContext = middlewareMap;
4725
4537
  await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
4726
4538
  await _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
4727
- await _chunkHNAISJFDcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
4539
+ await _chunkHDPT6OYEcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
4728
4540
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4729
- if (LoadingFallbackComponent) {
4541
+ if (LoadingFallbackComponent && !islandsNavigationRequest) {
4730
4542
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
4731
4543
  ...createRouteStateProps({
4732
4544
  params,
@@ -4747,7 +4559,7 @@ var ServerRenderer = class {
4747
4559
  } else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
4748
4560
  pageElement = await this.isolateServerPage(
4749
4561
  pageElement,
4750
- _optionalChain([routeManifestEntry, 'optionalAccess', _125 => _125.serverTree]) === true
4562
+ _optionalChain([routeManifestEntry, 'optionalAccess', _122 => _122.serverTree]) === true
4751
4563
  );
4752
4564
  }
4753
4565
  pageElement = this.createPageBoundary(pageElement, {
@@ -4757,7 +4569,27 @@ var ServerRenderer = class {
4757
4569
  });
4758
4570
  const islandsSegments = Boolean(islands && this.islandValues());
4759
4571
  const keptLayoutCount = islandsSegments && !renderingConfig.ssg && !shouldHydrateLayout && renderedRouteSlots.length === 0 ? countFarmKeptLayouts(requestHeader(req, "f-layouts"), layouts, params) : 0;
4760
- const keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
4572
+ let keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
4573
+ if (keptLayouts > 0) {
4574
+ let keptElement = null;
4575
+ for (let i = keptLayouts - 1; i >= 0; i--) {
4576
+ const KeptLayout = _optionalChain([layoutModules, 'access', _123 => _123[i], 'optionalAccess', _124 => _124.default]);
4577
+ if (KeptLayout) {
4578
+ keptElement = this.rendererRuntime.createElement(KeptLayout, {
4579
+ children: keptElement,
4580
+ params
4581
+ });
4582
+ }
4583
+ }
4584
+ try {
4585
+ await this.renderElementToCompleteHTML(
4586
+ await this.wrapWithIntegrationProviders(keptElement),
4587
+ { rejectLateErrors: true }
4588
+ );
4589
+ } catch (e14) {
4590
+ keptLayouts = 0;
4591
+ }
4592
+ }
4761
4593
  let wrappedElement = pageElement;
4762
4594
  for (let i = layoutModules.length - 1; i >= 0; i--) {
4763
4595
  const layoutModule = layoutModules[i];
@@ -4778,7 +4610,7 @@ var ServerRenderer = class {
4778
4610
  slot.module.default,
4779
4611
  slot.props
4780
4612
  );
4781
- slotElement = this.wrapClientGraph(slotElement);
4613
+ if (slot.shouldHydrate) slotElement = this.wrapClientGraph(slotElement);
4782
4614
  slotElement = this.rendererRuntime.createElement(
4783
4615
  "div",
4784
4616
  {
@@ -4790,7 +4622,7 @@ var ServerRenderer = class {
4790
4622
  );
4791
4623
  slotProps[slot.name] = slotElement;
4792
4624
  }
4793
- wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _126 => _126[i], 'optionalAccess', _127 => _127.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4625
+ wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _125 => _125[i], 'optionalAccess', _126 => _126.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4794
4626
  LayoutComponent,
4795
4627
  { params },
4796
4628
  { children: wrappedElement, ...slotProps },
@@ -4925,7 +4757,7 @@ var ServerRenderer = class {
4925
4757
  }
4926
4758
  }
4927
4759
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
4928
- const errorStatus = _chunkUJ3R2AH2cjs.resolveDefaultErrorStatus.call(void 0, error);
4760
+ const errorStatus = _chunkUPOYKX4Scjs.resolveDefaultErrorStatus.call(void 0, error);
4929
4761
  if (pprRefreshRoute) {
4930
4762
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4931
4763
  type: "ppr.refresh.error",
@@ -4961,32 +4793,32 @@ var ServerRenderer = class {
4961
4793
  }
4962
4794
  }
4963
4795
  async wrapWithIntegrationProviders(element) {
4964
- const providers = _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, this.config.integrations);
4796
+ const providers = _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, this.config.integrations);
4965
4797
  let wrapped = element;
4966
4798
  for (let i = providers.length - 1; i >= 0; i--) {
4967
4799
  const provider = providers[i];
4968
4800
  if (provider.component || provider.type === "clerk") {
4969
- const rendererCapabilities = _chunkRD623KW4cjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
4801
+ const rendererCapabilities = _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
4970
4802
  if (!rendererCapabilities.functionComponents) {
4971
4803
  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.`
4804
+ `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
4805
  );
4974
4806
  }
4975
- if (provider.type === "clerk" && !_chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer)) {
4807
+ if (provider.type === "clerk" && !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) {
4976
4808
  throw new Error(
4977
4809
  `Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
4978
4810
  );
4979
4811
  }
4980
4812
  let ProviderComponent;
4981
4813
  let providerSourceModule;
4982
- if (_chunkI32V5CZLcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4814
+ if (_chunkBDYM2TN3cjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4983
4815
  providerSourceModule = provider.component.module;
4984
4816
  const providerModuleId = provider.component.module.startsWith(".") ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0,
4985
- path10.resolve(this.config.root, provider.component.module),
4817
+ path9.resolve(this.config.root, provider.component.module),
4986
4818
  this.config.root
4987
4819
  ) : provider.component.module;
4988
4820
  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
4821
+ provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
4990
4822
  );
4991
4823
  ProviderComponent = providerModule[provider.component.export || "default"];
4992
4824
  } else if (typeof provider.component === "function") {
@@ -5008,7 +4840,7 @@ var ServerRenderer = class {
5008
4840
  }
5009
4841
  if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
5010
4842
  _nullishCoalesce(providerSourceModule, () => ( "")),
5011
- _chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _131 => _131.config, 'access', _132 => _132.renderer, 'optionalAccess', _133 => _133.componentExtensions]))
4843
+ _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _130 => _130.config, 'access', _131 => _131.renderer, 'optionalAccess', _132 => _132.componentExtensions]))
5012
4844
  )) {
5013
4845
  ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
5014
4846
  }
@@ -5077,7 +4909,9 @@ var ServerRenderer = class {
5077
4909
  );
5078
4910
  metadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
5079
4911
  metadata,
5080
- _chunk2C5L5RPMcjs.getFarmMarkdownAlternatePath.call(void 0, _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
4912
+ _chunkFT6KJHS3cjs.getFarmMarkdownAlternatePath.call(void 0, _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
4913
+ routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
4914
+ })
5081
4915
  );
5082
4916
  return metadata;
5083
4917
  }
@@ -5134,8 +4968,8 @@ var ServerRenderer = class {
5134
4968
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
5135
4969
  );
5136
4970
  }
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])
4971
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
4972
+ trustProxy: _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.server, 'optionalAccess', _135 => _135.trustProxy])
5139
4973
  });
5140
4974
  const url = new URL(request2.url);
5141
4975
  const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
@@ -5149,11 +4983,11 @@ var ServerRenderer = class {
5149
4983
  path: match.routePath,
5150
4984
  ...llmsContext
5151
4985
  }) : routeModule.default;
5152
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkFJWN7RV4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
5153
- origin: url.origin,
4986
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkQO43L7Z4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
4987
+ origin: await this.getAgentOrigin(request2),
5154
4988
  readMarkdown: llmsContext.markdown
5155
4989
  }) : value;
5156
- const response = _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
4990
+ const response = _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5157
4991
  method,
5158
4992
  request: request2
5159
4993
  });
@@ -5171,25 +5005,25 @@ var ServerRenderer = class {
5171
5005
  }
5172
5006
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
5173
5007
  getGeneratedLlmsKind(pathname) {
5174
- const config = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _137 => _137.config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.llmsTxt]));
5008
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.agent, 'optionalAccess', _138 => _138.llmsTxt]));
5175
5009
  if (!config.enabled) return null;
5176
5010
  if (pathname === "/llms.txt") return "llms";
5177
5011
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
5178
5012
  }
5179
5013
  async renderGeneratedLlmsTxt(req, res, kind) {
5180
5014
  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])
5015
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5016
+ trustProxy: _optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.server, 'optionalAccess', _141 => _141.trustProxy])
5183
5017
  });
5184
- const config = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _143 => _143.config, 'access', _144 => _144.agent, 'optionalAccess', _145 => _145.llmsTxt]));
5018
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt]));
5185
5019
  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,
5020
+ const body = kind === "llms-full" ? await _chunkQO43L7Z4cjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5021
+ origin: await this.getAgentOrigin(request2),
5188
5022
  readMarkdown: context.markdown
5189
5023
  }) : context.defaults;
5190
5024
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5191
5025
  res,
5192
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0,
5026
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0,
5193
5027
  kind,
5194
5028
  body,
5195
5029
  { revalidate: config.revalidate },
@@ -5208,23 +5042,23 @@ var ServerRenderer = class {
5208
5042
  }
5209
5043
  }
5210
5044
  getAgentCrawlers() {
5211
- return _chunkO6L3YYPMcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _146 => _146.config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.crawlers]));
5045
+ return _chunk4E57QHPWcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.agent, 'optionalAccess', _147 => _147.crawlers]));
5212
5046
  }
5213
5047
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
5214
5048
  async renderGeneratedRobotsTxt(req, res) {
5215
5049
  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;
5050
+ 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
5051
  const rootLayout = this.routeManager.getLayouts().get("/");
5218
5052
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5219
- const robots = _chunkO6L3YYPMcjs.createFarmAgentRobots.call(void 0, {
5053
+ const robots = _chunk4E57QHPWcjs.createFarmAgentRobots.call(void 0, {
5220
5054
  crawlers: this.getAgentCrawlers(),
5221
5055
  sitemapPath,
5222
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _154 => _154.metadataBase]),
5056
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _153 => _153.metadataBase]),
5223
5057
  basePath: this.config.basePath
5224
5058
  });
5225
5059
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5226
5060
  res,
5227
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5061
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5228
5062
  );
5229
5063
  } catch (error) {
5230
5064
  _chunkQMNWKQL4cjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -5238,13 +5072,13 @@ var ServerRenderer = class {
5238
5072
  }
5239
5073
  }
5240
5074
  getAgentSitemap() {
5241
- return _chunkO6L3YYPMcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _155 => _155.config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.sitemap]));
5075
+ return _chunk4E57QHPWcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _154 => _154.config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.sitemap]));
5242
5076
  }
5243
5077
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
5244
5078
  async renderGeneratedSitemap(req, res) {
5245
5079
  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])
5080
+ const request2 = _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5081
+ trustProxy: _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.server, 'optionalAccess', _159 => _159.trustProxy])
5248
5082
  });
5249
5083
  const sources = await Promise.all(
5250
5084
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5253,22 +5087,26 @@ var ServerRenderer = class {
5253
5087
  _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
5254
5088
  return void 0;
5255
5089
  }),
5256
- fs6.promises.stat(route.modulePath).catch(() => void 0)
5090
+ fs5.promises.stat(route.modulePath).catch(() => void 0)
5257
5091
  ]);
5092
+ if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _160 => _160.metadata]))) return null;
5258
5093
  return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _161 => _161.mtime, 'access', _162 => _162.toISOString, 'call', _163 => _163()]) };
5259
5094
  })
5260
5095
  );
5261
5096
  const rootLayout = this.routeManager.getLayouts().get("/");
5262
5097
  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
- });
5098
+ const sitemap = _chunk4E57QHPWcjs.createFarmDefaultSitemap.call(void 0,
5099
+ sources.filter((source) => source !== null),
5100
+ {
5101
+ origin: new URL(request2.url).origin,
5102
+ config: this.getAgentSitemap(),
5103
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _164 => _164.metadataBase]),
5104
+ basePath: this.config.basePath
5105
+ }
5106
+ );
5269
5107
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
5270
5108
  res,
5271
- _chunkUJ3R2AH2cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5109
+ _chunkUPOYKX4Scjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5272
5110
  );
5273
5111
  } catch (error) {
5274
5112
  _chunkQMNWKQL4cjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -5297,47 +5135,64 @@ var ServerRenderer = class {
5297
5135
  getAgentListedRoutes() {
5298
5136
  const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _165 => _165.middlewareRoutes, 'optionalCall', _166 => _166()]), () => ( [])) };
5299
5137
  return [...this.routeManager.getRoutes()].filter(
5300
- ([pattern]) => !pattern.includes("[") && !_chunkUJ3R2AH2cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5138
+ ([pattern]) => !pattern.includes("[") && !_chunkUPOYKX4Scjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5301
5139
  );
5302
5140
  }
5141
+ /**
5142
+ * Whether a listed page renders noindex: its own `robots`, else its nearest layout's, as
5143
+ * the production server decides. A layout that fails to load is surfaced by the page.
5144
+ */
5145
+ async isAgentPageNoIndex(pattern, metadata) {
5146
+ const layoutMetadata = await Promise.all(
5147
+ this.routeManager.getRouteLayouts(pattern).map(
5148
+ (layout) => this.routeManager.loadLayoutModule(layout.modulePath).then(
5149
+ (module) => module.metadata,
5150
+ () => void 0
5151
+ )
5152
+ )
5153
+ );
5154
+ return _chunkQO43L7Z4cjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
5155
+ }
5303
5156
  /**
5304
5157
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
5305
5158
  * server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
5306
5159
  * or a registered server such as the docs engine's. Production applies the same rules.
5307
5160
  */
5308
5161
  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;
5162
+ 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
5163
  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,
5164
+ if (this.routeManager.matchRoute(_chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5165
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkX3MHKLCOcjs.createFarmDefaultMCPServer.call(void 0,
5313
5166
  readAppPackageIdentity(this.config.root),
5314
- _chunkA3G5IY2Wcjs.FARM_VERSION
5167
+ _chunkHM7AGSKUcjs.FARM_VERSION
5315
5168
  ))));
5316
- return _chunkY5TOT5F6cjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5169
+ return _chunkX3MHKLCOcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5317
5170
  }
5318
5171
  async renderDefaultMCP(req, res) {
5319
5172
  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]) })));
5173
+ 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
5174
  try {
5322
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-OXT73ZBY.cjs");
5175
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-FER4MQDF.cjs");
5323
5176
  const origin = new URL(request2.url).origin;
5324
5177
  const response = await handleFarmDefaultMCPRequest(request2, {
5325
5178
  server,
5326
5179
  basePath: this.config.basePath,
5327
5180
  listPages: async () => {
5328
5181
  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
- }))
5182
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
5183
+ const module = await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }));
5184
+ const metadata = module.metadata;
5185
+ return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
5186
+ })
5187
+ );
5188
+ return _chunkX3MHKLCOcjs.collectFarmDefaultMCPPages.call(void 0,
5189
+ sources.filter((source) => source !== null),
5190
+ {
5191
+ origin,
5192
+ basePath: this.config.basePath,
5193
+ markdown: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md)
5194
+ }
5335
5195
  );
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
5196
  },
5342
5197
  // Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
5343
5198
  readMarkdown: this.createDevMarkdownReader(req)
@@ -5360,13 +5215,14 @@ var ServerRenderer = class {
5360
5215
  }
5361
5216
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
5362
5217
  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;
5218
+ const config = _chunkQO43L7Z4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.llmsTxt]));
5219
+ const origin = await this.getAgentOrigin(request2);
5365
5220
  const sources = await Promise.all(
5366
5221
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
5367
5222
  try {
5368
5223
  const module = await this.routeManager.loadRouteModule(route.modulePath);
5369
5224
  if (module.__farmRouteGuard) return null;
5225
+ if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
5370
5226
  return { pattern, metadata: module.metadata };
5371
5227
  } catch (error) {
5372
5228
  _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
@@ -5376,24 +5232,24 @@ var ServerRenderer = class {
5376
5232
  );
5377
5233
  const rootLayout = this.routeManager.getLayouts().get("/");
5378
5234
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5379
- const pages = _chunkFJWN7RV4cjs.collectFarmLlmsTxtPages.call(void 0,
5235
+ const pages = _chunkQO43L7Z4cjs.collectFarmLlmsTxtPages.call(void 0,
5380
5236
  sources.filter((source) => source !== null),
5381
5237
  {
5382
5238
  origin,
5383
5239
  basePath: this.config.basePath,
5384
- markdown: _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5240
+ markdown: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, this.config.md),
5385
5241
  include: config.include,
5386
5242
  exclude: config.exclude
5387
5243
  }
5388
5244
  );
5389
5245
  return {
5390
5246
  pages,
5391
- defaults: _chunkFJWN7RV4cjs.createFarmDefaultLlmsTxt.call(void 0, {
5247
+ defaults: _chunkQO43L7Z4cjs.createFarmDefaultLlmsTxt.call(void 0, {
5392
5248
  origin,
5393
5249
  pages,
5394
5250
  config,
5395
5251
  rootMetadata,
5396
- mcp: _optionalChain([this, 'access', _178 => _178.config, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.aiCatalog]) === false ? [] : _chunkC7DCMGC4cjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5252
+ mcp: _optionalChain([this, 'access', _178 => _178.config, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.aiCatalog]) === false ? [] : _chunkLPIZMU7Dcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5397
5253
  basePath: this.config.basePath,
5398
5254
  apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
5399
5255
  _chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
@@ -5403,9 +5259,27 @@ var ServerRenderer = class {
5403
5259
  defaultMCP: () => this.getDefaultMCPServer()
5404
5260
  })
5405
5261
  }),
5406
- ...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
5262
+ ...options.full ? {
5263
+ markdown: _chunkQO43L7Z4cjs.readFarmLlmsMarkdownFrom.call(void 0,
5264
+ new URL(request2.url).origin,
5265
+ origin,
5266
+ this.createDevMarkdownReader(options.req)
5267
+ )
5268
+ } : {}
5407
5269
  };
5408
5270
  }
5271
+ /**
5272
+ * The origin llms.txt and llms-full.txt link to: the root layout's `metadataBase`, else the
5273
+ * request's origin, as for the sitemap and the production server.
5274
+ */
5275
+ async getAgentOrigin(request2) {
5276
+ const rootLayout = this.routeManager.getLayouts().get("/");
5277
+ const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5278
+ return _chunkQO43L7Z4cjs.resolveFarmAgentOrigin.call(void 0,
5279
+ _optionalChain([rootMetadata, 'optionalAccess', _181 => _181.metadataBase]),
5280
+ new URL(request2.url).origin
5281
+ );
5282
+ }
5409
5283
  /**
5410
5284
  * Reads page mirrors back through this dev server, the way its .md handler
5411
5285
  * renders pages, so Markdown sources and agent overrides are included. Requests
@@ -5416,17 +5290,17 @@ var ServerRenderer = class {
5416
5290
  * body is discarded.
5417
5291
  */
5418
5292
  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) {
5293
+ const socket = _optionalChain([req, 'optionalAccess', _182 => _182.socket]);
5294
+ if (_optionalChain([req, 'optionalAccess', _183 => _183.method, 'optionalAccess', _184 => _184.toUpperCase, 'call', _185 => _185()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _186 => _186.localAddress]) || !socket.localPort) {
5421
5295
  return async () => null;
5422
5296
  }
5423
5297
  if (socket.encrypted) {
5424
5298
  const address = { host: socket.localAddress, port: socket.localPort };
5425
- return _chunkFJWN7RV4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5299
+ return _chunkQO43L7Z4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5426
5300
  }
5427
5301
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
5428
5302
  const localOrigin = `http://${host}:${socket.localPort}`;
5429
- const read = _chunkFJWN7RV4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5303
+ const read = _chunkQO43L7Z4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5430
5304
  return (url) => {
5431
5305
  const target = new URL(url);
5432
5306
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -5469,7 +5343,7 @@ var ServerRenderer = class {
5469
5343
  const response = await _chunkAXVRUDMBcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
5470
5344
  method: req.method,
5471
5345
  ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
5472
- renderer: _chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
5346
+ renderer: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
5473
5347
  });
5474
5348
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
5475
5349
  }
@@ -5482,8 +5356,8 @@ var ServerRenderer = class {
5482
5356
  return;
5483
5357
  }
5484
5358
  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])
5359
+ const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
5360
+ trustProxy: _optionalChain([this, 'access', _187 => _187.config, 'access', _188 => _188.server, 'optionalAccess', _189 => _189.trustProxy])
5487
5361
  });
5488
5362
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
5489
5363
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -5504,7 +5378,7 @@ var ServerRenderer = class {
5504
5378
  res.end();
5505
5379
  return;
5506
5380
  }
5507
- res.write(await fs6.promises.readFile(image.modulePath));
5381
+ res.write(await fs5.promises.readFile(image.modulePath));
5508
5382
  res.end();
5509
5383
  }
5510
5384
  async renderRouteErrorBoundary(req, res, options) {
@@ -5633,7 +5507,7 @@ var ServerRenderer = class {
5633
5507
  modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
5634
5508
  })
5635
5509
  );
5636
- const deferredProps = _chunkXQSYOVCWcjs.prepareDeferredData.call(void 0, {
5510
+ const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
5637
5511
  page: req.__FARM_PROPS__ || {},
5638
5512
  slots: routeSlots
5639
5513
  });
@@ -5658,12 +5532,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
5658
5532
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
5659
5533
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
5660
5534
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5661
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5535
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5662
5536
  window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5663
5537
  </script>`);
5664
5538
  const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
5665
5539
  const rendererHydrationScript = farmScripts(
5666
- _optionalChain([this, 'access', _189 => _189.rendererRuntime, 'access', _190 => _190.generateHydrationScript, 'optionalCall', _191 => _191()]) || ""
5540
+ _optionalChain([this, 'access', _190 => _190.rendererRuntime, 'access', _191 => _191.generateHydrationScript, 'optionalCall', _192 => _192()]) || ""
5667
5541
  );
5668
5542
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
5669
5543
  const farmClientScript = farmScripts(
@@ -5672,8 +5546,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5672
5546
  const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
5673
5547
  element,
5674
5548
  {
5675
- rejectLateNavigation: _chunk2C5L5RPMcjs._isFarmMarkdownPageCheck.call(void 0,
5676
- _optionalChain([req, 'access', _192 => _192.headers, 'optionalAccess', _193 => _193[_chunk2C5L5RPMcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5549
+ rejectLateNavigation: _chunkFT6KJHS3cjs._isFarmMarkdownPageCheck.call(void 0,
5550
+ _optionalChain([req, 'access', _193 => _193.headers, 'optionalAccess', _194 => _194[_chunkFT6KJHS3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5677
5551
  )
5678
5552
  }
5679
5553
  );
@@ -5685,7 +5559,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5685
5559
  viewport: viewportTags
5686
5560
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5687
5561
  pathname: getFarmMetadataPathname(req),
5688
- jsonLd: _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.agent, 'optionalAccess', _196 => _196.jsonLd])
5562
+ jsonLd: _optionalChain([this, 'access', _195 => _195.config, 'access', _196 => _196.agent, 'optionalAccess', _197 => _197.jsonLd])
5689
5563
  });
5690
5564
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
5691
5565
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
@@ -5695,19 +5569,19 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5695
5569
  i18nSnapshot,
5696
5570
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5697
5571
  ) : "";
5698
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
5572
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
5699
5573
  this.config.theme,
5700
5574
  this.config.basePath,
5701
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
5575
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
5702
5576
  );
5703
5577
  themeDocument.head = farmScripts(themeDocument.head);
5704
- const fullDocument = _chunkUJ3R2AH2cjs.extractFarmFullDocument.call(void 0, content);
5578
+ const fullDocument = _chunkUPOYKX4Scjs.extractFarmFullDocument.call(void 0, content);
5705
5579
  let html;
5706
5580
  if (fullDocument) {
5707
5581
  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, {
5582
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5583
+ const effectiveRendererHead = hasExplicitTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5584
+ html = _chunkUPOYKX4Scjs.composeFarmFullDocument.call(void 0, documentHtml, {
5711
5585
  fallbackIcon: !hasFavicon,
5712
5586
  viewport: viewportTags,
5713
5587
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -5733,7 +5607,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5733
5607
  });
5734
5608
  } else {
5735
5609
  html = `<!DOCTYPE html>
5736
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _197 => _197.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5610
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _198 => _198.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5737
5611
  <head>
5738
5612
  ${themeDocument.head}
5739
5613
  <meta charset="utf-8">
@@ -5764,7 +5638,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5764
5638
  const securedHtml = this.secureDocumentHTML(req, html);
5765
5639
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
5766
5640
  res.end();
5767
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _198 => _198.onComplete, 'optionalCall', _199 => _199(securedHtml)]);
5641
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _199 => _199.onComplete, 'optionalCall', _200 => _200(securedHtml)]);
5768
5642
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5769
5643
  type: "render.stream.complete",
5770
5644
  route,
@@ -5774,7 +5648,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5774
5648
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
5775
5649
  throw error;
5776
5650
  } finally {
5777
- _optionalChain([clearMiddlewareData, 'optionalCall', _200 => _200()]);
5651
+ _optionalChain([clearMiddlewareData, 'optionalCall', _201 => _201()]);
5778
5652
  }
5779
5653
  }
5780
5654
  /**
@@ -5789,7 +5663,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5789
5663
  if (!rootLayout) return false;
5790
5664
  try {
5791
5665
  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") {
5666
+ 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
5667
  return false;
5794
5668
  }
5795
5669
  const cached = documentLayouts.get(Layout);
@@ -5801,12 +5675,12 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5801
5675
  params: {}
5802
5676
  });
5803
5677
  rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
5804
- } catch (e14) {
5678
+ } catch (e15) {
5805
5679
  rendersDocument = false;
5806
5680
  }
5807
5681
  documentLayouts.set(Layout, rendersDocument);
5808
5682
  return rendersDocument;
5809
- } catch (e15) {
5683
+ } catch (e16) {
5810
5684
  return false;
5811
5685
  }
5812
5686
  }
@@ -5814,7 +5688,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5814
5688
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
5815
5689
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
5816
5690
  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))) {
5691
+ 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
5692
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
5819
5693
  }
5820
5694
  return new Promise((resolve3, reject) => {
@@ -5903,7 +5777,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5903
5777
  modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
5904
5778
  })
5905
5779
  );
5906
- const deferredProps = _chunkXQSYOVCWcjs.prepareDeferredData.call(void 0, {
5780
+ const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
5907
5781
  page: req.__FARM_PROPS__ || {},
5908
5782
  slots: routeSlotPayload
5909
5783
  });
@@ -5930,13 +5804,13 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
5930
5804
  req.__FARM_LOADING_MODULE_PATH__ || null
5931
5805
  )};
5932
5806
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5933
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5807
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5934
5808
  window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5935
5809
  </script>`;
5936
5810
  const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
5937
5811
  const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
5938
5812
  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;
5939
- const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && canBootFarmIslandsClient(this.config);
5813
+ const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
5940
5814
  const hydrationClickQueueScript = !islandsOnlyPage && !bootClient && (isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true) ? createPreHydrationClickQueueScript() : "";
5941
5815
  const {
5942
5816
  title,
@@ -5946,7 +5820,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5946
5820
  viewport: viewportTags
5947
5821
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5948
5822
  pathname: getFarmMetadataPathname(req),
5949
- jsonLd: _optionalChain([this, 'access', _207 => _207.config, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.jsonLd])
5823
+ jsonLd: _optionalChain([this, 'access', _208 => _208.config, 'access', _209 => _209.agent, 'optionalAccess', _210 => _210.jsonLd])
5950
5824
  });
5951
5825
  const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
5952
5826
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -5955,10 +5829,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5955
5829
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5956
5830
  ) : "";
5957
5831
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
5958
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
5832
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
5959
5833
  this.config.theme,
5960
5834
  this.config.basePath,
5961
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
5835
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
5962
5836
  );
5963
5837
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
5964
5838
  const devStyleLinks = this.collectDevStyleLinks();
@@ -5973,7 +5847,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5973
5847
  nonce: cspNonce,
5974
5848
  onShellReady() {
5975
5849
  if (pendingNavigationError) {
5976
- _optionalChain([abort, 'optionalCall', _210 => _210(pendingNavigationError)]);
5850
+ _optionalChain([abort, 'optionalCall', _211 => _211(pendingNavigationError)]);
5977
5851
  if (clearMiddlewareData) {
5978
5852
  clearMiddlewareData();
5979
5853
  }
@@ -5991,7 +5865,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
5991
5865
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
5992
5866
  }
5993
5867
  const shell = `<!DOCTYPE html>
5994
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _211 => _211.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5868
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _212 => _212.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5995
5869
  <head>
5996
5870
  ${themeDocument.head}
5997
5871
  <meta charset="utf-8">
@@ -6012,7 +5886,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6012
5886
  const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
6013
5887
  if (securedShell) {
6014
5888
  htmlParts.push(securedShell);
6015
- _optionalChain([staticShellParts, 'optionalAccess', _212 => _212.push, 'call', _213 => _213(securedShell)]);
5889
+ _optionalChain([staticShellParts, 'optionalAccess', _213 => _213.push, 'call', _214 => _214(securedShell)]);
6016
5890
  }
6017
5891
  const withEarlyClient = (document) => earlyClient ? {
6018
5892
  ...document,
@@ -6022,10 +5896,10 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6022
5896
  ${stampDocumentHTML(earlyClientScript)}`
6023
5897
  )
6024
5898
  } : document;
6025
- const documentTransform = streamDocument ? _chunkUJ3R2AH2cjs.createFarmStreamedDocumentTransform.call(void 0,
5899
+ const documentTransform = streamDocument ? _chunkUPOYKX4Scjs.createFarmStreamedDocumentTransform.call(void 0,
6026
5900
  (opening) => withEarlyClient(
6027
- _chunkUJ3R2AH2cjs.openFarmStreamedDocument.call(void 0,
6028
- hasExplicitTitle ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
5901
+ _chunkUPOYKX4Scjs.openFarmStreamedDocument.call(void 0,
5902
+ hasExplicitTitle ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
6029
5903
  {
6030
5904
  fallbackIcon: !hasFavicon,
6031
5905
  viewport: viewportTags,
@@ -6064,7 +5938,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6064
5938
  const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
6065
5939
  if (!checkedFullDocument && renderedText) {
6066
5940
  documentPrefix += renderedText;
6067
- const prefix = _chunkUJ3R2AH2cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
5941
+ const prefix = _chunkUPOYKX4Scjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6068
5942
  if (prefix !== "pending") {
6069
5943
  checkedFullDocument = true;
6070
5944
  documentPrefix = "";
@@ -6083,7 +5957,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6083
5957
  staticShellClosed = true;
6084
5958
  if (!suspenseHoleEmitted) {
6085
5959
  suspenseHoleEmitted = true;
6086
- _optionalChain([options, 'access', _214 => _214.onSuspenseHoleDetected, 'optionalCall', _215 => _215()]);
5960
+ _optionalChain([options, 'access', _215 => _215.onSuspenseHoleDetected, 'optionalCall', _216 => _216()]);
6087
5961
  }
6088
5962
  } else {
6089
5963
  staticShellParts.push(chunkText);
@@ -6147,8 +6021,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6147
6021
  recordRenderedChunk(tail, rewritten);
6148
6022
  if (tail) res.write(tail);
6149
6023
  }
6150
- const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _216 => _216.end, 'call', _217 => _217()]);
6151
- if (_optionalChain([documentEnd, 'optionalAccess', _218 => _218.text])) {
6024
+ const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _217 => _217.end, 'call', _218 => _218()]);
6025
+ if (_optionalChain([documentEnd, 'optionalAccess', _219 => _219.text])) {
6152
6026
  recordRenderedChunk(documentEnd.text, "");
6153
6027
  res.write(documentEnd.text);
6154
6028
  }
@@ -6159,7 +6033,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6159
6033
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
6160
6034
  earlyClient,
6161
6035
  // A full document: Farm's #root closes only where Farm opened it.
6162
- ..._optionalChain([documentEnd, 'optionalAccess', _219 => _219.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6036
+ ..._optionalChain([documentEnd, 'optionalAccess', _220 => _220.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6163
6037
  })
6164
6038
  );
6165
6039
  htmlParts.push(footer);
@@ -6250,6 +6124,22 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6250
6124
  }
6251
6125
  return false;
6252
6126
  }
6127
+ /**
6128
+ * The redirect a page-data request for `request` ended with. A `redirect()`
6129
+ * target is localized as a document render localizes it; a thrown 3xx
6130
+ * Response keeps its Location as written, as a document render sends it.
6131
+ */
6132
+ async resolvePageDataRedirect(request2, error) {
6133
+ const redirect = _chunkRWR7SMD7cjs.getFarmPageDataRedirect.call(void 0, error);
6134
+ if (!redirect || !_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) return redirect;
6135
+ return {
6136
+ status: redirect.status,
6137
+ location: await this.runWithRequestContext(
6138
+ request2,
6139
+ () => this.localizeRedirectUrl(redirect.location)
6140
+ )
6141
+ };
6142
+ }
6253
6143
  localizeRedirectUrl(url) {
6254
6144
  const snapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
6255
6145
  return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
@@ -6264,7 +6154,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6264
6154
  return await this.routeManager.loadRouteModule(notFoundPath);
6265
6155
  }
6266
6156
  async loadNotFoundComponent() {
6267
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _220 => _220.default]), async () => ( null));
6157
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _221 => _221.default]), async () => ( null));
6268
6158
  }
6269
6159
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
6270
6160
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -6287,13 +6177,13 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6287
6177
  */
6288
6178
  async createLateNavigationRecoveryHTML(req, error) {
6289
6179
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
6290
- return _chunkUJ3R2AH2cjs.createLateRedirectRecovery.call(void 0,
6180
+ return _chunkUPOYKX4Scjs.createLateRedirectRecovery.call(void 0,
6291
6181
  this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
6292
6182
  this.getCspNonce(req) || ""
6293
6183
  );
6294
6184
  }
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])
6185
+ const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6186
+ trustProxy: _optionalChain([this, 'access', _222 => _222.config, 'access', _223 => _223.server, 'optionalAccess', _224 => _224.trustProxy])
6297
6187
  }).pathname;
6298
6188
  let content = this.defaultNotFoundContent();
6299
6189
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -6309,29 +6199,34 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6309
6199
  _chunkQMNWKQL4cjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
6310
6200
  }
6311
6201
  }
6312
- return _chunkUJ3R2AH2cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6202
+ return _chunkUPOYKX4Scjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6313
6203
  }
6314
6204
  async render404(req, res) {
6315
6205
  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])
6206
+ const pathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6207
+ trustProxy: _optionalChain([this, 'access', _225 => _225.config, 'access', _226 => _226.server, 'optionalAccess', _227 => _227.trustProxy])
6318
6208
  }).pathname;
6209
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6210
+ res.setHeader("Content-Type", "application/json");
6211
+ res.end(JSON.stringify({ error: "Not found", pathname }));
6212
+ return;
6213
+ }
6319
6214
  const acceptHeader = req.headers.accept;
6320
6215
  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);
6216
+ if (_chunkFT6KJHS3cjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6217
+ res.setHeader("Content-Type", _chunkFT6KJHS3cjs.FARM_MARKDOWN_CONTENT_TYPE);
6323
6218
  res.setHeader("X-Farm-Markdown-Error", "404");
6324
6219
  res.setHeader("Cache-Control", "no-store");
6325
- res.end(_chunk2C5L5RPMcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6220
+ res.end(_chunkFT6KJHS3cjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6326
6221
  return;
6327
6222
  }
6328
- const appDir = path10.join(this.config.root, this.config.srcDir, "app");
6329
- const notFoundExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6223
+ const appDir = path9.join(this.config.root, this.config.srcDir, "app");
6224
+ const notFoundExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6330
6225
  let layoutModule = null;
6331
6226
  try {
6332
6227
  for (const ext of notFoundExtensions) {
6333
- const layoutPath = path10.join(appDir, `layout${ext}`);
6334
- if (fs6.existsSync(layoutPath)) {
6228
+ const layoutPath = path9.join(appDir, `layout${ext}`);
6229
+ if (fs5.existsSync(layoutPath)) {
6335
6230
  layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
6336
6231
  break;
6337
6232
  }
@@ -6342,9 +6237,9 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6342
6237
  );
6343
6238
  if (notFoundPath) {
6344
6239
  const notFoundModule = await this.loadNotFoundModule();
6345
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _227 => _227.default]), () => ( null));
6240
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _228 => _228.default]), () => ( null));
6346
6241
  if (NotFoundComponent) {
6347
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _228 => _228.default]), () => ( null));
6242
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _229 => _229.default]), () => ( null));
6348
6243
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
6349
6244
  if (LayoutComponent) {
6350
6245
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -6383,24 +6278,24 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6383
6278
  }
6384
6279
  res.statusCode = statusCode;
6385
6280
  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])
6281
+ const requestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
6282
+ trustProxy: _optionalChain([this, 'access', _230 => _230.config, 'access', _231 => _231.server, 'optionalAccess', _232 => _232.trustProxy])
6388
6283
  });
6389
6284
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
6390
- const statusText = _chunkUJ3R2AH2cjs.getDefaultErrorStatusText.call(void 0, statusCode);
6285
+ const statusText = _chunkUPOYKX4Scjs.getDefaultErrorStatusText.call(void 0, statusCode);
6391
6286
  const content = this.stampFarmScripts(
6392
6287
  req,
6393
- _chunkUJ3R2AH2cjs.createDefaultErrorMarkup.call(void 0, {
6288
+ _chunkUPOYKX4Scjs.createDefaultErrorMarkup.call(void 0, {
6394
6289
  statusCode,
6395
6290
  statusText,
6396
6291
  requestPath: requestUrl.pathname,
6397
6292
  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]),
6293
+ message: _optionalChain([diagnostics, 'optionalAccess', _233 => _233.message]),
6294
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _234 => _234.name]),
6295
+ stack: _optionalChain([diagnostics, 'optionalAccess', _235 => _235.stack]),
6296
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _236 => _236.sourceFrame]),
6402
6297
  development: isDev,
6403
- farmVersion: _chunkA3G5IY2Wcjs.FARM_VERSION,
6298
+ farmVersion: _chunkHM7AGSKUcjs.FARM_VERSION,
6404
6299
  nodeVersion: process.version,
6405
6300
  mode: isDev ? "development" : "production"
6406
6301
  })
@@ -6426,8 +6321,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6426
6321
  */
6427
6322
  getI18nAlternateOptions(req, metadata) {
6428
6323
  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
6324
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _237 => _237.metadataBase]),
6325
+ 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
6326
  };
6432
6327
  }
6433
6328
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
@@ -6437,7 +6332,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6437
6332
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
6438
6333
  const integrationManifestScript = farmScripts(`<script>
6439
6334
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
6440
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkI32V5CZLcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6335
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkBDYM2TN3cjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6441
6336
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
6442
6337
  </script>`);
6443
6338
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6446,20 +6341,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6446
6341
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
6447
6342
  ) : "";
6448
6343
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6449
- const themeDocument = _chunkUJ3R2AH2cjs.createFarmThemeDocumentParts.call(void 0,
6344
+ const themeDocument = _chunkUPOYKX4Scjs.createFarmThemeDocumentParts.call(void 0,
6450
6345
  this.config.theme,
6451
6346
  this.config.basePath,
6452
- _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
6347
+ _chunkQIXEU2WVcjs.getTheme.call(void 0, )
6453
6348
  );
6454
6349
  themeDocument.head = farmScripts(themeDocument.head);
6455
6350
  const rendererHydrationScript = farmScripts(
6456
- _optionalChain([this, 'access', _240 => _240.rendererRuntime, 'access', _241 => _241.generateHydrationScript, 'optionalCall', _242 => _242()]) || ""
6351
+ _optionalChain([this, 'access', _241 => _241.rendererRuntime, 'access', _242 => _242.generateHydrationScript, 'optionalCall', _243 => _243()]) || ""
6457
6352
  );
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);
6353
+ const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _244 => _244.metadata, 'optionalAccess', _245 => _245.viewport]));
6354
+ const fullDocument = _chunkUPOYKX4Scjs.extractFarmFullDocument.call(void 0, content);
6460
6355
  if (fullDocument) {
6461
- return _chunkUJ3R2AH2cjs.composeFarmFullDocument.call(void 0,
6462
- metadataHead ? _chunkUJ3R2AH2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6356
+ return _chunkUPOYKX4Scjs.composeFarmFullDocument.call(void 0,
6357
+ metadataHead ? _chunkUPOYKX4Scjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6463
6358
  {
6464
6359
  fallbackIcon: !metadataHead,
6465
6360
  viewport: viewportTags,
@@ -6485,7 +6380,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6485
6380
  );
6486
6381
  }
6487
6382
  return `<!DOCTYPE html>
6488
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _245 => _245.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6383
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _246 => _246.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6489
6384
  <head>
6490
6385
  ${themeDocument.head}
6491
6386
  <meta charset="utf-8">
@@ -6524,11 +6419,11 @@ ${clientScript}
6524
6419
  }
6525
6420
  applyDeploymentHeaders(req, res) {
6526
6421
  const deploymentId = this.getDeploymentId();
6527
- res.setHeader(_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6422
+ res.setHeader(_chunkF43OG25Pcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6528
6423
  if ((req.method || "GET").toUpperCase() !== "GET") return;
6529
6424
  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);
6425
+ 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]));
6426
+ const cookie = _chunkF43OG25Pcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
6532
6427
  const existing = res.getHeader("Set-Cookie");
6533
6428
  if (Array.isArray(existing)) {
6534
6429
  res.setHeader("Set-Cookie", [...existing, cookie]);
@@ -6557,7 +6452,7 @@ var FarmApp = class {
6557
6452
  constructor(config = {}, viteServer) {
6558
6453
  this.config = this.normalizeConfig(config);
6559
6454
  _chunkEVIWKPJVcjs.configureFarmObservability.call(void 0, this.config.observability);
6560
- _chunk4ZJ5C7UJcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6455
+ _chunkQIXEU2WVcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6561
6456
  this.i18nRuntime = _chunkRVGLYMJMcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
6562
6457
  _chunkRVGLYMJMcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
6563
6458
  this.viteServer = viteServer;
@@ -6579,6 +6474,7 @@ var FarmApp = class {
6579
6474
  await this.serverRenderer.initialize();
6580
6475
  await this.verifyAppStructure();
6581
6476
  await this.routeManager.discoverRoutes();
6477
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
6582
6478
  this.routeManager.generateClientManifest(this.config.root);
6583
6479
  if (process.env.FARM_VERBOSE) {
6584
6480
  _chunkQMNWKQL4cjs.logger.success("Farm.js application initialized successfully!");
@@ -6607,7 +6503,7 @@ var FarmApp = class {
6607
6503
  outDir: config.outDir || "dist",
6608
6504
  basePath,
6609
6505
  trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
6610
- renderer: _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer),
6506
+ renderer: _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer),
6611
6507
  preset: _nullishCoalesce(config.preset, () => ( "node-server")),
6612
6508
  deploy: config.deploy || {},
6613
6509
  storage: config.storage || {},
@@ -6617,17 +6513,20 @@ var FarmApp = class {
6617
6513
  integrations: config.integrations || {},
6618
6514
  plugins: config.plugins || [],
6619
6515
  migrations: config.migrations || { commands: [] },
6620
- cron: _chunkBT4SEFLCcjs.resolveCronConfig.call(void 0, config.cron),
6621
- workflows: _chunk3CCAICF7cjs.resolveWorkflowsConfig.call(void 0, config.workflows),
6516
+ cron: _chunkYAEN3L2Fcjs.resolveCronConfig.call(void 0, config.cron),
6517
+ workflows: _chunkKCY52OUQcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
6622
6518
  api: normalizeFarmAppAPIConfig(config.api),
6623
6519
  middleware: config.middleware || {},
6624
- routeRules: _chunkV56632LAcjs.normalizeRouteRules.call(void 0, config.routeRules),
6520
+ routeRules: _chunk22IWL4YDcjs.normalizeRouteRules.call(void 0, config.routeRules),
6625
6521
  context: config.context || (() => void 0),
6626
6522
  server: _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, config.server),
6627
6523
  serverActions: _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, config.serverActions),
6628
6524
  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),
6525
+ images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
6526
+ config.images,
6527
+ _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
6528
+ ),
6529
+ performance: _chunk4E57QHPWcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6631
6530
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
6632
6531
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
6633
6532
  root,
@@ -6639,7 +6538,7 @@ var FarmApp = class {
6639
6538
  serverRuntimeConfig: config.serverRuntimeConfig || {},
6640
6539
  publicRuntimeConfig: config.publicRuntimeConfig || {},
6641
6540
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
6642
- md: _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, config.md),
6541
+ md: _chunkFT6KJHS3cjs.resolveMarkdownConfig.call(void 0, config.md),
6643
6542
  mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
6644
6543
  observability: _nullishCoalesce(config.observability, () => ( false)),
6645
6544
  telemetry: config.telemetry !== false,
@@ -6655,16 +6554,28 @@ var FarmApp = class {
6655
6554
  env: config.env || { server: {}, public: {} },
6656
6555
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
6657
6556
  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)),
6557
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _254 => _254.experimental, 'optionalAccess', _255 => _255.serverComponents]), () => ( false)),
6558
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _256 => _256.experimental, 'optionalAccess', _257 => _257.serverActions]), () => ( false)),
6559
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _258 => _258.experimental, 'optionalAccess', _259 => _259.isolatedClientHydration]), () => ( "off")),
6560
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _260 => _260.experimental, 'optionalAccess', _261 => _261.ppr]), () => ( false)),
6662
6561
  ...config.experimental
6663
6562
  },
6664
6563
  agent: _nullishCoalesce(config.agent, () => ( {})),
6665
6564
  vite: config.vite || {}
6666
6565
  };
6667
6566
  }
6567
+ /** `renderer: false` serves no pages, so a page or layout file would silently never answer. */
6568
+ assertNoPageRoutes() {
6569
+ const files = [
6570
+ ...this.routeManager.getRoutes().values(),
6571
+ ...this.routeManager.getLayouts().values()
6572
+ ].map((entry) => path3.default.relative(this.config.root, entry.modulePath).split(path3.default.sep).join("/"));
6573
+ if (files.length === 0) return;
6574
+ throw new Error(
6575
+ `This app sets \`renderer: false\`, which serves API routes only, but it has pages or layouts:
6576
+ ` + [...new Set(files)].map((file) => ` - ${file}`).join("\n") + "\nRemove these files, or remove `renderer: false` to render pages."
6577
+ );
6578
+ }
6668
6579
  async verifyAppStructure() {
6669
6580
  const appDirs = _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, this.config);
6670
6581
  const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunkQMNWKQL4cjs.fileExists.call(void 0, appDir)))).some(
@@ -6672,7 +6583,7 @@ var FarmApp = class {
6672
6583
  );
6673
6584
  if (!hasAppDirectory) {
6674
6585
  const routeFiles = _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
6675
- (source) => _chunkNWUHS6GVcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
6586
+ (source) => _chunkQEJWNXRIcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
6676
6587
  );
6677
6588
  if (routeFiles.length > 0) {
6678
6589
  return;
@@ -6682,14 +6593,14 @@ var FarmApp = class {
6682
6593
  `App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
6683
6594
  );
6684
6595
  }
6685
- const componentExtensions = _chunkRD623KW4cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6596
+ const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6686
6597
  const rootLayoutPaths = appDirs.flatMap(
6687
6598
  (appDir) => componentExtensions.map((extension) => path3.default.join(appDir, `layout${extension}`))
6688
6599
  );
6689
6600
  const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunkQMNWKQL4cjs.fileExists.call(void 0, p))).then(
6690
6601
  (results) => results.some(Boolean)
6691
6602
  );
6692
- if (!hasRootLayout) {
6603
+ if (!hasRootLayout && !_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6693
6604
  _chunkQMNWKQL4cjs.logger.warn(
6694
6605
  `No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
6695
6606
  );
@@ -6705,7 +6616,7 @@ function isResolvedAuthConfig(value) {
6705
6616
  );
6706
6617
  }
6707
6618
  function normalizeFarmAppAPIConfig(config) {
6708
- if (typeof _optionalChain([config, 'optionalAccess', _261 => _261.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _262 => _262.basePath]) === "function") {
6619
+ if (typeof _optionalChain([config, 'optionalAccess', _262 => _262.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _263 => _263.basePath]) === "function") {
6709
6620
  throw new Error(
6710
6621
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
6711
6622
  );
@@ -6720,7 +6631,7 @@ function createFarmApp(config, viteServer) {
6720
6631
  var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
6721
6632
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
6722
6633
  function resolveFarmImageProviderForRuntime(images, options) {
6723
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _263 => _263.provider]), () => ( "auto"));
6634
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _264 => _264.provider]), () => ( "auto"));
6724
6635
  if (provider === "none") return images;
6725
6636
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
6726
6637
  if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -6755,7 +6666,7 @@ function resolveFarmAppPackages(root) {
6755
6666
  let manifest;
6756
6667
  try {
6757
6668
  manifest = JSON.parse(fs.default.readFileSync(path3.default.join(root, "package.json"), "utf8"));
6758
- } catch (e16) {
6669
+ } catch (e17) {
6759
6670
  return {};
6760
6671
  }
6761
6672
  const names = new Set(
@@ -6774,7 +6685,7 @@ function resolveFarmAppPackages(root) {
6774
6685
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
6775
6686
  versions[name] = version;
6776
6687
  break;
6777
- } catch (e17) {
6688
+ } catch (e18) {
6778
6689
  const parent = path3.default.dirname(dir);
6779
6690
  if (parent === dir) break;
6780
6691
  dir = parent;
@@ -6849,9 +6760,9 @@ function staticValue(node) {
6849
6760
  }
6850
6761
  }
6851
6762
  function property(object, name) {
6852
- return _optionalChain([object, 'access', _264 => _264.properties, 'access', _265 => _265.find, 'call', _266 => _266(
6763
+ return _optionalChain([object, 'access', _265 => _265.properties, 'access', _266 => _266.find, 'call', _267 => _267(
6853
6764
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
6854
- ), 'optionalAccess', _267 => _267.value]);
6765
+ ), 'optionalAccess', _268 => _268.value]);
6855
6766
  }
6856
6767
  function toolFromObject(object) {
6857
6768
  const name = staticValue(property(object, "name"));
@@ -6889,7 +6800,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6889
6800
  let program;
6890
6801
  try {
6891
6802
  program = parseAst2(code, { lang });
6892
- } catch (e18) {
6803
+ } catch (e19) {
6893
6804
  return [];
6894
6805
  }
6895
6806
  const locals = /* @__PURE__ */ new Map();
@@ -6897,7 +6808,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6897
6808
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
6898
6809
  continue;
6899
6810
  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])));
6811
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _269 => _269.imported, 'optionalAccess', _270 => _270.name]), () => ( _optionalChain([specifier, 'access', _271 => _271.imported, 'optionalAccess', _272 => _272.value])));
6901
6812
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
6902
6813
  locals.set(specifier.local.name, imported);
6903
6814
  }
@@ -6913,7 +6824,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
6913
6824
  const [argument] = current.arguments;
6914
6825
  if (definer && argument) {
6915
6826
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
6916
- (element) => _optionalChain([element, 'optionalAccess', _272 => _272.type]) === "ObjectExpression"
6827
+ (element) => _optionalChain([element, 'optionalAccess', _273 => _273.type]) === "ObjectExpression"
6917
6828
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
6918
6829
  for (const object of objects) {
6919
6830
  const tool = toolFromObject(object);
@@ -6938,7 +6849,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6938
6849
  expandDirectories: false,
6939
6850
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
6940
6851
  });
6941
- } catch (e19) {
6852
+ } catch (e20) {
6942
6853
  return [];
6943
6854
  }
6944
6855
  const seen = /* @__PURE__ */ new Set();
@@ -6947,7 +6858,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6947
6858
  let mtimeMs;
6948
6859
  try {
6949
6860
  mtimeMs = fs.default.statSync(file).mtimeMs;
6950
- } catch (e20) {
6861
+ } catch (e21) {
6951
6862
  continue;
6952
6863
  }
6953
6864
  let entry = cache.get(file);
@@ -6955,7 +6866,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6955
6866
  let code = "";
6956
6867
  try {
6957
6868
  code = fs.default.readFileSync(file, "utf8");
6958
- } catch (e21) {
6869
+ } catch (e22) {
6959
6870
  }
6960
6871
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
6961
6872
  cache.set(file, entry);
@@ -6974,8 +6885,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
6974
6885
 
6975
6886
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
6976
6887
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
6977
- const client = _optionalChain([cache2, 'optionalAccess', _273 => _273.client]);
6978
- const adapter = _optionalChain([client, 'optionalAccess', _274 => _274.adapter]);
6888
+ const client = _optionalChain([cache2, 'optionalAccess', _274 => _274.client]);
6889
+ const adapter = _optionalChain([client, 'optionalAccess', _275 => _275.adapter]);
6979
6890
  if (adapter === void 0) return void 0;
6980
6891
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
6981
6892
  throw new Error(
@@ -6990,8 +6901,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
6990
6901
  );
6991
6902
  }
6992
6903
  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;
6904
+ if (_optionalChain([client, 'optionalAccess', _276 => _276.version]) !== void 0) options.version = client.version;
6905
+ if (_optionalChain([client, 'optionalAccess', _277 => _277.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
6995
6906
  return { importPath: found.replace(/\\/g, "/"), options };
6996
6907
  }
6997
6908
  function resolveAdapterFile(resolved) {
@@ -7235,7 +7146,7 @@ function redactFarmDocsClientConfig(code, filename) {
7235
7146
  const current = node;
7236
7147
  if (current.type === "Property") {
7237
7148
  const name = propertyKeyName(current);
7238
- const valueType = _optionalChain([current, 'access', _277 => _277.value, 'optionalAccess', _278 => _278.type]);
7149
+ const valueType = _optionalChain([current, 'access', _278 => _278.value, 'optionalAccess', _279 => _279.type]);
7239
7150
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
7240
7151
  if (name && credential) {
7241
7152
  edits.push(
@@ -7266,7 +7177,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
7266
7177
  if (file === configModule) return true;
7267
7178
  try {
7268
7179
  return file === _fs.realpathSync.call(void 0, configModule).replace(/\\/g, "/");
7269
- } catch (e22) {
7180
+ } catch (e23) {
7270
7181
  return false;
7271
7182
  }
7272
7183
  }
@@ -7275,7 +7186,7 @@ function farmDocsClientConfigPlugin(configModule) {
7275
7186
  name: "farm:docs-client-config",
7276
7187
  enforce: "pre",
7277
7188
  transform(code, id, options) {
7278
- if (_optionalChain([options, 'optionalAccess', _279 => _279.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7189
+ if (_optionalChain([options, 'optionalAccess', _280 => _280.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7279
7190
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7280
7191
  return redacted === null ? null : { code: redacted, map: null };
7281
7192
  }
@@ -7306,7 +7217,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
7306
7217
  ];
7307
7218
  function getFarmClientOptimizeDepsInclude(renderer) {
7308
7219
  return Array.from(
7309
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _280 => _280.optimizeDeps]) || []])
7220
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _281 => _281.optimizeDeps]) || []])
7310
7221
  );
7311
7222
  }
7312
7223
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
@@ -7318,6 +7229,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
7318
7229
  });
7319
7230
  }
7320
7231
  function createFarmClientOptimizeDepsConfig(entries, renderer) {
7232
+ if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
7321
7233
  return {
7322
7234
  // Keep normal application dependency discovery for CJS-only packages, but
7323
7235
  // seed every Farm browser runtime so React is present in the first crawl.
@@ -7325,11 +7237,11 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
7325
7237
  // Waiting for the crawl avoids serving a partial optimizer generation and
7326
7238
  // then changing browser hashes while hydration is already in progress.
7327
7239
  holdUntilCrawlEnd: true,
7328
- include: getFarmClientOptimizeDepsInclude(renderer),
7240
+ include: getFarmClientOptimizeDepsInclude(renderer || void 0),
7329
7241
  // Farm's HTML boots through a virtual module and imports route UI lazily.
7330
7242
  // Explicit entries let Vite finish that crawl before a navigation can
7331
7243
  // rotate the optimizer hash underneath a hydrated React runtime.
7332
- ..._optionalChain([entries, 'optionalAccess', _281 => _281.length]) ? { entries: [...entries] } : {}
7244
+ ..._optionalChain([entries, 'optionalAccess', _282 => _282.length]) ? { entries: [...entries] } : {}
7333
7245
  };
7334
7246
  }
7335
7247
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
@@ -7355,8 +7267,8 @@ function mergeAlias(farmValue, userValue) {
7355
7267
  return [...normalize(userValue), ...normalize(farmValue)];
7356
7268
  }
7357
7269
  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]))));
7270
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _283 => _283.optimizeDeps, 'optionalAccess', _284 => _284.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _285 => _285.optimizeDeps, 'optionalAccess', _286 => _286.noDiscovery])));
7271
+ 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
7272
  return {
7361
7273
  ...farmConfig,
7362
7274
  ...userConfig,
@@ -7368,9 +7280,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7368
7280
  resolve: {
7369
7281
  ...farmConfig.resolve,
7370
7282
  ...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])),
7283
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _293 => _293.resolve, 'optionalAccess', _294 => _294.alias]), _optionalChain([userConfig, 'access', _295 => _295.resolve, 'optionalAccess', _296 => _296.alias])),
7372
7284
  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]) || []])
7285
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _297 => _297.resolve, 'optionalAccess', _298 => _298.dedupe]) || [], ..._optionalChain([userConfig, 'access', _299 => _299.resolve, 'optionalAccess', _300 => _300.dedupe]) || []])
7374
7286
  )
7375
7287
  },
7376
7288
  optimizeDeps: {
@@ -7380,21 +7292,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7380
7292
  holdUntilCrawlEnd,
7381
7293
  include: Array.from(
7382
7294
  /* @__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]) || []
7295
+ ..._optionalChain([farmConfig, 'access', _301 => _301.optimizeDeps, 'optionalAccess', _302 => _302.include]) || [],
7296
+ ..._optionalChain([userConfig, 'access', _303 => _303.optimizeDeps, 'optionalAccess', _304 => _304.include]) || []
7385
7297
  ])
7386
7298
  ),
7387
7299
  exclude: Array.from(
7388
7300
  /* @__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]) || []
7301
+ ..._optionalChain([farmConfig, 'access', _305 => _305.optimizeDeps, 'optionalAccess', _306 => _306.exclude]) || [],
7302
+ ..._optionalChain([userConfig, 'access', _307 => _307.optimizeDeps, 'optionalAccess', _308 => _308.exclude]) || []
7391
7303
  ])
7392
7304
  )
7393
7305
  },
7394
7306
  ssr: {
7395
7307
  ...farmConfig.ssr,
7396
7308
  ...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]))
7309
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _309 => _309.ssr, 'optionalAccess', _310 => _310.noExternal]), _optionalChain([userConfig, 'access', _311 => _311.ssr, 'optionalAccess', _312 => _312.noExternal]))
7398
7310
  }
7399
7311
  };
7400
7312
  }
@@ -7446,7 +7358,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7446
7358
  ...farmConfig.build,
7447
7359
  rollupOptions: {
7448
7360
  ...userBundlerOptions,
7449
- ..._optionalChain([farmConfig, 'access', _312 => _312.build, 'optionalAccess', _313 => _313.rollupOptions])
7361
+ ..._optionalChain([farmConfig, 'access', _313 => _313.build, 'optionalAccess', _314 => _314.rollupOptions])
7450
7362
  }
7451
7363
  },
7452
7364
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -7454,7 +7366,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7454
7366
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
7455
7367
  ssr: {
7456
7368
  ...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]))
7369
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _315 => _315.ssr, 'optionalAccess', _316 => _316.external]), _optionalChain([userConfig, 'access', _317 => _317.ssr, 'optionalAccess', _318 => _318.external]))
7458
7370
  }
7459
7371
  };
7460
7372
  }
@@ -7516,5 +7428,4 @@ ${FARM_DARK_VARIANT}
7516
7428
 
7517
7429
 
7518
7430
 
7519
-
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;
7431
+ 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_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;