@farm.js/core 0.1.74 → 0.1.75

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-NRIL4JBC.cjs → agent-mcp-handler-73SGWVZT.cjs} +9 -9
  2. package/dist/{agent-mcp-handler-HX4F4VKN.mjs → agent-mcp-handler-PJKZHYSA.mjs} +8 -8
  3. package/dist/{agent-mcp.d-CX8_oOT_.d.ts → agent-mcp.d-Djvao5eV.d.ts} +24 -2
  4. package/dist/{agent-mcp.d-BEhDfdWc.d.mts → agent-mcp.d-wA13pwmS.d.mts} +24 -2
  5. package/dist/agent-runtime.cjs +7 -7
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +6 -6
  9. package/dist/analyzer-23GCBYFI.cjs +16 -0
  10. package/dist/{analyzer-2K35LIQZ.mjs → analyzer-LJHMFCDW.mjs} +2 -2
  11. package/dist/api/client.cjs +4 -4
  12. package/dist/api/client.mjs +3 -3
  13. package/dist/api/client.native.cjs +6 -6
  14. package/dist/api/client.native.mjs +3 -3
  15. package/dist/api/node.cjs +12 -12
  16. package/dist/api/node.d.mts +3 -3
  17. package/dist/api/node.d.ts +3 -3
  18. package/dist/api/node.mjs +11 -11
  19. package/dist/api/route-manager.cjs +20 -20
  20. package/dist/api/route-manager.d.mts +3 -3
  21. package/dist/api/route-manager.d.ts +3 -3
  22. package/dist/api/route-manager.mjs +19 -19
  23. package/dist/api/runtime.cjs +11 -11
  24. package/dist/api/runtime.d.mts +2 -2
  25. package/dist/api/runtime.d.ts +2 -2
  26. package/dist/api/runtime.mjs +10 -10
  27. package/dist/api.cjs +23 -23
  28. package/dist/api.d.mts +4 -4
  29. package/dist/api.d.ts +4 -4
  30. package/dist/api.mjs +22 -22
  31. package/dist/{app-manifest.d-CVEx1CFB.d.ts → app-manifest.d-BukcP_EV.d.ts} +1 -1
  32. package/dist/{app-manifest.d-BcXt2yCx.d.mts → app-manifest.d-DIuqSi9k.d.mts} +1 -1
  33. package/dist/app-markdown.cjs +7 -7
  34. package/dist/app-markdown.d.mts +2 -2
  35. package/dist/app-markdown.d.ts +2 -2
  36. package/dist/app-markdown.mjs +6 -6
  37. package/dist/{app.d-B6i8CSrx.d.ts → app.d-BQqmM6Gy.d.ts} +29 -4
  38. package/dist/{app.d-DowzSmT5.d.mts → app.d-YVuFb10p.d.mts} +29 -4
  39. package/dist/{base-path.d-BJ3SYpB8.d.mts → base-path.d-m7wvRMnG.d.mts} +15 -1
  40. package/dist/{base-path.d-BJ3SYpB8.d.ts → base-path.d-m7wvRMnG.d.ts} +15 -1
  41. package/dist/cache.cjs +2 -2
  42. package/dist/cache.d.mts +14 -1
  43. package/dist/cache.d.ts +14 -1
  44. package/dist/cache.mjs +1 -1
  45. package/dist/{chunk-JYNNIGQO.cjs → chunk-25JGHAGH.cjs} +11 -1
  46. package/dist/{chunk-GWXZS7K5.mjs → chunk-2LKUR5QJ.mjs} +1 -1
  47. package/dist/{chunk-B3XY6FMC.mjs → chunk-2NQ3S2SJ.mjs} +3 -3
  48. package/dist/chunk-2PJVEL56.cjs +90 -0
  49. package/dist/{chunk-4M5ESTJ2.cjs → chunk-2RSVYJT6.cjs} +19 -3
  50. package/dist/{chunk-PG6ZIHKE.cjs → chunk-2YJ4DHTD.cjs} +2 -2
  51. package/dist/{chunk-MGZVDX4R.mjs → chunk-3AJQFVWW.mjs} +3 -3
  52. package/dist/{chunk-DRHHTHA3.mjs → chunk-3GMD2E4Q.mjs} +3 -3
  53. package/dist/{chunk-S3D6SL2V.cjs → chunk-42EUEYW6.cjs} +17 -12
  54. package/dist/{chunk-D2IAYGYA.mjs → chunk-47R7CX4A.mjs} +6 -6
  55. package/dist/{chunk-YQWRBBAA.mjs → chunk-4PWGLPL6.mjs} +1 -1
  56. package/dist/{chunk-7S7AAK2D.mjs → chunk-4QBFYEDC.mjs} +2 -1
  57. package/dist/{chunk-UHAARKF3.mjs → chunk-4T2RB4JA.mjs} +5 -5
  58. package/dist/{chunk-KMYOKQPP.cjs → chunk-4VLXQ55O.cjs} +27 -22
  59. package/dist/{chunk-V6T3UJAH.cjs → chunk-4ZSZI6XL.cjs} +17 -17
  60. package/dist/{chunk-XGJVRPYL.cjs → chunk-52LTENRE.cjs} +3 -3
  61. package/dist/{chunk-RQ4UZJPR.cjs → chunk-5AMH6AFA.cjs} +5 -3
  62. package/dist/{chunk-AYP2YFVN.mjs → chunk-5KAEGBIL.mjs} +75 -42
  63. package/dist/{chunk-FCBUNILW.mjs → chunk-5O3SK3ZC.mjs} +4 -4
  64. package/dist/{chunk-IJFNXP3D.cjs → chunk-5QZT2EQN.cjs} +2 -2
  65. package/dist/{chunk-X2KNHD4B.mjs → chunk-5WFPZG7K.mjs} +8 -8
  66. package/dist/{chunk-TPDKFRQX.cjs → chunk-62DZHPDK.cjs} +16 -11
  67. package/dist/{chunk-DTBRSRTR.cjs → chunk-63EFR2WF.cjs} +6 -5
  68. package/dist/{chunk-2RCCFB2Y.cjs → chunk-6B44ZU5P.cjs} +11 -11
  69. package/dist/{chunk-ZRCGPSUM.cjs → chunk-6D3CJFNU.cjs} +37 -21
  70. package/dist/{chunk-65OS2TOT.cjs → chunk-6DBBMQWT.cjs} +34 -34
  71. package/dist/{chunk-IP2R2TAE.mjs → chunk-6MATGOEF.mjs} +1 -1
  72. package/dist/{chunk-ACAEFEOH.cjs → chunk-7564NP5Z.cjs} +10 -10
  73. package/dist/{chunk-7H45IJWO.mjs → chunk-7DBJ2SWK.mjs} +1 -1
  74. package/dist/chunk-7E4FDO5X.mjs +265 -0
  75. package/dist/{chunk-FPBOAG6N.cjs → chunk-7EOSFIPN.cjs} +3 -3
  76. package/dist/{chunk-DRBXYJZ6.mjs → chunk-7FQFK3OA.mjs} +2 -2
  77. package/dist/{chunk-TUOO6IK3.mjs → chunk-7H2TXT2K.mjs} +11 -1
  78. package/dist/{chunk-A4PWGL46.mjs → chunk-7KDCVSTR.mjs} +4 -4
  79. package/dist/{chunk-GPICBTDV.cjs → chunk-7Q2YWZF7.cjs} +6 -6
  80. package/dist/{chunk-CFG4QERR.cjs → chunk-7Q7UB4TL.cjs} +2 -2
  81. package/dist/chunk-A3LNXQJJ.cjs +265 -0
  82. package/dist/{chunk-BFOMCSZ2.mjs → chunk-A5F55ZFA.mjs} +184 -27
  83. package/dist/{chunk-S6O2L47H.mjs → chunk-AG27TI6Q.mjs} +67 -5
  84. package/dist/{chunk-DC2AXGNZ.mjs → chunk-AM2M56SL.mjs} +1 -1
  85. package/dist/{chunk-JRHGJVJH.mjs → chunk-B5QRNCIE.mjs} +1 -1
  86. package/dist/{chunk-R6Q6VSGU.mjs → chunk-BGUTIQII.mjs} +1 -1
  87. package/dist/{chunk-3OMLZLDE.cjs → chunk-BNCKXPCU.cjs} +44 -0
  88. package/dist/{chunk-35GBGSQZ.cjs → chunk-BNTRXJL4.cjs} +3 -3
  89. package/dist/{chunk-BPAXGCKX.mjs → chunk-BRNPLD22.mjs} +30 -17
  90. package/dist/{chunk-JZGL2PIH.mjs → chunk-CDT7CGQT.mjs} +2 -2
  91. package/dist/{chunk-BNXV3PRM.mjs → chunk-CF74ABRI.mjs} +10 -10
  92. package/dist/chunk-CIY74JLV.cjs +134 -0
  93. package/dist/{chunk-IZ5WOTQP.mjs → chunk-CLM73YYD.mjs} +2 -2
  94. package/dist/{chunk-FGXSWRWA.mjs → chunk-CSAIIMY3.mjs} +1 -1
  95. package/dist/{chunk-EF5AP4CV.cjs → chunk-CYNQPKA4.cjs} +2 -2
  96. package/dist/{chunk-M53MIIXY.mjs → chunk-CZOXZ6WQ.mjs} +1 -1
  97. package/dist/{chunk-ROPMQNCG.mjs → chunk-DASQJ5UD.mjs} +2 -2
  98. package/dist/{chunk-BWFBTTJ5.cjs → chunk-DD22NQFX.cjs} +2 -2
  99. package/dist/{chunk-AL6E63FZ.mjs → chunk-DUSTJ6A5.mjs} +20 -17
  100. package/dist/{chunk-EWIEJQP6.cjs → chunk-DZ3AZ7UK.cjs} +52 -52
  101. package/dist/{chunk-6YFC3ZFX.mjs → chunk-DZXD6CYJ.mjs} +1 -1
  102. package/dist/{chunk-Q4G52OSW.mjs → chunk-EMTN5ABC.mjs} +1 -1
  103. package/dist/{chunk-GK2GBIXD.mjs → chunk-ERT6HQAI.mjs} +8 -3
  104. package/dist/{chunk-ZLRWO5GK.mjs → chunk-F35C3TJZ.mjs} +1 -1
  105. package/dist/{chunk-F244KE2D.cjs → chunk-F4ID7BGO.cjs} +33 -30
  106. package/dist/{chunk-C7GJDVN4.mjs → chunk-F7MJWW6A.mjs} +1 -1
  107. package/dist/{chunk-WTTJ2YS2.mjs → chunk-FCAYYLAE.mjs} +18 -2
  108. package/dist/{chunk-PWKAX5MS.cjs → chunk-FDZZ6K3N.cjs} +6 -6
  109. package/dist/{chunk-MHLNWRCJ.cjs → chunk-FE6KYDHC.cjs} +3 -3
  110. package/dist/{chunk-PTLXHRJZ.mjs → chunk-FLMALEY2.mjs} +37 -4
  111. package/dist/{chunk-GRHSQYD4.cjs → chunk-G7B6NU4X.cjs} +11 -11
  112. package/dist/{chunk-E4T7WJJN.mjs → chunk-GAAK3HDZ.mjs} +28 -7
  113. package/dist/{chunk-QMNWKQL4.cjs → chunk-GC5ROI3A.cjs} +4 -4
  114. package/dist/{chunk-JXIYH2NO.cjs → chunk-GCJ4GNMC.cjs} +4 -4
  115. package/dist/{chunk-KNEYWPZV.mjs → chunk-GFXKO4UW.mjs} +42 -10
  116. package/dist/{chunk-AU5UPNOD.mjs → chunk-GLF44JKY.mjs} +3 -3
  117. package/dist/{chunk-GUZC226X.mjs → chunk-GLVDXRG2.mjs} +1 -1
  118. package/dist/{chunk-FEQ72ZHD.mjs → chunk-GNY7BO7R.mjs} +6 -6
  119. package/dist/{chunk-OWQV6MLM.cjs → chunk-GYJT2U7J.cjs} +2 -1
  120. package/dist/{chunk-XZPI44Q7.cjs → chunk-H7OFZJCV.cjs} +8 -8
  121. package/dist/{chunk-IG4IQMIW.mjs → chunk-H7QY7ZE4.mjs} +1 -1
  122. package/dist/{chunk-2TZ3F6TN.cjs → chunk-HFJLMALC.cjs} +25 -25
  123. package/dist/{chunk-CROAFCMW.mjs → chunk-HONTCUK6.mjs} +1 -1
  124. package/dist/{chunk-7PJARAQQ.mjs → chunk-HQ2VAJLW.mjs} +1 -1
  125. package/dist/{chunk-LHFGTR7F.mjs → chunk-HT2SZKXG.mjs} +92 -10
  126. package/dist/{chunk-6JEXH7N6.mjs → chunk-HV2WZFUW.mjs} +1 -1
  127. package/dist/{chunk-ENYBDM4U.cjs → chunk-HVJ7IACB.cjs} +15 -7
  128. package/dist/{chunk-WS4SLJW5.mjs → chunk-IDOUCM2X.mjs} +142 -170
  129. package/dist/{chunk-FN5UEC7I.mjs → chunk-IG2JE6WJ.mjs} +1 -1
  130. package/dist/{chunk-MQ4DYVFS.cjs → chunk-IIHZ2BEE.cjs} +3 -3
  131. package/dist/{chunk-56HHUSR5.cjs → chunk-IK33N2AN.cjs} +1281 -685
  132. package/dist/{chunk-RSL3YFJG.cjs → chunk-IVBDRAOR.cjs} +1 -1
  133. package/dist/{chunk-FNWL5DMG.cjs → chunk-IXO6O2EL.cjs} +6 -6
  134. package/dist/{chunk-B5WZP3T3.cjs → chunk-IYFBLWXU.cjs} +41 -23
  135. package/dist/{chunk-R4BWNP73.mjs → chunk-JA6RML7C.mjs} +3 -3
  136. package/dist/{chunk-JSUVQ5HG.cjs → chunk-JHZ6HULQ.cjs} +12 -9
  137. package/dist/{chunk-NXGQIXR7.cjs → chunk-JNZDTE75.cjs} +313 -156
  138. package/dist/{chunk-KWUZJZ23.mjs → chunk-JRBWBMP2.mjs} +4 -3
  139. package/dist/{chunk-YH33PZ3K.mjs → chunk-K6DXKHFE.mjs} +1 -1
  140. package/dist/{chunk-AXVRUDMB.cjs → chunk-K6PGK7DC.cjs} +2 -2
  141. package/dist/{chunk-72NTEYCX.mjs → chunk-KHS3T3E5.mjs} +15 -10
  142. package/dist/{chunk-D4TYE6MY.cjs → chunk-KPYQ32BA.cjs} +2 -2
  143. package/dist/{chunk-J42QN7OC.cjs → chunk-KQS27YN7.cjs} +6 -6
  144. package/dist/{chunk-KUMKBBYP.mjs → chunk-KUXEII7V.mjs} +1 -1
  145. package/dist/{chunk-CA7DNRHO.cjs → chunk-L6E5BSNU.cjs} +3 -3
  146. package/dist/{chunk-47ZDUDN5.cjs → chunk-L7Y65BQU.cjs} +64 -32
  147. package/dist/{chunk-OSKIG4OP.mjs → chunk-LPXJEZJK.mjs} +30 -14
  148. package/dist/{chunk-CF77L6RL.mjs → chunk-LQBV2Y37.mjs} +4 -4
  149. package/dist/{chunk-HK4VJI27.cjs → chunk-LQWIIBI2.cjs} +11 -1
  150. package/dist/{chunk-BIX46FTI.mjs → chunk-MFU7SXAB.mjs} +10 -2
  151. package/dist/{chunk-YTVSWXEZ.cjs → chunk-ML4TOUZP.cjs} +76 -43
  152. package/dist/{chunk-ZD7JUTBY.mjs → chunk-NLATR3T3.mjs} +2 -2
  153. package/dist/{chunk-P3EZKU6L.cjs → chunk-NPGXX7HN.cjs} +37 -37
  154. package/dist/{chunk-3BUJIPKE.cjs → chunk-NSNQLBHR.cjs} +2 -2
  155. package/dist/chunk-NUWUEXUD.mjs +55 -0
  156. package/dist/{chunk-53EHWHT2.cjs → chunk-O4JYMU5N.cjs} +35 -22
  157. package/dist/{chunk-TNYC3TYP.mjs → chunk-O7JEFGUV.mjs} +2 -2
  158. package/dist/{chunk-62ZRA7XU.mjs → chunk-OCLCA3X3.mjs} +1 -1
  159. package/dist/{chunk-JI6N4W2I.mjs → chunk-OFIFRB62.mjs} +813 -217
  160. package/dist/{chunk-CXQZQK6R.mjs → chunk-OVUU2RCQ.mjs} +2 -2
  161. package/dist/{chunk-Q3MVNRAO.cjs → chunk-OZARLCYQ.cjs} +1005 -582
  162. package/dist/{chunk-HBLYSWIJ.cjs → chunk-PBJ7MEOV.cjs} +9 -9
  163. package/dist/{chunk-4AB62NMW.cjs → chunk-PBQGIA27.cjs} +2 -2
  164. package/dist/{chunk-RBRIKT6B.mjs → chunk-PDACTAVX.mjs} +3 -3
  165. package/dist/{chunk-AO5IRA2N.mjs → chunk-PE2LEWXA.mjs} +6 -3
  166. package/dist/{chunk-VZKCGHWC.cjs → chunk-PG7J7XYT.cjs} +6 -6
  167. package/dist/{chunk-MMK4MZUN.mjs → chunk-PKXGFQZS.mjs} +1 -1
  168. package/dist/{chunk-NKETXVKP.mjs → chunk-PL7MCYYD.mjs} +32 -14
  169. package/dist/chunk-PWHF2C6A.mjs +134 -0
  170. package/dist/{chunk-JWHRVBCZ.cjs → chunk-Q2EKSSEG.cjs} +21 -21
  171. package/dist/{chunk-EHJOSIXM.cjs → chunk-QDHR54S6.cjs} +11 -11
  172. package/dist/{chunk-YWDRWG4L.mjs → chunk-QGYHE6VJ.mjs} +872 -449
  173. package/dist/{chunk-ZOYKJBP5.cjs → chunk-QKW6DLDT.cjs} +2 -2
  174. package/dist/{chunk-3ODLJRA6.mjs → chunk-QSLGE2ZC.mjs} +1 -1
  175. package/dist/{chunk-FSODPZRT.cjs → chunk-QUEYL2WM.cjs} +10 -10
  176. package/dist/{chunk-ZDAEHG2O.cjs → chunk-QYOAGT3E.cjs} +3 -3
  177. package/dist/{chunk-VKLV7GF4.mjs → chunk-R5X7FDOG.mjs} +1 -1
  178. package/dist/{chunk-O47W53D3.cjs → chunk-RDADQG5S.cjs} +7 -77
  179. package/dist/chunk-RDSHEHBA.mjs +82 -0
  180. package/dist/{chunk-K3RU5MOR.mjs → chunk-RK4MGL6Q.mjs} +1 -1
  181. package/dist/{chunk-LRB5OVRT.cjs → chunk-RKQOMG2X.cjs} +2 -2
  182. package/dist/chunk-RQRTH57V.cjs +82 -0
  183. package/dist/{chunk-MUITBU5Z.mjs → chunk-S7QEQCVV.mjs} +2 -2
  184. package/dist/{chunk-HKZVC5GP.cjs → chunk-SFSTZ7TB.cjs} +8 -8
  185. package/dist/{chunk-ZZGANFQH.cjs → chunk-SX535SU5.cjs} +12 -12
  186. package/dist/{chunk-NLBK37HI.cjs → chunk-SXXSQVKK.cjs} +4 -4
  187. package/dist/{chunk-ELJQWUAR.mjs → chunk-SYPEMXW2.mjs} +2 -2
  188. package/dist/{chunk-XXKMAHYE.mjs → chunk-TFEODQLG.mjs} +1 -1
  189. package/dist/{chunk-BSJMWCWM.cjs → chunk-TZ2YPXLB.cjs} +7 -7
  190. package/dist/{chunk-OEL5EPOJ.mjs → chunk-UD6KTSJS.mjs} +6 -76
  191. package/dist/{chunk-2EVESLP3.mjs → chunk-UJIBSFUE.mjs} +4 -4
  192. package/dist/chunk-UNOXV37V.cjs +55 -0
  193. package/dist/{chunk-H2ZJ35NW.mjs → chunk-UOE6ZZZP.mjs} +1 -1
  194. package/dist/{chunk-O6K4G7YA.mjs → chunk-URQW27KO.mjs} +10 -5
  195. package/dist/chunk-VDQZV6BX.mjs +17 -0
  196. package/dist/{chunk-2DOI6HLJ.cjs → chunk-VJ6L7TII.cjs} +3 -3
  197. package/dist/{chunk-QL3YZTGZ.cjs → chunk-VJI2LWTL.cjs} +2 -2
  198. package/dist/{chunk-7RKHXF4P.mjs → chunk-WGNGM6MJ.mjs} +2 -2
  199. package/dist/{chunk-77SVUQM5.cjs → chunk-WHCNJVYU.cjs} +10 -10
  200. package/dist/{chunk-DM2YGTRH.cjs → chunk-WJ5CCQBM.cjs} +23 -23
  201. package/dist/chunk-WKVYF2B5.cjs +17 -0
  202. package/dist/{chunk-MKQ27TGW.cjs → chunk-WRWJ7IWT.cjs} +7 -7
  203. package/dist/{chunk-Y4FEQBKY.cjs → chunk-WW62HKA2.cjs} +47 -26
  204. package/dist/{chunk-XVSBALOY.cjs → chunk-X3Y6JWJG.cjs} +3 -3
  205. package/dist/{chunk-O2A6HE76.cjs → chunk-XGDI4OUB.cjs} +103 -21
  206. package/dist/{chunk-LIQJYEQP.cjs → chunk-XRFGOYXG.cjs} +4 -4
  207. package/dist/{chunk-42KMUIWZ.cjs → chunk-XX6ZA2IO.cjs} +3 -3
  208. package/dist/{chunk-6IOZPJ3I.cjs → chunk-Y3DO7BIJ.cjs} +69 -7
  209. package/dist/{chunk-L5JDKFMQ.cjs → chunk-YBXIVQCE.cjs} +4 -4
  210. package/dist/{chunk-JZ43UD6S.mjs → chunk-YCNKS6SD.mjs} +12 -12
  211. package/dist/{chunk-FYV6DTAG.cjs → chunk-YL7BKHYE.cjs} +538 -566
  212. package/dist/{chunk-G7S6XG6X.cjs → chunk-YN7G22MP.cjs} +6 -6
  213. package/dist/{chunk-VKRMO3EZ.cjs → chunk-YRXPDKMM.cjs} +10 -10
  214. package/dist/{chunk-VFPFXMTF.mjs → chunk-YSTKSZD2.mjs} +1 -1
  215. package/dist/{chunk-QDWMCFTH.mjs → chunk-YT2ZMLXK.mjs} +1 -1
  216. package/dist/{chunk-EMRYJG4U.cjs → chunk-YTNE4KGC.cjs} +3 -3
  217. package/dist/{chunk-E7QOEV5Z.cjs → chunk-YUCU6XB4.cjs} +4 -4
  218. package/dist/{chunk-NLRAQXAA.mjs → chunk-YVVY276M.mjs} +1 -1
  219. package/dist/{chunk-MQ5HA7H2.mjs → chunk-Z2FFLTF5.mjs} +3 -3
  220. package/dist/{chunk-JSDV2NUN.mjs → chunk-Z3QXQN4U.mjs} +1 -1
  221. package/dist/{chunk-HRQV5Q3J.mjs → chunk-Z4IRG4RG.mjs} +96 -9
  222. package/dist/{chunk-JOECBGY7.mjs → chunk-ZEWWZJPZ.mjs} +3 -1
  223. package/dist/{chunk-2GQBBOFH.mjs → chunk-ZIAWO6BC.mjs} +11 -1
  224. package/dist/{chunk-WH3PBJS7.cjs → chunk-ZIOFRBIU.cjs} +100 -13
  225. package/dist/{chunk-3OJNNCDL.cjs → chunk-ZNXU4E6A.cjs} +8 -8
  226. package/dist/{chunk-KIRIFO6T.mjs → chunk-ZO6TOLHL.mjs} +44 -0
  227. package/dist/{chunk-737MIVX3.cjs → chunk-ZPCZWEU3.cjs} +24 -24
  228. package/dist/{chunk-NET6PBUH.cjs → chunk-ZV76IQG7.cjs} +2 -2
  229. package/dist/{client-component.d-edV76QvU.d.mts → client-component.d-BeqVuqy2.d.mts} +2 -2
  230. package/dist/{client-component.d-DYOwmq0c.d.ts → client-component.d-CZ1NpHAY.d.ts} +2 -2
  231. package/dist/{client-plugins.d-DwvqqGsU.d.mts → client-plugins.d-ChceYO9t.d.mts} +24 -3
  232. package/dist/{client-plugins.d-BmJYW2FY.d.ts → client-plugins.d-D9kWC0QB.d.ts} +24 -3
  233. package/dist/client-plugins.d.mts +1 -1
  234. package/dist/client-plugins.d.ts +1 -1
  235. package/dist/client.cjs +15 -13
  236. package/dist/client.d.mts +6 -6
  237. package/dist/client.d.ts +6 -6
  238. package/dist/client.mjs +14 -12
  239. package/dist/config.d.mts +1 -1
  240. package/dist/config.d.ts +1 -1
  241. package/dist/cron.cjs +4 -4
  242. package/dist/cron.mjs +3 -3
  243. package/dist/desktop.d.mts +2 -2
  244. package/dist/desktop.d.ts +2 -2
  245. package/dist/{devtools-WPX62NG2.mjs → devtools-B3W3DLPG.mjs} +18 -18
  246. package/dist/{devtools-YMDS7PUA.cjs → devtools-T5I2WHRX.cjs} +20 -20
  247. package/dist/docs.cjs +27 -21
  248. package/dist/docs.d.mts +17 -3
  249. package/dist/docs.d.ts +17 -3
  250. package/dist/docs.mjs +26 -20
  251. package/dist/environment/vite.cjs +6 -6
  252. package/dist/environment/vite.mjs +5 -5
  253. package/dist/headers.cjs +3 -3
  254. package/dist/{headers.d-BIbQyAxJ.d.ts → headers.d-Aux4JVnm.d.ts} +1 -1
  255. package/dist/{headers.d-BtNxFc2s.d.mts → headers.d-BawakaPv.d.mts} +1 -1
  256. package/dist/headers.mjs +2 -2
  257. package/dist/i18n/client.cjs +15 -16
  258. package/dist/i18n/client.mjs +5 -6
  259. package/dist/i18n/index.cjs +4 -4
  260. package/dist/i18n/index.mjs +3 -3
  261. package/dist/i18n/server.cjs +5 -5
  262. package/dist/i18n/server.mjs +4 -4
  263. package/dist/image/server.cjs +5 -4
  264. package/dist/image/server.d.mts +5 -1
  265. package/dist/image/server.d.ts +5 -1
  266. package/dist/image/server.mjs +4 -3
  267. package/dist/image/sharp.cjs +53 -89
  268. package/dist/image/sharp.d.mts +2 -1
  269. package/dist/image/sharp.d.ts +2 -1
  270. package/dist/image/sharp.mjs +50 -86
  271. package/dist/index.cjs +99 -93
  272. package/dist/{index.d-CQdDRXd1.d.mts → index.d-Ccq42CPU.d.mts} +1 -1
  273. package/dist/{index.d-CQ_wUzOV.d.ts → index.d-r1MLpgeE.d.ts} +1 -1
  274. package/dist/index.d.mts +19 -19
  275. package/dist/index.d.ts +19 -19
  276. package/dist/index.mjs +96 -90
  277. package/dist/integrations/orm.d.mts +1 -1
  278. package/dist/integrations/orm.d.ts +1 -1
  279. package/dist/integrations.cjs +7 -7
  280. package/dist/integrations.d.mts +1 -1
  281. package/dist/integrations.d.ts +1 -1
  282. package/dist/integrations.mjs +6 -6
  283. package/dist/internal/app-markdown-runtime.cjs +6 -6
  284. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  285. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  286. package/dist/internal/app-markdown-runtime.mjs +5 -5
  287. package/dist/internal/build-runtime.cjs +68 -66
  288. package/dist/internal/build-runtime.d.mts +3 -3
  289. package/dist/internal/build-runtime.d.ts +3 -3
  290. package/dist/internal/build-runtime.mjs +67 -65
  291. package/dist/internal/cli-runtime.cjs +33 -33
  292. package/dist/internal/cli-runtime.mjs +32 -32
  293. package/dist/internal/client-error-overlay.cjs +4 -4
  294. package/dist/internal/client-error-overlay.mjs +1 -1
  295. package/dist/internal/client-runtime.cjs +23 -2
  296. package/dist/internal/client-runtime.d.mts +29 -8
  297. package/dist/internal/client-runtime.d.ts +29 -8
  298. package/dist/internal/client-runtime.mjs +23 -2
  299. package/dist/internal/compression-runtime.d.mts +1 -1
  300. package/dist/internal/compression-runtime.d.ts +1 -1
  301. package/dist/internal/config-runtime.cjs +20 -20
  302. package/dist/internal/config-runtime.d.mts +3 -3
  303. package/dist/internal/config-runtime.d.ts +3 -3
  304. package/dist/internal/config-runtime.mjs +19 -19
  305. package/dist/internal/form-actions.cjs +6 -6
  306. package/dist/internal/form-actions.mjs +5 -5
  307. package/dist/internal/infra-analytics-runtime.cjs +15 -15
  308. package/dist/internal/infra-analytics-runtime.mjs +13 -13
  309. package/dist/internal/islands-server.cjs +2 -2
  310. package/dist/internal/islands-server.mjs +1 -1
  311. package/dist/internal/metadata-image-runtime.cjs +4 -4
  312. package/dist/internal/metadata-image-runtime.mjs +3 -3
  313. package/dist/internal/native-server-fns.cjs +5 -5
  314. package/dist/internal/native-server-fns.mjs +4 -4
  315. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  316. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  317. package/dist/internal/production-runtime.cjs +63 -40
  318. package/dist/internal/production-runtime.d.mts +80 -13
  319. package/dist/internal/production-runtime.d.ts +80 -13
  320. package/dist/internal/production-runtime.mjs +66 -43
  321. package/dist/internal/react-cache.cjs +3 -3
  322. package/dist/internal/react-cache.mjs +1 -1
  323. package/dist/internal/start-manifest.cjs +54 -0
  324. package/dist/internal/start-manifest.d.mts +43 -0
  325. package/dist/internal/start-manifest.d.ts +43 -0
  326. package/dist/internal/start-manifest.mjs +54 -0
  327. package/dist/internal/vercel-edge-middleware.cjs +8 -8
  328. package/dist/internal/vercel-edge-middleware.mjs +7 -7
  329. package/dist/manager-R7FV4A56.cjs +18 -0
  330. package/dist/{manager-RHB2P35B.mjs → manager-YO2RHDYU.mjs} +5 -5
  331. package/dist/markdown.cjs +5 -5
  332. package/dist/markdown.d.mts +1 -1
  333. package/dist/markdown.d.ts +1 -1
  334. package/dist/markdown.mjs +4 -4
  335. package/dist/middleware.cjs +14 -14
  336. package/dist/middleware.d.mts +1 -1
  337. package/dist/middleware.d.ts +1 -1
  338. package/dist/middleware.mjs +13 -13
  339. package/dist/{mount.d-6bhpBQQB.d.mts → mount.d-BomEt2kV.d.mts} +1 -1
  340. package/dist/{mount.d-C-u7rFkM.d.ts → mount.d-Ca8eb9GB.d.ts} +1 -1
  341. package/dist/{native-server-fn-handler-W4FSD76W.cjs → native-server-fn-handler-IWNKQEXK.cjs} +9 -8
  342. package/dist/{native-server-fn-handler-I66X4E5S.mjs → native-server-fn-handler-LII4MDRR.mjs} +8 -7
  343. package/dist/native-tree-D3PW64ZL.cjs +28 -0
  344. package/dist/{native-tree-3X23BT3N.mjs → native-tree-G6ZWS7IR.mjs} +5 -5
  345. package/dist/{navigation-delegate.d-nx6gtsY4.d.mts → navigation-delegate.d-B1ujRkYo.d.mts} +1 -1
  346. package/dist/{navigation-delegate.d-xsG4T1x-.d.ts → navigation-delegate.d-DJCC2jXF.d.ts} +1 -1
  347. package/dist/navigation.cjs +13 -11
  348. package/dist/navigation.d.mts +4 -4
  349. package/dist/navigation.d.ts +4 -4
  350. package/dist/navigation.mjs +12 -10
  351. package/dist/{nitro-SSFTPZMW.cjs → nitro-HKMVYIXY.cjs} +13 -13
  352. package/dist/{nitro-XTQ2HKDL.mjs → nitro-RHLKLYXH.mjs} +8 -8
  353. package/dist/{plugin-5PIQQVRP.cjs → plugin-5BNPYCER.cjs} +2 -2
  354. package/dist/{plugin-QZT747YW.mjs → plugin-FD4S2QEJ.mjs} +1 -1
  355. package/dist/plugin.cjs +62 -60
  356. package/dist/plugin.d.mts +4 -4
  357. package/dist/plugin.d.ts +4 -4
  358. package/dist/plugin.mjs +61 -59
  359. package/dist/query/client.cjs +20 -9
  360. package/dist/query/client.mjs +16 -5
  361. package/dist/{render-plan.d-gW0fwKz2.d.ts → render-plan.d-BxRbaxYA.d.ts} +1 -1
  362. package/dist/{render-plan.d-B5y3h97B.d.mts → render-plan.d-CFod_Zf-.d.mts} +1 -1
  363. package/dist/renderer/react/server.cjs +9 -1
  364. package/dist/renderer/react/server.d.mts +9 -1
  365. package/dist/renderer/react/server.d.ts +9 -1
  366. package/dist/renderer/react/server.mjs +8 -0
  367. package/dist/renderer-client.cjs +25 -26
  368. package/dist/renderer-client.d.mts +4 -4
  369. package/dist/renderer-client.d.ts +4 -4
  370. package/dist/renderer-client.mjs +15 -16
  371. package/dist/request.cjs +2 -2
  372. package/dist/{request.d-B0ugAadD.d.ts → request.d-DG4TeXMM.d.mts} +7 -2
  373. package/dist/{request.d-DLq33nYo.d.mts → request.d-DRQgaXGG.d.ts} +7 -2
  374. package/dist/request.d.mts +2 -2
  375. package/dist/request.d.ts +2 -2
  376. package/dist/request.mjs +1 -1
  377. package/dist/{route-rendering.d-DSeIV7yV.d.mts → route-rendering.d-BXtZKgqu.d.mts} +1 -1
  378. package/dist/{route-rendering.d-ytaqDQD6.d.ts → route-rendering.d-Db07UNVG.d.ts} +1 -1
  379. package/dist/router.cjs +4 -4
  380. package/dist/{router.d-Chd5cpe3.d.mts → router.d-B61kXqxJ.d.mts} +1 -1
  381. package/dist/{router.d-BaEAEGPg.d.ts → router.d-BC3hyjf0.d.ts} +1 -1
  382. package/dist/router.mjs +3 -3
  383. package/dist/routes.cjs +6 -6
  384. package/dist/routes.d.mts +1 -1
  385. package/dist/routes.d.ts +1 -1
  386. package/dist/routes.mjs +5 -5
  387. package/dist/{rsc-pipeline-DPMYONEV.mjs → rsc-pipeline-LJ7YCGY6.mjs} +22 -22
  388. package/dist/{rsc-pipeline-XIUUMMG5.cjs → rsc-pipeline-VENBFYXW.cjs} +23 -23
  389. package/dist/{runtime-XIUJZTZ3.mjs → runtime-4DWUXZHS.mjs} +27 -27
  390. package/dist/{runtime-WD77S3C5.cjs → runtime-UNDTYGQS.cjs} +38 -38
  391. package/dist/{runtime.d-DpCs0eAO.d.mts → runtime.d-Cl6EBGmC.d.mts} +1 -1
  392. package/dist/{runtime.d-h2USyQsz.d.ts → runtime.d-SC95yDzr.d.ts} +1 -1
  393. package/dist/safe-fetch.cjs +15 -0
  394. package/dist/safe-fetch.d.mts +61 -0
  395. package/dist/safe-fetch.d.ts +61 -0
  396. package/dist/safe-fetch.mjs +15 -0
  397. package/dist/{schema-dev-notice-C2JINRZI.mjs → schema-dev-notice-CA55V57L.mjs} +2 -2
  398. package/dist/{schema-dev-notice-X7GG7QVB.cjs → schema-dev-notice-RWA2UTR6.cjs} +3 -3
  399. package/dist/server-action-security.cjs +5 -5
  400. package/dist/server-action-security.mjs +4 -4
  401. package/dist/server-fn.cjs +8 -7
  402. package/dist/server-fn.mjs +7 -6
  403. package/dist/server-plugins.cjs +7 -7
  404. package/dist/server-plugins.d.mts +3 -3
  405. package/dist/server-plugins.d.ts +3 -3
  406. package/dist/server-plugins.mjs +6 -6
  407. package/dist/server-query.cjs +9 -8
  408. package/dist/server-query.mjs +8 -7
  409. package/dist/server.cjs +101 -94
  410. package/dist/server.d.mts +13 -13
  411. package/dist/server.d.ts +13 -13
  412. package/dist/server.mjs +74 -67
  413. package/dist/{spa-router.d-DCQVtEaE.d.mts → spa-router.d-DrlXgDqY.d.mts} +4 -3
  414. package/dist/{spa-router.d-DpdJHs1q.d.ts → spa-router.d-DwM02Mwd.d.ts} +4 -3
  415. package/dist/testing.cjs +31 -31
  416. package/dist/testing.d.mts +1 -1
  417. package/dist/testing.d.ts +1 -1
  418. package/dist/testing.mjs +23 -23
  419. package/dist/theme/server.cjs +3 -3
  420. package/dist/theme/server.mjs +2 -2
  421. package/dist/{utils.d-DmicwMvS.d.ts → utils.d-C6KXz3uB.d.ts} +1 -1
  422. package/dist/{utils.d-DKDZtAY5.d.mts → utils.d-CHzxAshz.d.mts} +1 -1
  423. package/dist/version.cjs +2 -2
  424. package/dist/version.mjs +1 -1
  425. package/dist/vite.cjs +62 -60
  426. package/dist/vite.d.mts +10 -5
  427. package/dist/vite.d.ts +10 -5
  428. package/dist/vite.mjs +61 -59
  429. package/dist/workflows.cjs +7 -7
  430. package/dist/workflows.mjs +6 -6
  431. package/package.json +18 -1
  432. package/dist/analyzer-6EOYURMV.cjs +0 -16
  433. package/dist/chunk-D4XGKF67.cjs +0 -127
  434. package/dist/chunk-MFQGU5CC.mjs +0 -127
  435. package/dist/chunk-NCIAP562.mjs +0 -27
  436. package/dist/chunk-QQ44FYRO.cjs +0 -27
  437. package/dist/chunk-RI3EVPKD.cjs +0 -57
  438. package/dist/manager-S77ZARTC.cjs +0 -18
  439. package/dist/native-tree-TAPKR7QJ.cjs +0 -28
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkENYBDM4Ucjs = require('./chunk-ENYBDM4U.cjs');
4
+ var _chunkHVJ7IACBcjs = require('./chunk-HVJ7IACB.cjs');
5
5
 
6
6
 
7
7
  var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
@@ -9,10 +9,9 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkACAEFEOHcjs = require('./chunk-ACAEFEOH.cjs');
12
+ var _chunk7564NP5Zcjs = require('./chunk-7564NP5Z.cjs');
13
13
 
14
14
 
15
- var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
16
15
 
17
16
 
18
17
 
@@ -42,32 +41,33 @@ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
42
41
 
43
42
 
44
43
 
45
- var _chunkO2A6HE76cjs = require('./chunk-O2A6HE76.cjs');
46
44
 
47
45
 
48
- var _chunkDM2YGTRHcjs = require('./chunk-DM2YGTRH.cjs');
49
46
 
47
+ var _chunkXGDI4OUBcjs = require('./chunk-XGDI4OUB.cjs');
50
48
 
51
49
 
50
+ var _chunkWJ5CCQBMcjs = require('./chunk-WJ5CCQBM.cjs');
52
51
 
53
52
 
54
53
 
55
54
 
56
- var _chunkVKRMO3EZcjs = require('./chunk-VKRMO3EZ.cjs');
57
55
 
58
56
 
59
57
 
58
+ var _chunkYRXPDKMMcjs = require('./chunk-YRXPDKMM.cjs');
60
59
 
61
- var _chunkHBLYSWIJcjs = require('./chunk-HBLYSWIJ.cjs');
62
60
 
61
+ var _chunkK6PGK7DCcjs = require('./chunk-K6PGK7DC.cjs');
63
62
 
64
63
 
65
- var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
66
64
 
67
65
 
66
+ var _chunkPBJ7MEOVcjs = require('./chunk-PBJ7MEOV.cjs');
68
67
 
69
68
 
70
69
 
70
+ var _chunk52LTENREcjs = require('./chunk-52LTENRE.cjs');
71
71
 
72
72
 
73
73
 
@@ -86,14 +86,22 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
86
86
 
87
87
 
88
88
 
89
- var _chunkNXGQIXR7cjs = require('./chunk-NXGQIXR7.cjs');
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ var _chunkJNZDTE75cjs = require('./chunk-JNZDTE75.cjs');
90
98
 
91
99
 
92
100
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
93
101
 
94
102
 
95
103
 
96
- var _chunkRQ4UZJPRcjs = require('./chunk-RQ4UZJPR.cjs');
104
+ var _chunk5AMH6AFAcjs = require('./chunk-5AMH6AFA.cjs');
97
105
 
98
106
 
99
107
  var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
@@ -103,7 +111,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
103
111
  var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
104
112
 
105
113
 
106
- var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
114
+ var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
107
115
 
108
116
 
109
117
  var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
@@ -113,7 +121,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
113
121
 
114
122
 
115
123
 
116
- var _chunkF244KE2Dcjs = require('./chunk-F244KE2D.cjs');
124
+ var _chunkF4ID7BGOcjs = require('./chunk-F4ID7BGO.cjs');
117
125
 
118
126
 
119
127
 
@@ -123,7 +131,7 @@ var _chunkF244KE2Dcjs = require('./chunk-F244KE2D.cjs');
123
131
 
124
132
 
125
133
 
126
- var _chunkMKQ27TGWcjs = require('./chunk-MKQ27TGW.cjs');
134
+ var _chunkWRWJ7IWTcjs = require('./chunk-WRWJ7IWT.cjs');
127
135
 
128
136
 
129
137
 
@@ -157,17 +165,17 @@ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
157
165
  var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
158
166
 
159
167
 
160
- var _chunkEF5AP4CVcjs = require('./chunk-EF5AP4CV.cjs');
168
+ var _chunkCYNQPKA4cjs = require('./chunk-CYNQPKA4.cjs');
161
169
 
162
170
 
163
- var _chunkLIQJYEQPcjs = require('./chunk-LIQJYEQP.cjs');
171
+ var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
164
172
 
165
173
 
166
174
 
167
- var _chunkIJFNXP3Dcjs = require('./chunk-IJFNXP3D.cjs');
175
+ var _chunk5QZT2EQNcjs = require('./chunk-5QZT2EQN.cjs');
168
176
 
169
177
 
170
- var _chunkVZKCGHWCcjs = require('./chunk-VZKCGHWC.cjs');
178
+ var _chunkPG7J7XYTcjs = require('./chunk-PG7J7XYT.cjs');
171
179
 
172
180
 
173
181
 
@@ -180,10 +188,10 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
180
188
 
181
189
 
182
190
 
183
- var _chunkPG6ZIHKEcjs = require('./chunk-PG6ZIHKE.cjs');
191
+ var _chunk2YJ4DHTDcjs = require('./chunk-2YJ4DHTD.cjs');
184
192
 
185
193
 
186
- var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
194
+ var _chunkQUEYL2WMcjs = require('./chunk-QUEYL2WM.cjs');
187
195
 
188
196
 
189
197
  var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
@@ -191,7 +199,7 @@ var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
191
199
 
192
200
 
193
201
 
194
- var _chunk65OS2TOTcjs = require('./chunk-65OS2TOT.cjs');
202
+ var _chunk6DBBMQWTcjs = require('./chunk-6DBBMQWT.cjs');
195
203
 
196
204
 
197
205
  var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
@@ -202,7 +210,7 @@ var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
202
210
 
203
211
 
204
212
 
205
- var _chunkZDAEHG2Ocjs = require('./chunk-ZDAEHG2O.cjs');
213
+ var _chunkQYOAGT3Ecjs = require('./chunk-QYOAGT3E.cjs');
206
214
 
207
215
 
208
216
 
@@ -212,13 +220,13 @@ var _chunkYDXLC4DWcjs = require('./chunk-YDXLC4DW.cjs');
212
220
 
213
221
 
214
222
 
215
- var _chunkEMRYJG4Ucjs = require('./chunk-EMRYJG4U.cjs');
223
+ var _chunkYTNE4KGCcjs = require('./chunk-YTNE4KGC.cjs');
216
224
 
217
225
 
218
226
 
219
227
 
220
228
 
221
- var _chunkNLBK37HIcjs = require('./chunk-NLBK37HI.cjs');
229
+ var _chunkSXXSQVKKcjs = require('./chunk-SXXSQVKK.cjs');
222
230
 
223
231
 
224
232
 
@@ -229,7 +237,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
229
237
 
230
238
 
231
239
 
232
- var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
240
+ var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
233
241
 
234
242
 
235
243
 
@@ -241,7 +249,7 @@ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
241
249
 
242
250
 
243
251
 
244
- var _chunk3OMLZLDEcjs = require('./chunk-3OMLZLDE.cjs');
252
+ var _chunkBNCKXPCUcjs = require('./chunk-BNCKXPCU.cjs');
245
253
 
246
254
 
247
255
  var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
@@ -250,7 +258,7 @@ var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
250
258
  var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
251
259
 
252
260
 
253
- var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
261
+ var _chunk25JGHAGHcjs = require('./chunk-25JGHAGH.cjs');
254
262
 
255
263
 
256
264
  var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
@@ -267,7 +275,7 @@ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
267
275
 
268
276
 
269
277
 
270
- var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
278
+ var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
271
279
 
272
280
 
273
281
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
@@ -275,7 +283,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
275
283
 
276
284
 
277
285
 
278
- var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
286
+ var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
279
287
 
280
288
 
281
289
  var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
@@ -289,14 +297,13 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
289
297
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
290
298
 
291
299
 
292
- var _chunkRSL3YFJGcjs = require('./chunk-RSL3YFJG.cjs');
300
+ var _chunkIVBDRAORcjs = require('./chunk-IVBDRAOR.cjs');
293
301
 
294
302
 
295
- var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
303
+ var _chunkWKVYF2B5cjs = require('./chunk-WKVYF2B5.cjs');
296
304
 
297
305
 
298
-
299
- var _chunkGPICBTDVcjs = require('./chunk-GPICBTDV.cjs');
306
+ var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
300
307
 
301
308
 
302
309
  var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
@@ -308,7 +315,7 @@ var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
308
315
 
309
316
 
310
317
 
311
- var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
318
+ var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
312
319
 
313
320
 
314
321
 
@@ -323,6 +330,10 @@ var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
323
330
 
324
331
 
325
332
 
333
+ var _chunk7Q2YWZF7cjs = require('./chunk-7Q2YWZF7.cjs');
334
+
335
+
336
+
326
337
  var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
327
338
 
328
339
 
@@ -332,7 +343,8 @@ var _chunkDXUXQP2Tcjs = require('./chunk-DXUXQP2T.cjs');
332
343
  var _chunkHXNLKCWHcjs = require('./chunk-HXNLKCWH.cjs');
333
344
 
334
345
 
335
- var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
346
+ var _chunkFDZZ6K3Ncjs = require('./chunk-FDZZ6K3N.cjs');
347
+
336
348
 
337
349
 
338
350
 
@@ -340,7 +352,7 @@ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
340
352
 
341
353
 
342
354
 
343
- var _chunk4M5ESTJ2cjs = require('./chunk-4M5ESTJ2.cjs');
355
+ var _chunk2RSVYJT6cjs = require('./chunk-2RSVYJT6.cjs');
344
356
 
345
357
 
346
358
 
@@ -355,7 +367,7 @@ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
355
367
 
356
368
 
357
369
 
358
- var _chunkOWQV6MLMcjs = require('./chunk-OWQV6MLM.cjs');
370
+ var _chunkGYJT2U7Jcjs = require('./chunk-GYJT2U7J.cjs');
359
371
 
360
372
 
361
373
 
@@ -367,7 +379,7 @@ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
367
379
 
368
380
 
369
381
 
370
- var _chunkYTVSWXEZcjs = require('./chunk-YTVSWXEZ.cjs');
382
+ var _chunkML4TOUZPcjs = require('./chunk-ML4TOUZP.cjs');
371
383
 
372
384
 
373
385
  var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
@@ -375,7 +387,7 @@ var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
375
387
  // src/static-metadata-image.ts
376
388
  var _crypto = require('crypto');
377
389
  var _promises = require('fs/promises');
378
- var _path = require('path'); var path3 = _interopRequireWildcard(_path); var path9 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
390
+ var _path = require('path'); var path4 = _interopRequireWildcard(_path); var path10 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path);
379
391
  var _imagesize = require('image-size');
380
392
  var STATIC_METADATA_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp"];
381
393
  var CONTENT_TYPES = {
@@ -416,13 +428,13 @@ async function inspectStaticMetadataImage(filePath) {
416
428
  };
417
429
  }
418
430
  function getStaticMetadataImageAltPath(filePath) {
419
- return path3.default.join(
420
- path3.default.dirname(filePath),
421
- `${path3.default.basename(filePath, path3.default.extname(filePath))}.alt.txt`
431
+ return path4.default.join(
432
+ path4.default.dirname(filePath),
433
+ `${path4.default.basename(filePath, path4.default.extname(filePath))}.alt.txt`
422
434
  );
423
435
  }
424
436
  function getStaticMetadataImageExtension(filePath) {
425
- const extension = path3.default.extname(filePath).slice(1).toLowerCase();
437
+ const extension = path4.default.extname(filePath).slice(1).toLowerCase();
426
438
  return STATIC_METADATA_IMAGE_EXTENSIONS.includes(extension) ? extension : null;
427
439
  }
428
440
  async function readAltText(filePath) {
@@ -438,7 +450,7 @@ async function readAltText(filePath) {
438
450
  }
439
451
 
440
452
  // src/routing/route-manager.ts
441
- var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs);
453
+ var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs7 = _interopRequireWildcard(_fs); var fs5 = _interopRequireWildcard(_fs);
442
454
 
443
455
  function getRouteEntryDirectory(entry) {
444
456
  return _nullishCoalesce(entry.directory, () => ( entry.pattern));
@@ -454,10 +466,23 @@ function getRouteSpecificity(entry) {
454
466
  });
455
467
  }
456
468
  function compareRouteEntries(left, right) {
457
- return _chunkYTVSWXEZcjs.compareRouteSpecificity.call(void 0, getRouteSpecificity(left), getRouteSpecificity(right));
469
+ return _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, getRouteSpecificity(left), getRouteSpecificity(right));
458
470
  }
459
471
  var PLAN_SOURCE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
460
- var NODE_MODULES_SEGMENT = `${path3.default.sep}node_modules${path3.default.sep}`;
472
+ var NODE_MODULES_SEGMENT = `${path4.default.sep}node_modules${path4.default.sep}`;
473
+ function getInstalledPackageDirectory(file, start) {
474
+ let end = file.indexOf(path4.default.sep, start);
475
+ if (end !== -1 && file[start] === "@") end = file.indexOf(path4.default.sep, end + 1);
476
+ return end === -1 ? file : file.slice(0, end);
477
+ }
478
+ function realPathOutsideNodeModules(target) {
479
+ try {
480
+ const real = fs2.default.realpathSync(target);
481
+ return real.includes(NODE_MODULES_SEGMENT) ? null : real;
482
+ } catch (e) {
483
+ return null;
484
+ }
485
+ }
461
486
  var RouteManager = class _RouteManager {
462
487
  constructor(config, viteServer) {
463
488
  this.routes = /* @__PURE__ */ new Map();
@@ -473,7 +498,7 @@ var RouteManager = class _RouteManager {
473
498
  this.redirects = /* @__PURE__ */ new Map();
474
499
  this.programmaticPages = /* @__PURE__ */ new Map();
475
500
  this.programmaticLayouts = /* @__PURE__ */ new Map();
476
- this.programmaticClientRoutes = _chunkNXGQIXR7cjs.mergeProgrammaticClientRoutes.call(void 0, []);
501
+ this.programmaticClientRoutes = _chunkJNZDTE75cjs.mergeProgrammaticClientRoutes.call(void 0, []);
477
502
  this.discovery = Promise.resolve();
478
503
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
479
504
  // Each route module's hydration plan from the last plan, with the source files it read, so a dev
@@ -485,11 +510,13 @@ var RouteManager = class _RouteManager {
485
510
  this.planStamps = /* @__PURE__ */ new Map();
486
511
  this.sourceChangeTracking = false;
487
512
  this.linkedSources = /* @__PURE__ */ new Map();
513
+ // Whether each package directory under `node_modules` a plan read from links to a workspace.
514
+ this.linkedPackages = /* @__PURE__ */ new Map();
488
515
  // Source files edited since the last plan; null when the next plan must recompute every module.
489
516
  this.editedSources = null;
490
517
  this.config = config;
491
518
  this.viteServer = viteServer;
492
- if (viteServer) _chunkE7QOEV5Zcjs.trackProgrammaticRouteSources.call(void 0, );
519
+ if (viteServer) _chunkYUCU6XB4cjs.trackProgrammaticRouteSources.call(void 0, );
493
520
  }
494
521
  setRendererRuntime(rendererRuntime) {
495
522
  this.rendererRuntime = rendererRuntime;
@@ -533,10 +560,10 @@ var RouteManager = class _RouteManager {
533
560
  await this.discoverFileRoutes(source);
534
561
  await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
535
562
  }
536
- this.programmaticClientRoutes = _chunkNXGQIXR7cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
563
+ this.programmaticClientRoutes = _chunkJNZDTE75cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
537
564
  for (const slot of this.routeSlots.values()) {
538
- if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
539
- throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
565
+ if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
566
+ throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
540
567
  `Intercepting route slot "${slot.name}" targets "${slot.pattern}", but no canonical page exists for that URL`
541
568
  );
542
569
  }
@@ -552,18 +579,18 @@ var RouteManager = class _RouteManager {
552
579
  )
553
580
  );
554
581
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
555
- (left, right) => _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
556
- ).map((entry) => ({ entry, groupScope: _chunkO2A6HE76cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
582
+ (left, right) => _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
583
+ ).map((entry) => ({ entry, groupScope: _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
557
584
  for (const slot of this.routeSlots.values()) {
558
585
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
559
586
  this.routeSlotOwnerSegments.set(
560
587
  slot.ownerPattern,
561
- _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, `${slot.ownerPattern}/page.tsx`).segments
588
+ _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, `${slot.ownerPattern}/page.tsx`).segments
562
589
  );
563
590
  }
564
591
  }
565
592
  if (process.env.FARM_VERBOSE) {
566
- _chunkQMNWKQL4cjs.logger.info(
593
+ _chunkGC5ROI3Acjs.logger.info(
567
594
  `Discovered ${this.routes.size} pages, ${this.layouts.size} layouts, and ${this.metadataRoutes.size} metadata routes`
568
595
  );
569
596
  }
@@ -577,7 +604,7 @@ var RouteManager = class _RouteManager {
577
604
  matchRoute(pathname, options = {}) {
578
605
  const routePathname = this.toRoutePathname(pathname);
579
606
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
580
- const pathParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
607
+ const pathParts = _chunkGC5ROI3Acjs.splitRoutePath.call(void 0, normalizedPath);
581
608
  const trimmedPathname = routePathname.replace(/\/+$/, "");
582
609
  const hasEmptySegment = trimmedPathname.includes("//") || trimmedPathname === "" && routePathname.length > 1;
583
610
  let matchedRoute = null;
@@ -586,7 +613,7 @@ var RouteManager = class _RouteManager {
586
613
  if (hasEmptySegment && !routeEntry.route.segments.some((segment) => segment.isDynamic)) {
587
614
  continue;
588
615
  }
589
- const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
616
+ const match = _chunkGC5ROI3Acjs.matchRouteParts.call(void 0, pathParts, routeEntry.route.segments);
590
617
  if (match.matches) {
591
618
  matchedRoute = routeEntry;
592
619
  params = match.params;
@@ -608,6 +635,30 @@ var RouteManager = class _RouteManager {
608
635
  getRoutes() {
609
636
  return new Map(this.routes);
610
637
  }
638
+ /**
639
+ * The pages whose programmatic definition declares `search.preserve`, for Farm links to carry
640
+ * those params from the current URL. Read from the evaluated routes files, without planning.
641
+ */
642
+ getSearchPreserveRoutes() {
643
+ const routes = [];
644
+ for (const entry of this.routes.values()) {
645
+ const preserve = _optionalChain([_chunkYUCU6XB4cjs.getProgrammaticRouteSearchClientOptions.call(void 0,
646
+ _optionalChain([this, 'access', _2 => _2.programmaticPages, 'access', _3 => _3.get, 'call', _4 => _4(entry.modulePath), 'optionalAccess', _5 => _5.search])
647
+ ), 'optionalAccess', _6 => _6.preserve]);
648
+ if (!_optionalChain([preserve, 'optionalAccess', _7 => _7.length])) continue;
649
+ routes.push({
650
+ pattern: entry.pattern,
651
+ segments: entry.route.segments.map((seg) => ({
652
+ segment: seg.segment,
653
+ isDynamic: seg.isDynamic,
654
+ isCatchAll: seg.isCatchAll,
655
+ isOptional: seg.isOptional
656
+ })),
657
+ search: { preserve: [...preserve] }
658
+ });
659
+ }
660
+ return routes;
661
+ }
611
662
  /**
612
663
  * Get all registered layouts
613
664
  */
@@ -620,7 +671,7 @@ var RouteManager = class _RouteManager {
620
671
  /** The layouts that wrap a registered page, root first. */
621
672
  getRouteLayouts(pattern) {
622
673
  const routeEntry = this.routes.get(pattern);
623
- return routeEntry ? this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
674
+ return routeEntry ? this.findMatchingLayouts(_chunkGC5ROI3Acjs.splitRoutePath.call(void 0, pattern), routeEntry) : [];
624
675
  }
625
676
  /** Resolve route rules, inherited layouts, and the page export in precedence order. */
626
677
  async resolveRouteRuntimeConfig(pattern) {
@@ -629,7 +680,7 @@ var RouteManager = class _RouteManager {
629
680
  throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
630
681
  }
631
682
  const inherited = _chunkIUKBPBM7cjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
632
- const layouts = this.findMatchingLayouts(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pattern), routeEntry);
683
+ const layouts = this.findMatchingLayouts(_chunkGC5ROI3Acjs.splitRoutePath.call(void 0, pattern), routeEntry);
633
684
  const layoutConfigs = [];
634
685
  for (const layout of layouts) {
635
686
  const layoutModule = await this.loadLayoutModule(layout.modulePath);
@@ -673,12 +724,12 @@ var RouteManager = class _RouteManager {
673
724
  }
674
725
  matchRedirect(pathname, search = "") {
675
726
  const i18n = this.getI18nConfig();
676
- const localeMatch = i18n ? _chunkOWQV6MLMcjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
677
- const routePathname = _optionalChain([localeMatch, 'optionalAccess', _2 => _2.pathname]) || this.toRoutePathname(pathname);
727
+ const localeMatch = i18n ? _chunkGYJT2U7Jcjs.resolveFarmLocalePath.call(void 0, pathname, i18n) : void 0;
728
+ const routePathname = _optionalChain([localeMatch, 'optionalAccess', _8 => _8.pathname]) || this.toRoutePathname(pathname);
678
729
  const normalizedPath = routePathname === "/" ? "/" : routePathname.replace(/\/$/, "");
679
- const urlParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath);
730
+ const urlParts = _chunkGC5ROI3Acjs.splitRoutePath.call(void 0, normalizedPath);
680
731
  for (const redirectEntry of this.redirects.values()) {
681
- const match = _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
732
+ const match = _chunkGC5ROI3Acjs.matchRouteParts.call(void 0, urlParts, redirectEntry.route.segments);
682
733
  if (!match.matches) continue;
683
734
  const statusCode = redirectEntry.definition.statusCode || (redirectEntry.definition.permanent ? 308 : 307);
684
735
  return {
@@ -690,7 +741,7 @@ var RouteManager = class _RouteManager {
690
741
  match.params,
691
742
  getCatchAllParamSegments(redirectEntry.route.segments, urlParts)
692
743
  ),
693
- _optionalChain([localeMatch, 'optionalAccess', _3 => _3.locale])
744
+ _optionalChain([localeMatch, 'optionalAccess', _9 => _9.locale])
694
745
  ),
695
746
  search
696
747
  ),
@@ -723,7 +774,7 @@ var RouteManager = class _RouteManager {
723
774
  const pagePath = normalizedPath.slice(0, -suffix.fileName.length - 1) || "/";
724
775
  for (const imageEntry of this.metadataImages.values()) {
725
776
  if (imageEntry.kind !== suffix.kind) continue;
726
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, pagePath, imageEntry.route.segments);
777
+ const match = _chunkGC5ROI3Acjs.matchRoute.call(void 0, pagePath, imageEntry.route.segments);
727
778
  if (!match.matches) continue;
728
779
  return {
729
780
  image: imageEntry,
@@ -741,7 +792,7 @@ var RouteManager = class _RouteManager {
741
792
  const routePath = normalizedPath.slice(0, -suffix.outputName.length - 1) || "/";
742
793
  for (const metadata of this.metadataRoutes.values()) {
743
794
  if (metadata.kind !== suffix.kind) continue;
744
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, routePath, metadata.route.segments);
795
+ const match = _chunkGC5ROI3Acjs.matchRoute.call(void 0, routePath, metadata.route.segments);
745
796
  if (!match.matches) continue;
746
797
  return { metadata, params: match.params, routePath };
747
798
  }
@@ -755,7 +806,7 @@ var RouteManager = class _RouteManager {
755
806
  for (const metadata of this.metadataRoutes.values()) {
756
807
  if (metadata.kind !== kind || metadata.route.segments.length > pathSegments.length) continue;
757
808
  const routePath = metadata.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, metadata.route.segments.length).join("/")}`;
758
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, routePath, metadata.route.segments);
809
+ const match = _chunkGC5ROI3Acjs.matchRoute.call(void 0, routePath, metadata.route.segments);
759
810
  if (!match.matches) continue;
760
811
  if (!bestMatch || metadata.route.segments.length > bestMatch.metadata.route.segments.length) {
761
812
  bestMatch = { metadata, params: match.params, routePath };
@@ -776,7 +827,7 @@ var RouteManager = class _RouteManager {
776
827
  if (imageEntry.kind !== kind) continue;
777
828
  if (imageEntry.route.segments.length > pathSegments.length) continue;
778
829
  const candidatePath = imageEntry.route.segments.length === 0 ? "/" : `/${pathSegments.slice(0, imageEntry.route.segments.length).join("/")}`;
779
- const match = _chunkQMNWKQL4cjs.matchRoute.call(void 0, candidatePath, imageEntry.route.segments);
830
+ const match = _chunkGC5ROI3Acjs.matchRoute.call(void 0, candidatePath, imageEntry.route.segments);
780
831
  if (!match.matches) continue;
781
832
  if (!bestMatch || imageEntry.route.segments.length > bestMatch.image.route.segments.length) {
782
833
  bestMatch = {
@@ -797,16 +848,16 @@ var RouteManager = class _RouteManager {
797
848
  * Requests still fetch route data, but never inspect component source.
798
849
  */
799
850
  generateClientManifest(projectRoot = this.config.root) {
800
- const normalizedProjectRoot = path3.default.resolve(projectRoot);
801
- if (_optionalChain([this, 'access', _4 => _4.clientManifestCache, 'optionalAccess', _5 => _5.projectRoot]) === normalizedProjectRoot) {
851
+ const normalizedProjectRoot = path4.default.resolve(projectRoot);
852
+ if (_optionalChain([this, 'access', _10 => _10.clientManifestCache, 'optionalAccess', _11 => _11.projectRoot]) === normalizedProjectRoot) {
802
853
  return this.clientManifestCache.manifest;
803
854
  }
804
855
  const cacheFile = this.packageClientBoundaryCacheFile;
805
- const compute = () => _chunkNXGQIXR7cjs.withFarmSourceSnapshot.call(void 0,
856
+ const compute = () => _chunkJNZDTE75cjs.withFarmSourceSnapshot.call(void 0,
806
857
  () => this.computeClientManifest(normalizedProjectRoot),
807
858
  this.sourceSnapshot
808
859
  );
809
- return cacheFile ? _chunkNXGQIXR7cjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
860
+ return cacheFile ? _chunkJNZDTE75cjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
810
861
  }
811
862
  /**
812
863
  * @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
@@ -815,7 +866,7 @@ var RouteManager = class _RouteManager {
815
866
  */
816
867
  trackSourceChanges() {
817
868
  this.sourceChangeTracking = true;
818
- _nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkNXGQIXR7cjs.FarmSourceSnapshotStore)())));
869
+ _nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkJNZDTE75cjs.FarmSourceSnapshotStore)())));
819
870
  }
820
871
  /**
821
872
  * @internal A production build edits no source while it runs, so what the plan reads, parses and
@@ -824,7 +875,7 @@ var RouteManager = class _RouteManager {
824
875
  */
825
876
  keepBuildSourceSnapshot() {
826
877
  if (this.sourceChangeTracking) return;
827
- _nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkNXGQIXR7cjs.FarmSourceSnapshotStore)(false))));
878
+ _nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkJNZDTE75cjs.FarmSourceSnapshotStore)(false))));
828
879
  }
829
880
  /**
830
881
  * @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
@@ -846,15 +897,16 @@ var RouteManager = class _RouteManager {
846
897
  if (file.endsWith(".d.ts")) return;
847
898
  if (PLAN_SOURCE.test(file)) {
848
899
  if (event === "update") {
849
- _optionalChain([this, 'access', _6 => _6.editedSources, 'optionalAccess', _7 => _7.add, 'call', _8 => _8(path3.default.resolve(file))]);
900
+ _optionalChain([this, 'access', _12 => _12.editedSources, 'optionalAccess', _13 => _13.add, 'call', _14 => _14(path4.default.resolve(file))]);
850
901
  return;
851
902
  }
852
903
  } else if (!/\.jsonc?$/.test(file)) {
853
904
  return;
854
905
  }
855
906
  this.editedSources = null;
856
- _optionalChain([this, 'access', _9 => _9.sourceSnapshot, 'optionalAccess', _10 => _10.clear, 'call', _11 => _11()]);
907
+ _optionalChain([this, 'access', _15 => _15.sourceSnapshot, 'optionalAccess', _16 => _16.clear, 'call', _17 => _17()]);
857
908
  this.linkedSources.clear();
909
+ this.linkedPackages.clear();
858
910
  }
859
911
  /**
860
912
  * @internal Whether an edit to `file` leaves the current plan as it is: a client module the
@@ -865,8 +917,8 @@ var RouteManager = class _RouteManager {
865
917
  if (!this.sourceChangeTracking || !this.editedSources || !this.clientManifestCache) {
866
918
  return false;
867
919
  }
868
- const previous = _optionalChain([this, 'access', _12 => _12.sourceSnapshot, 'optionalAccess', _13 => _13.peekSource, 'call', _14 => _14(path3.default.resolve(file))]);
869
- return previous !== void 0 && _chunkNXGQIXR7cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
920
+ const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
921
+ return previous !== void 0 && _chunkJNZDTE75cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
870
922
  }
871
923
  /**
872
924
  * A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
@@ -877,7 +929,7 @@ var RouteManager = class _RouteManager {
877
929
  if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
878
930
  return { ...previous.plan };
879
931
  }
880
- const { result, files } = _chunkNXGQIXR7cjs.traceFarmSourceReads.call(void 0, compute);
932
+ const { result, files } = _chunkJNZDTE75cjs.traceFarmSourceReads.call(void 0, compute);
881
933
  const sources = /* @__PURE__ */ new Set();
882
934
  for (const file of files) {
883
935
  const source = this.planSourcePath(file);
@@ -885,7 +937,7 @@ var RouteManager = class _RouteManager {
885
937
  }
886
938
  if (!this.sourceChangeTracking) {
887
939
  for (const source of sources) {
888
- if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkNXGQIXR7cjs.getFarmSourceStamp.call(void 0, source));
940
+ if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkJNZDTE75cjs.getFarmSourceStamp.call(void 0, source));
889
941
  }
890
942
  }
891
943
  this.ownerPlans.set(key, { plan: result, files: sources, planKey });
@@ -905,7 +957,7 @@ var RouteManager = class _RouteManager {
905
957
  const isUnchanged = (file) => {
906
958
  let result = unchanged.get(file);
907
959
  if (result === void 0) {
908
- result = this.planStamps.get(file) === _chunkNXGQIXR7cjs.getFarmSourceStamp.call(void 0, file);
960
+ result = this.planStamps.get(file) === _chunkJNZDTE75cjs.getFarmSourceStamp.call(void 0, file);
909
961
  unchanged.set(file, result);
910
962
  }
911
963
  return result;
@@ -918,17 +970,22 @@ var RouteManager = class _RouteManager {
918
970
  /**
919
971
  * The path the watcher reports for a file a plan read: itself, or the real path of a workspace
920
972
  * package's source read through its `node_modules` link. Null for an installed package's file.
973
+ * Package managers link whole package directories, so one realpath of the directory rules out an
974
+ * installed package; a plan reads thousands of files of an icon package.
921
975
  */
922
976
  planSourcePath(file) {
923
- if (!file.includes(NODE_MODULES_SEGMENT)) return file;
977
+ const index = file.lastIndexOf(NODE_MODULES_SEGMENT);
978
+ if (index === -1) return file;
979
+ const directory = getInstalledPackageDirectory(file, index + NODE_MODULES_SEGMENT.length);
980
+ let linked = this.linkedPackages.get(directory);
981
+ if (linked === void 0) {
982
+ linked = realPathOutsideNodeModules(directory) !== null;
983
+ this.linkedPackages.set(directory, linked);
984
+ }
985
+ if (!linked) return null;
924
986
  let source = this.linkedSources.get(file);
925
987
  if (source === void 0) {
926
- try {
927
- const real = _fs.realpathSync.call(void 0, file);
928
- source = real.includes(NODE_MODULES_SEGMENT) ? null : real;
929
- } catch (e) {
930
- source = null;
931
- }
988
+ source = realPathOutsideNodeModules(file);
932
989
  this.linkedSources.set(file, source);
933
990
  }
934
991
  return source;
@@ -947,47 +1004,47 @@ var RouteManager = class _RouteManager {
947
1004
  */
948
1005
  inspectPackages(operation) {
949
1006
  const file = this.packageClientBoundaryCacheFile;
950
- return file ? _chunkNXGQIXR7cjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
1007
+ return file ? _chunkJNZDTE75cjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
951
1008
  }
952
1009
  computeClientManifest(normalizedProjectRoot) {
953
1010
  const toUrlPath = (absolutePath) => {
954
- const rootRelative = _chunkQMNWKQL4cjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
1011
+ const rootRelative = _chunkGC5ROI3Acjs.toRootRelativeUrlPath.call(void 0, absolutePath, normalizedProjectRoot);
955
1012
  if (rootRelative !== void 0) return rootRelative;
956
- if (path3.default.isAbsolute(absolutePath)) {
1013
+ if (path4.default.isAbsolute(absolutePath)) {
957
1014
  const normalized = absolutePath.replace(/\\/g, "/");
958
1015
  return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
959
1016
  }
960
1017
  return absolutePath;
961
1018
  };
962
- const integrationProviders = _chunk65OS2TOTcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
1019
+ const integrationProviders = _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
963
1020
  (provider) => provider.component || provider.type === "clerk"
964
1021
  );
965
1022
  const unsupportedIntegrationProvider = integrationProviders.find(
966
1023
  (provider) => provider.supportsIsolatedHydration !== true
967
1024
  );
968
- if (_optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
969
- _chunkQMNWKQL4cjs.logger.warn(
1025
+ if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
1026
+ _chunkGC5ROI3Acjs.logger.warn(
970
1027
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
971
1028
  );
972
1029
  }
973
- const isolatedMode = _chunkNXGQIXR7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
974
- _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]),
1030
+ const isolatedMode = _chunkJNZDTE75cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1031
+ _optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
975
1032
  {
976
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) === "rsc",
1033
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
977
1034
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
978
1035
  }
979
1036
  );
980
- const planOptions = _chunkNXGQIXR7cjs.getFarmClientHydrationPlanOptions.call(void 0,
1037
+ const planOptions = _chunkJNZDTE75cjs.getFarmClientHydrationPlanOptions.call(void 0,
981
1038
  this.config.renderer,
982
1039
  Boolean(unsupportedIntegrationProvider)
983
1040
  );
984
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.serverComponents])) === "islands";
985
- const changed = _optionalChain([this, 'access', _30 => _30.sourceSnapshot, 'optionalAccess', _31 => _31.refresh, 'call', _32 => _32(_nullishCoalesce(this.editedSources, () => ( [])))]);
1041
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _33 => _33.config, 'access', _34 => _34.experimental, 'optionalAccess', _35 => _35.serverComponents])) === "islands";
1042
+ const changed = _optionalChain([this, 'access', _36 => _36.sourceSnapshot, 'optionalAccess', _37 => _37.refresh, 'call', _38 => _38(_nullishCoalesce(this.editedSources, () => ( [])))]);
986
1043
  let edited = null;
987
1044
  if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
988
1045
  edited = /* @__PURE__ */ new Set();
989
1046
  for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
990
- if (_chunkNXGQIXR7cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
1047
+ if (_chunkJNZDTE75cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
991
1048
  const source = this.planSourcePath(file);
992
1049
  if (source) edited.add(source);
993
1050
  }
@@ -1002,13 +1059,13 @@ var RouteManager = class _RouteManager {
1002
1059
  metadata: this.planRouteModule(
1003
1060
  `layout:${entry.modulePath}`,
1004
1061
  edited,
1005
- () => _chunkNXGQIXR7cjs.getClientModuleHydrationPlan.call(void 0,
1062
+ () => _chunkJNZDTE75cjs.getClientModuleHydrationPlan.call(void 0,
1006
1063
  entry.modulePath,
1007
1064
  normalizedProjectRoot,
1008
1065
  isolatedMode,
1009
1066
  layoutPlanOptions
1010
1067
  ),
1011
- _chunkNXGQIXR7cjs.getClientModuleHydrationPlanKey.call(void 0,
1068
+ _chunkJNZDTE75cjs.getClientModuleHydrationPlanKey.call(void 0,
1012
1069
  entry.modulePath,
1013
1070
  normalizedProjectRoot,
1014
1071
  isolatedMode,
@@ -1016,7 +1073,7 @@ var RouteManager = class _RouteManager {
1016
1073
  )
1017
1074
  )
1018
1075
  }));
1019
- const markdownComponentsPlan = _chunkNXGQIXR7cjs.createMarkdownPageHydrationPlanner.call(void 0,
1076
+ const markdownComponentsPlan = _chunkJNZDTE75cjs.createMarkdownPageHydrationPlanner.call(void 0,
1020
1077
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
1021
1078
  normalizedProjectRoot,
1022
1079
  isolatedMode,
@@ -1029,16 +1086,16 @@ var RouteManager = class _RouteManager {
1029
1086
  const pagePlanOptions = { ...planOptions, serverOwners: islandsMode };
1030
1087
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
1031
1088
  entry,
1032
- metadata: _chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
1089
+ metadata: _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
1033
1090
  `page:${entry.modulePath}`,
1034
1091
  edited,
1035
- () => _chunkNXGQIXR7cjs.getClientModuleHydrationPlan.call(void 0,
1092
+ () => _chunkJNZDTE75cjs.getClientModuleHydrationPlan.call(void 0,
1036
1093
  entry.modulePath,
1037
1094
  normalizedProjectRoot,
1038
1095
  isolatedMode,
1039
1096
  pagePlanOptions
1040
1097
  ),
1041
- _chunkNXGQIXR7cjs.getClientModuleHydrationPlanKey.call(void 0,
1098
+ _chunkJNZDTE75cjs.getClientModuleHydrationPlanKey.call(void 0,
1042
1099
  entry.modulePath,
1043
1100
  normalizedProjectRoot,
1044
1101
  isolatedMode,
@@ -1047,51 +1104,51 @@ var RouteManager = class _RouteManager {
1047
1104
  )
1048
1105
  }));
1049
1106
  const markdownFallback = routeEntries.find(
1050
- ({ entry, metadata }) => _chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
1107
+ ({ entry, metadata }) => _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
1051
1108
  );
1052
1109
  if (markdownFallback) {
1053
- _chunkQMNWKQL4cjs.logger.warn(
1110
+ _chunkGC5ROI3Acjs.logger.warn(
1054
1111
  `[Farm.js] client components in Markdown pages stay static: ${markdownFallback.metadata.fallbackReason}.`
1055
1112
  );
1056
1113
  }
1057
- const markdownStaticPackages = _optionalChain([routeEntries, 'access', _33 => _33.find, 'call', _34 => _34(
1058
- ({ entry, metadata }) => _chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
1059
- ), 'optionalAccess', _35 => _35.metadata, 'access', _36 => _36.staticPackageBoundaries]);
1114
+ const markdownStaticPackages = _optionalChain([routeEntries, 'access', _39 => _39.find, 'call', _40 => _40(
1115
+ ({ entry, metadata }) => _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
1116
+ ), 'optionalAccess', _41 => _41.metadata, 'access', _42 => _42.staticPackageBoundaries]);
1060
1117
  if (markdownStaticPackages) {
1061
- _chunkQMNWKQL4cjs.logger.info(
1118
+ _chunkGC5ROI3Acjs.logger.info(
1062
1119
  `[Farm.js] Markdown pages render client components from ${markdownStaticPackages.join(", ")} as static HTML: package client components cannot be isolated yet.`
1063
1120
  );
1064
1121
  }
1065
1122
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
1066
- if (_chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
1067
- _chunkQMNWKQL4cjs.logger.info(
1123
+ if (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
1124
+ _chunkGC5ROI3Acjs.logger.info(
1068
1125
  `[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
1069
1126
  );
1070
1127
  }
1071
- _chunkNXGQIXR7cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1128
+ _chunkJNZDTE75cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1072
1129
  layoutEntries.map(({ entry, metadata }) => ({
1073
1130
  pattern: entry.pattern,
1074
- depth: _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
1131
+ depth: _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
1075
1132
  metadata
1076
1133
  })),
1077
1134
  routeEntries.map(({ entry, metadata }) => ({
1078
1135
  pattern: getRouteEntryDirectory(entry),
1079
- depth: _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
1136
+ depth: _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
1080
1137
  metadata
1081
1138
  })),
1082
- _chunkO2A6HE76cjs.routeBoundaryCoversDirectory,
1139
+ _chunkXGDI4OUBcjs.routeBoundaryCoversDirectory,
1083
1140
  { serverOwners: islandsMode }
1084
1141
  );
1085
1142
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
1086
1143
  if (!metadata.costGuardExceeded) continue;
1087
- _chunkQMNWKQL4cjs.logger.warn(
1144
+ _chunkGC5ROI3Acjs.logger.warn(
1088
1145
  `[Farm.js] isolated hydration kept route-wide for ${entry.modulePath}: ${metadata.fallbackReason}.`
1089
1146
  );
1090
1147
  }
1091
1148
  if (isolatedMode === "analyze") {
1092
1149
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
1093
1150
  if (!metadata.isolatedHydrationEligible) continue;
1094
- _chunkQMNWKQL4cjs.logger.info(
1151
+ _chunkGC5ROI3Acjs.logger.info(
1095
1152
  `[Farm.js] isolated hydration analysis: ${entry.modulePath} can keep ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"} while excluding its server owner from the browser graph.`
1096
1153
  );
1097
1154
  }
@@ -1099,7 +1156,7 @@ var RouteManager = class _RouteManager {
1099
1156
  const routes = routeEntries.map(({ entry, metadata }) => {
1100
1157
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
1101
1158
  const layoutShouldHydrate = layoutEntries.some(
1102
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkO2A6HE76cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
1159
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkXGDI4OUBcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
1103
1160
  );
1104
1161
  return {
1105
1162
  pattern: entry.pattern,
@@ -1115,15 +1172,15 @@ var RouteManager = class _RouteManager {
1115
1172
  modulePath: toUrlPath(boundary.modulePath)
1116
1173
  }))
1117
1174
  } : {},
1118
- ..._chunkNXGQIXR7cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
1119
- renderPlan: _chunkO2A6HE76cjs.createFarmRouteRenderPlan.call(void 0, {
1175
+ ..._chunkJNZDTE75cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
1176
+ renderPlan: _chunkXGDI4OUBcjs.createFarmRouteRenderPlan.call(void 0, {
1120
1177
  pageShouldHydrate: metadata.shouldHydrate,
1121
1178
  layoutShouldHydrate,
1122
1179
  islandStrategy: metadata.islandStrategy
1123
1180
  }),
1124
1181
  suppressedAsyncHydration: metadata.suppressedAsyncHydration,
1125
1182
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {},
1126
- search: _chunkE7QOEV5Zcjs.getProgrammaticRouteSearchClientOptions.call(void 0, _optionalChain([programmaticPage, 'optionalAccess', _37 => _37.search])),
1183
+ search: _chunkYUCU6XB4cjs.getProgrammaticRouteSearchClientOptions.call(void 0, _optionalChain([programmaticPage, 'optionalAccess', _43 => _43.search])),
1127
1184
  segments: entry.route.segments.map((seg) => ({
1128
1185
  segment: seg.segment,
1129
1186
  isDynamic: seg.isDynamic,
@@ -1132,7 +1189,7 @@ var RouteManager = class _RouteManager {
1132
1189
  }))
1133
1190
  };
1134
1191
  });
1135
- const treeLayoutPatterns = islandsMode ? _chunkO2A6HE76cjs.getFarmServerTreeLayoutPatterns.call(void 0,
1192
+ const treeLayoutPatterns = islandsMode ? _chunkXGDI4OUBcjs.getFarmServerTreeLayoutPatterns.call(void 0,
1136
1193
  layoutEntries.map(({ entry, metadata }) => ({
1137
1194
  pattern: entry.pattern,
1138
1195
  shouldHydrate: metadata.shouldHydrate,
@@ -1157,7 +1214,7 @@ var RouteManager = class _RouteManager {
1157
1214
  ...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
1158
1215
  }));
1159
1216
  const slots = Array.from(this.routeSlots.values()).map((entry) => {
1160
- const metadata = _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
1217
+ const metadata = _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
1161
1218
  return {
1162
1219
  name: entry.name,
1163
1220
  ownerPattern: entry.ownerPattern,
@@ -1173,7 +1230,7 @@ var RouteManager = class _RouteManager {
1173
1230
  };
1174
1231
  });
1175
1232
  const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
1176
- metadata: _chunkNXGQIXR7cjs.getClientModuleHydrationPlan.call(void 0,
1233
+ metadata: _chunkJNZDTE75cjs.getClientModuleHydrationPlan.call(void 0,
1177
1234
  entry.modulePath,
1178
1235
  normalizedProjectRoot,
1179
1236
  isolatedMode,
@@ -1184,7 +1241,7 @@ var RouteManager = class _RouteManager {
1184
1241
  for (const { metadata } of [...layoutEntries, ...routeEntries, ...slotPlans]) {
1185
1242
  if (!metadata.hasIsolatedClientBoundaries && !metadata.serverTreeLayout) continue;
1186
1243
  for (const boundary of metadata.isolatedBoundaries) {
1187
- isolatedClientBoundaryModules.add(path3.default.resolve(boundary.modulePath));
1244
+ isolatedClientBoundaryModules.add(path4.default.resolve(boundary.modulePath));
1188
1245
  }
1189
1246
  }
1190
1247
  const islandsErrors = [
@@ -1198,7 +1255,7 @@ var RouteManager = class _RouteManager {
1198
1255
  for (const error of islandsErrors) {
1199
1256
  if (this.reportedIslandsErrors.has(error)) continue;
1200
1257
  this.reportedIslandsErrors.add(error);
1201
- _chunkQMNWKQL4cjs.logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
1258
+ _chunkGC5ROI3Acjs.logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
1202
1259
  }
1203
1260
  const manifest = { routes, layouts, slots };
1204
1261
  this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
@@ -1236,17 +1293,17 @@ var RouteManager = class _RouteManager {
1236
1293
  }
1237
1294
  /** @internal Client modules selected by the compiled hydration ownership plan. */
1238
1295
  getIsolatedClientBoundaryModules(projectRoot = this.config.root) {
1239
- const normalizedProjectRoot = path3.default.resolve(projectRoot);
1296
+ const normalizedProjectRoot = path4.default.resolve(projectRoot);
1240
1297
  this.generateClientManifest(normalizedProjectRoot);
1241
- return _nullishCoalesce(_optionalChain([this, 'access', _38 => _38.clientManifestCache, 'optionalAccess', _39 => _39.isolatedClientBoundaryModules]), () => ( /* @__PURE__ */ new Set()));
1298
+ return _nullishCoalesce(_optionalChain([this, 'access', _44 => _44.clientManifestCache, 'optionalAccess', _45 => _45.isolatedClientBoundaryModules]), () => ( /* @__PURE__ */ new Set()));
1242
1299
  }
1243
1300
  /**
1244
1301
  * @internal Islands-mode pages with a client component that cannot become an island. Hydrating
1245
1302
  * such a page whole would ship its server code to the browser, so it stays static instead.
1246
1303
  */
1247
1304
  getIslandsErrors(projectRoot = this.config.root) {
1248
- this.generateClientManifest(path3.default.resolve(projectRoot));
1249
- return _nullishCoalesce(_optionalChain([this, 'access', _40 => _40.clientManifestCache, 'optionalAccess', _41 => _41.islandsErrors]), () => ( []));
1305
+ this.generateClientManifest(path4.default.resolve(projectRoot));
1306
+ return _nullishCoalesce(_optionalChain([this, 'access', _46 => _46.clientManifestCache, 'optionalAccess', _47 => _47.islandsErrors]), () => ( []));
1250
1307
  }
1251
1308
  /**
1252
1309
  * Invalidate build-time route metadata after a page or layout changes in dev.
@@ -1265,20 +1322,20 @@ var RouteManager = class _RouteManager {
1265
1322
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
1266
1323
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
1267
1324
  }
1268
- if (_chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1325
+ if (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
1269
1326
  const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
1270
1327
  const viteServer = this.viteServer;
1271
- return await _chunkIJFNXP3Dcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1328
+ return await _chunk5QZT2EQNcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
1272
1329
  // Loaded on render: the route runtime manifest only reads metadata and rendering config.
1273
- components: () => _chunkIJFNXP3Dcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1330
+ components: () => _chunk5QZT2EQNcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
1274
1331
  root: this.config.root,
1275
- loadModule: viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
1332
+ loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
1276
1333
  }),
1277
1334
  config: mdxConfig
1278
1335
  });
1279
1336
  }
1280
1337
  if (this.viteServer) {
1281
- const module = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
1338
+ const module = await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
1282
1339
  return module;
1283
1340
  } else {
1284
1341
  const module = await import(
@@ -1288,7 +1345,7 @@ var RouteManager = class _RouteManager {
1288
1345
  return module;
1289
1346
  }
1290
1347
  } catch (error) {
1291
- _chunkQMNWKQL4cjs.logger.error(`Failed to load route module: ${modulePath}`);
1348
+ _chunkGC5ROI3Acjs.logger.error(`Failed to load route module: ${modulePath}`);
1292
1349
  throw error;
1293
1350
  }
1294
1351
  }
@@ -1303,7 +1360,7 @@ var RouteManager = class _RouteManager {
1303
1360
  return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
1304
1361
  }
1305
1362
  if (this.viteServer) {
1306
- const module = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
1363
+ const module = await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
1307
1364
  return module;
1308
1365
  } else {
1309
1366
  const module = await import(
@@ -1313,7 +1370,7 @@ var RouteManager = class _RouteManager {
1313
1370
  return module;
1314
1371
  }
1315
1372
  } catch (error) {
1316
- _chunkQMNWKQL4cjs.logger.error(`Failed to load layout module: ${modulePath}`);
1373
+ _chunkGC5ROI3Acjs.logger.error(`Failed to load layout module: ${modulePath}`);
1317
1374
  throw error;
1318
1375
  }
1319
1376
  }
@@ -1322,11 +1379,11 @@ var RouteManager = class _RouteManager {
1322
1379
  */
1323
1380
  createRoutePattern(route) {
1324
1381
  if (route.segments.length === 0) return "/";
1325
- return "/" + route.segments.map(_chunkO2A6HE76cjs.formatRouteSegment).join("/");
1382
+ return "/" + route.segments.map(_chunkXGDI4OUBcjs.formatRouteSegment).join("/");
1326
1383
  }
1327
1384
  registerPageRoute(entry) {
1328
- _chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
1329
- const shape = _chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, entry.pattern);
1385
+ _chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
1386
+ const shape = _chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, entry.pattern);
1330
1387
  const existing = this.pageRouteShapes.get(shape);
1331
1388
  if (existing && existing.pattern !== entry.pattern) {
1332
1389
  if (existing.sourceRoot === entry.sourceRoot) {
@@ -1340,7 +1397,7 @@ var RouteManager = class _RouteManager {
1340
1397
  this.pageRouteShapes.set(shape, entry);
1341
1398
  }
1342
1399
  async discoverFileRoutes(source) {
1343
- const appDir = _chunkQMNWKQL4cjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
1400
+ const appDir = _chunkGC5ROI3Acjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
1344
1401
  const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
1345
1402
  (extension) => extension.slice(1)
1346
1403
  );
@@ -1359,8 +1416,8 @@ var RouteManager = class _RouteManager {
1359
1416
  appDir
1360
1417
  );
1361
1418
  const canonicalPageGroups = /* @__PURE__ */ new Map();
1362
- for (const file of pageFiles.filter((candidate) => _chunkZDAEHG2Ocjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
1363
- const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1419
+ for (const file of pageFiles.filter((candidate) => _chunkQYOAGT3Ecjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
1420
+ const route = _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, file);
1364
1421
  const pattern = this.createRoutePattern(route);
1365
1422
  const group = canonicalPageGroups.get(pattern);
1366
1423
  if (group) {
@@ -1373,25 +1430,25 @@ var RouteManager = class _RouteManager {
1373
1430
  }
1374
1431
  }
1375
1432
  for (const [pattern, group] of canonicalPageGroups) {
1376
- const componentFiles = group.files.filter((file) => !_chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, file));
1377
- const markdownFiles = group.files.filter(_chunkVZKCGHWCcjs.isFarmMarkdownPageFile);
1433
+ const componentFiles = group.files.filter((file) => !_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, file));
1434
+ const markdownFiles = group.files.filter(_chunkPG7J7XYTcjs.isFarmMarkdownPageFile);
1378
1435
  if (componentFiles.length > 1) {
1379
1436
  throw new Error(
1380
- `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
1437
+ `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path4.default.join(appDir, file)).join(" and ")}.`
1381
1438
  );
1382
1439
  }
1383
1440
  if (markdownFiles.length > 1) {
1384
1441
  throw new Error(
1385
- `Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
1442
+ `Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map((file) => path4.default.join(appDir, file)).join(" and ")}.`
1386
1443
  );
1387
1444
  }
1388
1445
  const componentFile = componentFiles[0];
1389
1446
  const markdownFile = markdownFiles[0];
1390
1447
  const primaryFile = componentFile || markdownFile;
1391
1448
  if (!primaryFile) continue;
1392
- const modulePath = path3.default.join(appDir, primaryFile);
1449
+ const modulePath = path4.default.join(appDir, primaryFile);
1393
1450
  const existing = this.routes.get(pattern);
1394
- if (_optionalChain([existing, 'optionalAccess', _42 => _42.sourceRoot]) === source.root) {
1451
+ if (_optionalChain([existing, 'optionalAccess', _48 => _48.sourceRoot]) === source.root) {
1395
1452
  throw new Error(
1396
1453
  `Duplicate page route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1397
1454
  );
@@ -1400,7 +1457,7 @@ var RouteManager = class _RouteManager {
1400
1457
  route: group.route,
1401
1458
  modulePath,
1402
1459
  ...markdownFile ? {
1403
- markdownSourcePath: path3.default.join(appDir, markdownFile)
1460
+ markdownSourcePath: path4.default.join(appDir, markdownFile)
1404
1461
  } : {},
1405
1462
  pattern,
1406
1463
  ...getPageDirectoryField(group.route, pattern),
@@ -1414,11 +1471,11 @@ var RouteManager = class _RouteManager {
1414
1471
  ["error", errorFiles, this.errors]
1415
1472
  ]) {
1416
1473
  for (const file of files) {
1417
- const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1418
- const modulePath = path3.default.join(appDir, file);
1419
- const pattern = _chunkO2A6HE76cjs.createRouteDirectoryPattern.call(void 0, route);
1474
+ const route = _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, file);
1475
+ const modulePath = path4.default.join(appDir, file);
1476
+ const pattern = _chunkXGDI4OUBcjs.createRouteDirectoryPattern.call(void 0, route);
1420
1477
  const existing = target.get(pattern);
1421
- if (_optionalChain([existing, 'optionalAccess', _43 => _43.sourceRoot]) === source.root) {
1478
+ if (_optionalChain([existing, 'optionalAccess', _49 => _49.sourceRoot]) === source.root) {
1422
1479
  throw new Error(
1423
1480
  `Duplicate ${kind} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1424
1481
  );
@@ -1433,15 +1490,15 @@ var RouteManager = class _RouteManager {
1433
1490
  }
1434
1491
  }
1435
1492
  for (const file of [...pageFiles, ...slotDefaultFiles]) {
1436
- const slot = _chunkZDAEHG2Ocjs.parseRouteSlotFile.call(void 0, file);
1493
+ const slot = _chunkQYOAGT3Ecjs.parseRouteSlotFile.call(void 0, file);
1437
1494
  if (!slot) continue;
1438
- const modulePath = path3.default.join(appDir, file);
1495
+ const modulePath = path4.default.join(appDir, file);
1439
1496
  const pattern = this.createRoutePattern(slot.route);
1440
1497
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
1441
- const ownerDirectory = _chunkO2A6HE76cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1498
+ const ownerDirectory = _chunkXGDI4OUBcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
1442
1499
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
1443
1500
  const existing = this.routeSlots.get(key);
1444
- if (_optionalChain([existing, 'optionalAccess', _44 => _44.sourceRoot]) === source.root) {
1501
+ if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
1445
1502
  throw new Error(
1446
1503
  `Duplicate route slot "${slot.name}" for "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
1447
1504
  );
@@ -1457,20 +1514,20 @@ var RouteManager = class _RouteManager {
1457
1514
  ...ownerDirectory === ownerPattern ? {} : { ownerDirectory },
1458
1515
  interception: slot.interception,
1459
1516
  fallback: slot.fallback,
1460
- containerId: _chunkZDAEHG2Ocjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
1517
+ containerId: _chunkQYOAGT3Ecjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
1461
1518
  });
1462
1519
  }
1463
1520
  for (const file of metadataImageFiles) {
1464
- const fileBase = path3.default.basename(file, path3.default.extname(file));
1521
+ const fileBase = path4.default.basename(file, path4.default.extname(file));
1465
1522
  const kind = fileBase === "twitter-image" ? "twitter" : "opengraph";
1466
1523
  const fileName = kind === "twitter" ? "twitter-image" : "opengraph-image";
1467
- const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1468
- const modulePath = path3.default.join(appDir, file);
1524
+ const route = _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, file);
1525
+ const modulePath = path4.default.join(appDir, file);
1469
1526
  const pattern = this.createRoutePattern(route);
1470
1527
  const key = `${kind}:${pattern}`;
1471
1528
  const existing = this.metadataImages.get(key);
1472
1529
  const sourceType = isStaticMetadataImageFile(file) ? "static" : "module";
1473
- if (_optionalChain([existing, 'optionalAccess', _45 => _45.sourceRoot]) === source.root) {
1530
+ if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
1474
1531
  throw new Error(
1475
1532
  `Duplicate ${fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one static image or module per route segment.`
1476
1533
  );
@@ -1490,15 +1547,15 @@ var RouteManager = class _RouteManager {
1490
1547
  }
1491
1548
  for (const file of metadataRouteFiles) {
1492
1549
  const descriptor = getApplicationMetadataRouteDescriptor(
1493
- path3.default.basename(file, path3.default.extname(file))
1550
+ path4.default.basename(file, path4.default.extname(file))
1494
1551
  );
1495
1552
  if (!descriptor) continue;
1496
- const route = _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, file);
1497
- const modulePath = path3.default.join(appDir, file);
1553
+ const route = _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, file);
1554
+ const modulePath = path4.default.join(appDir, file);
1498
1555
  const pattern = this.createRoutePattern(route);
1499
1556
  const key = `${descriptor.kind}:${pattern}`;
1500
1557
  const existing = this.metadataRoutes.get(key);
1501
- if (_optionalChain([existing, 'optionalAccess', _46 => _46.sourceRoot]) === source.root) {
1558
+ if (_optionalChain([existing, 'optionalAccess', _52 => _52.sourceRoot]) === source.root) {
1502
1559
  throw new Error(
1503
1560
  `Duplicate ${descriptor.fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one .ts or .js metadata route per segment.`
1504
1561
  );
@@ -1514,35 +1571,35 @@ var RouteManager = class _RouteManager {
1514
1571
  }
1515
1572
  }
1516
1573
  async discoverProgrammaticRoutes(source, clientRoutes) {
1517
- if (this.viteServer) _chunkE7QOEV5Zcjs.trackProgrammaticRouteSources.call(void 0, );
1518
- const manifests = await _chunkEMRYJG4Ucjs.loadProgrammaticRouteManifests.call(void 0, {
1574
+ if (this.viteServer) _chunkYUCU6XB4cjs.trackProgrammaticRouteSources.call(void 0, );
1575
+ const manifests = await _chunkYTNE4KGCcjs.loadProgrammaticRouteManifests.call(void 0, {
1519
1576
  root: source.root,
1520
1577
  srcDir: source.srcDir,
1521
1578
  loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
1522
1579
  });
1523
- const graph = this.viteServer ? _chunkNXGQIXR7cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1580
+ const graph = this.viteServer ? _chunkJNZDTE75cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
1524
1581
  for (const { filePath, manifest } of manifests) {
1525
1582
  if (graph) {
1526
1583
  clientRoutes.push(
1527
- _chunkNXGQIXR7cjs.resolveProgrammaticClientRoutes.call(void 0, {
1584
+ _chunkJNZDTE75cjs.resolveProgrammaticClientRoutes.call(void 0, {
1528
1585
  graph,
1529
1586
  routesFile: toRealPath(filePath),
1530
1587
  routes: manifest.routes,
1531
- normalizeRoutePath: _chunkE7QOEV5Zcjs.normalizeProgrammaticRoutePath
1588
+ normalizeRoutePath: _chunkYUCU6XB4cjs.normalizeProgrammaticRoutePath
1532
1589
  })
1533
1590
  );
1534
1591
  }
1535
1592
  for (const definition of manifest.routes) {
1536
1593
  if (definition.kind === "page") {
1537
- const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
1594
+ const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
1538
1595
  const pattern = this.createRoutePattern(route);
1539
1596
  const existing = this.routes.get(pattern);
1540
- if (_optionalChain([existing, 'optionalAccess', _47 => _47.sourceRoot]) === source.root) {
1597
+ if (_optionalChain([existing, 'optionalAccess', _53 => _53.sourceRoot]) === source.root) {
1541
1598
  throw new Error(
1542
1599
  `Duplicate page route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
1543
1600
  );
1544
1601
  }
1545
- const modulePath = _chunkE7QOEV5Zcjs.createProgrammaticRouteModuleId.call(void 0, filePath, "page", definition.path);
1602
+ const modulePath = _chunkYUCU6XB4cjs.createProgrammaticRouteModuleId.call(void 0, filePath, "page", definition.path);
1546
1603
  this.programmaticPages.set(modulePath, definition);
1547
1604
  this.registerPageRoute({
1548
1605
  route,
@@ -1554,15 +1611,15 @@ var RouteManager = class _RouteManager {
1554
1611
  });
1555
1612
  }
1556
1613
  if (definition.kind === "layout") {
1557
- const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
1558
- const pattern = _chunkO2A6HE76cjs.createRouteDirectoryPattern.call(void 0, route);
1614
+ const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
1615
+ const pattern = _chunkXGDI4OUBcjs.createRouteDirectoryPattern.call(void 0, route);
1559
1616
  const existing = this.layouts.get(pattern);
1560
- if (_optionalChain([existing, 'optionalAccess', _48 => _48.sourceRoot]) === source.root) {
1617
+ if (_optionalChain([existing, 'optionalAccess', _54 => _54.sourceRoot]) === source.root) {
1561
1618
  throw new Error(
1562
1619
  `Duplicate layout route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
1563
1620
  );
1564
1621
  }
1565
- const modulePath = _chunkE7QOEV5Zcjs.createProgrammaticRouteModuleId.call(void 0, filePath, "layout", definition.path);
1622
+ const modulePath = _chunkYUCU6XB4cjs.createProgrammaticRouteModuleId.call(void 0, filePath, "layout", definition.path);
1566
1623
  this.programmaticLayouts.set(modulePath, definition);
1567
1624
  this.layouts.set(pattern, {
1568
1625
  route,
@@ -1573,7 +1630,7 @@ var RouteManager = class _RouteManager {
1573
1630
  });
1574
1631
  }
1575
1632
  if (definition.kind === "redirect") {
1576
- const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.source, "page");
1633
+ const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.source, "page");
1577
1634
  const pattern = this.createRoutePattern(route);
1578
1635
  this.redirects.set(pattern, {
1579
1636
  route,
@@ -1586,8 +1643,8 @@ var RouteManager = class _RouteManager {
1586
1643
  }
1587
1644
  async loadProgrammaticRoutesModule(filePath) {
1588
1645
  if (this.viteServer) {
1589
- const viteRoot = _optionalChain([this, 'access', _49 => _49.viteServer, 'access', _50 => _50.config, 'optionalAccess', _51 => _51.root]) || this.config.root || process.cwd();
1590
- return await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, filePath, viteRoot));
1646
+ const viteRoot = _optionalChain([this, 'access', _55 => _55.viteServer, 'access', _56 => _56.config, 'optionalAccess', _57 => _57.root]) || this.config.root || process.cwd();
1647
+ return await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, filePath, viteRoot));
1591
1648
  }
1592
1649
  return await import(
1593
1650
  /* @vite-ignore */
@@ -1601,8 +1658,8 @@ var RouteManager = class _RouteManager {
1601
1658
  findMatchingLayouts(pathnameParts, route) {
1602
1659
  const matchingLayouts = [];
1603
1660
  for (const { entry, groupScope } of this.orderedLayouts) {
1604
- if (!_chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
1605
- if (groupScope !== null && !_chunkO2A6HE76cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1661
+ if (!_chunkGC5ROI3Acjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
1662
+ if (groupScope !== null && !_chunkXGDI4OUBcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
1606
1663
  continue;
1607
1664
  }
1608
1665
  matchingLayouts.push(entry);
@@ -1611,7 +1668,7 @@ var RouteManager = class _RouteManager {
1611
1668
  }
1612
1669
  matchPageRoute(pathnameParts) {
1613
1670
  for (const routeEntry of this.routes.values()) {
1614
- if (_chunkQMNWKQL4cjs.matchRouteParts.call(void 0, pathnameParts, routeEntry.route.segments).matches) return routeEntry;
1671
+ if (_chunkGC5ROI3Acjs.matchRouteParts.call(void 0, pathnameParts, routeEntry.route.segments).matches) return routeEntry;
1615
1672
  }
1616
1673
  return null;
1617
1674
  }
@@ -1625,14 +1682,14 @@ var RouteManager = class _RouteManager {
1625
1682
  groups.set(key, entries);
1626
1683
  }
1627
1684
  const normalizedFrom = interceptFrom ? this.toRoutePathname(new URL(interceptFrom, "http://farm.local").pathname) : void 0;
1628
- const normalizedFromParts = normalizedFrom ? _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedFrom) : void 0;
1685
+ const normalizedFromParts = normalizedFrom ? _chunkGC5ROI3Acjs.splitRoutePath.call(void 0, normalizedFrom) : void 0;
1629
1686
  const matches = [];
1630
1687
  for (const entries of groups.values()) {
1631
1688
  const candidates = entries.filter((entry) => !entry.fallback).filter(
1632
1689
  (entry) => !entry.interception || normalizedFrom !== void 0 && this.matchesRoutePrefix(normalizedFrom, entry.ownerPattern, normalizedFromParts)
1633
1690
  ).map((entry) => ({
1634
1691
  entry,
1635
- match: _chunkQMNWKQL4cjs.matchRouteParts.call(void 0, pathnameParts, entry.route.segments)
1692
+ match: _chunkGC5ROI3Acjs.matchRouteParts.call(void 0, pathnameParts, entry.route.segments)
1636
1693
  })).filter((candidate) => candidate.match.matches).sort((left, right) => {
1637
1694
  if (left.entry.interception !== right.entry.interception) {
1638
1695
  return left.entry.interception ? -1 : 1;
@@ -1672,25 +1729,25 @@ var RouteManager = class _RouteManager {
1672
1729
  return ownerDifference || left.name.localeCompare(right.name);
1673
1730
  });
1674
1731
  }
1675
- matchesRoutePrefix(pathname, pattern, pathnameParts = _chunkQMNWKQL4cjs.splitRoutePath.call(void 0, pathname)) {
1732
+ matchesRoutePrefix(pathname, pattern, pathnameParts = _chunkGC5ROI3Acjs.splitRoutePath.call(void 0, pathname)) {
1676
1733
  if (pattern === "/") return true;
1677
- const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => ( _chunkQMNWKQL4cjs.parseRoutePath.call(void 0, `${pattern}/page.tsx`).segments));
1678
- return _chunkQMNWKQL4cjs.matchRoutePrefixParts.call(void 0, pathnameParts, patternSegments);
1734
+ const patternSegments = _nullishCoalesce(this.routeSlotOwnerSegments.get(pattern), () => ( _chunkGC5ROI3Acjs.parseRoutePath.call(void 0, `${pattern}/page.tsx`).segments));
1735
+ return _chunkGC5ROI3Acjs.matchRoutePrefixParts.call(void 0, pathnameParts, patternSegments);
1679
1736
  }
1680
1737
  findNearestBoundary(pathname, boundaries, route) {
1681
1738
  const normalizedPath = pathname === "/" ? "/" : pathname.replace(/\/$/, "");
1682
1739
  let bestMatch = null;
1683
1740
  let page = route;
1684
1741
  for (const boundaryEntry of boundaries.values()) {
1685
- if (!_chunkQMNWKQL4cjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
1686
- const groupScope = _chunkO2A6HE76cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1742
+ if (!_chunkGC5ROI3Acjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
1743
+ const groupScope = _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
1687
1744
  if (groupScope !== null) {
1688
- if (page === void 0) page = this.matchPageRoute(_chunkQMNWKQL4cjs.splitRoutePath.call(void 0, normalizedPath));
1689
- if (!_chunkO2A6HE76cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1745
+ if (page === void 0) page = this.matchPageRoute(_chunkGC5ROI3Acjs.splitRoutePath.call(void 0, normalizedPath));
1746
+ if (!_chunkXGDI4OUBcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
1690
1747
  }
1691
1748
  const depth = boundaryEntry.route.segments.length;
1692
- const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _52 => _52.route, 'access', _53 => _53.segments, 'access', _54 => _54.length]), () => ( -1));
1693
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkO2A6HE76cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1749
+ const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _58 => _58.route, 'access', _59 => _59.segments, 'access', _60 => _60.length]), () => ( -1));
1750
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkXGDI4OUBcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
1694
1751
  bestMatch = boundaryEntry;
1695
1752
  }
1696
1753
  }
@@ -1701,13 +1758,13 @@ var RouteManager = class _RouteManager {
1701
1758
  */
1702
1759
  logRoutes() {
1703
1760
  if (this.routes.size > 0) {
1704
- _chunkQMNWKQL4cjs.logger.info("Registered routes:");
1761
+ _chunkGC5ROI3Acjs.logger.info("Registered routes:");
1705
1762
  for (const [pattern, entry] of this.routes) {
1706
1763
  console.log(` ${pattern} -> ${entry.modulePath}`);
1707
1764
  }
1708
1765
  }
1709
1766
  if (this.layouts.size > 0) {
1710
- _chunkQMNWKQL4cjs.logger.info("Registered layouts:");
1767
+ _chunkGC5ROI3Acjs.logger.info("Registered layouts:");
1711
1768
  for (const [pattern, entry] of this.layouts) {
1712
1769
  console.log(` ${pattern} -> ${entry.modulePath}`);
1713
1770
  }
@@ -1740,7 +1797,7 @@ var RouteManager = class _RouteManager {
1740
1797
  }));
1741
1798
  const i18n = this.getI18nConfig();
1742
1799
  const docsAdapterRoutes = this.getDocsAdapterRoutes();
1743
- const result = await _chunkACAEFEOHcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1800
+ const result = await _chunk7564NP5Zcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
1744
1801
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
1745
1802
  ...docsAdapterRoutes ? { docsAdapterRoutes } : {}
1746
1803
  });
@@ -1757,25 +1814,25 @@ var RouteManager = class _RouteManager {
1757
1814
  ssg: result.ssg.flatMap(
1758
1815
  (page) => i18n.locales.map((locale) => ({
1759
1816
  ...page,
1760
- urlPath: _chunkOWQV6MLMcjs.localizeFarmPathname.call(void 0, page.urlPath, locale, i18n)
1817
+ urlPath: _chunkGYJT2U7Jcjs.localizeFarmPathname.call(void 0, page.urlPath, locale, i18n)
1761
1818
  }))
1762
1819
  ),
1763
1820
  ssr: result.ssr.flatMap(
1764
- (routePath) => i18n.locales.map((locale) => _chunkOWQV6MLMcjs.localizeFarmPathname.call(void 0, routePath, locale, i18n))
1821
+ (routePath) => i18n.locales.map((locale) => _chunkGYJT2U7Jcjs.localizeFarmPathname.call(void 0, routePath, locale, i18n))
1765
1822
  )
1766
1823
  };
1767
1824
  }
1768
1825
  /** A request pathname as routes see it: without the basePath and, with i18n, the locale. */
1769
1826
  toRoutePathname(pathname) {
1770
1827
  const i18n = this.getI18nConfig();
1771
- return i18n ? _chunkOWQV6MLMcjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, this.config.basePath);
1828
+ return i18n ? _chunkGYJT2U7Jcjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, this.config.basePath);
1772
1829
  }
1773
1830
  localizeRedirectDestination(destination, locale) {
1774
1831
  if (!destination.startsWith("/") || destination.startsWith("//")) {
1775
1832
  return destination;
1776
1833
  }
1777
1834
  const i18n = this.getI18nConfig();
1778
- return locale && i18n ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, destination, locale, i18n) : this.config.basePath ? _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, destination, this.config.basePath) : destination;
1835
+ return locale && i18n ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, destination, locale, i18n) : this.config.basePath ? _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, destination, this.config.basePath) : destination;
1779
1836
  }
1780
1837
  getI18nConfig() {
1781
1838
  const i18n = this.config.i18n;
@@ -1787,7 +1844,7 @@ var RouteManager = class _RouteManager {
1787
1844
  async isRouteSSG(modulePath) {
1788
1845
  try {
1789
1846
  const mod = await this.loadRouteModule(modulePath);
1790
- const rendering = await _chunkACAEFEOHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1847
+ const rendering = await _chunk7564NP5Zcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1791
1848
  return rendering.ssg;
1792
1849
  } catch (e2) {
1793
1850
  return false;
@@ -1799,7 +1856,7 @@ var RouteManager = class _RouteManager {
1799
1856
  async hasRouteISR(modulePath) {
1800
1857
  try {
1801
1858
  const mod = await this.loadRouteModule(modulePath);
1802
- const rendering = await _chunkACAEFEOHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1859
+ const rendering = await _chunk7564NP5Zcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1803
1860
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
1804
1861
  } catch (e3) {
1805
1862
  return false;
@@ -1811,7 +1868,7 @@ var RouteManager = class _RouteManager {
1811
1868
  async getRouteRevalidateInterval(modulePath) {
1812
1869
  try {
1813
1870
  const mod = await this.loadRouteModule(modulePath);
1814
- const rendering = await _chunkACAEFEOHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1871
+ const rendering = await _chunk7564NP5Zcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
1815
1872
  return rendering.revalidate;
1816
1873
  } catch (e4) {
1817
1874
  return void 0;
@@ -1819,14 +1876,14 @@ var RouteManager = class _RouteManager {
1819
1876
  }
1820
1877
  };
1821
1878
  function getPageDirectoryField(route, pattern) {
1822
- const directory = _chunkO2A6HE76cjs.createRouteDirectoryPattern.call(void 0, route);
1879
+ const directory = _chunkXGDI4OUBcjs.createRouteDirectoryPattern.call(void 0, route);
1823
1880
  return directory === pattern ? {} : { directory };
1824
1881
  }
1825
1882
  function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
1826
1883
  let result = destination;
1827
1884
  for (const [key, rawValue] of Object.entries(params)) {
1828
1885
  const segments = catchAllSegments[key];
1829
- const value = segments ? segments.map(_chunkPWKAX5MScjs.encodeConfigRouteSegment).join("/") : _chunkPWKAX5MScjs.encodeConfigRouteSegment.call(void 0, rawValue);
1886
+ const value = segments ? segments.map(_chunkFDZZ6K3Ncjs.encodeConfigRouteSegment).join("/") : _chunkFDZZ6K3Ncjs.encodeConfigRouteSegment.call(void 0, rawValue);
1830
1887
  result = replaceAll(result, `[[...${key}]]`, value);
1831
1888
  result = replaceAll(result, `[...${key}]`, value);
1832
1889
  result = replaceAll(result, `[${key}]`, value);
@@ -1898,14 +1955,14 @@ function replaceAll(input, search, replacement) {
1898
1955
  }
1899
1956
  async function safeGlobFiles(pattern, cwd) {
1900
1957
  try {
1901
- return await _chunkQMNWKQL4cjs.globFiles.call(void 0, pattern, cwd);
1958
+ return await _chunkGC5ROI3Acjs.globFiles.call(void 0, pattern, cwd);
1902
1959
  } catch (e5) {
1903
1960
  return [];
1904
1961
  }
1905
1962
  }
1906
1963
  function toRealPath(filePath) {
1907
1964
  try {
1908
- return _fs.realpathSync.call(void 0, filePath);
1965
+ return fs2.default.realpathSync(filePath);
1909
1966
  } catch (e6) {
1910
1967
  return filePath;
1911
1968
  }
@@ -1943,11 +2000,11 @@ function createFarmDevClientManifest(manifest, options) {
1943
2000
  }
1944
2001
  for (const layout of manifest.layouts) {
1945
2002
  if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
1946
- const groupScope = _chunkO2A6HE76cjs.getRouteGroupScope.call(void 0, layout.pattern);
2003
+ const groupScope = _chunkXGDI4OUBcjs.getRouteGroupScope.call(void 0, layout.pattern);
1947
2004
  clientManifest.layouts[layout.pattern] = {
1948
2005
  modulePath: layout.modulePath,
1949
2006
  pattern: layout.pattern,
1950
- ...groupScope ? { urlPattern: _chunkO2A6HE76cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
2007
+ ...groupScope ? { urlPattern: _chunkXGDI4OUBcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
1951
2008
  shouldHydrate: layout.shouldHydrate,
1952
2009
  islandStrategy: layout.islandStrategy,
1953
2010
  // Islands mode: rebuilt from its server tree, so its module is never preloaded.
@@ -1963,32 +2020,6 @@ function createFarmDevClientManifest(manifest, options) {
1963
2020
  return clientManifest;
1964
2021
  }
1965
2022
 
1966
- // src/server/dev-styles.ts
1967
-
1968
-
1969
- function resolveDevGlobalStylesheetHref(root, srcDir = "src") {
1970
- const file = path3.join(root, srcDir, "app", "globals.css");
1971
- if (!fs.existsSync(file)) return void 0;
1972
- return `/${path3.relative(root, file).split(path3.sep).join("/")}`;
1973
- }
1974
- var STYLE_EXTENSIONS = /\.(css|scss|sass|less|styl|stylus)(?:$|\?)/;
1975
- var ALREADY_LINKED = "/src/app/globals.css";
1976
- function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED, options = {}) {
1977
- const seen = /* @__PURE__ */ new Set();
1978
- for (const mod of modules) {
1979
- const id = _nullishCoalesce(_nullishCoalesce(mod.id, () => ( mod.file)), () => ( ""));
1980
- if (!STYLE_EXTENSIONS.test(id)) continue;
1981
- const cssModule = id.includes(".module.");
1982
- if (cssModule && !options.cssModules) continue;
1983
- const url = mod.url;
1984
- if (!url || !url.startsWith("/")) continue;
1985
- const bare = url.split("?")[0];
1986
- if (bare === alreadyLinked) continue;
1987
- seen.add(cssModule ? `${bare}?direct` : bare);
1988
- }
1989
- return [...seen].sort();
1990
- }
1991
-
1992
2023
  // src/font-vite.ts
1993
2024
 
1994
2025
 
@@ -1997,6 +2028,7 @@ function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED, optio
1997
2028
  var _module = require('module');
1998
2029
  var _url = require('url');
1999
2030
  var FONT_IMPORTS = /* @__PURE__ */ new Set(["@farm.js/core", "@farm.js/core/font"]);
2031
+ var FARM_CORE_DIRECTORY = `${path4.default.dirname(typeof __filename === "string" ? __filename : _url.fileURLToPath.call(void 0, _chunkBTZ5O6VMcjs.define_import_meta_default.url)).replace(/\\/g, "/")}/`;
2000
2032
  var FONT_FUNCTIONS = /* @__PURE__ */ new Set(["localFont", "remoteFont"]);
2001
2033
  var FONT_CSS_PREFIX = "\0farm:font-css:";
2002
2034
  var FONT_RUNTIME_ID = "\0farm:font-runtime";
@@ -2050,7 +2082,7 @@ function farmFontImportsPlugin(options = {}) {
2050
2082
  return;
2051
2083
  }
2052
2084
  const resource = registry.getDevResource(pathname);
2053
- if (!_optionalChain([resource, 'optionalAccess', _55 => _55.bytes])) {
2085
+ if (!_optionalChain([resource, 'optionalAccess', _61 => _61.bytes])) {
2054
2086
  next();
2055
2087
  return;
2056
2088
  }
@@ -2099,7 +2131,7 @@ function farmFontImportsPlugin(options = {}) {
2099
2131
  }
2100
2132
  async function transformFarmFontCalls(options) {
2101
2133
  const cleanId = options.id.split("?", 1)[0];
2102
- if (!MODULE_EXTENSION_RE.test(cleanId) || /\.d\.[cm]?ts$/.test(cleanId) || !containsFontFunction(options.code)) {
2134
+ if (!MODULE_EXTENSION_RE.test(cleanId) || /\.d\.[cm]?ts$/.test(cleanId) || !containsFontFunction(options.code) || cleanId.replace(/\\/g, "/").startsWith(FARM_CORE_DIRECTORY)) {
2103
2135
  return null;
2104
2136
  }
2105
2137
  const ast = options.parse(options.code);
@@ -2351,7 +2383,7 @@ ${FONT_SECTION_END}
2351
2383
  return resource;
2352
2384
  }
2353
2385
  const bytes2 = await fetchRemoteFont(url, input.integrity);
2354
- return this.createSelfHostedResource(bytes2, extension, path3.default.basename(url.pathname));
2386
+ return this.createSelfHostedResource(bytes2, extension, path4.default.basename(url.pathname));
2355
2387
  }
2356
2388
  if (input.source.startsWith("/")) {
2357
2389
  return this.createPublicResource(input.moduleId, input.source);
@@ -2374,8 +2406,8 @@ ${FONT_SECTION_END}
2374
2406
  }
2375
2407
  return this.createSelfHostedResource(
2376
2408
  bytes,
2377
- path3.default.extname(resolvedPath),
2378
- path3.default.basename(resolvedPath)
2409
+ path4.default.extname(resolvedPath),
2410
+ path4.default.basename(resolvedPath)
2379
2411
  );
2380
2412
  }
2381
2413
  async createPublicResource(moduleId, source) {
@@ -2386,7 +2418,7 @@ ${FONT_SECTION_END}
2386
2418
  );
2387
2419
  }
2388
2420
  const publicPath = normalizePublicFontPath(source, moduleId);
2389
- const resolvedPath = path3.default.resolve(this.publicDir, `.${publicPath}`);
2421
+ const resolvedPath = path4.default.resolve(this.publicDir, `.${publicPath}`);
2390
2422
  if (!isPathInside(this.publicDir, resolvedPath)) {
2391
2423
  throw fontError(moduleId, `public font path must stay inside publicDir`);
2392
2424
  }
@@ -2402,7 +2434,7 @@ ${FONT_SECTION_END}
2402
2434
  `could not read ${JSON.stringify(source)} from publicDir: ${error.message}`
2403
2435
  );
2404
2436
  }
2405
- const extension = path3.default.extname(resolvedPath).toLowerCase();
2437
+ const extension = path4.default.extname(resolvedPath).toLowerCase();
2406
2438
  const hash = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex").slice(0, 12);
2407
2439
  const resource = {
2408
2440
  extension,
@@ -2417,7 +2449,7 @@ ${FONT_SECTION_END}
2417
2449
  createSelfHostedResource(bytes, extension, fileName) {
2418
2450
  const normalizedExtension = extension.toLowerCase();
2419
2451
  const hash = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex").slice(0, 12);
2420
- const baseName = sanitizeFileName(path3.default.basename(fileName, extension)) || "font";
2452
+ const baseName = sanitizeFileName(path4.default.basename(fileName, extension)) || "font";
2421
2453
  const outputFileName = `assets/fonts/${baseName}-h${hash}${normalizedExtension}`;
2422
2454
  const key = `${hash}${normalizedExtension}`;
2423
2455
  const existing = this.resources.get(key);
@@ -2568,7 +2600,7 @@ function readFontOptions(code, id, call) {
2568
2600
  const declaration = call.ancestors.at(-2);
2569
2601
  const statement = call.ancestors.at(-3);
2570
2602
  const statementParent = call.ancestors.at(-4);
2571
- const isModuleScope = _optionalChain([declaration, 'optionalAccess', _56 => _56.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _57 => _57.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _58 => _58.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _59 => _59.type]) === "Program");
2603
+ const isModuleScope = _optionalChain([declaration, 'optionalAccess', _62 => _62.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _63 => _63.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _64 => _64.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _65 => _65.type]) === "Program");
2572
2604
  if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
2573
2605
  throw fontError(id, `${call.kind}() must be declared directly at module scope`);
2574
2606
  }
@@ -2770,24 +2802,24 @@ function verifyIntegrity(bytes, integrity) {
2770
2802
  if (!matches) throw new Error("downloaded font did not match its integrity value");
2771
2803
  }
2772
2804
  function resolveLocalFontPath(source, importer, root) {
2773
- if (source.startsWith(".")) return path3.default.resolve(path3.default.dirname(importer), source);
2774
- if (path3.default.isAbsolute(source)) {
2805
+ if (source.startsWith(".")) return path4.default.resolve(path4.default.dirname(importer), source);
2806
+ if (path4.default.isAbsolute(source)) {
2775
2807
  return source;
2776
2808
  }
2777
2809
  try {
2778
2810
  return _module.createRequire.call(void 0, _url.pathToFileURL.call(void 0, importer)).resolve(source);
2779
2811
  } catch (e8) {
2780
2812
  const segments = source.replace(/\\/g, "/").split("/");
2781
- if (segments.includes("..")) return path3.default.resolve(root, source);
2782
- let current = path3.default.dirname(importer);
2783
- const filesystemRoot = path3.default.parse(current).root;
2813
+ if (segments.includes("..")) return path4.default.resolve(root, source);
2814
+ let current = path4.default.dirname(importer);
2815
+ const filesystemRoot = path4.default.parse(current).root;
2784
2816
  while (true) {
2785
- const candidate = path3.default.join(current, "node_modules", ...segments);
2817
+ const candidate = path4.default.join(current, "node_modules", ...segments);
2786
2818
  if (_fs.existsSync.call(void 0, candidate)) return candidate;
2787
2819
  if (current === filesystemRoot) break;
2788
- current = path3.default.dirname(current);
2820
+ current = path4.default.dirname(current);
2789
2821
  }
2790
- return path3.default.resolve(root, "node_modules", ...segments);
2822
+ return path4.default.resolve(root, "node_modules", ...segments);
2791
2823
  }
2792
2824
  }
2793
2825
  function replaceFontSection(css, section) {
@@ -2820,11 +2852,11 @@ function getGlobalMap(key) {
2820
2852
  return created;
2821
2853
  }
2822
2854
  function normalizeRoot(root) {
2823
- return path3.default.resolve(root).replace(/\\/g, "/");
2855
+ return path4.default.resolve(root).replace(/\\/g, "/");
2824
2856
  }
2825
2857
  function normalizePublicDir(root, publicDir) {
2826
2858
  if (publicDir === false || publicDir === "") return false;
2827
- return path3.default.resolve(root, publicDir || "public");
2859
+ return path4.default.resolve(root, publicDir || "public");
2828
2860
  }
2829
2861
  function normalizePublicFontPath(source, moduleId) {
2830
2862
  if (source.includes("?") || source.includes("#")) {
@@ -2833,8 +2865,8 @@ function normalizePublicFontPath(source, moduleId) {
2833
2865
  return `/${source.replace(/\\/g, "/").replace(/^\/+/, "")}`;
2834
2866
  }
2835
2867
  function isPathInside(parent, child) {
2836
- const relative3 = path3.default.relative(parent, child);
2837
- return relative3 === "" || !relative3.startsWith("..") && !path3.default.isAbsolute(relative3);
2868
+ const relative3 = path4.default.relative(parent, child);
2869
+ return relative3 === "" || !relative3.startsWith("..") && !path4.default.isAbsolute(relative3);
2838
2870
  }
2839
2871
  function normalizeBasePath(value) {
2840
2872
  if (!value || value === "/") return "/";
@@ -2844,7 +2876,7 @@ function joinBasePath(basePath, value) {
2844
2876
  return basePath === "/" ? value : `${basePath.replace(/\/$/, "")}${value}`;
2845
2877
  }
2846
2878
  function extensionFromPath(pathname) {
2847
- const extension = path3.default.extname(pathname).toLowerCase();
2879
+ const extension = path4.default.extname(pathname).toLowerCase();
2848
2880
  if (!FONT_EXTENSION_RE.test(extension)) {
2849
2881
  throw new Error(`[Farm fonts] Remote font URL must end in .woff2, .woff, .ttf, or .otf`);
2850
2882
  }
@@ -2983,6 +3015,49 @@ function fontError(id, message) {
2983
3015
  return new Error(`[Farm fonts] ${message} in ${id.split("?", 1)[0]}`);
2984
3016
  }
2985
3017
 
3018
+ // src/server/dev-styles.ts
3019
+
3020
+
3021
+ function resolveDevGlobalStylesheetHref(root, srcDir = "src") {
3022
+ const file = path4.join(root, srcDir, "app", "globals.css");
3023
+ if (!fs2.existsSync(file)) return void 0;
3024
+ return `/${path4.relative(root, file).split(path4.sep).join("/")}`;
3025
+ }
3026
+ var STYLE_EXTENSIONS = /\.(css|scss|sass|less|styl|stylus)(?:$|\?)/;
3027
+ var ALREADY_LINKED = "/src/app/globals.css";
3028
+ function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED, options = {}) {
3029
+ const seen = /* @__PURE__ */ new Set();
3030
+ for (const mod of modules) {
3031
+ const id = _nullishCoalesce(_nullishCoalesce(mod.id, () => ( mod.file)), () => ( ""));
3032
+ if (!STYLE_EXTENSIONS.test(id)) continue;
3033
+ const cssModule = id.includes(".module.");
3034
+ if (cssModule && !options.cssModules) continue;
3035
+ const url = mod.url;
3036
+ if (!url || !url.startsWith("/")) continue;
3037
+ const bare = url.split("?")[0];
3038
+ if (bare === alreadyLinked) continue;
3039
+ seen.add(cssModule ? `${bare}?direct` : bare);
3040
+ }
3041
+ return [...seen].sort();
3042
+ }
3043
+ var SERVER_STYLESHEET_FILE = /\.(?:css|less|sass|scss|styl|stylus|pcss|postcss|sss)$/;
3044
+ function farmDevServerStylesheetsPlugin() {
3045
+ return {
3046
+ name: "farm:dev-server-stylesheets",
3047
+ apply: "serve",
3048
+ enforce: "pre",
3049
+ applyToEnvironment: (environment) => environment.config.consumer === "server",
3050
+ load: {
3051
+ filter: { id: SERVER_STYLESHEET_FILE },
3052
+ handler(id) {
3053
+ if (id.startsWith("\0") && !id.startsWith(FONT_CSS_PREFIX)) return null;
3054
+ if (/\.module\.[^./]+$/.test(id)) return null;
3055
+ return "";
3056
+ }
3057
+ }
3058
+ };
3059
+ }
3060
+
2986
3061
  // src/integration-provider-build.ts
2987
3062
 
2988
3063
  function isRendererCompiledComponent(moduleId, rendererComponentExtensions) {
@@ -3004,7 +3079,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
3004
3079
  let hasClerkProvider = false;
3005
3080
  renderedProviders.forEach((provider, index) => {
3006
3081
  let componentExpression = "null";
3007
- if (_chunk65OS2TOTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
3082
+ if (_chunk6DBBMQWTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
3008
3083
  const namespace = `FarmIntegrationProviderModule${index}`;
3009
3084
  imports.push(
3010
3085
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -3061,7 +3136,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
3061
3136
  const entries = [];
3062
3137
  let needsMarkHelper = false;
3063
3138
  providers.forEach((provider, index) => {
3064
- if (!_chunk65OS2TOTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
3139
+ if (!_chunk6DBBMQWTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
3065
3140
  const namespace = `FarmServerIntegrationProviderModule${index}`;
3066
3141
  imports.push(
3067
3142
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -3086,7 +3161,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
3086
3161
  }
3087
3162
  function resolveProviderModule(moduleId, root) {
3088
3163
  if (!moduleId.startsWith(".")) return moduleId;
3089
- return _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, path3.default.resolve(root, moduleId), root);
3164
+ return _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, path4.default.resolve(root, moduleId), root);
3090
3165
  }
3091
3166
 
3092
3167
  // src/island-inference.ts
@@ -3102,34 +3177,34 @@ var PARSE_LANGS = /* @__PURE__ */ new Map([
3102
3177
  [".mjs", "js"]
3103
3178
  ]);
3104
3179
  function parseFarmIslandSource(file, code) {
3105
- const lang = PARSE_LANGS.get(path3.default.extname(file));
3106
- if (!lang) throw new Error(`${path3.default.basename(file)} is not a script module`);
3180
+ const lang = PARSE_LANGS.get(path4.default.extname(file));
3181
+ if (!lang) throw new Error(`${path4.default.basename(file)} is not a script module`);
3107
3182
  return _parseAst.parseAst.call(void 0, code, { lang });
3108
3183
  }
3109
3184
  function modifiedAt(file) {
3110
3185
  try {
3111
- return fs.default.statSync(file).mtimeMs;
3186
+ return fs2.default.statSync(file).mtimeMs;
3112
3187
  } catch (e9) {
3113
3188
  return -1;
3114
3189
  }
3115
3190
  }
3116
3191
  var inferences = /* @__PURE__ */ new Map();
3117
3192
  function inferFarmIslandStrategy(filePath, root) {
3118
- const file = path3.default.resolve(filePath);
3193
+ const file = path4.default.resolve(filePath);
3119
3194
  const cached = inferences.get(file);
3120
3195
  if (cached && cached.stamps.every(([read, stamp]) => modifiedAt(read) === stamp)) {
3121
3196
  return cached.result;
3122
3197
  }
3123
3198
  let code;
3124
3199
  try {
3125
- code = fs.default.readFileSync(file, "utf8");
3200
+ code = fs2.default.readFileSync(file, "utf8");
3126
3201
  } catch (e10) {
3127
- return { strategy: null, files: [file], reason: `${path3.default.basename(file)} could not be read` };
3202
+ return { strategy: null, files: [file], reason: `${path4.default.basename(file)} could not be read` };
3128
3203
  }
3129
3204
  const result = _compiler.inferStrategy.call(void 0, file, code, {
3130
3205
  parse: parseFarmIslandSource,
3131
3206
  resolve: (specifier, importer) => {
3132
- const resolved = _chunkNXGQIXR7cjs.resolveImportedModule.call(void 0, importer, specifier, root);
3207
+ const resolved = _chunkJNZDTE75cjs.resolveImportedModule.call(void 0, importer, specifier, root);
3133
3208
  return resolved.local ? resolved.path : null;
3134
3209
  }
3135
3210
  });
@@ -3144,12 +3219,12 @@ function invalidateFarmRouteRootInferences() {
3144
3219
  routeRootInferences.clear();
3145
3220
  }
3146
3221
  function inferFarmRouteRootStrategy(owners, root) {
3147
- const key = [_nullishCoalesce(root, () => ( "")), ...owners.map((owner) => path3.default.resolve(owner))].join("\n");
3222
+ const key = [_nullishCoalesce(root, () => ( "")), ...owners.map((owner) => path4.default.resolve(owner))].join("\n");
3148
3223
  const cached = routeRootInferences.get(key);
3149
3224
  if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
3150
3225
  return cached.result;
3151
3226
  }
3152
- const { result, files } = _chunkNXGQIXR7cjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
3227
+ const { result, files } = _chunkJNZDTE75cjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
3153
3228
  const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
3154
3229
  routeRootInferences.set(key, {
3155
3230
  stamps: [...read].map((file) => [file, modifiedAt(file)]),
@@ -3158,20 +3233,20 @@ function inferFarmRouteRootStrategy(owners, root) {
3158
3233
  return result;
3159
3234
  }
3160
3235
  var NODE_MODULES = "node_modules";
3161
- var NODE_MODULES_SEGMENT2 = `${path3.default.sep}${NODE_MODULES}${path3.default.sep}`;
3236
+ var NODE_MODULES_SEGMENT2 = `${path4.default.sep}${NODE_MODULES}${path4.default.sep}`;
3162
3237
  function isInstalledPackageFile(file) {
3163
- return file.includes(NODE_MODULES_SEGMENT2) || file.startsWith(`${NODE_MODULES}${path3.default.sep}`) || file.endsWith(`${path3.default.sep}${NODE_MODULES}`) || file === NODE_MODULES;
3238
+ return file.includes(NODE_MODULES_SEGMENT2) || file.startsWith(`${NODE_MODULES}${path4.default.sep}`) || file.endsWith(`${path4.default.sep}${NODE_MODULES}`) || file === NODE_MODULES;
3164
3239
  }
3165
3240
  function inferRouteRoot(owners, root) {
3166
3241
  const files = [];
3167
3242
  const modules = [];
3168
3243
  for (const owner of owners) {
3169
- const rendered = _chunkNXGQIXR7cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
3244
+ const rendered = _chunkJNZDTE75cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
3170
3245
  if (!rendered) {
3171
3246
  return {
3172
3247
  strategy: null,
3173
3248
  files,
3174
- reason: `${path3.default.basename(owner)}: its client components could not be listed`
3249
+ reason: `${path4.default.basename(owner)}: its client components could not be listed`
3175
3250
  };
3176
3251
  }
3177
3252
  modules.push(...rendered);
@@ -3179,10 +3254,10 @@ function inferRouteRoot(owners, root) {
3179
3254
  for (const module of modules) {
3180
3255
  let source = null;
3181
3256
  try {
3182
- source = fs.default.readFileSync(module, "utf8");
3257
+ source = fs2.default.readFileSync(module, "utf8");
3183
3258
  } catch (e11) {
3184
3259
  }
3185
- if (_chunkNXGQIXR7cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
3260
+ if (_chunkJNZDTE75cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
3186
3261
  }
3187
3262
  for (const module of modules) {
3188
3263
  const result = inferFarmIslandStrategy(module, root);
@@ -3194,7 +3269,7 @@ function inferRouteRoot(owners, root) {
3194
3269
  function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
3195
3270
  const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
3196
3271
  const onRoute = layouts.filter(
3197
- (layout) => _chunkO2A6HE76cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
3272
+ (layout) => _chunkXGDI4OUBcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
3198
3273
  );
3199
3274
  const declared = [
3200
3275
  ...page.islandStrategy ? [page.islandStrategy] : [],
@@ -3227,15 +3302,15 @@ var _stream = require('stream');
3227
3302
 
3228
3303
  function resolveFarmNotFoundComponentPath(config, appDirs) {
3229
3304
  const extensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
3230
- const configuredPath = _optionalChain([config, 'access', _60 => _60.notFound, 'optionalAccess', _61 => _61.component, 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
3305
+ const configuredPath = _optionalChain([config, 'access', _66 => _66.notFound, 'optionalAccess', _67 => _67.component, 'optionalAccess', _68 => _68.trim, 'call', _69 => _69()]);
3231
3306
  if (configuredPath) {
3232
- const componentPath = path3.default.isAbsolute(configuredPath) ? path3.default.normalize(configuredPath) : path3.default.resolve(config.root, configuredPath);
3307
+ const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
3233
3308
  if (!extensions.some((extension) => componentPath.endsWith(extension))) {
3234
3309
  throw new Error(
3235
3310
  `notFound.component must use one of the configured renderer extensions: ${extensions.join(", ")}`
3236
3311
  );
3237
3312
  }
3238
- if (!fs.default.existsSync(componentPath) || !fs.default.statSync(componentPath).isFile()) {
3313
+ if (!fs2.default.existsSync(componentPath) || !fs2.default.statSync(componentPath).isFile()) {
3239
3314
  throw new Error(`notFound.component was not found: ${componentPath}`);
3240
3315
  }
3241
3316
  return componentPath;
@@ -3243,8 +3318,8 @@ function resolveFarmNotFoundComponentPath(config, appDirs) {
3243
3318
  let discoveredPath = null;
3244
3319
  for (const appDir of appDirs) {
3245
3320
  for (const extension of extensions) {
3246
- const candidate = path3.default.join(appDir, `not-found${extension}`);
3247
- if (fs.default.existsSync(candidate) && fs.default.statSync(candidate).isFile()) {
3321
+ const candidate = path4.default.join(appDir, `not-found${extension}`);
3322
+ if (fs2.default.existsSync(candidate) && fs2.default.statSync(candidate).isFile()) {
3248
3323
  discoveredPath = candidate;
3249
3324
  break;
3250
3325
  }
@@ -3265,11 +3340,11 @@ function getFarmLayoutKey(pattern, params) {
3265
3340
  );
3266
3341
  }
3267
3342
  function countFarmKeptLayouts(layoutsHeader, layouts, params) {
3268
- const chain = _chunkO2A6HE76cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
3343
+ const chain = _chunkXGDI4OUBcjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
3269
3344
  if (chain.length === 0) return 0;
3270
3345
  const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
3271
- if (chain[0] === keys[0]) return _chunkO2A6HE76cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
3272
- return keys.length > 1 ? 1 + _chunkO2A6HE76cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
3346
+ if (chain[0] === keys[0]) return _chunkXGDI4OUBcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
3347
+ return keys.length > 1 ? 1 + _chunkXGDI4OUBcjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
3273
3348
  }
3274
3349
  function createFarmFlushToken() {
3275
3350
  const bytes = new Uint8Array(16);
@@ -3469,7 +3544,7 @@ function findStackLocation(stack, root) {
3469
3544
  const candidate = normalizeStackPath(match[1]);
3470
3545
  if (!candidate || candidate.includes(`${path8.sep}node_modules${path8.sep}`)) continue;
3471
3546
  const absolutePath = path8.resolve(candidate);
3472
- if (!isPathInsideRoot(root, absolutePath) || !fs4.existsSync(absolutePath)) continue;
3547
+ if (!isPathInsideRoot(root, absolutePath) || !fs5.existsSync(absolutePath)) continue;
3473
3548
  const relativePath = path8.relative(root, absolutePath).split(path8.sep).join("/");
3474
3549
  return {
3475
3550
  absolutePath,
@@ -3482,7 +3557,7 @@ function findStackLocation(stack, root) {
3482
3557
  }
3483
3558
  function createSourceFrame(location) {
3484
3559
  try {
3485
- const sourceLines = fs4.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3560
+ const sourceLines = fs5.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
3486
3561
  if (location.line < 1 || location.line > sourceLines.length) return void 0;
3487
3562
  const start = Math.max(1, location.line - 2);
3488
3563
  const end = Math.min(sourceLines.length, location.line + 2);
@@ -3524,7 +3599,245 @@ function createDefaultErrorDiagnostics(error, root) {
3524
3599
  function canBootFarmIslandsClient(config) {
3525
3600
  const docs = config.docs;
3526
3601
  const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
3527
- return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _64 => _64.experimental, 'optionalAccess', _65 => _65.serverComponents])) === "islands" && !docsEnabled && _chunkENYBDM4Ucjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkENYBDM4Ucjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
3602
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverComponents])) === "islands" && !docsEnabled && _chunkHVJ7IACBcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkHVJ7IACBcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
3603
+ }
3604
+
3605
+ // src/islands-kept-layouts.ts
3606
+
3607
+
3608
+
3609
+ var SCRIPT_SOURCE = /\.[cm]?[jt]sx?$/;
3610
+ var ASSET_SOURCE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf)$/;
3611
+ var PURE_PACKAGE_IMPORTS = /* @__PURE__ */ new Map([
3612
+ ["react", "*"],
3613
+ ["react/jsx-runtime", "*"],
3614
+ ["react/jsx-dev-runtime", "*"],
3615
+ ["@farm.js/core/client", /* @__PURE__ */ new Set(["Link"])]
3616
+ ]);
3617
+ var IMPURE_GLOBALS = /* @__PURE__ */ new Set([
3618
+ "process",
3619
+ "globalThis",
3620
+ "global",
3621
+ "window",
3622
+ "self",
3623
+ "Date",
3624
+ "crypto",
3625
+ "fetch",
3626
+ "require",
3627
+ "eval",
3628
+ "Function",
3629
+ "performance",
3630
+ "setTimeout",
3631
+ "setInterval",
3632
+ "queueMicrotask",
3633
+ "AsyncLocalStorage"
3634
+ ]);
3635
+ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
3636
+ "ImportDeclaration",
3637
+ "FunctionDeclaration",
3638
+ "VariableDeclaration",
3639
+ "ClassDeclaration",
3640
+ "TSTypeAliasDeclaration",
3641
+ "TSInterfaceDeclaration",
3642
+ "TSEnumDeclaration",
3643
+ "TSModuleDeclaration",
3644
+ "TSDeclareFunction",
3645
+ "EmptyStatement"
3646
+ ]);
3647
+ function parse(code, file) {
3648
+ const extension = path4.default.extname(file).slice(1);
3649
+ const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
3650
+ return _chunkJNZDTE75cjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
3651
+ try {
3652
+ return _parseAst.parseAst.call(void 0, code, { lang });
3653
+ } catch (e14) {
3654
+ return null;
3655
+ }
3656
+ });
3657
+ }
3658
+ function findFarmRequestDecidingConstruct(code, file) {
3659
+ const program = parse(code, file);
3660
+ if (!program) return { reason: "the module does not parse", imports: [] };
3661
+ const imports = [];
3662
+ let reason = null;
3663
+ for (const statement of program.body) {
3664
+ if (statement.type === "ImportDeclaration") {
3665
+ if (statement.importKind === "type") continue;
3666
+ const names = [];
3667
+ for (const specifier of _nullishCoalesce(statement.specifiers, () => ( []))) {
3668
+ if (specifier.importKind === "type") continue;
3669
+ if (specifier.type === "ImportSpecifier") {
3670
+ names.push(_nullishCoalesce(specifier.imported.name, () => ( specifier.imported.value)));
3671
+ } else if (specifier.type === "ImportDefaultSpecifier") names.push("default");
3672
+ else names.push("*");
3673
+ }
3674
+ if ((_nullishCoalesce(statement.specifiers, () => ( []))).length === 0 || names.length > 0) {
3675
+ imports.push({ source: statement.source.value, names });
3676
+ }
3677
+ continue;
3678
+ }
3679
+ if (statement.type === "ExportAllDeclaration") {
3680
+ if (statement.exportKind !== "type")
3681
+ imports.push({ source: statement.source.value, names: ["*"] });
3682
+ continue;
3683
+ }
3684
+ if (statement.type === "ExportNamedDeclaration") {
3685
+ if (statement.source && statement.exportKind !== "type") {
3686
+ imports.push({
3687
+ source: statement.source.value,
3688
+ names: (_nullishCoalesce(statement.specifiers, () => ( []))).filter((specifier) => specifier.exportKind !== "type").map((specifier) => _nullishCoalesce(specifier.local.name, () => ( specifier.local.value)))
3689
+ });
3690
+ }
3691
+ continue;
3692
+ }
3693
+ if (statement.type === "ExportDefaultDeclaration") continue;
3694
+ if (statement.type === "ExpressionStatement" && typeof statement.directive === "string") {
3695
+ continue;
3696
+ }
3697
+ if (!DECLARATION_STATEMENTS.has(statement.type)) {
3698
+ _nullishCoalesce(reason, () => ( (reason = `a top-level ${statement.type}`)));
3699
+ }
3700
+ }
3701
+ const visit = (node, parent, key) => {
3702
+ if (reason || !node || typeof node !== "object") return;
3703
+ if (Array.isArray(node)) {
3704
+ for (const child of node) visit(child, parent, key);
3705
+ return;
3706
+ }
3707
+ const current = node;
3708
+ if (typeof current.type !== "string") return;
3709
+ switch (current.type) {
3710
+ case "ThrowStatement":
3711
+ reason = "a throw statement";
3712
+ return;
3713
+ case "AwaitExpression":
3714
+ reason = "an await expression";
3715
+ return;
3716
+ case "YieldExpression":
3717
+ reason = "a generator";
3718
+ return;
3719
+ case "ImportExpression":
3720
+ reason = "a dynamic import()";
3721
+ return;
3722
+ case "ForOfStatement":
3723
+ if (current.await) {
3724
+ reason = "a for await loop";
3725
+ return;
3726
+ }
3727
+ break;
3728
+ case "FunctionDeclaration":
3729
+ case "FunctionExpression":
3730
+ case "ArrowFunctionExpression":
3731
+ if (current.async || current.generator) {
3732
+ reason = current.async ? "an async function" : "a generator";
3733
+ return;
3734
+ }
3735
+ break;
3736
+ case "MetaProperty":
3737
+ reason = "import.meta";
3738
+ return;
3739
+ case "CallExpression":
3740
+ if (_optionalChain([current, 'access', _72 => _72.callee, 'optionalAccess', _73 => _73.type]) === "Identifier" && current.callee.name === "use") {
3741
+ reason = "a use() call";
3742
+ return;
3743
+ }
3744
+ if (_optionalChain([current, 'access', _74 => _74.callee, 'optionalAccess', _75 => _75.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _76 => _76.callee, 'access', _77 => _77.object, 'optionalAccess', _78 => _78.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _79 => _79.callee, 'access', _80 => _80.property, 'optionalAccess', _81 => _81.name]) === "random") {
3745
+ reason = "Math.random()";
3746
+ return;
3747
+ }
3748
+ break;
3749
+ case "Identifier":
3750
+ if (IMPURE_GLOBALS.has(current.name) && isReference(current, parent, key)) {
3751
+ reason = `the global ${current.name}`;
3752
+ return;
3753
+ }
3754
+ break;
3755
+ }
3756
+ for (const [childKey, value] of Object.entries(current)) {
3757
+ if (childKey === "start" || childKey === "end" || childKey === "loc" || childKey === "range") {
3758
+ continue;
3759
+ }
3760
+ if (value && typeof value === "object") visit(value, current, childKey);
3761
+ }
3762
+ };
3763
+ for (const statement of program.body) {
3764
+ if (statement.type === "ImportDeclaration") continue;
3765
+ visit(statement, program, "body");
3766
+ if (reason) break;
3767
+ }
3768
+ return { reason, imports };
3769
+ }
3770
+ function isReference(node, parent, key) {
3771
+ if (!parent) return true;
3772
+ if (parent.type === "MemberExpression" && key === "property" && !parent.computed) return false;
3773
+ if ((parent.type === "Property" || parent.type === "MethodDefinition") && key === "key") {
3774
+ return Boolean(parent.computed);
3775
+ }
3776
+ if (parent.type === "PropertyDefinition" && key === "key") return Boolean(parent.computed);
3777
+ if (parent.type.startsWith("TS")) return false;
3778
+ if (parent.type === "JSXAttribute" || parent.type.startsWith("JSX")) return false;
3779
+ if (parent.type === "LabeledStatement" || parent.type === "BreakStatement") return false;
3780
+ if (parent.type === "ContinueStatement") return false;
3781
+ return true;
3782
+ }
3783
+ function readSource(file) {
3784
+ try {
3785
+ _chunkJNZDTE75cjs.noteFarmSourceRead.call(void 0, file);
3786
+ return fs2.default.readFileSync(file, "utf8");
3787
+ } catch (e15) {
3788
+ return null;
3789
+ }
3790
+ }
3791
+ function explainFarmKeptLayoutRender(modulePath, root) {
3792
+ const entry = _chunkJNZDTE75cjs.resolveModuleSourcePath.call(void 0, modulePath, root);
3793
+ if (!entry) return `${modulePath} does not resolve`;
3794
+ const visited = /* @__PURE__ */ new Set();
3795
+ const check = (file) => {
3796
+ if (visited.has(file)) return null;
3797
+ visited.add(file);
3798
+ if (ASSET_SOURCE.test(file)) return null;
3799
+ if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
3800
+ const code = readSource(file);
3801
+ if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
3802
+ const { reason, imports } = _chunkJNZDTE75cjs.memoizeInFarmSourceSnapshot.call(void 0,
3803
+ "kept-layout-module",
3804
+ code,
3805
+ () => findFarmRequestDecidingConstruct(code, file)
3806
+ );
3807
+ if (reason) return `${path4.default.relative(root, file)} has ${reason}`;
3808
+ for (const imported of imports) {
3809
+ const allowed = PURE_PACKAGE_IMPORTS.get(imported.source);
3810
+ if (allowed) {
3811
+ if (allowed === "*" || imported.names.every((name) => allowed.has(name))) continue;
3812
+ return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
3813
+ }
3814
+ if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
3815
+ const resolved = _chunkJNZDTE75cjs.resolveImportedModule.call(void 0, file, imported.source, root);
3816
+ if (!resolved.path || !resolved.local) {
3817
+ return `${path4.default.relative(root, file)} imports ${imported.source}`;
3818
+ }
3819
+ const nested = check(resolved.path);
3820
+ if (nested) return nested;
3821
+ }
3822
+ return null;
3823
+ };
3824
+ return check(entry);
3825
+ }
3826
+ var answers = /* @__PURE__ */ new Map();
3827
+ function canFarmSkipKeptLayoutRender(modulePath, root) {
3828
+ const key = `${root}\0${modulePath}`;
3829
+ const known = answers.get(key);
3830
+ if (known && known.stamps.every(([file, stamp]) => _chunkJNZDTE75cjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
3831
+ return known.skip;
3832
+ }
3833
+ const { result, files } = _chunkJNZDTE75cjs.traceFarmSourceReads.call(void 0,
3834
+ () => explainFarmKeptLayoutRender(modulePath, root) === null
3835
+ );
3836
+ answers.set(key, {
3837
+ skip: result,
3838
+ stamps: files.map((file) => [file, _chunkJNZDTE75cjs.getFarmSourceStamp.call(void 0, file)])
3839
+ });
3840
+ return result;
3528
3841
  }
3529
3842
 
3530
3843
  // src/server/renderer.ts
@@ -3603,7 +3916,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
3603
3916
  function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
3604
3917
  if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
3605
3918
  warnedSuppressedAsyncHydrationModules.add(modulePath);
3606
- _chunkQMNWKQL4cjs.logger.warn(_chunkNXGQIXR7cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3919
+ _chunkGC5ROI3Acjs.logger.warn(_chunkJNZDTE75cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
3607
3920
  }
3608
3921
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
3609
3922
  var documentLayouts = /* @__PURE__ */ new WeakMap();
@@ -3640,7 +3953,7 @@ function appendResponseHeader(res, name, value) {
3640
3953
  }
3641
3954
  }
3642
3955
  function requestHeader(req, name) {
3643
- const value = _optionalChain([req, 'access', _66 => _66.headers, 'optionalAccess', _67 => _67[name]]);
3956
+ const value = _optionalChain([req, 'access', _82 => _82.headers, 'optionalAccess', _83 => _83[name]]);
3644
3957
  return Array.isArray(value) ? value[0] : value;
3645
3958
  }
3646
3959
  function appendResponseVary(res, value) {
@@ -3654,7 +3967,7 @@ function appendResponseVary(res, value) {
3654
3967
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
3655
3968
  if (snapshot.routing === "none") return "";
3656
3969
  const url = new URL(requestPath, "http://farm.local");
3657
- return _chunkO2A6HE76cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3970
+ return _chunkXGDI4OUBcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
3658
3971
  }
3659
3972
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
3660
3973
  function createPPRRefreshScript() {
@@ -3749,12 +4062,12 @@ async function parseRouteModuleProps(routeModule, input) {
3749
4062
  }
3750
4063
  const schemas = routeModule.__farmRouteSchemas;
3751
4064
  const params = parseRouteModuleSchema(
3752
- _optionalChain([schemas, 'optionalAccess', _68 => _68.params]),
4065
+ _optionalChain([schemas, 'optionalAccess', _84 => _84.params]),
3753
4066
  input.props.params,
3754
4067
  "params",
3755
4068
  input.routePath
3756
4069
  );
3757
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _69 => _69.search]), input.search, "search", input.routePath);
4070
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _85 => _85.search]), input.search, "search", input.routePath);
3758
4071
  return {
3759
4072
  ...input.props,
3760
4073
  params,
@@ -3786,16 +4099,17 @@ function createRouteStateProps(input) {
3786
4099
  function readAppPackageIdentity(root) {
3787
4100
  try {
3788
4101
  return JSON.parse(
3789
- fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
4102
+ fs7.readFileSync(path10.join(root || process.cwd(), "package.json"), "utf8")
3790
4103
  );
3791
- } catch (e14) {
4104
+ } catch (e16) {
3792
4105
  return {};
3793
4106
  }
3794
4107
  }
4108
+ var pageRequests = /* @__PURE__ */ new WeakMap();
3795
4109
  var ServerRenderer = class {
3796
4110
  constructor(config, routeManager, i18nRuntime, viteServer) {
3797
4111
  this.ssgManifest = [];
3798
- this.dataCache = _chunk3OMLZLDEcjs.getFarmDataCache.call(void 0, );
4112
+ this.dataCache = _chunkBNCKXPCUcjs.getFarmDataCache.call(void 0, );
3799
4113
  this.config = config;
3800
4114
  this.routeManager = routeManager;
3801
4115
  this.i18nRuntime = i18nRuntime;
@@ -3806,16 +4120,16 @@ var ServerRenderer = class {
3806
4120
  async initialize() {
3807
4121
  if (this.rendererRuntime) return;
3808
4122
  if (this.islandValues()) {
3809
- _chunkXGJVRPYLcjs.installFarmIslandValues.call(void 0, );
4123
+ _chunk52LTENREcjs.installFarmIslandValues.call(void 0, );
3810
4124
  (await import("./internal/islands-server.cjs")).installFarmIslandsServer();
3811
4125
  await _asyncNullishCoalesce(islands, async () => ( (islands = await import("./internal/islands-runtime.cjs"))));
3812
4126
  } else {
3813
- _chunkXGJVRPYLcjs.uninstallFarmIslandValues.call(void 0, );
4127
+ _chunk52LTENREcjs.uninstallFarmIslandValues.call(void 0, );
3814
4128
  }
3815
- if (_optionalChain([this, 'access', _70 => _70.config, 'access', _71 => _71.notFound, 'optionalAccess', _72 => _72.component, 'optionalAccess', _73 => _73.trim, 'call', _74 => _74()])) {
4129
+ if (_optionalChain([this, 'access', _86 => _86.config, 'access', _87 => _87.notFound, 'optionalAccess', _88 => _88.component, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()])) {
3816
4130
  resolveFarmNotFoundComponentPath(this.config, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config));
3817
4131
  }
3818
- 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,
4132
+ const loaded = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
3819
4133
  _chunk67MZTLTFcjs.resolveFarmRendererModule.call(void 0,
3820
4134
  this.config.root || process.cwd(),
3821
4135
  this.config.renderer.server
@@ -3837,7 +4151,7 @@ var ServerRenderer = class {
3837
4151
  "node"
3838
4152
  );
3839
4153
  this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
3840
- _optionalChain([this, 'access', _75 => _75.routeManager, 'access', _76 => _76.setRendererRuntime, 'optionalCall', _77 => _77(this.rendererRuntime)]);
4154
+ _optionalChain([this, 'access', _91 => _91.routeManager, 'access', _92 => _92.setRendererRuntime, 'optionalCall', _93 => _93(this.rendererRuntime)]);
3841
4155
  await this.applyRendererAppSetup();
3842
4156
  }
3843
4157
  /**
@@ -3857,13 +4171,13 @@ var ServerRenderer = class {
3857
4171
  `Renderer \`${this.config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`
3858
4172
  );
3859
4173
  }
3860
- const setupModule = this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
4174
+ const setupModule = this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
3861
4175
  if (setupModule === this.appliedAppSetupModule) return;
3862
4176
  this.appliedAppSetupModule = setupModule;
3863
4177
  configureApp(setupModule.default);
3864
4178
  }
3865
4179
  createPageBoundary(pageElement, options) {
3866
- return this.rendererRuntime.createElement(
4180
+ const boundary = this.rendererRuntime.createElement(
3867
4181
  "div",
3868
4182
  {
3869
4183
  id: "__farm_page__",
@@ -3875,6 +4189,7 @@ var ServerRenderer = class {
3875
4189
  },
3876
4190
  pageElement
3877
4191
  );
4192
+ return options.pageShouldHydrate && !options.layoutShouldHydrate && this.reactRenderer ? this.reactRenderer.markPagePosition(boundary) : boundary;
3878
4193
  }
3879
4194
  /// The app's `<srcDir>/app/globals.css`, linked only when it exists, as the
3880
4195
  /// production build imports it only when it exists. An app without one gets
@@ -3894,7 +4209,7 @@ var ServerRenderer = class {
3894
4209
  /// Stylesheets the app imported through JS (fontsource packages, component
3895
4210
  /// CSS) that the document must link alongside globals.css — see #658.
3896
4211
  collectDevStyleHrefs() {
3897
- const graph = _optionalChain([this, 'access', _78 => _78.viteServer, 'optionalAccess', _79 => _79.moduleGraph]);
4212
+ const graph = _optionalChain([this, 'access', _94 => _94.viteServer, 'optionalAccess', _95 => _95.moduleGraph]);
3898
4213
  if (!graph) return [];
3899
4214
  return collectDevStylesheetUrls(
3900
4215
  graph.idToModuleMap.values(),
@@ -3945,7 +4260,7 @@ var ServerRenderer = class {
3945
4260
  "data-farm-layout-boundary": "true",
3946
4261
  "data-farm-layout-pattern": pattern,
3947
4262
  ...segment ? { "data-farm-layout-key": segment.key } : {},
3948
- ..._optionalChain([segment, 'optionalAccess', _80 => _80.kept]) ? { "data-farm-layout-kept": "true" } : {},
4263
+ ..._optionalChain([segment, 'optionalAccess', _96 => _96.kept]) ? { "data-farm-layout-kept": "true" } : {},
3949
4264
  style: { display: "contents" }
3950
4265
  },
3951
4266
  layoutElement
@@ -3997,7 +4312,7 @@ var ServerRenderer = class {
3997
4312
  writable.once("error", reject);
3998
4313
  const stream = renderToPipeableStream(element, {
3999
4314
  nonce: _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, ),
4000
- formState: _chunkHBLYSWIJcjs.getFarmFormState.call(void 0, ),
4315
+ formState: _chunkPBJ7MEOVcjs.getFarmFormState.call(void 0, ),
4001
4316
  ...inlineBoundaries ? {
4002
4317
  progressiveChunkSize: Number.MAX_SAFE_INTEGER,
4003
4318
  onAllReady() {
@@ -4041,7 +4356,7 @@ var ServerRenderer = class {
4041
4356
  );
4042
4357
  return { html: rendered.html, head: rendered.head || "" };
4043
4358
  }
4044
- const { head, body } = _chunkO2A6HE76cjs.takeFarmHoistedHead.call(void 0,
4359
+ const { head, body } = _chunkXGDI4OUBcjs.takeFarmHoistedHead.call(void 0,
4045
4360
  await this.renderElementToCompleteHTML(element, options),
4046
4361
  true
4047
4362
  );
@@ -4049,7 +4364,7 @@ var ServerRenderer = class {
4049
4364
  }
4050
4365
  /** Islands mode sends large prop values once, keyed by content (RFC 0003). */
4051
4366
  islandValues() {
4052
- return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _81 => _81.config, 'access', _82 => _82.experimental, 'optionalAccess', _83 => _83.serverComponents])) === "islands";
4367
+ return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.experimental, 'optionalAccess', _99 => _99.serverComponents])) === "islands";
4053
4368
  }
4054
4369
  /**
4055
4370
  * Render the route tree used by client navigation without producing a second
@@ -4060,6 +4375,7 @@ var ServerRenderer = class {
4060
4375
  await this.initialize();
4061
4376
  if (this.viteServer) await this.applyRendererAppSetup();
4062
4377
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
4378
+ this.publishSearchPreserveRoutes();
4063
4379
  _chunkDVJM55D2cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4064
4380
  let element = this.rendererRuntime.createElement(input.PageComponent, input.pageProps);
4065
4381
  if (input.LoadingComponent) {
@@ -4116,6 +4432,9 @@ var ServerRenderer = class {
4116
4432
  });
4117
4433
  element = this.createLayoutBoundary(layout.pattern, element);
4118
4434
  }
4435
+ if (input.pageShouldHydrate && !input.layoutShouldHydrate && this.reactRenderer) {
4436
+ element = this.reactRenderer.markLayoutPosition(element);
4437
+ }
4119
4438
  if (input.layoutShouldHydrate) {
4120
4439
  element = this.wrapClientGraph(element);
4121
4440
  }
@@ -4123,10 +4442,141 @@ var ServerRenderer = class {
4123
4442
  rejectLateRedirects: true
4124
4443
  });
4125
4444
  }
4445
+ /**
4446
+ * A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
4447
+ * client components are islands: the docs runtime's document with the layout chain
4448
+ * rendered around its body, and the client that hydrates it with the boot data an app page has. Production renders the same tree
4449
+ * (wrapFarmDocsResponseWithLayouts in nitro/universal-build.ts, with docs-layout-tree.ts).
4450
+ * Any other docs response is sent as it is.
4451
+ */
4452
+ async wrapDocsResponseWithLayouts(request2, response) {
4453
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _100 => _100.headers, 'access', _101 => _101.get, 'call', _102 => _102("content-type"), 'optionalAccess', _103 => _103.toLowerCase, 'call', _104 => _104(), 'access', _105 => _105.includes, 'call', _106 => _106("text/html")])) {
4454
+ return response;
4455
+ }
4456
+ await this.initialize();
4457
+ if (this.viteServer) await this.applyRendererAppSetup();
4458
+ const pathname = new URL(request2.url).pathname;
4459
+ const root = this.config.root || process.cwd();
4460
+ const matched = this.routeManager.matchRoute(pathname);
4461
+ const routeManifest = this.routeManager.generateClientManifest(this.config.root);
4462
+ const islandsMode = Boolean(islands && this.islandValues());
4463
+ const layouts = matched.layouts.map((layout) => {
4464
+ const entry = routeManifest.layouts.find((candidate) => candidate.pattern === layout.pattern);
4465
+ return {
4466
+ pattern: layout.pattern,
4467
+ modulePath: layout.modulePath,
4468
+ shouldHydrate: _optionalChain([entry, 'optionalAccess', _107 => _107.shouldHydrate]) === true,
4469
+ islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _108 => _108.islandStrategy]), () => ( null)),
4470
+ hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _109 => _109.hasIsolatedClientBoundaries]) === true,
4471
+ serverTree: _optionalChain([entry, 'optionalAccess', _110 => _110.serverTree]) === true,
4472
+ islands: _optionalChain([entry, 'optionalAccess', _111 => _111.hasIsolatedClientBoundaries]) === true
4473
+ };
4474
+ });
4475
+ if (!_chunkXGDI4OUBcjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
4476
+ const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
4477
+ const hasIsolatedClientBoundaries = layouts.some(
4478
+ (layout) => layout.hasIsolatedClientBoundaries
4479
+ );
4480
+ const source = await response.text();
4481
+ const bodyMatch = /<body([^>]*)>([\s\S]*?)<\/body>/i.exec(source);
4482
+ if (!bodyMatch) {
4483
+ return new Response(source, {
4484
+ status: response.status,
4485
+ statusText: response.statusText,
4486
+ headers: response.headers
4487
+ });
4488
+ }
4489
+ const modules = await Promise.all(
4490
+ layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
4491
+ );
4492
+ const treeLayouts = layouts.map((layout, index) => ({
4493
+ ...layout,
4494
+ Component: _optionalChain([modules, 'access', _112 => _112[index], 'optionalAccess', _113 => _113.default])
4495
+ }));
4496
+ const islandStrategy = _chunkXGDI4OUBcjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
4497
+ const tree = await _chunkXGDI4OUBcjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
4498
+ pageHtml: bodyMatch[2],
4499
+ layouts: treeLayouts,
4500
+ params: matched.params,
4501
+ renderServerTreeLayout: islandsMode ? (Layout, props, outlets, pattern) => islands.renderFarmServerTreeLayout(
4502
+ Layout,
4503
+ props,
4504
+ outlets,
4505
+ pattern
4506
+ ) : void 0,
4507
+ layoutKey: islandsMode ? (pattern) => getFarmLayoutKey(pattern, matched.params) : void 0
4508
+ });
4509
+ const rendered = await this.renderElementToDocumentParts(
4510
+ this.rendererRuntime.createElement(
4511
+ "div",
4512
+ { id: "root" },
4513
+ await this.wrapWithIntegrationProviders(
4514
+ shouldHydrateLayout ? this.wrapClientGraph(tree) : tree
4515
+ )
4516
+ )
4517
+ );
4518
+ const rootMarkup = _chunkXGDI4OUBcjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
4519
+ const clientLayouts = layouts.map((layout) => ({
4520
+ pattern: layout.pattern,
4521
+ modulePath: _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, layout.modulePath, root),
4522
+ shouldHydrate: layout.shouldHydrate,
4523
+ islandStrategy: layout.islandStrategy,
4524
+ ...layout.hasIsolatedClientBoundaries ? { hasIsolatedClientBoundaries: true } : {},
4525
+ // Islands mode: the browser rebuilds this layout from its tree, not its module.
4526
+ ...shouldHydrateLayout && layout.serverTree ? { serverTree: true } : {}
4527
+ }));
4528
+ const clientManifest = createFarmDevClientManifest(routeManifest, {
4529
+ sharedAssets: [
4530
+ ...this.devGlobalStylesheetAssets(),
4531
+ ...this.collectDevStyleHrefs().map((href) => ({
4532
+ tag: "link",
4533
+ attrs: { rel: "stylesheet", href }
4534
+ }))
4535
+ ],
4536
+ boot: { layoutPatterns: layouts.map((layout) => layout.pattern) }
4537
+ });
4538
+ const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
4539
+ const bootstrapScript = `<script>
4540
+ window.__FARM_PROPS__ = ${serializeInlineValue({ params: matched.params })};
4541
+ window.__FARM_ROUTE_SLOTS__ = [];
4542
+ window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
4543
+ window.__FARM_PATH__ = ${serializeInlineValue(pathname)};
4544
+ window.__FARM_IS_CLIENT__ = false;
4545
+ window.__FARM_PAGE_SHOULD_HYDRATE__ = false;
4546
+ window.__FARM_LAYOUT_SHOULD_HYDRATE__ = ${JSON.stringify(shouldHydrateLayout)};
4547
+ window.__FARM_LAYOUTS__ = ${serializeInlineValue(clientLayouts)};
4548
+ window.__FARM_SHOULD_HYDRATE__ = ${JSON.stringify(shouldHydrateLayout || hasIsolatedClientBoundaries)};
4549
+ window.__FARM_HAS_ISOLATED_CLIENT_BOUNDARIES__ = ${JSON.stringify(hasIsolatedClientBoundaries)};
4550
+ window.__FARM_ISLAND_STRATEGY__ = ${serializeInlineValue(islandStrategy)};
4551
+ window.__FARM_PAGE_MODULE__ = "";
4552
+ window.__FARM_LOADING_MODULE__ = null;
4553
+ window.__FARM_MANIFEST__ = ${serializeInlineValue(clientManifest)};
4554
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(_chunk6DBBMQWTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
4555
+ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "null"};
4556
+ </script>`;
4557
+ const head = [
4558
+ ...this.collectDevStyleLinks(),
4559
+ `<script type="module" src="/@vite/client"></script>`,
4560
+ source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _114 => _114.rendererRuntime, 'access', _115 => _115.generateHydrationScript, 'optionalCall', _116 => _116()]),
4561
+ bootstrapScript
4562
+ ].filter(Boolean).map((markup) => _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
4563
+ const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
4564
+ ${_chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, `<script type="module" src="/@farm/client.js"></script>`)}`;
4565
+ const html = source.replace(bodyMatch[0], () => `<body${bodyMatch[1]}>${rootMarkup}${clientScript}</body>`).replace(/<\/head>/i, () => ` ${head}
4566
+ </head>`);
4567
+ const headers = new Headers(response.headers);
4568
+ headers.delete("content-length");
4569
+ headers.delete("etag");
4570
+ return new Response(html, {
4571
+ status: response.status,
4572
+ statusText: response.statusText,
4573
+ headers
4574
+ });
4575
+ }
4126
4576
  async runWithRequestContext(request2, fn) {
4127
- return _chunk4M5ESTJ2cjs._runWithCurrentRequest.call(void 0,
4577
+ return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
4128
4578
  request2,
4129
- () => _optionalChain([this, 'access', _84 => _84.i18nRuntime, 'optionalAccess', _85 => _85.config, 'access', _86 => _86.enabled]) ? _chunkNLBK37HIcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
4579
+ () => _optionalChain([this, 'access', _117 => _117.i18nRuntime, 'optionalAccess', _118 => _118.config, 'access', _119 => _119.enabled]) ? _chunkSXXSQVKKcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
4130
4580
  redirect: false
4131
4581
  }) : fn()
4132
4582
  );
@@ -4138,10 +4588,10 @@ var ServerRenderer = class {
4138
4588
  * Load SSG manifest from build output
4139
4589
  */
4140
4590
  loadSSGManifest() {
4141
- const manifestPath = path9.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
4591
+ const manifestPath = path10.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
4142
4592
  let content;
4143
4593
  try {
4144
- content = fs5.readFileSync(manifestPath, "utf-8");
4594
+ content = fs7.readFileSync(manifestPath, "utf-8");
4145
4595
  } catch (error) {
4146
4596
  if (error.code === "ENOENT") {
4147
4597
  return;
@@ -4151,13 +4601,13 @@ var ServerRenderer = class {
4151
4601
  );
4152
4602
  }
4153
4603
  this.ssgManifest = parseSSGManifest(content, manifestPath);
4154
- _chunkQMNWKQL4cjs.logger.info(`Loaded SSG manifest: ${this.ssgManifest.length} pages`);
4604
+ _chunkGC5ROI3Acjs.logger.info(`Loaded SSG manifest: ${this.ssgManifest.length} pages`);
4155
4605
  }
4156
4606
  /**
4157
4607
  * Check if a path should be served from SSG cache
4158
4608
  */
4159
4609
  async shouldServeSSG(pathname) {
4160
- const ssgPage = _chunkACAEFEOHcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
4610
+ const ssgPage = _chunk7564NP5Zcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
4161
4611
  if (!ssgPage) return null;
4162
4612
  const cached = await this.getCachedSSGPage(pathname);
4163
4613
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -4166,10 +4616,10 @@ var ServerRenderer = class {
4166
4616
  return ssgPage;
4167
4617
  }
4168
4618
  getSSGCacheKey(urlPath) {
4169
- return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, ["ssg", _chunk3OMLZLDEcjs.normalizeRevalidatePath.call(void 0, urlPath)]);
4619
+ return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, ["ssg", _chunkBNCKXPCUcjs.normalizeRevalidatePath.call(void 0, urlPath)]);
4170
4620
  }
4171
4621
  getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
4172
- const key = ["ppr", locale, _chunk3OMLZLDEcjs.normalizeRevalidatePath.call(void 0, pathname), search, this.getDeploymentId()];
4622
+ const key = ["ppr", locale, _chunkBNCKXPCUcjs.normalizeRevalidatePath.call(void 0, pathname), search, this.getDeploymentId()];
4173
4623
  return _chunkDXUXQP2Tcjs.createFarmCacheKey.call(void 0, origin ? [...key, origin] : key);
4174
4624
  }
4175
4625
  getCachedSSGPage(urlPath) {
@@ -4194,26 +4644,23 @@ var ServerRenderer = class {
4194
4644
  this.getPPRCacheKey(pathname, search, locale, origin)
4195
4645
  );
4196
4646
  }
4197
- async cachePPRShell(options, html) {
4647
+ getPPRShellWriteOptions(options) {
4648
+ return {
4649
+ // revalidatePath() takes the route path (`/pricing`), as the docs show, while the shell
4650
+ // answers the public one (`/console/fr/pricing`): either clears it, as in production.
4651
+ paths: [.../* @__PURE__ */ new Set([options.pathname, this.routeManager.toRoutePathname(options.pathname)])],
4652
+ tags: ["ppr"],
4653
+ revalidate: _nullishCoalesce(options.revalidate, () => ( false))
4654
+ };
4655
+ }
4656
+ async cachePPRShell(options, html, write, cookieIndependent = false) {
4198
4657
  const key = this.getPPRCacheKey(
4199
4658
  options.pathname,
4200
4659
  options.search,
4201
4660
  options.locale,
4202
4661
  options.origin
4203
4662
  );
4204
- await this.dataCache.pprShellCache.setAsync(
4205
- key,
4206
- { html },
4207
- {
4208
- // revalidatePath() takes the route path (`/pricing`), as the docs show, while the shell
4209
- // answers the public one (`/console/fr/pricing`): either clears it, as in production.
4210
- paths: [
4211
- .../* @__PURE__ */ new Set([options.pathname, this.routeManager.toRoutePathname(options.pathname)])
4212
- ],
4213
- tags: ["ppr"],
4214
- revalidate: _nullishCoalesce(options.revalidate, () => ( false))
4215
- }
4216
- );
4663
+ await (await _asyncNullishCoalesce(write, async () => ( await this.dataCache.pprShellCache.startWriteAsync(this.getPPRShellWriteOptions(options))))).commit(key, { html, ...cookieIndependent ? { cookieIndependent: true } : {} });
4217
4664
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4218
4665
  type: "ppr.shell.cached",
4219
4666
  route: options.pathname,
@@ -4229,9 +4676,6 @@ var ServerRenderer = class {
4229
4676
  if (method !== "GET" && method !== "HEAD") {
4230
4677
  return "method";
4231
4678
  }
4232
- if (_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie)) {
4233
- return "cookie";
4234
- }
4235
4679
  if (req.headers.authorization) {
4236
4680
  return "authorization";
4237
4681
  }
@@ -4262,11 +4706,14 @@ var ServerRenderer = class {
4262
4706
  }
4263
4707
  return headers;
4264
4708
  }
4265
- serveCachedPPRShell(res, shell, revalidate) {
4709
+ serveCachedPPRShell(req, res, shell, revalidate) {
4266
4710
  res.setHeader("Content-Type", "text/html; charset=utf-8");
4267
4711
  for (const [key, value] of Object.entries(this.getPPRHeaders("hit", revalidate))) {
4268
4712
  res.setHeader(key, value);
4269
4713
  }
4714
+ if (_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie)) {
4715
+ res.setHeader("Cache-Control", "private, no-store");
4716
+ }
4270
4717
  res.write(shell.html);
4271
4718
  res.end();
4272
4719
  }
@@ -4278,7 +4725,7 @@ var ServerRenderer = class {
4278
4725
  setImmediate(async () => {
4279
4726
  try {
4280
4727
  const mod = await this.routeManager.loadRouteModule(page.filePath);
4281
- if (!_optionalChain([mod, 'optionalAccess', _87 => _87.default])) return;
4728
+ if (!_optionalChain([mod, 'optionalAccess', _120 => _120.default])) return;
4282
4729
  const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
4283
4730
  const layoutModules = await Promise.all(
4284
4731
  layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
@@ -4292,7 +4739,7 @@ var ServerRenderer = class {
4292
4739
  };
4293
4740
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4294
4741
  const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
4295
- (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _88 => _88.pattern])
4742
+ (entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _121 => _121.pattern])
4296
4743
  ), () => ( {
4297
4744
  shouldHydrate: false,
4298
4745
  islandStrategy: null
@@ -4318,6 +4765,9 @@ var ServerRenderer = class {
4318
4765
  });
4319
4766
  pageElement = this.createLayoutBoundary(layouts[i].pattern, pageElement);
4320
4767
  }
4768
+ if (pageMetadata.shouldHydrate && !layoutShouldHydrate && this.reactRenderer) {
4769
+ pageElement = this.reactRenderer.markLayoutPosition(pageElement);
4770
+ }
4321
4771
  const html = await this.rendererRuntime.renderToString(
4322
4772
  await this.wrapWithIntegrationProviders(pageElement)
4323
4773
  );
@@ -4327,7 +4777,7 @@ var ServerRenderer = class {
4327
4777
  pageProps,
4328
4778
  pathname: page.urlPath
4329
4779
  });
4330
- const { title, tags, hasFavicon } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, mergedMetadata);
4780
+ const { title, tags, hasFavicon } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, mergedMetadata);
4331
4781
  const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`;
4332
4782
  const fullDocument = this.createFullHTML(
4333
4783
  html,
@@ -4337,13 +4787,13 @@ var ServerRenderer = class {
4337
4787
  { metadata: mergedMetadata }
4338
4788
  );
4339
4789
  await this.cacheSSGPage(page, fullDocument, { document: true });
4340
- _chunkQMNWKQL4cjs.logger.info(`ISR: Regenerated ${page.urlPath}`);
4790
+ _chunkGC5ROI3Acjs.logger.info(`ISR: Regenerated ${page.urlPath}`);
4341
4791
  } catch (error) {
4342
- _chunkQMNWKQL4cjs.logger.error(`ISR regeneration failed for ${page.urlPath}: ${error}`);
4792
+ _chunkGC5ROI3Acjs.logger.error(`ISR regeneration failed for ${page.urlPath}: ${error}`);
4343
4793
  }
4344
4794
  });
4345
4795
  } catch (error) {
4346
- _chunkQMNWKQL4cjs.logger.error(`ISR trigger failed: ${error}`);
4796
+ _chunkGC5ROI3Acjs.logger.error(`ISR trigger failed: ${error}`);
4347
4797
  }
4348
4798
  }
4349
4799
  /**
@@ -4364,10 +4814,10 @@ var ServerRenderer = class {
4364
4814
  return true;
4365
4815
  }
4366
4816
  try {
4367
- 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");
4368
- if (fs5.existsSync(htmlPath)) {
4369
- const stat = fs5.statSync(htmlPath);
4370
- const html = fs5.readFileSync(htmlPath, "utf-8");
4817
+ 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");
4818
+ if (fs7.existsSync(htmlPath)) {
4819
+ const stat = fs7.statSync(htmlPath);
4820
+ const html = fs7.readFileSync(htmlPath, "utf-8");
4371
4821
  await this.cacheSSGPage(page, html, {
4372
4822
  document: true,
4373
4823
  createdAt: stat.mtimeMs
@@ -4386,14 +4836,23 @@ var ServerRenderer = class {
4386
4836
  return true;
4387
4837
  }
4388
4838
  } catch (error) {
4389
- _chunkQMNWKQL4cjs.logger.error(`Failed to serve SSG page ${page.urlPath}: ${error}`);
4839
+ _chunkGC5ROI3Acjs.logger.error(`Failed to serve SSG page ${page.urlPath}: ${error}`);
4390
4840
  }
4391
4841
  return false;
4392
4842
  }
4843
+ /**
4844
+ * The pages with `search.preserve`, for the links this render draws (set per render, like the
4845
+ * base path, so a routes-file edit applies to the next one). A route manager without the list,
4846
+ * such as a partial test double, has none.
4847
+ */
4848
+ publishSearchPreserveRoutes() {
4849
+ _chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _122 => _122.routeManager, 'access', _123 => _123.getSearchPreserveRoutes, 'optionalCall', _124 => _124()]), () => ( [])));
4850
+ }
4393
4851
  async renderPage(req, res) {
4394
4852
  await this.initialize();
4395
4853
  if (this.viteServer) await this.applyRendererAppSetup();
4396
4854
  _chunkD22BUQKWcjs.setFarmBasePath.call(void 0, this.config.basePath);
4855
+ this.publishSearchPreserveRoutes();
4397
4856
  _chunkDVJM55D2cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4398
4857
  const cspNonce = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, this.security);
4399
4858
  if (cspNonce) {
@@ -4403,15 +4862,15 @@ var ServerRenderer = class {
4403
4862
  }
4404
4863
  const request2 = this.createPageRequest(req, res);
4405
4864
  const runtime = this.i18nRuntime;
4406
- if (_optionalChain([runtime, 'optionalAccess', _89 => _89.config, 'access', _90 => _90.enabled])) {
4865
+ if (_optionalChain([runtime, 'optionalAccess', _125 => _125.config, 'access', _126 => _126.enabled])) {
4407
4866
  const resolution = runtime.resolveRequest(request2);
4408
- const varyHeaders = _chunkGPICBTDVcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4867
+ const varyHeaders = _chunk7Q2YWZF7cjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
4409
4868
  for (const header of varyHeaders) appendResponseVary(res, header);
4410
4869
  if (resolution.persist) {
4411
4870
  appendResponseHeader(
4412
4871
  res,
4413
4872
  "Set-Cookie",
4414
- _chunkGPICBTDVcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
4873
+ _chunk7Q2YWZF7cjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
4415
4874
  );
4416
4875
  }
4417
4876
  if (resolution.redirect && (request2.method === "GET" || request2.method === "HEAD")) {
@@ -4422,7 +4881,7 @@ var ServerRenderer = class {
4422
4881
  return;
4423
4882
  }
4424
4883
  }
4425
- return _chunk4M5ESTJ2cjs._runWithFarmCspNonce.call(void 0,
4884
+ return _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
4426
4885
  cspNonce,
4427
4886
  () => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
4428
4887
  );
@@ -4433,10 +4892,17 @@ var ServerRenderer = class {
4433
4892
  * it can stop.
4434
4893
  */
4435
4894
  createPageRequest(req, res) {
4895
+ const existing = pageRequests.get(req);
4896
+ if (existing) return existing;
4897
+ const request2 = this.createPageRequestOnce(req, res);
4898
+ pageRequests.set(req, request2);
4899
+ return request2;
4900
+ }
4901
+ createPageRequestOnce(req, res) {
4436
4902
  const observable = typeof req.once === "function" && typeof res.once === "function";
4437
- return _chunk4M5ESTJ2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
4438
- trustProxy: _optionalChain([this, 'access', _91 => _91.config, 'access', _92 => _92.server, 'optionalAccess', _93 => _93.trustProxy]),
4439
- signal: observable ? _chunkCFG4QERRcjs.createFarmNodeRequestAbortSignal.call(void 0,
4903
+ return _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
4904
+ trustProxy: _optionalChain([this, 'access', _127 => _127.config, 'access', _128 => _128.server, 'optionalAccess', _129 => _129.trustProxy]),
4905
+ signal: observable ? _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0,
4440
4906
  req,
4441
4907
  res
4442
4908
  ) : void 0
@@ -4463,8 +4929,9 @@ var ServerRenderer = class {
4463
4929
  durationMs: Date.now() - renderStartTime
4464
4930
  });
4465
4931
  };
4932
+ let pprShellWrite;
4466
4933
  try {
4467
- const url = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.server, 'optionalAccess', _96 => _96.trustProxy]) });
4934
+ const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _130 => _130.config, 'access', _131 => _131.server, 'optionalAccess', _132 => _132.trustProxy]) });
4468
4935
  pathname = url.pathname;
4469
4936
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
4470
4937
  searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -4534,7 +5001,7 @@ var ServerRenderer = class {
4534
5001
  layouts = match.layouts;
4535
5002
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
4536
5003
  if (!route) {
4537
- if (_chunkVKRMO3EZcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5004
+ if (_chunkYRXPDKMMcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
4538
5005
  await this.renderDefaultMCP(req, res);
4539
5006
  completeRender(res.statusCode || 200, pathname);
4540
5007
  return;
@@ -4551,7 +5018,7 @@ var ServerRenderer = class {
4551
5018
  params
4552
5019
  });
4553
5020
  let actionRequest;
4554
- if (req.method === "POST" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.experimental, 'optionalAccess', _99 => _99.serverComponents])) === "islands") {
5021
+ if (req.method === "POST" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.serverComponents])) === "islands") {
4555
5022
  await Promise.all([
4556
5023
  this.routeManager.loadRouteModule(route.modulePath),
4557
5024
  ...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
@@ -4562,9 +5029,9 @@ var ServerRenderer = class {
4562
5029
  toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__),
4563
5030
  () => _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0,
4564
5031
  toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
4565
- () => _chunkHBLYSWIJcjs.handleFarmFormActionRequest.call(void 0,
5032
+ () => _chunkPBJ7MEOVcjs.handleFarmFormActionRequest.call(void 0,
4566
5033
  formActionRequest,
4567
- _chunkLIQJYEQPcjs.resolveServerActionsConfig.call(void 0, this.config.serverActions),
5034
+ _chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, this.config.serverActions),
4568
5035
  // Before a rewrite, the URL the browser posted to.
4569
5036
  new URL(
4570
5037
  _nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/")),
@@ -4627,11 +5094,11 @@ var ServerRenderer = class {
4627
5094
  searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
4628
5095
  error
4629
5096
  };
4630
- if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _100 => _100.notFound])) {
5097
+ if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _136 => _136.notFound])) {
4631
5098
  res.statusCode = 404;
4632
5099
  PageComponent = programmaticRouteComponents.notFound;
4633
5100
  pageProps = routeStateProps;
4634
- } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _101 => _101.error])) {
5101
+ } else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _137 => _137.error])) {
4635
5102
  res.statusCode = 500;
4636
5103
  PageComponent = programmaticRouteComponents.error;
4637
5104
  pageProps = routeStateProps;
@@ -4639,21 +5106,21 @@ var ServerRenderer = class {
4639
5106
  throw error;
4640
5107
  }
4641
5108
  }
4642
- const renderingConfig = await _chunkACAEFEOHcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5109
+ const renderingConfig = await _chunk7564NP5Zcjs.resolveRouteRenderingConfigFromFile.call(void 0,
4643
5110
  routeModule,
4644
5111
  route.modulePath,
4645
- { experimentalPPR: _optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.ppr]) === true }
5112
+ { experimentalPPR: _optionalChain([this, 'access', _138 => _138.config, 'access', _139 => _139.experimental, 'optionalAccess', _140 => _140.ppr]) === true }
4646
5113
  );
4647
5114
  const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
4648
5115
  const islandsNavigationRequest = Boolean(
4649
5116
  islands && this.islandValues() && (requestHeader(req, "f-layouts") || requestHeader(req, "f-stream"))
4650
5117
  );
4651
5118
  const canCachePPRShell = renderingConfig.ppr && !pprBypassReason && !islandsNavigationRequest;
4652
- const pprI18nSnapshot = canCachePPRShell ? _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
4653
- const pprShellOptions = canCachePPRShell ? {
5119
+ const pprI18nSnapshot = canCachePPRShell ? _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
5120
+ let pprShellOptions = canCachePPRShell ? {
4654
5121
  pathname,
4655
5122
  search: url.search,
4656
- locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _105 => _105.locale]), () => ( "")),
5123
+ locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _141 => _141.locale]), () => ( "")),
4657
5124
  origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
4658
5125
  revalidate: renderingConfig.revalidate
4659
5126
  } : void 0;
@@ -4673,6 +5140,7 @@ var ServerRenderer = class {
4673
5140
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "ppr.refresh.start", route: pathname });
4674
5141
  }
4675
5142
  }
5143
+ const pprVisitorCookies = Boolean(_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, req.headers.cookie));
4676
5144
  if (pprShellOptions) {
4677
5145
  const pprCacheKey = this.getPPRCacheKey(
4678
5146
  pathname,
@@ -4686,25 +5154,37 @@ var ServerRenderer = class {
4686
5154
  pprShellOptions.locale,
4687
5155
  pprShellOptions.origin
4688
5156
  );
4689
- if (cachedPPRShell) {
5157
+ if (cachedPPRShell && pprVisitorCookies && !cachedPPRShell.value.cookieIndependent) {
5158
+ pprShellOptions = void 0;
5159
+ _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "ppr.shell.bypass", route: pathname, reason: "cookie" });
5160
+ _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "cache.bypass", route: pathname, reason: "cookie" });
5161
+ } else if (cachedPPRShell) {
4690
5162
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4691
5163
  type: "ppr.shell.hit",
4692
5164
  route: pathname,
4693
5165
  key: pprCacheKey
4694
5166
  });
4695
- this.serveCachedPPRShell(res, cachedPPRShell.value, renderingConfig.revalidate);
5167
+ this.serveCachedPPRShell(req, res, cachedPPRShell.value, renderingConfig.revalidate);
4696
5168
  completeRender(res.statusCode || 200, pathname);
4697
5169
  return;
5170
+ } else {
5171
+ _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5172
+ type: "ppr.shell.miss",
5173
+ route: pathname,
5174
+ key: pprCacheKey
5175
+ });
5176
+ if (req.method !== "HEAD") {
5177
+ pprShellWrite = await this.dataCache.pprShellCache.startWriteAsync(
5178
+ this.getPPRShellWriteOptions(pprShellOptions)
5179
+ );
5180
+ }
4698
5181
  }
4699
- _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
4700
- type: "ppr.shell.miss",
4701
- route: pathname,
4702
- key: pprCacheKey
4703
- });
4704
5182
  }
4705
5183
  const outerRequest = _chunk3BIASUGRcjs._peekCurrentRequest.call(void 0, );
4706
- const countRequestReads = () => (outerRequest ? _chunk4M5ESTJ2cjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunk4M5ESTJ2cjs._getRequestReadCount.call(void 0, currentRequest);
5184
+ const countRequestReads = () => (outerRequest ? _chunk2RSVYJT6cjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunk2RSVYJT6cjs._getRequestReadCount.call(void 0, currentRequest);
4707
5185
  const requestReadsBeforeRender = countRequestReads();
5186
+ const countRequestCookieReads = () => (outerRequest ? _chunk2RSVYJT6cjs._getRequestCookieReadCount.call(void 0, outerRequest) : 0) + _chunk2RSVYJT6cjs._getRequestCookieReadCount.call(void 0, currentRequest);
5187
+ const requestCookieReadsBeforeRender = countRequestCookieReads();
4708
5188
  let LoadingFallbackComponent = null;
4709
5189
  if (loadingBoundaryEntry) {
4710
5190
  const loadingModule = await this.routeManager.loadRouteModule(
@@ -4725,7 +5205,7 @@ var ServerRenderer = class {
4725
5205
  const routeManifestEntry = routeManifest.routes.find(
4726
5206
  (entry) => entry.pattern === route.pattern
4727
5207
  );
4728
- const moduleMetadata = routeManifestEntry || _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
5208
+ const moduleMetadata = routeManifestEntry || _chunkJNZDTE75cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
4729
5209
  const isClientComponent = moduleMetadata.isClientComponent;
4730
5210
  const renderedRouteSlots = await Promise.all(
4731
5211
  routeSlots.map(async (slot) => {
@@ -4776,20 +5256,20 @@ var ServerRenderer = class {
4776
5256
  if (moduleMetadata.suppressedAsyncHydration) {
4777
5257
  warnSuppressedAsyncHydrationOnce(
4778
5258
  route.modulePath,
4779
- _optionalChain([routeManifestEntry, 'optionalAccess', _106 => _106.suppressedAsyncHydrationReason])
5259
+ _optionalChain([routeManifestEntry, 'optionalAccess', _142 => _142.suppressedAsyncHydrationReason])
4780
5260
  );
4781
5261
  }
4782
5262
  const layoutHydrationMetadata = layouts.map((layout) => {
4783
5263
  const manifestEntry = routeManifest.layouts.find(
4784
5264
  (entry) => entry.pattern === layout.pattern
4785
5265
  );
4786
- if (_optionalChain([manifestEntry, 'optionalAccess', _107 => _107.suppressedAsyncHydration])) {
5266
+ if (_optionalChain([manifestEntry, 'optionalAccess', _143 => _143.suppressedAsyncHydration])) {
4787
5267
  warnSuppressedAsyncHydrationOnce(
4788
5268
  layout.modulePath,
4789
5269
  manifestEntry.suppressedAsyncHydrationReason
4790
5270
  );
4791
5271
  }
4792
- if (typeof _optionalChain([manifestEntry, 'optionalAccess', _108 => _108.shouldHydrate]) === "boolean") {
5272
+ if (typeof _optionalChain([manifestEntry, 'optionalAccess', _144 => _144.shouldHydrate]) === "boolean") {
4793
5273
  return {
4794
5274
  isClientComponent: manifestEntry.isClientComponent === true,
4795
5275
  shouldHydrate: manifestEntry.shouldHydrate,
@@ -4809,12 +5289,12 @@ var ServerRenderer = class {
4809
5289
  );
4810
5290
  const clientLayouts = layouts.map((layout, index) => ({
4811
5291
  pattern: layout.pattern,
4812
- modulePath: _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
4813
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _109 => _109[index], 'optionalAccess', _110 => _110.shouldHydrate]) === true,
4814
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _111 => _111[index], 'optionalAccess', _112 => _112.islandStrategy]), () => ( null)),
4815
- ..._optionalChain([layoutHydrationMetadata, 'access', _113 => _113[index], 'optionalAccess', _114 => _114.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
5292
+ modulePath: _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
5293
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _145 => _145[index], 'optionalAccess', _146 => _146.shouldHydrate]) === true,
5294
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _147 => _147[index], 'optionalAccess', _148 => _148.islandStrategy]), () => ( null)),
5295
+ ..._optionalChain([layoutHydrationMetadata, 'access', _149 => _149[index], 'optionalAccess', _150 => _150.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
4816
5296
  // Islands mode: the browser rebuilds this layout from its tree, not its module.
4817
- ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _115 => _115[index], 'optionalAccess', _116 => _116.serverTree]) === true ? { serverTree: true } : {}
5297
+ ...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _151 => _151[index], 'optionalAccess', _152 => _152.serverTree]) === true ? { serverTree: true } : {}
4818
5298
  }));
4819
5299
  const hydrationStrategies = [
4820
5300
  ...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
@@ -4828,9 +5308,9 @@ var ServerRenderer = class {
4828
5308
  layouts.map((layout, index) => ({
4829
5309
  pattern: layout.pattern,
4830
5310
  modulePath: layout.modulePath,
4831
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _117 => _117[index], 'optionalAccess', _118 => _118.shouldHydrate]) === true,
4832
- hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _119 => _119[index], 'optionalAccess', _120 => _120.hasIsolatedClientBoundaries]) === true,
4833
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _121 => _121[index], 'optionalAccess', _122 => _122.islandStrategy]), () => ( null))
5311
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _153 => _153[index], 'optionalAccess', _154 => _154.shouldHydrate]) === true,
5312
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _155 => _155[index], 'optionalAccess', _156 => _156.hasIsolatedClientBoundaries]) === true,
5313
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _157 => _157[index], 'optionalAccess', _158 => _158.islandStrategy]), () => ( null))
4834
5314
  })),
4835
5315
  this.config.root || process.cwd(),
4836
5316
  true
@@ -4838,9 +5318,10 @@ var ServerRenderer = class {
4838
5318
  const hasHydratableRouteSlots = renderedRouteSlots.some(
4839
5319
  (slot) => slot.isClientComponent || slot.shouldHydrate
4840
5320
  );
4841
- const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _123 => _123.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
5321
+ const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _159 => _159.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
4842
5322
  req.__FARM_PAGE_PATH__ = route.modulePath;
4843
5323
  req.__FARM_ROUTE__ = pathname;
5324
+ req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _160 => _160[0], 'optionalAccess', _161 => _161.modulePath]);
4844
5325
  req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
4845
5326
  req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
4846
5327
  req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
@@ -4851,7 +5332,7 @@ var ServerRenderer = class {
4851
5332
  req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
4852
5333
  req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
4853
5334
  req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
4854
- req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _124 => _124.modulePath]) ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
5335
+ req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _162 => _162.modulePath]) ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
4855
5336
  req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
4856
5337
  name: slot.name,
4857
5338
  ownerPattern: slot.ownerPattern,
@@ -4900,7 +5381,7 @@ var ServerRenderer = class {
4900
5381
  const middlewareDataForContext = middlewareMap;
4901
5382
  await _chunkYDXLC4DWcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
4902
5383
  await _chunkYDXLC4DWcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
4903
- await _chunk4M5ESTJ2cjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5384
+ await _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
4904
5385
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
4905
5386
  if (LoadingFallbackComponent && !islandsNavigationRequest) {
4906
5387
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
@@ -4923,7 +5404,7 @@ var ServerRenderer = class {
4923
5404
  } else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
4924
5405
  pageElement = await this.isolateServerPage(
4925
5406
  pageElement,
4926
- _optionalChain([routeManifestEntry, 'optionalAccess', _125 => _125.serverTree]) === true
5407
+ _optionalChain([routeManifestEntry, 'optionalAccess', _163 => _163.serverTree]) === true
4927
5408
  );
4928
5409
  }
4929
5410
  pageElement = this.createPageBoundary(pageElement, {
@@ -4934,10 +5415,11 @@ var ServerRenderer = class {
4934
5415
  const islandsSegments = Boolean(islands && this.islandValues());
4935
5416
  const keptLayoutCount = islandsSegments && !renderingConfig.ssg && !shouldHydrateLayout && renderedRouteSlots.length === 0 ? countFarmKeptLayouts(requestHeader(req, "f-layouts"), layouts, params) : 0;
4936
5417
  let keptLayouts = keptLayoutCount > 1 ? keptLayoutCount : 0;
4937
- if (keptLayouts > 0) {
5418
+ const keptRoot = this.config.root || process.cwd();
5419
+ if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
4938
5420
  let keptElement = null;
4939
5421
  for (let i = keptLayouts - 1; i >= 0; i--) {
4940
- const KeptLayout = _optionalChain([layoutModules, 'access', _126 => _126[i], 'optionalAccess', _127 => _127.default]);
5422
+ const KeptLayout = _optionalChain([layoutModules, 'access', _164 => _164[i], 'optionalAccess', _165 => _165.default]);
4941
5423
  if (KeptLayout) {
4942
5424
  keptElement = this.rendererRuntime.createElement(KeptLayout, {
4943
5425
  children: keptElement,
@@ -4950,7 +5432,7 @@ var ServerRenderer = class {
4950
5432
  await this.wrapWithIntegrationProviders(this.wrapClientGraph(keptElement)),
4951
5433
  { rejectLateErrors: true }
4952
5434
  );
4953
- } catch (e15) {
5435
+ } catch (e17) {
4954
5436
  keptLayouts = 0;
4955
5437
  }
4956
5438
  }
@@ -4986,7 +5468,7 @@ var ServerRenderer = class {
4986
5468
  );
4987
5469
  slotProps[slot.name] = slotElement;
4988
5470
  }
4989
- wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _128 => _128[i], 'optionalAccess', _129 => _129.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
5471
+ wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _166 => _166[i], 'optionalAccess', _167 => _167.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
4990
5472
  LayoutComponent,
4991
5473
  { params },
4992
5474
  { children: wrappedElement, ...slotProps },
@@ -5023,8 +5505,14 @@ var ServerRenderer = class {
5023
5505
  wrappedElement
5024
5506
  );
5025
5507
  }
5508
+ if ((isClientComponent || shouldHydrate) && !shouldHydrateLayout && this.reactRenderer) {
5509
+ wrappedElement = this.reactRenderer.markLayoutPosition(wrappedElement);
5510
+ }
5026
5511
  const integratedElement = await this.wrapWithIntegrationProviders(wrappedElement);
5027
5512
  const pprHeaders = renderingConfig.ppr ? this.getPPRHeaders(pprShellOptions ? "miss" : "bypass", renderingConfig.revalidate) : void 0;
5513
+ if (pprHeaders && pprShellOptions && pprVisitorCookies) {
5514
+ pprHeaders["Cache-Control"] = "private, no-store";
5515
+ }
5028
5516
  await this.renderWithSSR(
5029
5517
  integratedElement,
5030
5518
  req,
@@ -5057,7 +5545,26 @@ var ServerRenderer = class {
5057
5545
  });
5058
5546
  return;
5059
5547
  }
5060
- return this.cachePPRShell(pprShellOptions, html);
5548
+ const renderReadCookies = countRequestCookieReads() !== requestCookieReadsBeforeRender;
5549
+ if (renderReadCookies && pprVisitorCookies) {
5550
+ _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5551
+ type: "ppr.shell.bypass",
5552
+ route: pathname,
5553
+ reason: "cookie"
5554
+ });
5555
+ _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5556
+ type: "cache.bypass",
5557
+ route: pathname,
5558
+ reason: "cookie"
5559
+ });
5560
+ return;
5561
+ }
5562
+ return this.cachePPRShell(
5563
+ pprShellOptions,
5564
+ html,
5565
+ pprShellWrite,
5566
+ !renderReadCookies
5567
+ );
5061
5568
  } : void 0
5062
5569
  }
5063
5570
  );
@@ -5085,8 +5592,8 @@ var ServerRenderer = class {
5085
5592
  }
5086
5593
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
5087
5594
  const redirect = _chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error);
5088
- const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5089
- const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
5595
+ const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
5596
+ const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
5090
5597
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5091
5598
  type: "route.redirect",
5092
5599
  from: pathname,
@@ -5122,7 +5629,7 @@ var ServerRenderer = class {
5122
5629
  }
5123
5630
  }
5124
5631
  emitFarmRenderError(req, pathname, error);
5125
- const errorStatus = _chunkO2A6HE76cjs.resolveDefaultErrorStatus.call(void 0, error);
5632
+ const errorStatus = _chunkXGDI4OUBcjs.resolveDefaultErrorStatus.call(void 0, error);
5126
5633
  if (pprRefreshRoute) {
5127
5634
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5128
5635
  type: "ppr.refresh.error",
@@ -5130,7 +5637,7 @@ var ServerRenderer = class {
5130
5637
  error
5131
5638
  });
5132
5639
  }
5133
- _chunkQMNWKQL4cjs.logger.error(`Error rendering page: ${error}`);
5640
+ _chunkGC5ROI3Acjs.logger.error(`Error rendering page: ${error}`);
5134
5641
  if (res.headersSent || res.writableEnded) {
5135
5642
  if (!res.writableEnded) {
5136
5643
  res.end();
@@ -5148,17 +5655,20 @@ var ServerRenderer = class {
5148
5655
  pluginExposedContext,
5149
5656
  error,
5150
5657
  statusCode: errorStatus,
5151
- errorModulePath: errorBoundaryEntry.modulePath
5658
+ errorModulePath: errorBoundaryEntry.modulePath,
5659
+ errorPattern: errorBoundaryEntry.pattern
5152
5660
  });
5153
5661
  if (rendered) {
5154
5662
  return;
5155
5663
  }
5156
5664
  }
5157
5665
  await this.renderError(req, res, error, errorStatus);
5666
+ } finally {
5667
+ _optionalChain([pprShellWrite, 'optionalAccess', _168 => _168.release, 'call', _169 => _169()]);
5158
5668
  }
5159
5669
  }
5160
5670
  async wrapWithIntegrationProviders(element) {
5161
- const providers = _chunk65OS2TOTcjs.getIntegrationProviders.call(void 0, this.config.integrations);
5671
+ const providers = _chunk6DBBMQWTcjs.getIntegrationProviders.call(void 0, this.config.integrations);
5162
5672
  let wrapped = element;
5163
5673
  for (let i = providers.length - 1; i >= 0; i--) {
5164
5674
  const provider = providers[i];
@@ -5166,7 +5676,7 @@ var ServerRenderer = class {
5166
5676
  const rendererCapabilities = _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
5167
5677
  if (!rendererCapabilities.functionComponents) {
5168
5678
  throw new Error(
5169
- `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _130 => _130.config, 'access', _131 => _131.renderer, 'optionalAccess', _132 => _132.name]), () => ( "the configured renderer"))}\` cannot.`
5679
+ `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _170 => _170.config, 'access', _171 => _171.renderer, 'optionalAccess', _172 => _172.name]), () => ( "the configured renderer"))}\` cannot.`
5170
5680
  );
5171
5681
  }
5172
5682
  if (provider.type === "clerk" && !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer)) {
@@ -5176,14 +5686,14 @@ var ServerRenderer = class {
5176
5686
  }
5177
5687
  let ProviderComponent;
5178
5688
  let providerSourceModule;
5179
- if (_chunk65OS2TOTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
5689
+ if (_chunk6DBBMQWTcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
5180
5690
  providerSourceModule = provider.component.module;
5181
- const providerModuleId = provider.component.module.startsWith(".") ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0,
5182
- path9.resolve(this.config.root, provider.component.module),
5691
+ const providerModuleId = provider.component.module.startsWith(".") ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0,
5692
+ path10.resolve(this.config.root, provider.component.module),
5183
5693
  this.config.root
5184
5694
  ) : provider.component.module;
5185
- const providerModule = this.viteServer ? await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
5186
- provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
5695
+ const providerModule = this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
5696
+ provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path10.resolve(this.config.root, provider.component.module)).href : provider.component.module
5187
5697
  );
5188
5698
  ProviderComponent = providerModule[provider.component.export || "default"];
5189
5699
  } else if (typeof provider.component === "function") {
@@ -5205,7 +5715,7 @@ var ServerRenderer = class {
5205
5715
  }
5206
5716
  if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
5207
5717
  _nullishCoalesce(providerSourceModule, () => ( "")),
5208
- _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _133 => _133.config, 'access', _134 => _134.renderer, 'optionalAccess', _135 => _135.componentExtensions]))
5718
+ _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _173 => _173.config, 'access', _174 => _174.renderer, 'optionalAccess', _175 => _175.componentExtensions]))
5209
5719
  )) {
5210
5720
  ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
5211
5721
  }
@@ -5221,27 +5731,27 @@ var ServerRenderer = class {
5221
5731
  async resolveRouteMetadata(options) {
5222
5732
  let metadata = {};
5223
5733
  for (const layoutModule of options.layoutModules) {
5224
- metadata = _chunk6IOZPJ3Icjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
5734
+ metadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
5225
5735
  if (typeof layoutModule.generateMetadata === "function") {
5226
- metadata = _chunk6IOZPJ3Icjs.mergeMetadata.call(void 0,
5736
+ metadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0,
5227
5737
  metadata,
5228
5738
  await layoutModule.generateMetadata({
5229
5739
  params: options.pageProps.params
5230
5740
  })
5231
5741
  );
5232
5742
  }
5233
- metadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0, metadata, layoutModule, {
5743
+ metadata = await _chunkY3DO7BIJcjs.mergeModuleViewport.call(void 0, metadata, layoutModule, {
5234
5744
  params: options.pageProps.params
5235
5745
  });
5236
5746
  }
5237
- metadata = _chunk6IOZPJ3Icjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
5747
+ metadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
5238
5748
  if (!options.skipGeneratedRouteMetadata && typeof options.routeModule.generateMetadata === "function") {
5239
- metadata = _chunk6IOZPJ3Icjs.mergeMetadata.call(void 0,
5749
+ metadata = _chunkY3DO7BIJcjs.mergeMetadata.call(void 0,
5240
5750
  metadata,
5241
5751
  await options.routeModule.generateMetadata(options.pageProps)
5242
5752
  );
5243
5753
  }
5244
- metadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0,
5754
+ metadata = await _chunkY3DO7BIJcjs.mergeModuleViewport.call(void 0,
5245
5755
  metadata,
5246
5756
  options.skipGeneratedRouteMetadata ? { viewport: options.routeModule.viewport } : options.routeModule,
5247
5757
  options.pageProps
@@ -5256,25 +5766,25 @@ var ServerRenderer = class {
5256
5766
  manifestMatch.metadata,
5257
5767
  manifestMatch.params
5258
5768
  );
5259
- const snapshot2 = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5260
- const localizedHref = snapshot2 ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
5769
+ const snapshot2 = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
5770
+ const localizedHref = snapshot2 ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
5261
5771
  metadata.manifest = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
5262
5772
  }
5263
5773
  }
5264
5774
  for (const kind of ["opengraph", "twitter"]) {
5265
5775
  const reference = await this.resolveMetadataImageReference(kind, options.pathname);
5266
5776
  if (reference) {
5267
- metadata = _chunk6IOZPJ3Icjs.addMetadataImageReference.call(void 0, metadata, reference);
5777
+ metadata = _chunkY3DO7BIJcjs.addMetadataImageReference.call(void 0, metadata, reference);
5268
5778
  }
5269
5779
  }
5270
- const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5780
+ const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
5271
5781
  const publicPathname = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
5272
- snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
5782
+ snapshot ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
5273
5783
  this.config.basePath
5274
5784
  );
5275
- metadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
5785
+ metadata = _chunkY3DO7BIJcjs.addMetadataMarkdownAlternate.call(void 0,
5276
5786
  metadata,
5277
- _chunkPG6ZIHKEcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkPG6ZIHKEcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
5787
+ _chunk2YJ4DHTDcjs.getFarmMarkdownAlternatePath.call(void 0, _chunk2YJ4DHTDcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname, {
5278
5788
  routePathname: (pathname) => this.routeManager.toRoutePathname(pathname)
5279
5789
  })
5280
5790
  );
@@ -5284,8 +5794,8 @@ var ServerRenderer = class {
5284
5794
  const match = this.routeManager.getMatchingMetadataImage(pathname, kind);
5285
5795
  if (!match) return null;
5286
5796
  const rawHref = this.routeManager.resolveMetadataImagePath(match.image, match.params);
5287
- const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
5288
- const localizedHref = snapshot ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
5797
+ const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
5798
+ const localizedHref = snapshot ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
5289
5799
  const href = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
5290
5800
  const reference = {
5291
5801
  kind,
@@ -5314,7 +5824,7 @@ var ServerRenderer = class {
5314
5824
  reference.contentType = imageModule.contentType;
5315
5825
  }
5316
5826
  } catch (error) {
5317
- _chunkQMNWKQL4cjs.logger.warn(`Failed to read ${kind} image metadata for ${pathname}: ${error}`);
5827
+ _chunkGC5ROI3Acjs.logger.warn(`Failed to read ${kind} image metadata for ${pathname}: ${error}`);
5318
5828
  }
5319
5829
  return reference;
5320
5830
  }
@@ -5333,8 +5843,8 @@ var ServerRenderer = class {
5333
5843
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
5334
5844
  );
5335
5845
  }
5336
- const request2 = _chunk4M5ESTJ2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5337
- trustProxy: _optionalChain([this, 'access', _136 => _136.config, 'access', _137 => _137.server, 'optionalAccess', _138 => _138.trustProxy])
5846
+ const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5847
+ trustProxy: _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.server, 'optionalAccess', _178 => _178.trustProxy])
5338
5848
  });
5339
5849
  const url = new URL(request2.url);
5340
5850
  const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
@@ -5348,17 +5858,17 @@ var ServerRenderer = class {
5348
5858
  path: match.routePath,
5349
5859
  ...llmsContext
5350
5860
  }) : routeModule.default;
5351
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkMKQ27TGWcjs.renderFarmLlmsFullTxt.call(void 0, value, {
5861
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkWRWJ7IWTcjs.renderFarmLlmsFullTxt.call(void 0, value, {
5352
5862
  origin: await this.getAgentOrigin(request2),
5353
5863
  readMarkdown: llmsContext.markdown
5354
5864
  }) : value;
5355
- const response = _chunkO2A6HE76cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5865
+ const response = _chunkXGDI4OUBcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
5356
5866
  method,
5357
5867
  request: request2
5358
5868
  });
5359
5869
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
5360
5870
  } catch (error) {
5361
- _chunkQMNWKQL4cjs.logger.error(`Metadata route render failed for ${match.metadata.modulePath}: ${error}`);
5871
+ _chunkGC5ROI3Acjs.logger.error(`Metadata route render failed for ${match.metadata.modulePath}: ${error}`);
5362
5872
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5363
5873
  res,
5364
5874
  new Response("Internal Server Error", {
@@ -5370,25 +5880,25 @@ var ServerRenderer = class {
5370
5880
  }
5371
5881
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
5372
5882
  getGeneratedLlmsKind(pathname) {
5373
- const config = _chunkMKQ27TGWcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _139 => _139.config, 'access', _140 => _140.agent, 'optionalAccess', _141 => _141.llmsTxt]));
5883
+ const config = _chunkWRWJ7IWTcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _179 => _179.config, 'access', _180 => _180.agent, 'optionalAccess', _181 => _181.llmsTxt]));
5374
5884
  if (!config.enabled) return null;
5375
5885
  if (pathname === "/llms.txt") return "llms";
5376
5886
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
5377
5887
  }
5378
5888
  async renderGeneratedLlmsTxt(req, res, kind) {
5379
5889
  try {
5380
- const request2 = _chunk4M5ESTJ2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5381
- trustProxy: _optionalChain([this, 'access', _142 => _142.config, 'access', _143 => _143.server, 'optionalAccess', _144 => _144.trustProxy])
5890
+ const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5891
+ trustProxy: _optionalChain([this, 'access', _182 => _182.config, 'access', _183 => _183.server, 'optionalAccess', _184 => _184.trustProxy])
5382
5892
  });
5383
- const config = _chunkMKQ27TGWcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.agent, 'optionalAccess', _147 => _147.llmsTxt]));
5893
+ const config = _chunkWRWJ7IWTcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _185 => _185.config, 'access', _186 => _186.agent, 'optionalAccess', _187 => _187.llmsTxt]));
5384
5894
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
5385
- const body = kind === "llms-full" ? await _chunkMKQ27TGWcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5895
+ const body = kind === "llms-full" ? await _chunkWRWJ7IWTcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
5386
5896
  origin: await this.getAgentOrigin(request2),
5387
5897
  readMarkdown: context.markdown
5388
5898
  }) : context.defaults;
5389
5899
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5390
5900
  res,
5391
- _chunkO2A6HE76cjs.createFarmMetadataRouteResponse.call(void 0,
5901
+ _chunkXGDI4OUBcjs.createFarmMetadataRouteResponse.call(void 0,
5392
5902
  kind,
5393
5903
  body,
5394
5904
  { revalidate: config.revalidate },
@@ -5396,7 +5906,7 @@ var ServerRenderer = class {
5396
5906
  )
5397
5907
  );
5398
5908
  } catch (error) {
5399
- _chunkQMNWKQL4cjs.logger.error(`Generated ${kind}.txt failed: ${error}`);
5909
+ _chunkGC5ROI3Acjs.logger.error(`Generated ${kind}.txt failed: ${error}`);
5400
5910
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5401
5911
  res,
5402
5912
  new Response("Internal Server Error", {
@@ -5407,26 +5917,26 @@ var ServerRenderer = class {
5407
5917
  }
5408
5918
  }
5409
5919
  getAgentCrawlers() {
5410
- return _chunkF244KE2Dcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.crawlers]));
5920
+ return _chunkF4ID7BGOcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.agent, 'optionalAccess', _190 => _190.crawlers]));
5411
5921
  }
5412
5922
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
5413
5923
  async renderGeneratedRobotsTxt(req, res) {
5414
5924
  try {
5415
- const sitemapPath = _optionalChain([this, 'access', _151 => _151.routeManager, 'access', _152 => _152.matchMetadataRoute, 'call', _153 => _153("/sitemap.xml"), 'optionalAccess', _154 => _154.metadata, 'access', _155 => _155.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5925
+ const sitemapPath = _optionalChain([this, 'access', _191 => _191.routeManager, 'access', _192 => _192.matchMetadataRoute, 'call', _193 => _193("/sitemap.xml"), 'optionalAccess', _194 => _194.metadata, 'access', _195 => _195.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
5416
5926
  const rootLayout = this.routeManager.getLayouts().get("/");
5417
5927
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5418
- const robots = _chunkF244KE2Dcjs.createFarmAgentRobots.call(void 0, {
5928
+ const robots = _chunkF4ID7BGOcjs.createFarmAgentRobots.call(void 0, {
5419
5929
  crawlers: this.getAgentCrawlers(),
5420
5930
  sitemapPath,
5421
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _156 => _156.metadataBase]),
5931
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _196 => _196.metadataBase]),
5422
5932
  basePath: this.config.basePath
5423
5933
  });
5424
5934
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5425
5935
  res,
5426
- _chunkO2A6HE76cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5936
+ _chunkXGDI4OUBcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
5427
5937
  );
5428
5938
  } catch (error) {
5429
- _chunkQMNWKQL4cjs.logger.error(`Generated robots.txt failed: ${error}`);
5939
+ _chunkGC5ROI3Acjs.logger.error(`Generated robots.txt failed: ${error}`);
5430
5940
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5431
5941
  res,
5432
5942
  new Response("Internal Server Error", {
@@ -5437,46 +5947,46 @@ var ServerRenderer = class {
5437
5947
  }
5438
5948
  }
5439
5949
  getAgentSitemap() {
5440
- return _chunkF244KE2Dcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.sitemap]));
5950
+ return _chunkF4ID7BGOcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _197 => _197.config, 'access', _198 => _198.agent, 'optionalAccess', _199 => _199.sitemap]));
5441
5951
  }
5442
5952
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
5443
5953
  async renderGeneratedSitemap(req, res) {
5444
5954
  try {
5445
- const request2 = _chunk4M5ESTJ2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5446
- trustProxy: _optionalChain([this, 'access', _160 => _160.config, 'access', _161 => _161.server, 'optionalAccess', _162 => _162.trustProxy])
5955
+ const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5956
+ trustProxy: _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.server, 'optionalAccess', _202 => _202.trustProxy])
5447
5957
  });
5448
5958
  const sources = await Promise.all(
5449
5959
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
5450
5960
  const [module, stat] = await Promise.all([
5451
5961
  this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
5452
- _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
5962
+ _chunkGC5ROI3Acjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
5453
5963
  return void 0;
5454
5964
  }),
5455
- fs5.promises.stat(route.modulePath).catch(() => void 0)
5965
+ fs7.promises.stat(route.modulePath).catch(() => void 0)
5456
5966
  ]);
5457
- if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _163 => _163.metadata]))) return null;
5458
- return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _164 => _164.mtime, 'access', _165 => _165.toISOString, 'call', _166 => _166()]) };
5967
+ if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _203 => _203.metadata]))) return null;
5968
+ return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _204 => _204.mtime, 'access', _205 => _205.toISOString, 'call', _206 => _206()]) };
5459
5969
  })
5460
5970
  );
5461
5971
  const rootLayout = this.routeManager.getLayouts().get("/");
5462
5972
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5463
- const sitemap = _chunkF244KE2Dcjs.createFarmDefaultSitemap.call(void 0,
5973
+ const sitemap = _chunkF4ID7BGOcjs.createFarmDefaultSitemap.call(void 0,
5464
5974
  sources.filter((source) => source !== null),
5465
5975
  {
5466
5976
  origin: new URL(request2.url).origin,
5467
5977
  config: this.getAgentSitemap(),
5468
- metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _167 => _167.metadataBase]),
5978
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _207 => _207.metadataBase]),
5469
5979
  basePath: this.config.basePath,
5470
5980
  trailingSlash: this.config.trailingSlash,
5471
- i18n: _optionalChain([this, 'access', _168 => _168.i18nRuntime, 'optionalAccess', _169 => _169.config])
5981
+ i18n: _optionalChain([this, 'access', _208 => _208.i18nRuntime, 'optionalAccess', _209 => _209.config])
5472
5982
  }
5473
5983
  );
5474
5984
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5475
5985
  res,
5476
- _chunkO2A6HE76cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5986
+ _chunkXGDI4OUBcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
5477
5987
  );
5478
5988
  } catch (error) {
5479
- _chunkQMNWKQL4cjs.logger.error(`Generated sitemap.xml failed: ${error}`);
5989
+ _chunkGC5ROI3Acjs.logger.error(`Generated sitemap.xml failed: ${error}`);
5480
5990
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5481
5991
  res,
5482
5992
  new Response("Internal Server Error", {
@@ -5500,9 +6010,9 @@ var ServerRenderer = class {
5500
6010
  * matcher) covers, as the production build decides.
5501
6011
  */
5502
6012
  getAgentListedRoutes() {
5503
- const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _170 => _170.middlewareRoutes, 'optionalCall', _171 => _171()]), () => ( [])) };
6013
+ const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _210 => _210.middlewareRoutes, 'optionalCall', _211 => _211()]), () => ( [])) };
5504
6014
  return [...this.routeManager.getRoutes()].filter(
5505
- ([pattern]) => !pattern.includes("[") && !_chunkO2A6HE76cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
6015
+ ([pattern]) => !pattern.includes("[") && !_chunkXGDI4OUBcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
5506
6016
  );
5507
6017
  }
5508
6018
  /**
@@ -5518,7 +6028,7 @@ var ServerRenderer = class {
5518
6028
  )
5519
6029
  )
5520
6030
  );
5521
- return _chunkMKQ27TGWcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
6031
+ return _chunkWRWJ7IWTcjs.isFarmPageNoIndex.call(void 0, metadata, layoutMetadata);
5522
6032
  }
5523
6033
  /**
5524
6034
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
@@ -5526,22 +6036,22 @@ var ServerRenderer = class {
5526
6036
  * or a registered server such as the docs engine's. Production applies the same rules.
5527
6037
  */
5528
6038
  getDefaultMCPServer() {
5529
- if (_optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.agent, 'optionalAccess', _174 => _174.mcp]) !== true || _chunkVKRMO3EZcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
5530
- if (_optionalChain([this, 'access', _175 => _175.apiRouteExists, 'optionalCall', _176 => _176("/api/mcp")])) return void 0;
5531
- if (this.routeManager.matchRoute(_chunkVKRMO3EZcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
5532
- _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkVKRMO3EZcjs.createFarmDefaultMCPServer.call(void 0,
6039
+ if (_optionalChain([this, 'access', _212 => _212.config, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.mcp]) !== true || _chunkYRXPDKMMcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6040
+ if (_optionalChain([this, 'access', _215 => _215.apiRouteExists, 'optionalCall', _216 => _216("/api/mcp")])) return void 0;
6041
+ if (this.routeManager.matchRoute(_chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6042
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkYRXPDKMMcjs.createFarmDefaultMCPServer.call(void 0,
5533
6043
  readAppPackageIdentity(this.config.root),
5534
- _chunkRSL3YFJGcjs.FARM_VERSION
6044
+ _chunkIVBDRAORcjs.FARM_VERSION
5535
6045
  ))));
5536
- return _chunkVKRMO3EZcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6046
+ return _chunkYRXPDKMMcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
5537
6047
  }
5538
6048
  async renderDefaultMCP(req, res) {
5539
6049
  const server = this.getDefaultMCPServer();
5540
- const request2 = _nullishCoalesce(_chunk4M5ESTJ2cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk4M5ESTJ2cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _177 => _177.config, 'access', _178 => _178.server, 'optionalAccess', _179 => _179.trustProxy]) })));
6050
+ const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _217 => _217.config, 'access', _218 => _218.server, 'optionalAccess', _219 => _219.trustProxy]) })));
5541
6051
  try {
5542
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-NRIL4JBC.cjs");
6052
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-73SGWVZT.cjs");
5543
6053
  const origin = new URL(request2.url).origin;
5544
- const i18n = _optionalChain([this, 'access', _180 => _180.i18nRuntime, 'optionalAccess', _181 => _181.config]);
6054
+ const i18n = _optionalChain([this, 'access', _220 => _220.i18nRuntime, 'optionalAccess', _221 => _221.config]);
5545
6055
  const metadataBase = await this.getRootMetadataBase();
5546
6056
  const response = await handleFarmDefaultMCPRequest(request2, {
5547
6057
  server,
@@ -5556,13 +6066,13 @@ var ServerRenderer = class {
5556
6066
  return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
5557
6067
  })
5558
6068
  );
5559
- return _chunkVKRMO3EZcjs.collectFarmDefaultMCPPages.call(void 0,
6069
+ return _chunkYRXPDKMMcjs.collectFarmDefaultMCPPages.call(void 0,
5560
6070
  sources.filter((source) => source !== null),
5561
6071
  {
5562
6072
  origin,
5563
6073
  metadataBase,
5564
6074
  basePath: this.config.basePath,
5565
- markdown: _chunkPG6ZIHKEcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6075
+ markdown: _chunk2YJ4DHTDcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5566
6076
  trailingSlash: this.config.trailingSlash,
5567
6077
  i18n
5568
6078
  }
@@ -5573,7 +6083,7 @@ var ServerRenderer = class {
5573
6083
  });
5574
6084
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
5575
6085
  } catch (error) {
5576
- _chunkQMNWKQL4cjs.logger.error(`Default MCP server failed: ${error}`);
6086
+ _chunkGC5ROI3Acjs.logger.error(`Default MCP server failed: ${error}`);
5577
6087
  await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
5578
6088
  res,
5579
6089
  new Response(
@@ -5589,7 +6099,7 @@ var ServerRenderer = class {
5589
6099
  }
5590
6100
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
5591
6101
  async createLlmsTxtContext(request2, options = {}) {
5592
- const config = _chunkMKQ27TGWcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _182 => _182.config, 'access', _183 => _183.agent, 'optionalAccess', _184 => _184.llmsTxt]));
6102
+ const config = _chunkWRWJ7IWTcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _222 => _222.config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.llmsTxt]));
5593
6103
  const origin = await this.getAgentOrigin(request2);
5594
6104
  const sources = await Promise.all(
5595
6105
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5599,33 +6109,33 @@ var ServerRenderer = class {
5599
6109
  if (await this.isAgentPageNoIndex(pattern, module.metadata)) return null;
5600
6110
  return { pattern, metadata: module.metadata };
5601
6111
  } catch (error) {
5602
- _chunkQMNWKQL4cjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
6112
+ _chunkGC5ROI3Acjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
5603
6113
  return { pattern };
5604
6114
  }
5605
6115
  })
5606
6116
  );
5607
6117
  const rootLayout = this.routeManager.getLayouts().get("/");
5608
6118
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5609
- const pages = _chunkMKQ27TGWcjs.collectFarmLlmsTxtPages.call(void 0,
6119
+ const pages = _chunkWRWJ7IWTcjs.collectFarmLlmsTxtPages.call(void 0,
5610
6120
  sources.filter((source) => source !== null),
5611
6121
  {
5612
6122
  origin,
5613
6123
  basePath: this.config.basePath,
5614
- markdown: _chunkPG6ZIHKEcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6124
+ markdown: _chunk2YJ4DHTDcjs.resolveMarkdownConfig.call(void 0, this.config.md),
5615
6125
  include: config.include,
5616
6126
  exclude: config.exclude,
5617
6127
  trailingSlash: this.config.trailingSlash,
5618
- i18n: _optionalChain([this, 'access', _185 => _185.i18nRuntime, 'optionalAccess', _186 => _186.config])
6128
+ i18n: _optionalChain([this, 'access', _225 => _225.i18nRuntime, 'optionalAccess', _226 => _226.config])
5619
6129
  }
5620
6130
  );
5621
6131
  return {
5622
6132
  pages,
5623
- defaults: _chunkMKQ27TGWcjs.createFarmDefaultLlmsTxt.call(void 0, {
6133
+ defaults: _chunkWRWJ7IWTcjs.createFarmDefaultLlmsTxt.call(void 0, {
5624
6134
  origin,
5625
6135
  pages,
5626
6136
  config,
5627
6137
  rootMetadata,
5628
- mcp: _optionalChain([this, 'access', _187 => _187.config, 'access', _188 => _188.agent, 'optionalAccess', _189 => _189.aiCatalog]) === false ? [] : _chunkDM2YGTRHcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6138
+ mcp: _optionalChain([this, 'access', _227 => _227.config, 'access', _228 => _228.agent, 'optionalAccess', _229 => _229.aiCatalog]) === false ? [] : _chunkWJ5CCQBMcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
5629
6139
  basePath: this.config.basePath,
5630
6140
  apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
5631
6141
  _chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
@@ -5636,7 +6146,7 @@ var ServerRenderer = class {
5636
6146
  })
5637
6147
  }),
5638
6148
  ...options.full ? {
5639
- markdown: _chunkMKQ27TGWcjs.readFarmLlmsMarkdownFrom.call(void 0,
6149
+ markdown: _chunkWRWJ7IWTcjs.readFarmLlmsMarkdownFrom.call(void 0,
5640
6150
  new URL(request2.url).origin,
5641
6151
  origin,
5642
6152
  this.createDevMarkdownReader(options.req)
@@ -5649,13 +6159,13 @@ var ServerRenderer = class {
5649
6159
  * `metadataBase`, else the request's origin, as for the sitemap and the production server.
5650
6160
  */
5651
6161
  async getAgentOrigin(request2) {
5652
- return _chunkMKQ27TGWcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
6162
+ return _chunkWRWJ7IWTcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
5653
6163
  }
5654
6164
  /** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
5655
6165
  async getRootMetadataBase() {
5656
6166
  const rootLayout = this.routeManager.getLayouts().get("/");
5657
6167
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5658
- return _optionalChain([rootMetadata, 'optionalAccess', _190 => _190.metadataBase]);
6168
+ return _optionalChain([rootMetadata, 'optionalAccess', _230 => _230.metadataBase]);
5659
6169
  }
5660
6170
  /**
5661
6171
  * Reads page mirrors back through this dev server, the way its .md handler
@@ -5667,17 +6177,17 @@ var ServerRenderer = class {
5667
6177
  * body is discarded.
5668
6178
  */
5669
6179
  createDevMarkdownReader(req) {
5670
- const socket = _optionalChain([req, 'optionalAccess', _191 => _191.socket]);
5671
- if (_optionalChain([req, 'optionalAccess', _192 => _192.method, 'optionalAccess', _193 => _193.toUpperCase, 'call', _194 => _194()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _195 => _195.localAddress]) || !socket.localPort) {
6180
+ const socket = _optionalChain([req, 'optionalAccess', _231 => _231.socket]);
6181
+ if (_optionalChain([req, 'optionalAccess', _232 => _232.method, 'optionalAccess', _233 => _233.toUpperCase, 'call', _234 => _234()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _235 => _235.localAddress]) || !socket.localPort) {
5672
6182
  return async () => null;
5673
6183
  }
5674
6184
  if (socket.encrypted) {
5675
6185
  const address = { host: socket.localAddress, port: socket.localPort };
5676
- return _chunkMKQ27TGWcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6186
+ return _chunkWRWJ7IWTcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
5677
6187
  }
5678
6188
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
5679
6189
  const localOrigin = `http://${host}:${socket.localPort}`;
5680
- const read = _chunkMKQ27TGWcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6190
+ const read = _chunkWRWJ7IWTcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
5681
6191
  return (url) => {
5682
6192
  const target = new URL(url);
5683
6193
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -5717,7 +6227,7 @@ var ServerRenderer = class {
5717
6227
  }
5718
6228
  async writeMetadataImageResponse(req, res, value, imageModule) {
5719
6229
  const ifNoneMatch = req.headers["if-none-match"];
5720
- const response = await _chunkAXVRUDMBcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
6230
+ const response = await _chunkK6PGK7DCcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
5721
6231
  method: req.method,
5722
6232
  ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
5723
6233
  renderer: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
@@ -5733,8 +6243,8 @@ var ServerRenderer = class {
5733
6243
  return;
5734
6244
  }
5735
6245
  const etag = `"${image.staticInfo.hash}"`;
5736
- const requestUrl = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
5737
- trustProxy: _optionalChain([this, 'access', _196 => _196.config, 'access', _197 => _197.server, 'optionalAccess', _198 => _198.trustProxy])
6246
+ const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
6247
+ trustProxy: _optionalChain([this, 'access', _236 => _236.config, 'access', _237 => _237.server, 'optionalAccess', _238 => _238.trustProxy])
5738
6248
  });
5739
6249
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
5740
6250
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -5745,7 +6255,7 @@ var ServerRenderer = class {
5745
6255
  "Cache-Control",
5746
6256
  isVersioned ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate"
5747
6257
  );
5748
- if (_chunkCFG4QERRcjs.matchesFarmIfNoneMatch.call(void 0, req.headers["if-none-match"], etag)) {
6258
+ if (_chunk7Q7UB4TLcjs.matchesFarmIfNoneMatch.call(void 0, req.headers["if-none-match"], etag)) {
5749
6259
  res.statusCode = 304;
5750
6260
  res.end();
5751
6261
  return;
@@ -5755,7 +6265,7 @@ var ServerRenderer = class {
5755
6265
  res.end();
5756
6266
  return;
5757
6267
  }
5758
- res.write(await fs5.promises.readFile(image.modulePath));
6268
+ res.write(await fs7.promises.readFile(image.modulePath));
5759
6269
  res.end();
5760
6270
  }
5761
6271
  async renderRouteErrorBoundary(req, res, options) {
@@ -5784,8 +6294,14 @@ var ServerRenderer = class {
5784
6294
  }
5785
6295
  });
5786
6296
  let wrapped = errorElement;
6297
+ const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
6298
+ (layout) => !("pattern" in layout) || _chunkXGDI4OUBcjs.routeBoundaryCoversDirectory.call(void 0,
6299
+ layout.pattern,
6300
+ options.errorPattern
6301
+ )
6302
+ );
5787
6303
  const layoutModules = await Promise.all(
5788
- options.layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
6304
+ boundaryLayouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
5789
6305
  );
5790
6306
  for (let i = layoutModules.length - 1; i >= 0; i--) {
5791
6307
  const LayoutComponent = layoutModules[i].default;
@@ -5818,7 +6334,7 @@ var ServerRenderer = class {
5818
6334
  res.end();
5819
6335
  return true;
5820
6336
  } catch (renderError) {
5821
- _chunkQMNWKQL4cjs.logger.warn(`Failed to render route-level error boundary: ${renderError}`);
6337
+ _chunkGC5ROI3Acjs.logger.warn(`Failed to render route-level error boundary: ${renderError}`);
5822
6338
  return false;
5823
6339
  }
5824
6340
  }
@@ -5835,7 +6351,7 @@ var ServerRenderer = class {
5835
6351
  const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
5836
6352
  (slot) => ({
5837
6353
  ...slot,
5838
- modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
6354
+ modulePath: typeof slot.modulePath === "string" ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
5839
6355
  })
5840
6356
  );
5841
6357
  const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
@@ -5843,7 +6359,7 @@ var ServerRenderer = class {
5843
6359
  slots: routeSlots
5844
6360
  });
5845
6361
  const pagePath = req.__FARM_PAGE_PATH__;
5846
- const relativePath = pagePath ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
6362
+ const relativePath = pagePath ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
5847
6363
  const deploymentId = this.getDeploymentId();
5848
6364
  const farmScripts = (markup) => this.stampFarmScripts(req, markup);
5849
6365
  const bootstrapScript = farmScripts(`<script data-farm-refresh-state>
@@ -5863,12 +6379,12 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
5863
6379
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
5864
6380
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
5865
6381
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5866
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk65OS2TOTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
5867
- window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6382
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk6DBBMQWTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6383
+ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
5868
6384
  </script>`);
5869
6385
  const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
5870
6386
  const rendererHydrationScript = farmScripts(
5871
- _optionalChain([this, 'access', _199 => _199.rendererRuntime, 'access', _200 => _200.generateHydrationScript, 'optionalCall', _201 => _201()]) || ""
6387
+ _optionalChain([this, 'access', _239 => _239.rendererRuntime, 'access', _240 => _240.generateHydrationScript, 'optionalCall', _241 => _241()]) || ""
5872
6388
  );
5873
6389
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
5874
6390
  const farmClientScript = farmScripts(
@@ -5877,8 +6393,8 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5877
6393
  const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
5878
6394
  element,
5879
6395
  {
5880
- rejectLateNavigation: _chunkPG6ZIHKEcjs._isFarmMarkdownPageCheck.call(void 0,
5881
- _optionalChain([req, 'access', _202 => _202.headers, 'optionalAccess', _203 => _203[_chunkPG6ZIHKEcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
6396
+ rejectLateNavigation: _chunk2YJ4DHTDcjs._isFarmMarkdownPageCheck.call(void 0,
6397
+ _optionalChain([req, 'access', _242 => _242.headers, 'optionalAccess', _243 => _243[_chunk2YJ4DHTDcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
5882
6398
  )
5883
6399
  }
5884
6400
  );
@@ -5888,31 +6404,31 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5888
6404
  hasFavicon,
5889
6405
  hasExplicitTitle,
5890
6406
  viewport: viewportTags
5891
- } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6407
+ } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
5892
6408
  pathname: getFarmMetadataPathname(req),
5893
- jsonLd: _optionalChain([this, 'access', _204 => _204.config, 'access', _205 => _205.agent, 'optionalAccess', _206 => _206.jsonLd])
6409
+ jsonLd: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.jsonLd])
5894
6410
  });
5895
6411
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
5896
6412
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
5897
- const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
6413
+ const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
5898
6414
  const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(
5899
6415
  req.__FARM_ROUTE__ || req.url || "/",
5900
6416
  i18nSnapshot,
5901
6417
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
5902
6418
  ) : "";
5903
- const themeDocument = _chunkO2A6HE76cjs.createFarmThemeDocumentParts.call(void 0,
6419
+ const themeDocument = _chunkXGDI4OUBcjs.createFarmThemeDocumentParts.call(void 0,
5904
6420
  this.config.theme,
5905
6421
  this.config.basePath,
5906
- _chunkRQ4UZJPRcjs.getTheme.call(void 0, )
6422
+ _chunk5AMH6AFAcjs.getTheme.call(void 0, )
5907
6423
  );
5908
6424
  themeDocument.head = farmScripts(themeDocument.head);
5909
- const fullDocument = _chunkO2A6HE76cjs.extractFarmFullDocument.call(void 0, content);
6425
+ const fullDocument = _chunkXGDI4OUBcjs.extractFarmFullDocument.call(void 0, _chunkXGDI4OUBcjs.markFarmDocumentLayouts.call(void 0, content));
5910
6426
  let html;
5911
6427
  if (fullDocument) {
5912
6428
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
5913
- const documentHtml = shouldReplaceLayoutTitle ? _chunkO2A6HE76cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
5914
- const effectiveRendererHead = hasExplicitTitle ? _chunkO2A6HE76cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
5915
- html = _chunkO2A6HE76cjs.composeFarmFullDocument.call(void 0, documentHtml, {
6429
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkXGDI4OUBcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6430
+ const effectiveRendererHead = hasExplicitTitle ? _chunkXGDI4OUBcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6431
+ html = _chunkXGDI4OUBcjs.composeFarmFullDocument.call(void 0, documentHtml, {
5916
6432
  fallbackIcon: !hasFavicon,
5917
6433
  viewport: viewportTags,
5918
6434
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -5938,7 +6454,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5938
6454
  });
5939
6455
  } else {
5940
6456
  html = `<!DOCTYPE html>
5941
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _207 => _207.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6457
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _247 => _247.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
5942
6458
  <head>
5943
6459
  ${themeDocument.head}
5944
6460
  <meta charset="utf-8">
@@ -5969,7 +6485,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5969
6485
  const securedHtml = this.secureDocumentHTML(req, html);
5970
6486
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
5971
6487
  res.end();
5972
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _208 => _208.onComplete, 'optionalCall', _209 => _209(securedHtml)]);
6488
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _248 => _248.onComplete, 'optionalCall', _249 => _249(securedHtml)]);
5973
6489
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5974
6490
  type: "render.stream.complete",
5975
6491
  route,
@@ -5979,7 +6495,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5979
6495
  emitFarmRenderError(req, route, error);
5980
6496
  throw error;
5981
6497
  } finally {
5982
- _optionalChain([clearMiddlewareData, 'optionalCall', _210 => _210()]);
6498
+ _optionalChain([clearMiddlewareData, 'optionalCall', _250 => _250()]);
5983
6499
  }
5984
6500
  }
5985
6501
  /**
@@ -5988,13 +6504,12 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
5988
6504
  * this up front keeps a route's first request on the buffered path too; a layout this cannot
5989
6505
  * call (async, a class, or one using hooks) falls back to detection from the stream.
5990
6506
  */
5991
- async rootLayoutRendersDocument() {
5992
- if (typeof this.routeManager.getLayouts !== "function") return false;
5993
- const rootLayout = this.routeManager.getLayouts().get("/");
5994
- if (!rootLayout) return false;
6507
+ async rootLayoutRendersDocument(req) {
6508
+ const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _251 => _251.routeManager, 'access', _252 => _252.getLayouts, 'call', _253 => _253(), 'access', _254 => _254.get, 'call', _255 => _255("/"), 'optionalAccess', _256 => _256.modulePath]) : void 0)));
6509
+ if (!modulePath) return false;
5995
6510
  try {
5996
- const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
5997
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _211 => _211.prototype, 'optionalAccess', _212 => _212.isReactComponent]) || _optionalChain([Layout, 'access', _213 => _213.constructor, 'optionalAccess', _214 => _214.name]) === "AsyncFunction") {
6511
+ const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
6512
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _257 => _257.prototype, 'optionalAccess', _258 => _258.isReactComponent]) || _optionalChain([Layout, 'access', _259 => _259.constructor, 'optionalAccess', _260 => _260.name]) === "AsyncFunction") {
5998
6513
  return false;
5999
6514
  }
6000
6515
  const cached = documentLayouts.get(Layout);
@@ -6006,20 +6521,20 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6006
6521
  params: {}
6007
6522
  });
6008
6523
  rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
6009
- } catch (e16) {
6524
+ } catch (e18) {
6010
6525
  rendersDocument = false;
6011
6526
  }
6012
6527
  documentLayouts.set(Layout, rendersDocument);
6013
6528
  return rendersDocument;
6014
- } catch (e17) {
6529
+ } catch (e19) {
6015
6530
  return false;
6016
6531
  }
6017
6532
  }
6018
6533
  async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
6019
6534
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
6020
6535
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
6021
- const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument();
6022
- if (!renderToPipeableStream || _chunkPG6ZIHKEcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _215 => _215.headers, 'optionalAccess', _216 => _216[_chunkPG6ZIHKEcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
6536
+ const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
6537
+ if (!renderToPipeableStream || _chunk2YJ4DHTDcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _261 => _261.headers, 'optionalAccess', _262 => _262[_chunk2YJ4DHTDcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunk67MZTLTFcjs.isReactRenderer.call(void 0, this.config.renderer))) {
6023
6538
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
6024
6539
  }
6025
6540
  return new Promise((resolve3, reject) => {
@@ -6054,12 +6569,12 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6054
6569
  let lateNavigationError = null;
6055
6570
  const pagePath = req.__FARM_PAGE_PATH__;
6056
6571
  const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
6057
- const relativePath = pagePath ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
6572
+ const relativePath = pagePath ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
6058
6573
  const clientManifest = this.createDevBootClientManifest(req, options);
6059
6574
  const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
6060
6575
  (slot) => ({
6061
6576
  ...slot,
6062
- modulePath: typeof slot.modulePath === "string" ? _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
6577
+ modulePath: typeof slot.modulePath === "string" ? _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, slot.modulePath, this.config.root) : slot.modulePath
6063
6578
  })
6064
6579
  );
6065
6580
  const deferredProps = _chunkDBYNZIIQcjs.prepareDeferredData.call(void 0, {
@@ -6089,9 +6604,9 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
6089
6604
  req.__FARM_LOADING_MODULE_PATH__ || null
6090
6605
  )};
6091
6606
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6092
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk65OS2TOTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6093
- window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6094
- </script>${_chunkHBLYSWIJcjs.renderFarmFormStateScript.call(void 0, )}`;
6607
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk6DBBMQWTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6608
+ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6609
+ </script>${_chunkPBJ7MEOVcjs.renderFarmFormStateScript.call(void 0, )}`;
6095
6610
  const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
6096
6611
  const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
6097
6612
  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;
@@ -6103,21 +6618,21 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6103
6618
  hasFavicon,
6104
6619
  hasExplicitTitle,
6105
6620
  viewport: viewportTags
6106
- } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6621
+ } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6107
6622
  pathname: getFarmMetadataPathname(req),
6108
- jsonLd: _optionalChain([this, 'access', _217 => _217.config, 'access', _218 => _218.agent, 'optionalAccess', _219 => _219.jsonLd])
6623
+ jsonLd: _optionalChain([this, 'access', _263 => _263.config, 'access', _264 => _264.agent, 'optionalAccess', _265 => _265.jsonLd])
6109
6624
  });
6110
- const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
6625
+ const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
6111
6626
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
6112
6627
  req.__FARM_ROUTE__ || req.url || "/",
6113
6628
  i18nSnapshot,
6114
6629
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6115
6630
  ) : "";
6116
6631
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6117
- const themeDocument = _chunkO2A6HE76cjs.createFarmThemeDocumentParts.call(void 0,
6632
+ const themeDocument = _chunkXGDI4OUBcjs.createFarmThemeDocumentParts.call(void 0,
6118
6633
  this.config.theme,
6119
6634
  this.config.basePath,
6120
- _chunkRQ4UZJPRcjs.getTheme.call(void 0, )
6635
+ _chunk5AMH6AFAcjs.getTheme.call(void 0, )
6121
6636
  );
6122
6637
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
6123
6638
  const devStyleLinks = this.collectDevStyleLinks();
@@ -6130,10 +6645,10 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6130
6645
  const earlyClientScript = bootClient ? createFarmDevBootScript(waitingRoot, rootStrategy) : FARM_DEV_EARLY_CLIENT_SCRIPT;
6131
6646
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
6132
6647
  nonce: cspNonce,
6133
- formState: _chunkHBLYSWIJcjs.getFarmFormState.call(void 0, ),
6648
+ formState: _chunkPBJ7MEOVcjs.getFarmFormState.call(void 0, ),
6134
6649
  onShellReady() {
6135
6650
  if (pendingNavigationError) {
6136
- _optionalChain([abort, 'optionalCall', _220 => _220(pendingNavigationError)]);
6651
+ _optionalChain([abort, 'optionalCall', _266 => _266(pendingNavigationError)]);
6137
6652
  if (clearMiddlewareData) {
6138
6653
  clearMiddlewareData();
6139
6654
  }
@@ -6151,7 +6666,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6151
6666
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
6152
6667
  }
6153
6668
  const shell = `<!DOCTYPE html>
6154
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _221 => _221.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6669
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _267 => _267.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6155
6670
  <head>
6156
6671
  ${themeDocument.head}
6157
6672
  <meta charset="utf-8">
@@ -6172,14 +6687,14 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6172
6687
  let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
6173
6688
  let heldHead = "";
6174
6689
  const releaseShell = (complete) => {
6175
- const split = _chunkO2A6HE76cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
6690
+ const split = _chunkXGDI4OUBcjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
6176
6691
  if (!split) return null;
6177
- const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkO2A6HE76cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
6178
- const opened = _chunkO2A6HE76cjs.appendFarmHead.call(void 0, shellHead, split.head);
6692
+ const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkXGDI4OUBcjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
6693
+ const opened = _chunkXGDI4OUBcjs.appendFarmHead.call(void 0, shellHead, split.head);
6179
6694
  pendingShell = "";
6180
6695
  heldHead = "";
6181
6696
  htmlParts.push(opened);
6182
- _optionalChain([staticShellParts, 'optionalAccess', _222 => _222.push, 'call', _223 => _223(opened)]);
6697
+ _optionalChain([staticShellParts, 'optionalAccess', _268 => _268.push, 'call', _269 => _269(opened)]);
6183
6698
  res.write(opened);
6184
6699
  return split.body;
6185
6700
  };
@@ -6191,10 +6706,12 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6191
6706
  ${stampDocumentHTML(earlyClientScript)}`
6192
6707
  )
6193
6708
  } : document;
6194
- const documentTransform = streamDocument ? _chunkO2A6HE76cjs.createFarmStreamedDocumentTransform.call(void 0,
6709
+ const documentTransform = streamDocument ? _chunkXGDI4OUBcjs.createFarmStreamedDocumentTransform.call(void 0,
6195
6710
  (opening) => withEarlyClient(
6196
- _chunkO2A6HE76cjs.openFarmStreamedDocument.call(void 0,
6197
- hasExplicitTitle ? _chunkO2A6HE76cjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
6711
+ _chunkXGDI4OUBcjs.openFarmStreamedDocument.call(void 0,
6712
+ _chunkXGDI4OUBcjs.markFarmDocumentLayouts.call(void 0,
6713
+ hasExplicitTitle ? _chunkXGDI4OUBcjs.removeFarmDocumentTitles.call(void 0, opening) : opening
6714
+ ),
6198
6715
  {
6199
6716
  fallbackIcon: !hasFavicon,
6200
6717
  viewport: viewportTags,
@@ -6233,7 +6750,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6233
6750
  const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
6234
6751
  if (!checkedFullDocument && renderedText) {
6235
6752
  documentPrefix += renderedText;
6236
- const prefix = _chunkO2A6HE76cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6753
+ const prefix = _chunkXGDI4OUBcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6237
6754
  if (prefix !== "pending") {
6238
6755
  checkedFullDocument = true;
6239
6756
  documentPrefix = "";
@@ -6252,7 +6769,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6252
6769
  staticShellClosed = true;
6253
6770
  if (!suspenseHoleEmitted) {
6254
6771
  suspenseHoleEmitted = true;
6255
- _optionalChain([options, 'access', _224 => _224.onSuspenseHoleDetected, 'optionalCall', _225 => _225()]);
6772
+ _optionalChain([options, 'access', _270 => _270.onSuspenseHoleDetected, 'optionalCall', _271 => _271()]);
6256
6773
  }
6257
6774
  } else {
6258
6775
  staticShellParts.push(chunkText);
@@ -6304,7 +6821,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6304
6821
  const body = releaseShell(true);
6305
6822
  if (body) {
6306
6823
  htmlParts.push(body);
6307
- _optionalChain([staticShellParts, 'optionalAccess', _226 => _226.push, 'call', _227 => _227(body)]);
6824
+ _optionalChain([staticShellParts, 'optionalAccess', _272 => _272.push, 'call', _273 => _273(body)]);
6308
6825
  res.write(body);
6309
6826
  }
6310
6827
  }
@@ -6320,7 +6837,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6320
6837
  finishStream(callback);
6321
6838
  },
6322
6839
  (error) => {
6323
- _chunkQMNWKQL4cjs.logger.error(`Could not recover from a late navigation error: ${error}`);
6840
+ _chunkGC5ROI3Acjs.logger.error(`Could not recover from a late navigation error: ${error}`);
6324
6841
  finishStream(callback);
6325
6842
  }
6326
6843
  );
@@ -6336,8 +6853,8 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6336
6853
  recordRenderedChunk(tail, rewritten);
6337
6854
  if (tail) res.write(tail);
6338
6855
  }
6339
- const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _228 => _228.end, 'call', _229 => _229()]);
6340
- if (_optionalChain([documentEnd, 'optionalAccess', _230 => _230.text])) {
6856
+ const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _274 => _274.end, 'call', _275 => _275()]);
6857
+ if (_optionalChain([documentEnd, 'optionalAccess', _276 => _276.text])) {
6341
6858
  recordRenderedChunk(documentEnd.text, "");
6342
6859
  res.write(documentEnd.text);
6343
6860
  }
@@ -6348,7 +6865,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6348
6865
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
6349
6866
  earlyClient,
6350
6867
  // A full document: Farm's #root closes only where Farm opened it.
6351
- ..._optionalChain([documentEnd, 'optionalAccess', _231 => _231.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6868
+ ..._optionalChain([documentEnd, 'optionalAccess', _277 => _277.document]) ? { closeRoot: documentEnd.rootOpened } : {}
6352
6869
  })
6353
6870
  );
6354
6871
  htmlParts.push(footer);
@@ -6370,7 +6887,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6370
6887
  }
6371
6888
  const cachedHtml = staticShellParts ? staticShellParts.join("") : htmlParts.join("");
6372
6889
  Promise.resolve(options.onComplete(cachedHtml)).catch((error) => {
6373
- _chunkQMNWKQL4cjs.logger.warn(`Failed to cache PPR shell: ${error}`);
6890
+ _chunkGC5ROI3Acjs.logger.warn(`Failed to cache PPR shell: ${error}`);
6374
6891
  });
6375
6892
  }
6376
6893
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
@@ -6389,7 +6906,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6389
6906
  onShellError(error) {
6390
6907
  didError = true;
6391
6908
  if (!isWebResponse(error) && !_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error) && !_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)) {
6392
- _chunkQMNWKQL4cjs.logger.error(`SSR shell error: ${error}`);
6909
+ _chunkGC5ROI3Acjs.logger.error(`SSR shell error: ${error}`);
6393
6910
  emitFarmRenderError(req, observabilityRoute, error);
6394
6911
  }
6395
6912
  if (clearMiddlewareData) {
@@ -6405,7 +6922,7 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6405
6922
  return;
6406
6923
  }
6407
6924
  if (!isWebResponse(error)) {
6408
- _chunkQMNWKQL4cjs.logger.error(`SSR streaming error: ${error}`);
6925
+ _chunkGC5ROI3Acjs.logger.error(`SSR streaming error: ${error}`);
6409
6926
  emitFarmRenderError(req, observabilityRoute, error);
6410
6927
  }
6411
6928
  }
@@ -6447,8 +6964,8 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6447
6964
  };
6448
6965
  }
6449
6966
  localizeRedirectUrl(url) {
6450
- const snapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
6451
- return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkOWQV6MLMcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
6967
+ const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
6968
+ return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
6452
6969
  }
6453
6970
  /** The app's not-found component, or null when it relies on the built-in page. */
6454
6971
  async loadNotFoundModule() {
@@ -6460,12 +6977,12 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6460
6977
  return await this.routeManager.loadRouteModule(notFoundPath);
6461
6978
  }
6462
6979
  async loadNotFoundComponent() {
6463
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _232 => _232.default]), async () => ( null));
6980
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _278 => _278.default]), async () => ( null));
6464
6981
  }
6465
6982
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
6466
6983
  async notFoundMetadataHead(layoutModule, notFoundModule) {
6467
- const metadata = await _chunk6IOZPJ3Icjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
6468
- const { title, tags, hasFavicon } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, metadata);
6984
+ const metadata = await _chunkY3DO7BIJcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
6985
+ const { title, tags, hasFavicon } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, metadata);
6469
6986
  return {
6470
6987
  head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
6471
6988
  metadata
@@ -6483,13 +7000,13 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6483
7000
  */
6484
7001
  async createLateNavigationRecoveryHTML(req, error) {
6485
7002
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
6486
- return _chunkO2A6HE76cjs.createLateRedirectRecovery.call(void 0,
7003
+ return _chunkXGDI4OUBcjs.createLateRedirectRecovery.call(void 0,
6487
7004
  this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
6488
7005
  this.getCspNonce(req) || ""
6489
7006
  );
6490
7007
  }
6491
- const pathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
6492
- trustProxy: _optionalChain([this, 'access', _233 => _233.config, 'access', _234 => _234.server, 'optionalAccess', _235 => _235.trustProxy])
7008
+ const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
7009
+ trustProxy: _optionalChain([this, 'access', _279 => _279.config, 'access', _280 => _280.server, 'optionalAccess', _281 => _281.trustProxy])
6493
7010
  }).pathname;
6494
7011
  let content = this.defaultNotFoundContent();
6495
7012
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -6501,15 +7018,15 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6501
7018
  )
6502
7019
  );
6503
7020
  } catch (error2) {
6504
- _chunkQMNWKQL4cjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
7021
+ _chunkGC5ROI3Acjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
6505
7022
  }
6506
7023
  }
6507
- return _chunkO2A6HE76cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
7024
+ return _chunkXGDI4OUBcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
6508
7025
  }
6509
7026
  async render404(req, res) {
6510
7027
  res.statusCode = 404;
6511
- const pathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
6512
- trustProxy: _optionalChain([this, 'access', _236 => _236.config, 'access', _237 => _237.server, 'optionalAccess', _238 => _238.trustProxy])
7028
+ const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
7029
+ trustProxy: _optionalChain([this, 'access', _282 => _282.config, 'access', _283 => _283.server, 'optionalAccess', _284 => _284.trustProxy])
6513
7030
  }).pathname;
6514
7031
  if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6515
7032
  res.setHeader("Content-Type", "application/json");
@@ -6526,20 +7043,20 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6526
7043
  }
6527
7044
  const acceptHeader = req.headers.accept;
6528
7045
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
6529
- if (_chunkPG6ZIHKEcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6530
- res.setHeader("Content-Type", _chunkPG6ZIHKEcjs.FARM_MARKDOWN_CONTENT_TYPE);
7046
+ if (_chunk2YJ4DHTDcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
7047
+ res.setHeader("Content-Type", _chunk2YJ4DHTDcjs.FARM_MARKDOWN_CONTENT_TYPE);
6531
7048
  res.setHeader("X-Farm-Markdown-Error", "404");
6532
7049
  res.setHeader("Cache-Control", "no-store");
6533
- res.end(_chunkPG6ZIHKEcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
7050
+ res.end(_chunk2YJ4DHTDcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6534
7051
  return;
6535
7052
  }
6536
- const appDir = path9.join(this.config.root, this.config.srcDir, "app");
7053
+ const appDir = path10.join(this.config.root, this.config.srcDir, "app");
6537
7054
  const notFoundExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6538
7055
  let layoutModule = null;
6539
7056
  try {
6540
7057
  for (const ext of notFoundExtensions) {
6541
- const layoutPath = path9.join(appDir, `layout${ext}`);
6542
- if (fs5.existsSync(layoutPath)) {
7058
+ const layoutPath = path10.join(appDir, `layout${ext}`);
7059
+ if (fs7.existsSync(layoutPath)) {
6543
7060
  layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
6544
7061
  break;
6545
7062
  }
@@ -6550,9 +7067,9 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6550
7067
  );
6551
7068
  if (notFoundPath) {
6552
7069
  const notFoundModule = await this.loadNotFoundModule();
6553
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _239 => _239.default]), () => ( null));
7070
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _285 => _285.default]), () => ( null));
6554
7071
  if (NotFoundComponent) {
6555
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _240 => _240.default]), () => ( null));
7072
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _286 => _286.default]), () => ( null));
6556
7073
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
6557
7074
  if (LayoutComponent) {
6558
7075
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -6588,24 +7105,24 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6588
7105
  }
6589
7106
  res.statusCode = statusCode;
6590
7107
  const isDev = process.env.NODE_ENV === "development";
6591
- const requestUrl = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
6592
- trustProxy: _optionalChain([this, 'access', _241 => _241.config, 'access', _242 => _242.server, 'optionalAccess', _243 => _243.trustProxy])
7108
+ const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
7109
+ trustProxy: _optionalChain([this, 'access', _287 => _287.config, 'access', _288 => _288.server, 'optionalAccess', _289 => _289.trustProxy])
6593
7110
  });
6594
7111
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
6595
- const statusText = _chunkO2A6HE76cjs.getDefaultErrorStatusText.call(void 0, statusCode);
7112
+ const statusText = _chunkXGDI4OUBcjs.getDefaultErrorStatusText.call(void 0, statusCode);
6596
7113
  const content = this.stampFarmScripts(
6597
7114
  req,
6598
- _chunkO2A6HE76cjs.createDefaultErrorMarkup.call(void 0, {
7115
+ _chunkXGDI4OUBcjs.createDefaultErrorMarkup.call(void 0, {
6599
7116
  statusCode,
6600
7117
  statusText,
6601
7118
  requestPath: requestUrl.pathname,
6602
7119
  method: req.method || "GET",
6603
- message: _optionalChain([diagnostics, 'optionalAccess', _244 => _244.message]),
6604
- errorName: _optionalChain([diagnostics, 'optionalAccess', _245 => _245.name]),
6605
- stack: _optionalChain([diagnostics, 'optionalAccess', _246 => _246.stack]),
6606
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _247 => _247.sourceFrame]),
7120
+ message: _optionalChain([diagnostics, 'optionalAccess', _290 => _290.message]),
7121
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _291 => _291.name]),
7122
+ stack: _optionalChain([diagnostics, 'optionalAccess', _292 => _292.stack]),
7123
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _293 => _293.sourceFrame]),
6607
7124
  development: isDev,
6608
- farmVersion: _chunkRSL3YFJGcjs.FARM_VERSION,
7125
+ farmVersion: _chunkIVBDRAORcjs.FARM_VERSION,
6609
7126
  nodeVersion: process.version,
6610
7127
  mode: isDev ? "development" : "production"
6611
7128
  })
@@ -6631,18 +7148,19 @@ window.__FARM_I18N__ = ${_chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0
6631
7148
  */
6632
7149
  getI18nAlternateOptions(req, metadata) {
6633
7150
  return {
6634
- metadataBase: _optionalChain([metadata, 'optionalAccess', _248 => _248.metadataBase]),
6635
- origin: req ? _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _249 => _249.config, 'access', _250 => _250.server, 'optionalAccess', _251 => _251.trustProxy]) }).origin : void 0
7151
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _294 => _294.metadataBase]),
7152
+ origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _295 => _295.config, 'access', _296 => _296.server, 'optionalAccess', _297 => _297.trustProxy]) }).origin : void 0,
7153
+ languages: _optionalChain([metadata, 'optionalAccess', _298 => _298.alternates, 'optionalAccess', _299 => _299.languages])
6636
7154
  };
6637
7155
  }
6638
7156
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
6639
- const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
7157
+ const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
6640
7158
  const farmScripts = (html) => this.stampFarmScripts(alternates.req, html);
6641
7159
  const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
6642
7160
  const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
6643
7161
  const integrationManifestScript = farmScripts(`<script>
6644
7162
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
6645
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk65OS2TOTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7163
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunk6DBBMQWTcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6646
7164
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
6647
7165
  </script>`);
6648
7166
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6651,20 +7169,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6651
7169
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
6652
7170
  ) : "";
6653
7171
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6654
- const themeDocument = _chunkO2A6HE76cjs.createFarmThemeDocumentParts.call(void 0,
7172
+ const themeDocument = _chunkXGDI4OUBcjs.createFarmThemeDocumentParts.call(void 0,
6655
7173
  this.config.theme,
6656
7174
  this.config.basePath,
6657
- _chunkRQ4UZJPRcjs.getTheme.call(void 0, )
7175
+ _chunk5AMH6AFAcjs.getTheme.call(void 0, )
6658
7176
  );
6659
7177
  themeDocument.head = farmScripts(themeDocument.head);
6660
7178
  const rendererHydrationScript = farmScripts(
6661
- _optionalChain([this, 'access', _252 => _252.rendererRuntime, 'access', _253 => _253.generateHydrationScript, 'optionalCall', _254 => _254()]) || ""
7179
+ _optionalChain([this, 'access', _300 => _300.rendererRuntime, 'access', _301 => _301.generateHydrationScript, 'optionalCall', _302 => _302()]) || ""
6662
7180
  );
6663
- const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _255 => _255.metadata, 'optionalAccess', _256 => _256.viewport]));
6664
- const fullDocument = _chunkO2A6HE76cjs.extractFarmFullDocument.call(void 0, content);
7181
+ const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _303 => _303.metadata, 'optionalAccess', _304 => _304.viewport]));
7182
+ const fullDocument = _chunkXGDI4OUBcjs.extractFarmFullDocument.call(void 0, _chunkXGDI4OUBcjs.markFarmDocumentLayouts.call(void 0, content));
6665
7183
  if (fullDocument) {
6666
- return _chunkO2A6HE76cjs.composeFarmFullDocument.call(void 0,
6667
- metadataHead ? _chunkO2A6HE76cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7184
+ return _chunkXGDI4OUBcjs.composeFarmFullDocument.call(void 0,
7185
+ metadataHead ? _chunkXGDI4OUBcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
6668
7186
  {
6669
7187
  fallbackIcon: !metadataHead,
6670
7188
  viewport: viewportTags,
@@ -6690,7 +7208,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
6690
7208
  );
6691
7209
  }
6692
7210
  return `<!DOCTYPE html>
6693
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _257 => _257.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7211
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _305 => _305.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6694
7212
  <head>
6695
7213
  ${themeDocument.head}
6696
7214
  <meta charset="utf-8">
@@ -6731,7 +7249,7 @@ ${clientScript}
6731
7249
  const deploymentId = this.getDeploymentId();
6732
7250
  res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
6733
7251
  if ((req.method || "GET").toUpperCase() !== "GET") return;
6734
- const isSecure = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.server, 'optionalAccess', _260 => _260.trustProxy]) }).protocol === "https:";
7252
+ const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy]) }).protocol === "https:";
6735
7253
  const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
6736
7254
  const existing = res.getHeader("Set-Cookie");
6737
7255
  if (Array.isArray(existing)) {
@@ -6772,9 +7290,9 @@ var FarmApp = class {
6772
7290
  constructor(config = {}, viteServer) {
6773
7291
  this.config = this.normalizeConfig(config);
6774
7292
  _chunkEVIWKPJVcjs.configureFarmObservability.call(void 0, this.config.observability);
6775
- _chunkRQ4UZJPRcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
6776
- this.i18nRuntime = _chunkNLBK37HIcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
6777
- _chunkNLBK37HIcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
7293
+ _chunk5AMH6AFAcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7294
+ this.i18nRuntime = _chunkSXXSQVKKcjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
7295
+ _chunkSXXSQVKKcjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
6778
7296
  this.viteServer = viteServer;
6779
7297
  this.routeManager = new RouteManager(this.config, viteServer);
6780
7298
  this.serverRenderer = new ServerRenderer(
@@ -6786,10 +7304,10 @@ var FarmApp = class {
6786
7304
  }
6787
7305
  async initialize() {
6788
7306
  if (process.env.FARM_VERBOSE) {
6789
- _chunkQMNWKQL4cjs.logger.info("Initializing Farm.js application...");
7307
+ _chunkGC5ROI3Acjs.logger.info("Initializing Farm.js application...");
6790
7308
  }
6791
7309
  await _chunkJMYXO572cjs.initStorage.call(void 0, this.config.storage);
6792
- await _chunk3OMLZLDEcjs.configureFarmCache.call(void 0, this.config.cache);
7310
+ await _chunkBNCKXPCUcjs.configureFarmCache.call(void 0, this.config.cache);
6793
7311
  await this.i18nRuntime.initialize();
6794
7312
  await this.serverRenderer.initialize();
6795
7313
  await this.verifyAppStructure();
@@ -6797,7 +7315,7 @@ var FarmApp = class {
6797
7315
  if (_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
6798
7316
  this.routeManager.generateClientManifest(this.config.root);
6799
7317
  if (process.env.FARM_VERBOSE) {
6800
- _chunkQMNWKQL4cjs.logger.success("Farm.js application initialized successfully!");
7318
+ _chunkGC5ROI3Acjs.logger.success("Farm.js application initialized successfully!");
6801
7319
  }
6802
7320
  }
6803
7321
  getRouteManager() {
@@ -6833,20 +7351,20 @@ var FarmApp = class {
6833
7351
  integrations: config.integrations || {},
6834
7352
  plugins: config.plugins || [],
6835
7353
  migrations: config.migrations || { commands: [] },
6836
- cron: _chunkEF5AP4CVcjs.resolveCronConfig.call(void 0, config.cron),
6837
- workflows: _chunkFSODPZRTcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7354
+ cron: _chunkCYNQPKA4cjs.resolveCronConfig.call(void 0, config.cron),
7355
+ workflows: _chunkQUEYL2WMcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
6838
7356
  api: normalizeFarmAppAPIConfig(config.api),
6839
7357
  middleware: config.middleware || {},
6840
- routeRules: _chunkMQ4DYVFScjs.normalizeRouteRules.call(void 0, config.routeRules),
7358
+ routeRules: _chunkIIHZ2BEEcjs.normalizeRouteRules.call(void 0, config.routeRules),
6841
7359
  context: config.context || (() => void 0),
6842
- server: _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, config.server),
6843
- serverActions: _chunkLIQJYEQPcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7360
+ server: _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, config.server),
7361
+ serverActions: _chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
6844
7362
  security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
6845
7363
  images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
6846
7364
  config.images,
6847
7365
  _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
6848
7366
  ),
6849
- performance: _chunkF244KE2Dcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7367
+ performance: _chunkF4ID7BGOcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
6850
7368
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
6851
7369
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
6852
7370
  root,
@@ -6858,7 +7376,7 @@ var FarmApp = class {
6858
7376
  serverRuntimeConfig: config.serverRuntimeConfig || {},
6859
7377
  publicRuntimeConfig: config.publicRuntimeConfig || {},
6860
7378
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
6861
- md: _chunkPG6ZIHKEcjs.resolveMarkdownConfig.call(void 0, config.md),
7379
+ md: _chunk2YJ4DHTDcjs.resolveMarkdownConfig.call(void 0, config.md),
6862
7380
  mdx: _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx),
6863
7381
  observability: _nullishCoalesce(config.observability, () => ( false)),
6864
7382
  telemetry: config.telemetry !== false,
@@ -6874,10 +7392,10 @@ var FarmApp = class {
6874
7392
  env: config.env || { server: {}, public: {} },
6875
7393
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
6876
7394
  experimental: {
6877
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _261 => _261.experimental, 'optionalAccess', _262 => _262.serverComponents]), () => ( false)),
6878
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _263 => _263.experimental, 'optionalAccess', _264 => _264.serverActions]), () => ( false)),
6879
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _265 => _265.experimental, 'optionalAccess', _266 => _266.isolatedClientHydration]), () => ( "off")),
6880
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _267 => _267.experimental, 'optionalAccess', _268 => _268.ppr]), () => ( false)),
7395
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _309 => _309.experimental, 'optionalAccess', _310 => _310.serverComponents]), () => ( false)),
7396
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverActions]), () => ( false)),
7397
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _313 => _313.experimental, 'optionalAccess', _314 => _314.isolatedClientHydration]), () => ( "off")),
7398
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _315 => _315.experimental, 'optionalAccess', _316 => _316.ppr]), () => ( false)),
6881
7399
  ...config.experimental
6882
7400
  },
6883
7401
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -6889,7 +7407,7 @@ var FarmApp = class {
6889
7407
  const files = [
6890
7408
  ...this.routeManager.getRoutes().values(),
6891
7409
  ...this.routeManager.getLayouts().values()
6892
- ].map((entry) => path3.default.relative(this.config.root, entry.modulePath).split(path3.default.sep).join("/"));
7410
+ ].map((entry) => path4.default.relative(this.config.root, entry.modulePath).split(path4.default.sep).join("/"));
6893
7411
  if (files.length === 0) return;
6894
7412
  throw new Error(
6895
7413
  `This app sets \`renderer: false\`, which serves API routes only, but it has pages or layouts:
@@ -6898,30 +7416,30 @@ var FarmApp = class {
6898
7416
  }
6899
7417
  async verifyAppStructure() {
6900
7418
  const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, this.config);
6901
- const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunkQMNWKQL4cjs.fileExists.call(void 0, appDir)))).some(
7419
+ const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunkGC5ROI3Acjs.fileExists.call(void 0, appDir)))).some(
6902
7420
  Boolean
6903
7421
  );
6904
7422
  if (!hasAppDirectory) {
6905
7423
  const routeFiles = _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
6906
- (source) => _chunkEMRYJG4Ucjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7424
+ (source) => _chunkYTNE4KGCcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
6907
7425
  );
6908
7426
  if (routeFiles.length > 0) {
6909
7427
  return;
6910
7428
  }
6911
- const appDir = _chunkQMNWKQL4cjs.resolveAppPath.call(void 0, this.config.root, this.config.srcDir, "app");
7429
+ const appDir = _chunkGC5ROI3Acjs.resolveAppPath.call(void 0, this.config.root, this.config.srcDir, "app");
6912
7430
  throw new Error(
6913
7431
  `App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
6914
7432
  );
6915
7433
  }
6916
7434
  const componentExtensions = _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
6917
7435
  const rootLayoutPaths = appDirs.flatMap(
6918
- (appDir) => componentExtensions.map((extension) => path3.default.join(appDir, `layout${extension}`))
7436
+ (appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
6919
7437
  );
6920
- const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunkQMNWKQL4cjs.fileExists.call(void 0, p))).then(
7438
+ const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunkGC5ROI3Acjs.fileExists.call(void 0, p))).then(
6921
7439
  (results) => results.some(Boolean)
6922
7440
  );
6923
7441
  if (!hasRootLayout && !_chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
6924
- _chunkQMNWKQL4cjs.logger.warn(
7442
+ _chunkGC5ROI3Acjs.logger.warn(
6925
7443
  `No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
6926
7444
  );
6927
7445
  }
@@ -6936,7 +7454,7 @@ function isResolvedAuthConfig(value) {
6936
7454
  );
6937
7455
  }
6938
7456
  function normalizeFarmAppAPIConfig(config) {
6939
- if (typeof _optionalChain([config, 'optionalAccess', _269 => _269.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _270 => _270.basePath]) === "function") {
7457
+ if (typeof _optionalChain([config, 'optionalAccess', _317 => _317.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _318 => _318.basePath]) === "function") {
6940
7458
  throw new Error(
6941
7459
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
6942
7460
  );
@@ -6951,7 +7469,7 @@ function createFarmApp(config, viteServer) {
6951
7469
  var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
6952
7470
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
6953
7471
  function resolveFarmImageProviderForRuntime(images, options) {
6954
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _271 => _271.provider]), () => ( "auto"));
7472
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _319 => _319.provider]), () => ( "auto"));
6955
7473
  if (provider === "none") return images;
6956
7474
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
6957
7475
  if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -6960,7 +7478,7 @@ function resolveFarmImageProviderForRuntime(images, options) {
6960
7478
  `images.provider "node" optimizes images with sharp, which is not installed. ${SHARP_INSTALL_HINT}`
6961
7479
  );
6962
7480
  }
6963
- _chunkQMNWKQL4cjs.logger.info(
7481
+ _chunkGC5ROI3Acjs.logger.info(
6964
7482
  `Image optimization is off because sharp is not installed; images use their original URLs. ${SHARP_INSTALL_HINT}, or set images.provider to "none".`
6965
7483
  );
6966
7484
  return Object.freeze({ ...images, provider: "none" });
@@ -6978,6 +7496,18 @@ function resolveFarmImageServerRuntime(images, preset) {
6978
7496
  return provider === "cloudflare" || provider === "auto" && cloudflarePreset ? "cloudflare" : "node";
6979
7497
  }
6980
7498
 
7499
+ // src/markdown-source-path.ts
7500
+
7501
+ function toBakedMarkdownSourcePath(root, filePath) {
7502
+ if (!filePath) return "";
7503
+ if (!path4.default.isAbsolute(filePath)) return filePath.split(path4.default.sep).join("/");
7504
+ const relative3 = path4.default.relative(root, filePath);
7505
+ if (!relative3 || relative3.startsWith("..") || path4.default.isAbsolute(relative3)) {
7506
+ return path4.default.basename(filePath);
7507
+ }
7508
+ return relative3.split(path4.default.sep).join("/");
7509
+ }
7510
+
6981
7511
  // src/app-manifest-packages.ts
6982
7512
 
6983
7513
 
@@ -6985,8 +7515,8 @@ var FARM_PACKAGE = /^@(?:farm\.js|farming-labs)\/[a-z0-9._-]+$/;
6985
7515
  function resolveFarmAppPackages(root) {
6986
7516
  let manifest;
6987
7517
  try {
6988
- manifest = JSON.parse(fs.default.readFileSync(path3.default.join(root, "package.json"), "utf8"));
6989
- } catch (e18) {
7518
+ manifest = JSON.parse(fs2.default.readFileSync(path4.default.join(root, "package.json"), "utf8"));
7519
+ } catch (e20) {
6990
7520
  return {};
6991
7521
  }
6992
7522
  const names = new Set(
@@ -7000,13 +7530,13 @@ function resolveFarmAppPackages(root) {
7000
7530
  for (let dir = root; ; ) {
7001
7531
  try {
7002
7532
  const { version } = JSON.parse(
7003
- fs.default.readFileSync(path3.default.join(dir, "node_modules", name, "package.json"), "utf8")
7533
+ fs2.default.readFileSync(path4.default.join(dir, "node_modules", name, "package.json"), "utf8")
7004
7534
  );
7005
7535
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
7006
7536
  versions[name] = version;
7007
7537
  break;
7008
- } catch (e19) {
7009
- const parent = path3.default.dirname(dir);
7538
+ } catch (e21) {
7539
+ const parent = path4.default.dirname(dir);
7010
7540
  if (parent === dir) break;
7011
7541
  dir = parent;
7012
7542
  }
@@ -7036,7 +7566,7 @@ var LANGS = {
7036
7566
  cjs: "jsx",
7037
7567
  jsx: "jsx"
7038
7568
  };
7039
- var parseAst2;
7569
+ var parseAst3;
7040
7570
  function staticValue(node) {
7041
7571
  if (!node) return NOT_STATIC;
7042
7572
  switch (node.type) {
@@ -7080,9 +7610,9 @@ function staticValue(node) {
7080
7610
  }
7081
7611
  }
7082
7612
  function property(object, name) {
7083
- return _optionalChain([object, 'access', _272 => _272.properties, 'access', _273 => _273.find, 'call', _274 => _274(
7613
+ return _optionalChain([object, 'access', _320 => _320.properties, 'access', _321 => _321.find, 'call', _322 => _322(
7084
7614
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
7085
- ), 'optionalAccess', _275 => _275.value]);
7615
+ ), 'optionalAccess', _323 => _323.value]);
7086
7616
  }
7087
7617
  function toolFromObject(object) {
7088
7618
  const name = staticValue(property(object, "name"));
@@ -7113,14 +7643,14 @@ function toolFromObject(object) {
7113
7643
  }
7114
7644
  function findFarmWebMCPTools(code, filename = "module.tsx") {
7115
7645
  if (!code.includes(WEBMCP_CLIENT)) return [];
7116
- const lang = _nullishCoalesce(LANGS[path3.default.extname(filename).slice(1)], () => ( "tsx"));
7117
- _nullishCoalesce(parseAst2, () => ( (parseAst2 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkBTZ5O6VMcjs.define_import_meta_default.url)(
7646
+ const lang = _nullishCoalesce(LANGS[path4.default.extname(filename).slice(1)], () => ( "tsx"));
7647
+ _nullishCoalesce(parseAst3, () => ( (parseAst3 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkBTZ5O6VMcjs.define_import_meta_default.url)(
7118
7648
  "rolldown/parseAst"
7119
7649
  ).parseAst)));
7120
7650
  let program;
7121
7651
  try {
7122
- program = parseAst2(code, { lang });
7123
- } catch (e20) {
7652
+ program = parseAst3(code, { lang });
7653
+ } catch (e22) {
7124
7654
  return [];
7125
7655
  }
7126
7656
  const locals = /* @__PURE__ */ new Map();
@@ -7128,7 +7658,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
7128
7658
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
7129
7659
  continue;
7130
7660
  for (const specifier of statement.specifiers) {
7131
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _276 => _276.imported, 'optionalAccess', _277 => _277.name]), () => ( _optionalChain([specifier, 'access', _278 => _278.imported, 'optionalAccess', _279 => _279.value])));
7661
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _324 => _324.imported, 'optionalAccess', _325 => _325.name]), () => ( _optionalChain([specifier, 'access', _326 => _326.imported, 'optionalAccess', _327 => _327.value])));
7132
7662
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
7133
7663
  locals.set(specifier.local.name, imported);
7134
7664
  }
@@ -7144,7 +7674,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
7144
7674
  const [argument] = current.arguments;
7145
7675
  if (definer && argument) {
7146
7676
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
7147
- (element) => _optionalChain([element, 'optionalAccess', _280 => _280.type]) === "ObjectExpression"
7677
+ (element) => _optionalChain([element, 'optionalAccess', _328 => _328.type]) === "ObjectExpression"
7148
7678
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
7149
7679
  for (const object of objects) {
7150
7680
  const tool = toolFromObject(object);
@@ -7160,7 +7690,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
7160
7690
  }
7161
7691
  var cache = /* @__PURE__ */ new Map();
7162
7692
  function collectFarmWebMCPTools(root, srcDir = "src") {
7163
- const base = path3.default.resolve(root, srcDir);
7693
+ const base = path4.default.resolve(root, srcDir);
7164
7694
  let files;
7165
7695
  try {
7166
7696
  files = _tinyglobby.globSync.call(void 0, "**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}", {
@@ -7169,7 +7699,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
7169
7699
  expandDirectories: false,
7170
7700
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
7171
7701
  });
7172
- } catch (e21) {
7702
+ } catch (e23) {
7173
7703
  return [];
7174
7704
  }
7175
7705
  const seen = /* @__PURE__ */ new Set();
@@ -7177,16 +7707,16 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
7177
7707
  for (const file of files.sort()) {
7178
7708
  let mtimeMs;
7179
7709
  try {
7180
- mtimeMs = fs.default.statSync(file).mtimeMs;
7181
- } catch (e22) {
7710
+ mtimeMs = fs2.default.statSync(file).mtimeMs;
7711
+ } catch (e24) {
7182
7712
  continue;
7183
7713
  }
7184
7714
  let entry = cache.get(file);
7185
7715
  if (!entry || entry.mtimeMs !== mtimeMs) {
7186
7716
  let code = "";
7187
7717
  try {
7188
- code = fs.default.readFileSync(file, "utf8");
7189
- } catch (e23) {
7718
+ code = fs2.default.readFileSync(file, "utf8");
7719
+ } catch (e25) {
7190
7720
  }
7191
7721
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
7192
7722
  cache.set(file, entry);
@@ -7205,15 +7735,15 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
7205
7735
 
7206
7736
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
7207
7737
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
7208
- const client = _optionalChain([cache2, 'optionalAccess', _281 => _281.client]);
7209
- const adapter = _optionalChain([client, 'optionalAccess', _282 => _282.adapter]);
7738
+ const client = _optionalChain([cache2, 'optionalAccess', _329 => _329.client]);
7739
+ const adapter = _optionalChain([client, 'optionalAccess', _330 => _330.adapter]);
7210
7740
  if (adapter === void 0) return void 0;
7211
7741
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
7212
7742
  throw new Error(
7213
7743
  'cache.client.adapter must be a module path string, for example "./src/cache-adapter".'
7214
7744
  );
7215
7745
  }
7216
- const resolved = path3.default.resolve(root, adapter);
7746
+ const resolved = path4.default.resolve(root, adapter);
7217
7747
  const found = resolveAdapterFile(resolved);
7218
7748
  if (!found) {
7219
7749
  throw new Error(
@@ -7221,15 +7751,15 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
7221
7751
  );
7222
7752
  }
7223
7753
  const options = {};
7224
- if (_optionalChain([client, 'optionalAccess', _283 => _283.version]) !== void 0) options.version = client.version;
7225
- if (_optionalChain([client, 'optionalAccess', _284 => _284.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
7754
+ if (_optionalChain([client, 'optionalAccess', _331 => _331.version]) !== void 0) options.version = client.version;
7755
+ if (_optionalChain([client, 'optionalAccess', _332 => _332.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
7226
7756
  return { importPath: found.replace(/\\/g, "/"), options };
7227
7757
  }
7228
7758
  function resolveAdapterFile(resolved) {
7229
- if (fs.default.existsSync(resolved) && fs.default.statSync(resolved).isFile()) return resolved;
7759
+ if (fs2.default.existsSync(resolved) && fs2.default.statSync(resolved).isFile()) return resolved;
7230
7760
  for (const extension of ADAPTER_EXTENSIONS) {
7231
7761
  const candidate = `${resolved}.${extension}`;
7232
- if (fs.default.existsSync(candidate) && fs.default.statSync(candidate).isFile()) return candidate;
7762
+ if (fs2.default.existsSync(candidate) && fs2.default.statSync(candidate).isFile()) return candidate;
7233
7763
  }
7234
7764
  return void 0;
7235
7765
  }
@@ -7272,14 +7802,27 @@ function farmChildrenToArray(children) {
7272
7802
 
7273
7803
  function unwrapFarmDocumentElement(node) {
7274
7804
  if (!React.isValidElement(node) || node.type !== "html") return undefined;
7275
- const children = farmChildrenToArray(node.props.children);
7276
- const body = children.find(function (child) {
7277
- return React.isValidElement(child) && child.type === "body";
7278
- });
7279
- if (body) return body.props.children === undefined ? null : body.props.children;
7280
- return children.filter(function (child) {
7281
- return !(React.isValidElement(child) && child.type === "head");
7282
- });
7805
+ let body;
7806
+ function documentChild(child) {
7807
+ if (React.isValidElement(child)) {
7808
+ if (child.type === "body" && !body) body = child;
7809
+ return child.type === "head" ? null : child;
7810
+ }
7811
+ if (child && typeof child === "object" && typeof child[Symbol.iterator] === "function") {
7812
+ return Array.from(child, documentChild);
7813
+ }
7814
+ return child;
7815
+ }
7816
+ const children = documentChild(node.props.children);
7817
+ if (!body) return farmChildrenToArray(children);
7818
+
7819
+ // React derives useId from the size and index of each sibling array. Keep
7820
+ // the body's original slot, including empty siblings and nested arrays.
7821
+ function bodySlot(child) {
7822
+ if (Array.isArray(child)) return child.map(bodySlot);
7823
+ return child === body ? (body.props.children ?? null) : null;
7824
+ }
7825
+ return bodySlot(children);
7283
7826
  }
7284
7827
 
7285
7828
  function farmLayoutBoundaryElement(pattern, content) {
@@ -7589,10 +8132,10 @@ function exactIdPattern(ids) {
7589
8132
  function fileNamePattern(files) {
7590
8133
  const names = /* @__PURE__ */ new Set();
7591
8134
  for (const file of files) {
7592
- names.add(path3.default.basename(file));
8135
+ names.add(path4.default.basename(file));
7593
8136
  try {
7594
- names.add(path3.default.basename(_fs.realpathSync.call(void 0, file)));
7595
- } catch (e24) {
8137
+ names.add(path4.default.basename(_fs.realpathSync.call(void 0, file)));
8138
+ } catch (e26) {
7596
8139
  }
7597
8140
  }
7598
8141
  return new RegExp(`(?:^|/)(?:${[...names].map(escapeRegExp).join("|")})(?:\\?.*)?$`);
@@ -7602,7 +8145,7 @@ function fileNamePattern(files) {
7602
8145
 
7603
8146
 
7604
8147
 
7605
- var parseAst3;
8148
+ var parseAst4;
7606
8149
  function propertyKeyName(property2) {
7607
8150
  if (property2.computed) return void 0;
7608
8151
  const key = property2.key;
@@ -7611,11 +8154,11 @@ function propertyKeyName(property2) {
7611
8154
  return void 0;
7612
8155
  }
7613
8156
  function redactFarmDocsClientConfig(code, filename) {
7614
- _nullishCoalesce(parseAst3, () => ( (parseAst3 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkBTZ5O6VMcjs.define_import_meta_default.url)(
8157
+ _nullishCoalesce(parseAst4, () => ( (parseAst4 = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkBTZ5O6VMcjs.define_import_meta_default.url)(
7615
8158
  "rolldown/parseAst"
7616
8159
  ).parseAst)));
7617
- const extension = path3.default.extname(filename);
7618
- const program = parseAst3(code, {
8160
+ const extension = path4.default.extname(filename);
8161
+ const program = parseAst4(code, {
7619
8162
  lang: extension === ".tsx" || extension === ".jsx" ? "tsx" : "ts"
7620
8163
  });
7621
8164
  const edits = [];
@@ -7628,7 +8171,7 @@ function redactFarmDocsClientConfig(code, filename) {
7628
8171
  const current = node;
7629
8172
  if (current.type === "Property") {
7630
8173
  const name = propertyKeyName(current);
7631
- const valueType = _optionalChain([current, 'access', _285 => _285.value, 'optionalAccess', _286 => _286.type]);
8174
+ const valueType = _optionalChain([current, 'access', _333 => _333.value, 'optionalAccess', _334 => _334.type]);
7632
8175
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
7633
8176
  if (name && credential) {
7634
8177
  edits.push(
@@ -7659,7 +8202,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
7659
8202
  if (file === configModule) return true;
7660
8203
  try {
7661
8204
  return file === _fs.realpathSync.call(void 0, configModule).replace(/\\/g, "/");
7662
- } catch (e25) {
8205
+ } catch (e27) {
7663
8206
  return false;
7664
8207
  }
7665
8208
  }
@@ -7671,7 +8214,7 @@ function farmDocsClientConfigPlugin(configModule) {
7671
8214
  // Never matches without a docs config module, so the bundler never calls the handler.
7672
8215
  filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
7673
8216
  handler(code, id, options) {
7674
- if (_optionalChain([options, 'optionalAccess', _287 => _287.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
8217
+ if (_optionalChain([options, 'optionalAccess', _335 => _335.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
7675
8218
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7676
8219
  return redacted === null ? null : { code: redacted, map: null };
7677
8220
  }
@@ -7679,6 +8222,55 @@ function farmDocsClientConfigPlugin(configModule) {
7679
8222
  };
7680
8223
  }
7681
8224
 
8225
+ // src/video-player.ts
8226
+ var FARM_VIDEO_PLAYER_HTML = `<!doctype html>
8227
+ <html lang="en">
8228
+ <head>
8229
+ <meta charset="utf-8">
8230
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8231
+ <meta name="robots" content="noindex">
8232
+ <title>Video</title>
8233
+ <style>
8234
+ html, body { height: 100%; margin: 0; background: #000; }
8235
+ video { display: block; width: 100%; height: 100%; object-fit: contain; }
8236
+ </style>
8237
+ </head>
8238
+ <body>
8239
+ <video controls muted playsinline preload="metadata"></video>
8240
+ <script>
8241
+ (() => {
8242
+ const params = new URLSearchParams(location.search);
8243
+ const sameOrigin = (value) => {
8244
+ if (!value) return null;
8245
+ try {
8246
+ const url = new URL(value, location.href);
8247
+ return url.origin === location.origin ? url.href : null;
8248
+ } catch {
8249
+ return null;
8250
+ }
8251
+ };
8252
+ const src = sameOrigin(params.get("src"));
8253
+ if (!src) return;
8254
+ const video = document.querySelector("video");
8255
+ const poster = sameOrigin(params.get("poster"));
8256
+ if (poster) video.poster = poster;
8257
+ video.addEventListener(
8258
+ "loadedmetadata",
8259
+ () => {
8260
+ if (video.duration > 10) return;
8261
+ video.loop = true;
8262
+ // A browser may refuse autoplay; the controls still play it.
8263
+ video.play().catch(() => {});
8264
+ },
8265
+ { once: true },
8266
+ );
8267
+ video.src = src;
8268
+ })();
8269
+ </script>
8270
+ </body>
8271
+ </html>
8272
+ `;
8273
+
7682
8274
  // src/server/vite-config.ts
7683
8275
 
7684
8276
  var FARM_CLIENT_ENTRY_PATTERN = "**/{page,layout,loading,error,not-found,default}.{js,jsx,ts,tsx}";
@@ -7703,13 +8295,13 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
7703
8295
  ];
7704
8296
  function getFarmClientOptimizeDepsInclude(renderer) {
7705
8297
  return Array.from(
7706
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _288 => _288.optimizeDeps]) || []])
8298
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _336 => _336.optimizeDeps]) || []])
7707
8299
  );
7708
8300
  }
7709
8301
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
7710
- const resolvedProjectRoot = path3.default.resolve(projectRoot);
8302
+ const resolvedProjectRoot = path4.default.resolve(projectRoot);
7711
8303
  return appDirectories.map((appDirectory) => {
7712
- const relativeAppDirectory = path3.default.relative(resolvedProjectRoot, path3.default.resolve(appDirectory)).replace(/\\/g, "/");
8304
+ const relativeAppDirectory = path4.default.relative(resolvedProjectRoot, path4.default.resolve(appDirectory)).replace(/\\/g, "/");
7713
8305
  const prefix = relativeAppDirectory || ".";
7714
8306
  return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
7715
8307
  });
@@ -7727,12 +8319,12 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
7727
8319
  // Farm's HTML boots through a virtual module and imports route UI lazily.
7728
8320
  // Explicit entries let Vite finish that crawl before a navigation can
7729
8321
  // rotate the optimizer hash underneath a hydrated React runtime.
7730
- ..._optionalChain([entries, 'optionalAccess', _289 => _289.length]) ? { entries: [...entries] } : {}
8322
+ ..._optionalChain([entries, 'optionalAccess', _337 => _337.length]) ? { entries: [...entries] } : {}
7731
8323
  };
7732
8324
  }
7733
8325
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
7734
8326
  return {
7735
- "@": path3.default.resolve(projectRoot, srcDir)
8327
+ "@": path4.default.resolve(projectRoot, srcDir)
7736
8328
  };
7737
8329
  }
7738
8330
  function mergeNoExternal(farmValue, userValue) {
@@ -7759,8 +8351,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
7759
8351
  return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
7760
8352
  }
7761
8353
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7762
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _290 => _290.optimizeDeps, 'optionalAccess', _291 => _291.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _292 => _292.optimizeDeps, 'optionalAccess', _293 => _293.noDiscovery])));
7763
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _294 => _294.optimizeDeps, 'optionalAccess', _295 => _295.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _296 => _296.optimizeDeps, 'optionalAccess', _297 => _297.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _298 => _298.optimizeDeps, 'optionalAccess', _299 => _299.holdUntilCrawlEnd]))));
8354
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _338 => _338.optimizeDeps, 'optionalAccess', _339 => _339.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _340 => _340.optimizeDeps, 'optionalAccess', _341 => _341.noDiscovery])));
8355
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _342 => _342.optimizeDeps, 'optionalAccess', _343 => _343.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _344 => _344.optimizeDeps, 'optionalAccess', _345 => _345.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _346 => _346.optimizeDeps, 'optionalAccess', _347 => _347.holdUntilCrawlEnd]))));
7764
8356
  return {
7765
8357
  ...farmConfig,
7766
8358
  ...userConfig,
@@ -7772,9 +8364,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7772
8364
  resolve: {
7773
8365
  ...farmConfig.resolve,
7774
8366
  ...userConfig.resolve,
7775
- alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _300 => _300.resolve, 'optionalAccess', _301 => _301.alias]), _optionalChain([userConfig, 'access', _302 => _302.resolve, 'optionalAccess', _303 => _303.alias])),
8367
+ alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _348 => _348.resolve, 'optionalAccess', _349 => _349.alias]), _optionalChain([userConfig, 'access', _350 => _350.resolve, 'optionalAccess', _351 => _351.alias])),
7776
8368
  dedupe: Array.from(
7777
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _304 => _304.resolve, 'optionalAccess', _305 => _305.dedupe]) || [], ..._optionalChain([userConfig, 'access', _306 => _306.resolve, 'optionalAccess', _307 => _307.dedupe]) || []])
8369
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _352 => _352.resolve, 'optionalAccess', _353 => _353.dedupe]) || [], ..._optionalChain([userConfig, 'access', _354 => _354.resolve, 'optionalAccess', _355 => _355.dedupe]) || []])
7778
8370
  )
7779
8371
  },
7780
8372
  optimizeDeps: {
@@ -7784,21 +8376,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7784
8376
  holdUntilCrawlEnd,
7785
8377
  include: Array.from(
7786
8378
  /* @__PURE__ */ new Set([
7787
- ..._optionalChain([farmConfig, 'access', _308 => _308.optimizeDeps, 'optionalAccess', _309 => _309.include]) || [],
7788
- ..._optionalChain([userConfig, 'access', _310 => _310.optimizeDeps, 'optionalAccess', _311 => _311.include]) || []
8379
+ ..._optionalChain([farmConfig, 'access', _356 => _356.optimizeDeps, 'optionalAccess', _357 => _357.include]) || [],
8380
+ ..._optionalChain([userConfig, 'access', _358 => _358.optimizeDeps, 'optionalAccess', _359 => _359.include]) || []
7789
8381
  ])
7790
8382
  ),
7791
8383
  exclude: Array.from(
7792
8384
  /* @__PURE__ */ new Set([
7793
- ..._optionalChain([farmConfig, 'access', _312 => _312.optimizeDeps, 'optionalAccess', _313 => _313.exclude]) || [],
7794
- ..._optionalChain([userConfig, 'access', _314 => _314.optimizeDeps, 'optionalAccess', _315 => _315.exclude]) || []
8385
+ ..._optionalChain([farmConfig, 'access', _360 => _360.optimizeDeps, 'optionalAccess', _361 => _361.exclude]) || [],
8386
+ ..._optionalChain([userConfig, 'access', _362 => _362.optimizeDeps, 'optionalAccess', _363 => _363.exclude]) || []
7795
8387
  ])
7796
8388
  )
7797
8389
  },
7798
8390
  ssr: {
7799
8391
  ...farmConfig.ssr,
7800
8392
  ...userConfig.ssr,
7801
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _316 => _316.ssr, 'optionalAccess', _317 => _317.noExternal]), _optionalChain([userConfig, 'access', _318 => _318.ssr, 'optionalAccess', _319 => _319.noExternal]))
8393
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _364 => _364.ssr, 'optionalAccess', _365 => _365.noExternal]), _optionalChain([userConfig, 'access', _366 => _366.ssr, 'optionalAccess', _367 => _367.noExternal]))
7802
8394
  }
7803
8395
  };
7804
8396
  }
@@ -7869,8 +8461,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
7869
8461
  ...userRolldownOptions
7870
8462
  };
7871
8463
  const merged = mergeFarmViteConfig(farmConfig, shared);
7872
- const farmBundlerOptions = _optionalChain([farmConfig, 'access', _320 => _320.build, 'optionalAccess', _321 => _321.rollupOptions]);
7873
- const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _322 => _322.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _323 => _323.output]);
8464
+ const farmBundlerOptions = _optionalChain([farmConfig, 'access', _368 => _368.build, 'optionalAccess', _369 => _369.rollupOptions]);
8465
+ const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _370 => _370.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _371 => _371.output]);
7874
8466
  return {
7875
8467
  ...merged,
7876
8468
  build: {
@@ -7887,7 +8479,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
7887
8479
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
7888
8480
  ssr: {
7889
8481
  ...merged.ssr,
7890
- external: mergeExternal(_optionalChain([farmConfig, 'access', _324 => _324.ssr, 'optionalAccess', _325 => _325.external]), _optionalChain([userConfig, 'access', _326 => _326.ssr, 'optionalAccess', _327 => _327.external]))
8482
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _372 => _372.ssr, 'optionalAccess', _373 => _373.external]), _optionalChain([userConfig, 'access', _374 => _374.ssr, 'optionalAccess', _375 => _375.external]))
7891
8483
  }
7892
8484
  };
7893
8485
  }
@@ -7960,4 +8552,8 @@ ${FARM_DARK_VARIANT}
7960
8552
 
7961
8553
 
7962
8554
 
7963
- exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.createFarmDevClientManifest = createFarmDevClientManifest; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.invalidateFarmRouteRootInferences = invalidateFarmRouteRootInferences; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
8555
+
8556
+
8557
+
8558
+
8559
+ exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.createFarmDevClientManifest = createFarmDevClientManifest; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.farmDevServerStylesheetsPlugin = farmDevServerStylesheetsPlugin; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.invalidateFarmRouteRootInferences = invalidateFarmRouteRootInferences; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.canFarmSkipKeptLayoutRender = canFarmSkipKeptLayoutRender; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.toBakedMarkdownSourcePath = toBakedMarkdownSourcePath; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.FARM_VIDEO_PLAYER_HTML = FARM_VIDEO_PLAYER_HTML; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;