@farm.js/core 0.1.35 → 0.1.37

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 (285) hide show
  1. package/dist/{metadata-BnLDsUOS.d.ts → agent-mcp-BC0bAGVF.d.mts} +45 -2
  2. package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
  3. package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
  4. package/dist/{metadata-WGpBYcGn.d.mts → agent-mcp-jyDHbQKe.d.ts} +45 -2
  5. package/dist/agent-runtime.cjs +6 -4
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +5 -3
  9. package/dist/api/client.cjs +3 -3
  10. package/dist/api/client.mjs +2 -2
  11. package/dist/api/route-manager.cjs +9 -9
  12. package/dist/api/route-manager.d.mts +10 -4
  13. package/dist/api/route-manager.d.ts +10 -4
  14. package/dist/api/route-manager.mjs +8 -8
  15. package/dist/api/runtime.cjs +6 -6
  16. package/dist/api/runtime.d.mts +4 -62
  17. package/dist/api/runtime.d.ts +4 -62
  18. package/dist/api/runtime.mjs +5 -5
  19. package/dist/api.cjs +13 -12
  20. package/dist/api.d.mts +3 -3
  21. package/dist/api.d.ts +3 -3
  22. package/dist/api.mjs +12 -11
  23. package/dist/{app-BXB3JZYc.d.ts → app-CKO3iN1c.d.ts} +17 -3
  24. package/dist/{app-D_j9AAVL.d.mts → app-Cbkj9ufe.d.mts} +17 -3
  25. package/dist/app-markdown.cjs +6 -4
  26. package/dist/app-markdown.d.mts +3 -3
  27. package/dist/app-markdown.d.ts +3 -3
  28. package/dist/app-markdown.mjs +5 -3
  29. package/dist/{chunk-F7JZENPF.cjs → chunk-3A4KGQYI.cjs} +38 -30
  30. package/dist/{chunk-4MMGO7YW.cjs → chunk-3IP27TCG.cjs} +43 -32
  31. package/dist/{chunk-FDR64H6B.mjs → chunk-3KGDJLJK.mjs} +41 -2
  32. package/dist/{chunk-UJD4PHYB.mjs → chunk-4E5WBPEG.mjs} +72 -354
  33. package/dist/{chunk-KXWRO25S.cjs → chunk-4GPOC4LN.cjs} +3 -3
  34. package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
  35. package/dist/{chunk-4KU5Q7C2.mjs → chunk-4P6ULFMD.mjs} +253 -67
  36. package/dist/chunk-4WQ6PGSJ.cjs +367 -0
  37. package/dist/{chunk-SMHH4VDG.mjs → chunk-4WVJLURN.mjs} +1 -1
  38. package/dist/{chunk-2F2ER724.cjs → chunk-5BXGGEC7.cjs} +27 -22
  39. package/dist/{chunk-3BHT4WMP.cjs → chunk-5D2JIPLH.cjs} +8 -8
  40. package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
  41. package/dist/{chunk-GFHLGIYC.cjs → chunk-6LGFV2CQ.cjs} +8 -8
  42. package/dist/chunk-6SJ2KJTA.mjs +314 -0
  43. package/dist/{chunk-PFQKNERH.cjs → chunk-6TJITR2B.cjs} +457 -218
  44. package/dist/{chunk-73MC7ZL6.cjs → chunk-75X755YZ.cjs} +2 -2
  45. package/dist/{chunk-3UH7MRCP.cjs → chunk-7DWNJI73.cjs} +13 -13
  46. package/dist/{chunk-7L5V3KQO.cjs → chunk-7O5M4UKW.cjs} +2 -2
  47. package/dist/{chunk-BJPBQNIE.cjs → chunk-7SQ5SGYZ.cjs} +2 -2
  48. package/dist/{chunk-27ZWSI3W.cjs → chunk-ADOAUDQ6.cjs} +2 -2
  49. package/dist/{chunk-CP6X4AEU.mjs → chunk-AJQTP4OO.mjs} +1 -1
  50. package/dist/{chunk-YKX5BK66.cjs → chunk-ATWHHSY2.cjs} +7 -7
  51. package/dist/{chunk-EFCQPQMG.cjs → chunk-B5PFZLKV.cjs} +89 -8
  52. package/dist/{chunk-FNO7A7CM.cjs → chunk-BHY547NB.cjs} +34 -16
  53. package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
  54. package/dist/{chunk-7GLPRTTF.cjs → chunk-CGBDNNSM.cjs} +2 -2
  55. package/dist/chunk-CI6E3UOH.cjs +314 -0
  56. package/dist/{chunk-2G2NNLE2.mjs → chunk-CQMVIOYP.mjs} +5 -5
  57. package/dist/{chunk-X6W5FFH6.cjs → chunk-CVH2BXPY.cjs} +8 -8
  58. package/dist/{chunk-TKSCR644.cjs → chunk-D3C5LBQY.cjs} +2 -2
  59. package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
  60. package/dist/chunk-DTSROJ5J.mjs +367 -0
  61. package/dist/{chunk-DBNKI4NF.cjs → chunk-ECKF2BAM.cjs} +6 -2
  62. package/dist/{chunk-GQ3Z3IZI.cjs → chunk-EMMQ64QW.cjs} +18 -18
  63. package/dist/{chunk-6DU6UFUE.mjs → chunk-EXG5LD6B.mjs} +16 -8
  64. package/dist/{chunk-HUMR6LSU.mjs → chunk-F5QO4FNE.mjs} +1 -1
  65. package/dist/{chunk-YULD7ICZ.mjs → chunk-FBOJ55OM.mjs} +1 -1
  66. package/dist/{chunk-IHNMMXHV.mjs → chunk-FGRYBX5X.mjs} +15 -10
  67. package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
  68. package/dist/{chunk-3BU22U3M.cjs → chunk-G2TEB74S.cjs} +5 -2
  69. package/dist/{chunk-G5RT7EXW.mjs → chunk-HEVMCTSR.mjs} +21 -6
  70. package/dist/{chunk-W7LF2J2S.mjs → chunk-HMRSWN47.mjs} +1 -1
  71. package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
  72. package/dist/{chunk-UAORZ7QA.mjs → chunk-IAIYV4RZ.mjs} +2 -2
  73. package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
  74. package/dist/{chunk-2NNMOPDN.mjs → chunk-J3ANCZKA.mjs} +4 -1
  75. package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
  76. package/dist/{chunk-SC2WYWPF.mjs → chunk-JPNFPAZ4.mjs} +3 -3
  77. package/dist/{chunk-F6Z3Y5KL.mjs → chunk-K3SAEIM3.mjs} +5 -2
  78. package/dist/{chunk-QAU5JD57.mjs → chunk-K4I4O5TS.mjs} +289 -50
  79. package/dist/{chunk-KN7K4VQN.mjs → chunk-KDTBF3UU.mjs} +1 -1
  80. package/dist/{chunk-OMVAU7NT.cjs → chunk-KIIMAWOJ.cjs} +11 -1
  81. package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
  82. package/dist/{chunk-QORUJDIV.mjs → chunk-KPFKMDM7.mjs} +2 -2
  83. package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
  84. package/dist/{chunk-YDQZGSDS.mjs → chunk-LBDP3YT3.mjs} +1 -1
  85. package/dist/{chunk-6ETPZTJI.mjs → chunk-LBGILORX.mjs} +116 -55
  86. package/dist/{chunk-IPXLADVO.cjs → chunk-LOFKRKO7.cjs} +122 -61
  87. package/dist/{chunk-ULAWS2PA.cjs → chunk-LPFV45AY.cjs} +29 -26
  88. package/dist/{chunk-3KZS4SUS.mjs → chunk-MCIZVNOQ.mjs} +1 -1
  89. package/dist/{chunk-RU3M2FIK.cjs → chunk-MRMI32SN.cjs} +87 -369
  90. package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
  91. package/dist/{chunk-XCACDAZZ.cjs → chunk-NDILNQ4L.cjs} +25 -10
  92. package/dist/{chunk-6TJOML4E.mjs → chunk-NFMDCAOS.mjs} +14 -11
  93. package/dist/{chunk-UXFQ3UDA.cjs → chunk-NICDYKBS.cjs} +42 -3
  94. package/dist/{chunk-EZDQRNQ7.mjs → chunk-NNSAQX3U.mjs} +23 -5
  95. package/dist/{chunk-YC6V7PWE.cjs → chunk-NQ6QFZWD.cjs} +1 -1
  96. package/dist/{chunk-PDOCJ6RY.mjs → chunk-O6WAEAX3.mjs} +1 -1
  97. package/dist/{chunk-U4KT7QP3.cjs → chunk-OW67PDDS.cjs} +14 -1
  98. package/dist/{chunk-77GNHH2Z.cjs → chunk-PMQHMWZU.cjs} +3 -3
  99. package/dist/chunk-PTZ2TVNE.cjs +178 -0
  100. package/dist/{chunk-6WCPV6G2.mjs → chunk-Q2KB32T4.mjs} +1 -1
  101. package/dist/{chunk-ICUQICNC.cjs → chunk-Q5FYSK45.cjs} +718 -532
  102. package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
  103. package/dist/{chunk-Q3VLETLE.mjs → chunk-RRMVL6CJ.mjs} +4 -4
  104. package/dist/{chunk-IZY3V5XW.mjs → chunk-S3VWVTVA.mjs} +14 -1
  105. package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
  106. package/dist/{chunk-VFQT3LAO.cjs → chunk-SDOTRX3V.cjs} +5 -5
  107. package/dist/chunk-SGBZPZUW.mjs +75 -0
  108. package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
  109. package/dist/{chunk-ZXGAFZDO.cjs → chunk-T5OJPTVN.cjs} +2 -2
  110. package/dist/{chunk-2ELDTQRN.mjs → chunk-TDNWPAVR.mjs} +1 -1
  111. package/dist/{chunk-VZJR7UTG.cjs → chunk-TE2G5ION.cjs} +2 -2
  112. package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
  113. package/dist/{chunk-4JHOT46A.mjs → chunk-TPLJVC7E.mjs} +86 -5
  114. package/dist/{chunk-NRSN7G7E.mjs → chunk-TW4GYDBJ.mjs} +1 -1
  115. package/dist/{chunk-XBML5KMG.cjs → chunk-U6MPZ35Q.cjs} +24 -14
  116. package/dist/chunk-UH6QN5NL.mjs +178 -0
  117. package/dist/{chunk-FTFYRMQQ.cjs → chunk-UJZLSXUB.cjs} +53 -28
  118. package/dist/chunk-UXHS27O6.cjs +75 -0
  119. package/dist/{chunk-DQQOKWYA.cjs → chunk-VR4GD5I3.cjs} +3 -3
  120. package/dist/{chunk-22LTEMGQ.mjs → chunk-VXAWRDK7.mjs} +14 -4
  121. package/dist/{chunk-62XKI4Z3.cjs → chunk-W2YDNK66.cjs} +6 -3
  122. package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
  123. package/dist/{chunk-EJQT6KZN.cjs → chunk-WC5UV2HQ.cjs} +2 -2
  124. package/dist/{chunk-SAZVVAJH.mjs → chunk-WQ7T2263.mjs} +18 -7
  125. package/dist/chunk-WRPHYQVY.mjs +109 -0
  126. package/dist/chunk-WT4TGLXT.cjs +109 -0
  127. package/dist/{chunk-SOMHP6GF.mjs → chunk-XOPOIFTJ.mjs} +2 -2
  128. package/dist/{chunk-3PXS2MHU.mjs → chunk-YCKO6FRS.mjs} +1 -1
  129. package/dist/{chunk-C35ZBVRD.mjs → chunk-YWMZUGIS.mjs} +6 -2
  130. package/dist/{chunk-HMIJDL7S.mjs → chunk-Z5BEWYVO.mjs} +31 -6
  131. package/dist/{chunk-OKZUAXHF.mjs → chunk-Z7LA7MHQ.mjs} +1 -1
  132. package/dist/{chunk-Y7RKTKYI.mjs → chunk-ZMMBIVQM.mjs} +10 -0
  133. package/dist/{client-plugins-HIyulDym.d.ts → client-plugins-C8DjftDF.d.ts} +112 -5
  134. package/dist/{client-plugins-CvIslxWi.d.mts → client-plugins-CV4eJ9De.d.mts} +112 -5
  135. package/dist/client-plugins.d.mts +1 -1
  136. package/dist/client-plugins.d.ts +1 -1
  137. package/dist/client.cjs +8 -8
  138. package/dist/client.d.mts +5 -5
  139. package/dist/client.d.ts +5 -5
  140. package/dist/client.mjs +7 -7
  141. package/dist/config.d.mts +1 -1
  142. package/dist/config.d.ts +1 -1
  143. package/dist/{devtools-EAUY43BS.cjs → devtools-JXFQNWSH.cjs} +11 -10
  144. package/dist/{devtools-EE5RIBTH.mjs → devtools-KVOY2TCZ.mjs} +10 -9
  145. package/dist/docs.cjs +13 -12
  146. package/dist/docs.d.mts +2 -2
  147. package/dist/docs.d.ts +2 -2
  148. package/dist/docs.mjs +12 -11
  149. package/dist/headers.cjs +4 -4
  150. package/dist/headers.mjs +3 -3
  151. package/dist/i18n/client.cjs +11 -11
  152. package/dist/i18n/client.mjs +3 -3
  153. package/dist/image/server.cjs +3 -3
  154. package/dist/image/server.mjs +2 -2
  155. package/dist/image/sharp.cjs +10 -10
  156. package/dist/image/sharp.mjs +2 -2
  157. package/dist/index.cjs +61 -54
  158. package/dist/index.d.mts +14 -14
  159. package/dist/index.d.ts +14 -14
  160. package/dist/index.mjs +60 -53
  161. package/dist/integrations.cjs +8 -4
  162. package/dist/integrations.d.mts +1 -1
  163. package/dist/integrations.d.ts +1 -1
  164. package/dist/integrations.mjs +7 -3
  165. package/dist/internal/app-markdown-runtime.cjs +5 -3
  166. package/dist/internal/app-markdown-runtime.d.mts +19 -5
  167. package/dist/internal/app-markdown-runtime.d.ts +19 -5
  168. package/dist/internal/app-markdown-runtime.mjs +4 -2
  169. package/dist/internal/build-runtime.cjs +38 -34
  170. package/dist/internal/build-runtime.d.mts +3 -3
  171. package/dist/internal/build-runtime.d.ts +3 -3
  172. package/dist/internal/build-runtime.mjs +37 -33
  173. package/dist/internal/cli-runtime.cjs +17 -16
  174. package/dist/internal/cli-runtime.mjs +16 -15
  175. package/dist/internal/client-error-overlay.cjs +4 -4
  176. package/dist/internal/client-error-overlay.mjs +1 -1
  177. package/dist/internal/client-runtime.cjs +2 -2
  178. package/dist/internal/client-runtime.mjs +1 -1
  179. package/dist/internal/compression-runtime.d.mts +1 -1
  180. package/dist/internal/compression-runtime.d.ts +1 -1
  181. package/dist/internal/config-runtime.cjs +11 -10
  182. package/dist/internal/config-runtime.d.mts +2 -2
  183. package/dist/internal/config-runtime.d.ts +2 -2
  184. package/dist/internal/config-runtime.mjs +10 -9
  185. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  186. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  187. package/dist/internal/isolated-boundary.cjs +2 -2
  188. package/dist/internal/isolated-boundary.d.mts +0 -1
  189. package/dist/internal/isolated-boundary.d.ts +0 -1
  190. package/dist/internal/isolated-boundary.mjs +1 -1
  191. package/dist/internal/metadata-image-runtime.cjs +3 -3
  192. package/dist/internal/metadata-image-runtime.mjs +2 -2
  193. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  194. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  195. package/dist/internal/production-runtime.cjs +27 -48
  196. package/dist/internal/production-runtime.d.mts +67 -27
  197. package/dist/internal/production-runtime.d.ts +67 -27
  198. package/dist/internal/production-runtime.mjs +34 -55
  199. package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
  200. package/dist/layers-VUWIOFEO.cjs +18 -0
  201. package/dist/markdown.cjs +1 -1
  202. package/dist/markdown.d.mts +1 -1
  203. package/dist/markdown.d.ts +1 -1
  204. package/dist/markdown.mjs +1 -1
  205. package/dist/middleware.cjs +10 -10
  206. package/dist/middleware.d.mts +6 -4
  207. package/dist/middleware.d.ts +6 -4
  208. package/dist/middleware.mjs +9 -9
  209. package/dist/navigation.cjs +7 -7
  210. package/dist/navigation.d.mts +4 -4
  211. package/dist/navigation.d.ts +4 -4
  212. package/dist/navigation.mjs +6 -6
  213. package/dist/{nitro-OVPLKPE2.cjs → nitro-7F65EZZS.cjs} +3 -3
  214. package/dist/{nitro-MXRDCXWZ.mjs → nitro-MPZJGPXK.mjs} +2 -2
  215. package/dist/plugin.cjs +31 -28
  216. package/dist/plugin.d.mts +1 -1
  217. package/dist/plugin.d.ts +1 -1
  218. package/dist/plugin.mjs +30 -27
  219. package/dist/{production-runtime-Crq6CJ-2.d.ts → production-runtime-C2kkrPVZ.d.ts} +1 -1
  220. package/dist/{production-runtime-0sRnuYc-.d.mts → production-runtime-Du_FHb2-.d.mts} +1 -1
  221. package/dist/query/client.cjs +9 -9
  222. package/dist/query/client.mjs +4 -4
  223. package/dist/{render-plan-8ozZh2Qv.d.ts → render-plan-BnnPTpus.d.ts} +1 -1
  224. package/dist/{render-plan-gs9GGPzw.d.mts → render-plan-Cgx7v8tJ.d.mts} +1 -1
  225. package/dist/renderer/react/server.cjs +3 -3
  226. package/dist/renderer/react/server.mjs +1 -1
  227. package/dist/renderer-client.cjs +12 -12
  228. package/dist/renderer-client.d.mts +3 -3
  229. package/dist/renderer-client.d.ts +3 -3
  230. package/dist/renderer-client.mjs +4 -4
  231. package/dist/{request-B5G8rLBH.d.ts → request-BNWr7r5e.d.ts} +1 -1
  232. package/dist/{request-fkhiynXe.d.mts → request-sKayKcop.d.mts} +1 -1
  233. package/dist/request.cjs +3 -3
  234. package/dist/request.d.mts +2 -2
  235. package/dist/request.d.ts +2 -2
  236. package/dist/request.mjs +2 -2
  237. package/dist/{route-rendering-lS5nUMua.d.ts → route-rendering-Bx4Auw6Q.d.ts} +1 -1
  238. package/dist/{route-rendering-CLnS7AZj.d.mts → route-rendering-DWFp3Yq4.d.mts} +1 -1
  239. package/dist/{router-ifU8Dui1.d.mts → router-BK6K42Ij.d.mts} +1 -1
  240. package/dist/{router-4iuiYnOW.d.ts → router-DnW_2tQi.d.ts} +1 -1
  241. package/dist/routes.cjs +2 -2
  242. package/dist/routes.d.mts +1 -1
  243. package/dist/routes.d.ts +1 -1
  244. package/dist/routes.mjs +1 -1
  245. package/dist/runtime-CA3Ei5k_.d.ts +69 -0
  246. package/dist/runtime-DJDaCMd_.d.mts +69 -0
  247. package/dist/server-action-security.cjs +3 -3
  248. package/dist/server-action-security.mjs +2 -2
  249. package/dist/server-fn.cjs +5 -5
  250. package/dist/server-fn.mjs +4 -4
  251. package/dist/server-plugins.cjs +5 -5
  252. package/dist/server-plugins.d.mts +2 -2
  253. package/dist/server-plugins.d.ts +2 -2
  254. package/dist/server-plugins.mjs +4 -4
  255. package/dist/server-query.cjs +6 -6
  256. package/dist/server-query.mjs +5 -5
  257. package/dist/server.cjs +57 -54
  258. package/dist/server.d.mts +7 -7
  259. package/dist/server.d.ts +7 -7
  260. package/dist/server.mjs +35 -32
  261. package/dist/{spa-router-Bq7VCOwx.d.mts → spa-router-D6fUA4Rn.d.mts} +2 -2
  262. package/dist/{spa-router-DaJk5Re4.d.ts → spa-router-Mwbd7g2L.d.ts} +2 -2
  263. package/dist/testing.cjs +13 -13
  264. package/dist/testing.d.mts +1 -1
  265. package/dist/testing.d.ts +1 -1
  266. package/dist/testing.mjs +10 -10
  267. package/dist/theme/server.cjs +4 -4
  268. package/dist/theme/server.mjs +3 -3
  269. package/dist/{utils-BXLmFsVR.d.ts → utils-BwVcAfUR.d.ts} +1 -1
  270. package/dist/{utils-XJn0c9bj.d.mts → utils-p9Hs-jCc.d.mts} +1 -1
  271. package/dist/version.cjs +2 -2
  272. package/dist/version.mjs +1 -1
  273. package/dist/vite.cjs +31 -28
  274. package/dist/vite.d.mts +1 -1
  275. package/dist/vite.d.ts +1 -1
  276. package/dist/vite.mjs +30 -27
  277. package/dist/workflows.cjs +3 -3
  278. package/dist/workflows.mjs +2 -2
  279. package/package.json +1 -1
  280. package/types/middleware.d.ts +5 -1
  281. package/dist/chunk-FXEF4PPL.mjs +0 -47
  282. package/dist/chunk-XD32KALF.cjs +0 -47
  283. package/dist/layers-4PNE2HOY.cjs +0 -18
  284. /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
  285. /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk3BHT4WMPcjs = require('./chunk-3BHT4WMP.cjs');
7
+ var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
8
8
 
9
9
 
10
10
 
@@ -41,16 +41,25 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkIPXLADVOcjs = require('./chunk-IPXLADVO.cjs');
44
+
45
+ var _chunkLOFKRKO7cjs = require('./chunk-LOFKRKO7.cjs');
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ var _chunkPTZ2TVNEcjs = require('./chunk-PTZ2TVNE.cjs');
45
54
 
46
55
 
47
56
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
48
57
 
49
58
 
50
- var _chunkEJQT6KZNcjs = require('./chunk-EJQT6KZN.cjs');
59
+ var _chunkWC5UV2HQcjs = require('./chunk-WC5UV2HQ.cjs');
51
60
 
52
61
 
53
- var _chunk7GLPRTTFcjs = require('./chunk-7GLPRTTF.cjs');
62
+ var _chunkCGBDNNSMcjs = require('./chunk-CGBDNNSM.cjs');
54
63
 
55
64
 
56
65
 
@@ -64,7 +73,7 @@ var _chunk3SDFA7UFcjs = require('./chunk-3SDFA7UF.cjs');
64
73
 
65
74
 
66
75
 
67
- var _chunkKXWRO25Scjs = require('./chunk-KXWRO25S.cjs');
76
+ var _chunk4GPOC4LNcjs = require('./chunk-4GPOC4LN.cjs');
68
77
 
69
78
 
70
79
 
@@ -93,7 +102,7 @@ var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
93
102
 
94
103
 
95
104
 
96
- var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
105
+ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
97
106
 
98
107
 
99
108
 
@@ -120,10 +129,14 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
120
129
 
121
130
 
122
131
 
132
+ var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
133
+
134
+
135
+
123
136
 
124
137
 
125
138
 
126
- var _chunkRU3M2FIKcjs = require('./chunk-RU3M2FIK.cjs');
139
+ var _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
127
140
 
128
141
 
129
142
 
@@ -133,7 +146,7 @@ var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
133
146
  var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
134
147
 
135
148
 
136
- var _chunkZXGAFZDOcjs = require('./chunk-ZXGAFZDO.cjs');
149
+ var _chunkT5OJPTVNcjs = require('./chunk-T5OJPTVN.cjs');
137
150
 
138
151
 
139
152
 
@@ -141,12 +154,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
141
154
 
142
155
 
143
156
 
144
- var _chunk73MC7ZL6cjs = require('./chunk-73MC7ZL6.cjs');
157
+ var _chunk75X755YZcjs = require('./chunk-75X755YZ.cjs');
145
158
 
146
159
 
147
160
 
148
161
 
149
- var _chunkEFCQPQMGcjs = require('./chunk-EFCQPQMG.cjs');
162
+ var _chunkB5PFZLKVcjs = require('./chunk-B5PFZLKV.cjs');
150
163
 
151
164
 
152
165
 
@@ -163,7 +176,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
163
176
  var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
164
177
 
165
178
 
166
- var _chunkVFQT3LAOcjs = require('./chunk-VFQT3LAO.cjs');
179
+ var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
167
180
 
168
181
 
169
182
  var _chunk4ZFL5GFNcjs = require('./chunk-4ZFL5GFN.cjs');
@@ -183,10 +196,10 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
183
196
 
184
197
 
185
198
 
186
- var _chunkFTFYRMQQcjs = require('./chunk-FTFYRMQQ.cjs');
199
+ var _chunkUJZLSXUBcjs = require('./chunk-UJZLSXUB.cjs');
187
200
 
188
201
 
189
- var _chunkULAWS2PAcjs = require('./chunk-ULAWS2PA.cjs');
202
+ var _chunkLPFV45AYcjs = require('./chunk-LPFV45AY.cjs');
190
203
 
191
204
 
192
205
 
@@ -196,7 +209,10 @@ var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
196
209
 
197
210
 
198
211
 
199
- var _chunk3BU22U3Mcjs = require('./chunk-3BU22U3M.cjs');
212
+ var _chunkG2TEB74Scjs = require('./chunk-G2TEB74S.cjs');
213
+
214
+
215
+ var _chunkUXHS27O6cjs = require('./chunk-UXHS27O6.cjs');
200
216
 
201
217
 
202
218
  var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
@@ -205,11 +221,11 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
205
221
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
206
222
 
207
223
 
208
- var _chunkXBML5KMGcjs = require('./chunk-XBML5KMG.cjs');
224
+ var _chunkU6MPZ35Qcjs = require('./chunk-U6MPZ35Q.cjs');
209
225
 
210
226
 
211
227
 
212
- var _chunkSJNMVDDFcjs = require('./chunk-SJNMVDDF.cjs');
228
+ var _chunkFUCSUGDMcjs = require('./chunk-FUCSUGDM.cjs');
213
229
 
214
230
 
215
231
 
@@ -224,7 +240,7 @@ var _chunkXJXBIP67cjs = require('./chunk-XJXBIP67.cjs');
224
240
  var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
225
241
 
226
242
 
227
- var _chunkXCACDAZZcjs = require('./chunk-XCACDAZZ.cjs');
243
+ var _chunkNDILNQ4Lcjs = require('./chunk-NDILNQ4L.cjs');
228
244
 
229
245
 
230
246
  var _chunk75RZHGLScjs = require('./chunk-75RZHGLS.cjs');
@@ -262,7 +278,7 @@ var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
262
278
 
263
279
 
264
280
 
265
- var _chunkOMVAU7NTcjs = require('./chunk-OMVAU7NT.cjs');
281
+ var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
266
282
 
267
283
 
268
284
  var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
@@ -270,7 +286,8 @@ var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
270
286
 
271
287
 
272
288
 
273
- var _chunkBMWDEBXOcjs = require('./chunk-BMWDEBXO.cjs');
289
+
290
+ var _chunkSHLXACIOcjs = require('./chunk-SHLXACIO.cjs');
274
291
 
275
292
 
276
293
 
@@ -296,9 +313,6 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
296
313
  var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
297
314
 
298
315
 
299
- var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
300
-
301
-
302
316
 
303
317
 
304
318
  var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
@@ -308,7 +322,10 @@ var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
308
322
  var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
309
323
 
310
324
 
311
- var _chunkYC6V7PWEcjs = require('./chunk-YC6V7PWE.cjs');
325
+ var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
326
+
327
+
328
+ var _chunkNQ6QFZWDcjs = require('./chunk-NQ6QFZWD.cjs');
312
329
 
313
330
 
314
331
 
@@ -346,7 +363,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
346
363
  var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
347
364
 
348
365
 
349
- var _chunk27ZWSI3Wcjs = require('./chunk-27ZWSI3W.cjs');
366
+ var _chunkADOAUDQ6cjs = require('./chunk-ADOAUDQ6.cjs');
350
367
 
351
368
 
352
369
  var _chunkYX3DBN4Mcjs = require('./chunk-YX3DBN4M.cjs');
@@ -360,10 +377,11 @@ var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
360
377
 
361
378
 
362
379
 
363
- var _chunkUXFQ3UDAcjs = require('./chunk-UXFQ3UDA.cjs');
380
+
381
+ var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
364
382
 
365
383
 
366
- var _chunkU4KT7QP3cjs = require('./chunk-U4KT7QP3.cjs');
384
+ var _chunkOW67PDDScjs = require('./chunk-OW67PDDS.cjs');
367
385
 
368
386
 
369
387
 
@@ -826,6 +844,7 @@ function getClientModuleHydrationPlan(modulePath, root, mode = "off", options =
826
844
  }
827
845
  const inspection = collectIsolatedClientBoundaries(resolvedPath, root, {
828
846
  allowDynamicCardinality: asyncOwner,
847
+ allowElementProps: asyncOwner,
829
848
  staticPackageBoundaries: asyncOwner
830
849
  });
831
850
  if (inspection.boundaries.length === 0) {
@@ -1323,7 +1342,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
1323
1342
  fallbackReason = `the client boundary imported from ${specifier} renders inside <${container}>, where the HTML parser relocates its hydration marker`;
1324
1343
  return 0;
1325
1344
  }
1326
- if (passesElementValuedProps(content, localBindings)) {
1345
+ if (!options.allowElementProps && passesElementValuedProps(content, localBindings)) {
1327
1346
  fallbackReason = `the client boundary imported from ${specifier} receives React elements, which cannot cross the boundary as serialized props`;
1328
1347
  return 0;
1329
1348
  }
@@ -1372,10 +1391,12 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
1372
1391
  };
1373
1392
  }
1374
1393
  let importsClientBoundary = false;
1394
+ let importsAsyncOwner = false;
1375
1395
  let importedIslandStrategy = null;
1376
1396
  for (const specifier of getImportSpecifiers(content)) {
1377
1397
  const imported = resolveImportedModule(resolvedPath, specifier, root);
1378
1398
  const importedMetadata = imported.local ? inspectClientModuleMetadata(imported.path, root, visited, false) : inspectPackageClientBoundary(imported.path, root, visited);
1399
+ if (importedMetadata.suppressedAsyncHydration) importsAsyncOwner = true;
1379
1400
  if (importedMetadata.isClientComponent || importedMetadata.shouldHydrate) {
1380
1401
  importsClientBoundary = true;
1381
1402
  if (importedIslandStrategy === null) {
@@ -1386,7 +1407,7 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
1386
1407
  }
1387
1408
  }
1388
1409
  const shouldHydrate = parsed.hasHydrateExport || importsClientBoundary;
1389
- if (shouldHydrate && hasAsyncDefaultExport(content)) {
1410
+ if (shouldHydrate && hasAsyncDefaultExport(content) || importsAsyncOwner) {
1390
1411
  return {
1391
1412
  isClientComponent: false,
1392
1413
  shouldHydrate: false,
@@ -2003,7 +2024,7 @@ var _RouteManager = class _RouteManager {
2003
2024
  this.redirects.clear();
2004
2025
  this.programmaticPages.clear();
2005
2026
  this.programmaticLayouts.clear();
2006
- for (const source of _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, this.config)) {
2027
+ for (const source of _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, this.config)) {
2007
2028
  await this.discoverFileRoutes(source);
2008
2029
  await this.discoverProgrammaticRoutes(source);
2009
2030
  }
@@ -2025,8 +2046,8 @@ var _RouteManager = class _RouteManager {
2025
2046
  )
2026
2047
  );
2027
2048
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
2028
- (left, right) => _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2029
- ).map((entry) => ({ entry, groupScope: _chunkIPXLADVOcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2049
+ (left, right) => _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2050
+ ).map((entry) => ({ entry, groupScope: _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2030
2051
  for (const slot of this.routeSlots.values()) {
2031
2052
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
2032
2053
  this.routeSlotOwnerSegments.set(
@@ -2268,7 +2289,7 @@ var _RouteManager = class _RouteManager {
2268
2289
  }
2269
2290
  return absolutePath;
2270
2291
  }, "toUrlPath");
2271
- const integrationProviders = _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2292
+ const integrationProviders = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2272
2293
  (provider) => provider.component || provider.type === "clerk"
2273
2294
  );
2274
2295
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -2307,7 +2328,7 @@ var _RouteManager = class _RouteManager {
2307
2328
  );
2308
2329
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
2309
2330
  entry,
2310
- metadata: _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2331
+ metadata: _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2311
2332
  entry.modulePath,
2312
2333
  normalizedProjectRoot,
2313
2334
  isolatedMode,
@@ -2315,7 +2336,7 @@ var _RouteManager = class _RouteManager {
2315
2336
  )
2316
2337
  }));
2317
2338
  const markdownFallback = routeEntries.find(
2318
- ({ entry, metadata }) => _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2339
+ ({ entry, metadata }) => _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2319
2340
  );
2320
2341
  if (markdownFallback) {
2321
2342
  _chunk5QIKR7RRcjs.logger.warn(
@@ -2323,7 +2344,7 @@ var _RouteManager = class _RouteManager {
2323
2344
  );
2324
2345
  }
2325
2346
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _121 => _121.find, 'call', _122 => _122(
2326
- ({ entry, metadata }) => _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2347
+ ({ entry, metadata }) => _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2327
2348
  ), 'optionalAccess', _123 => _123.metadata, 'access', _124 => _124.staticPackageBoundaries]);
2328
2349
  if (markdownStaticPackages) {
2329
2350
  _chunk5QIKR7RRcjs.logger.info(
@@ -2331,7 +2352,7 @@ var _RouteManager = class _RouteManager {
2331
2352
  );
2332
2353
  }
2333
2354
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2334
- if (_chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2355
+ if (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2335
2356
  _chunk5QIKR7RRcjs.logger.info(
2336
2357
  `[Farm.js] ${entry.pattern} is async, so it renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
2337
2358
  );
@@ -2339,15 +2360,15 @@ var _RouteManager = class _RouteManager {
2339
2360
  enforceFarmIsolatedHydrationRouteBudget(
2340
2361
  layoutEntries.map(({ entry, metadata }) => ({
2341
2362
  pattern: entry.pattern,
2342
- depth: _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2363
+ depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2343
2364
  metadata
2344
2365
  })),
2345
2366
  routeEntries.map(({ entry, metadata }) => ({
2346
2367
  pattern: getRouteEntryDirectory(entry),
2347
- depth: _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2368
+ depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2348
2369
  metadata
2349
2370
  })),
2350
- _chunkIPXLADVOcjs.routeBoundaryCoversDirectory
2371
+ _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory
2351
2372
  );
2352
2373
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2353
2374
  if (!metadata.costGuardExceeded) continue;
@@ -2366,7 +2387,7 @@ var _RouteManager = class _RouteManager {
2366
2387
  const routes = routeEntries.map(({ entry, metadata }) => {
2367
2388
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
2368
2389
  const layoutShouldHydrate = layoutEntries.some(
2369
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkIPXLADVOcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2390
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2370
2391
  );
2371
2392
  return {
2372
2393
  pattern: entry.pattern,
@@ -2485,19 +2506,19 @@ var _RouteManager = class _RouteManager {
2485
2506
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
2486
2507
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
2487
2508
  }
2488
- if (_chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2509
+ if (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2489
2510
  const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
2490
- const components = await _chunk73MC7ZL6cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2511
+ const components = await _chunk75X755YZcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2491
2512
  root: this.config.root,
2492
- loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
2513
+ loadModule: this.viteServer ? (componentModulePath) => _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
2493
2514
  });
2494
- return await _chunk73MC7ZL6cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2515
+ return await _chunk75X755YZcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2495
2516
  components,
2496
2517
  config: mdxConfig
2497
2518
  });
2498
2519
  }
2499
2520
  if (this.viteServer) {
2500
- const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2521
+ const module = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2501
2522
  return module;
2502
2523
  } else {
2503
2524
  const module = await import(
@@ -2522,7 +2543,7 @@ var _RouteManager = class _RouteManager {
2522
2543
  return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
2523
2544
  }
2524
2545
  if (this.viteServer) {
2525
- const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2546
+ const module = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2526
2547
  return module;
2527
2548
  } else {
2528
2549
  const module = await import(
@@ -2541,7 +2562,7 @@ var _RouteManager = class _RouteManager {
2541
2562
  */
2542
2563
  createRoutePattern(route) {
2543
2564
  if (route.segments.length === 0) return "/";
2544
- return "/" + route.segments.map(_chunkIPXLADVOcjs.formatRouteSegment).join("/");
2565
+ return "/" + route.segments.map(_chunkLOFKRKO7cjs.formatRouteSegment).join("/");
2545
2566
  }
2546
2567
  registerPageRoute(entry) {
2547
2568
  _chunkNO3WWW3Ncjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -2592,8 +2613,8 @@ var _RouteManager = class _RouteManager {
2592
2613
  }
2593
2614
  }
2594
2615
  for (const [pattern, group] of canonicalPageGroups) {
2595
- const componentFiles = group.files.filter((file) => !_chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, file));
2596
- const markdownFiles = group.files.filter(_chunkEFCQPQMGcjs.isFarmMarkdownPageFile);
2616
+ const componentFiles = group.files.filter((file) => !_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, file));
2617
+ const markdownFiles = group.files.filter(_chunkB5PFZLKVcjs.isFarmMarkdownPageFile);
2597
2618
  if (componentFiles.length > 1) {
2598
2619
  throw new Error(
2599
2620
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
@@ -2635,7 +2656,7 @@ var _RouteManager = class _RouteManager {
2635
2656
  for (const file of files) {
2636
2657
  const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
2637
2658
  const modulePath = path9.default.join(appDir, file);
2638
- const pattern = _chunkIPXLADVOcjs.createRouteDirectoryPattern.call(void 0, route);
2659
+ const pattern = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
2639
2660
  const existing = target.get(pattern);
2640
2661
  if (_optionalChain([existing, 'optionalAccess', _129 => _129.sourceRoot]) === source.root) {
2641
2662
  throw new Error(
@@ -2657,7 +2678,7 @@ var _RouteManager = class _RouteManager {
2657
2678
  const modulePath = path9.default.join(appDir, file);
2658
2679
  const pattern = this.createRoutePattern(slot.route);
2659
2680
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
2660
- const ownerDirectory = _chunkIPXLADVOcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2681
+ const ownerDirectory = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2661
2682
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
2662
2683
  const existing = this.routeSlots.get(key);
2663
2684
  if (_optionalChain([existing, 'optionalAccess', _130 => _130.sourceRoot]) === source.root) {
@@ -2733,7 +2754,7 @@ var _RouteManager = class _RouteManager {
2733
2754
  }
2734
2755
  }
2735
2756
  async discoverProgrammaticRoutes(source) {
2736
- const manifests = await _chunkSJNMVDDFcjs.loadProgrammaticRouteManifests.call(void 0, {
2757
+ const manifests = await _chunkFUCSUGDMcjs.loadProgrammaticRouteManifests.call(void 0, {
2737
2758
  root: source.root,
2738
2759
  srcDir: source.srcDir,
2739
2760
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (filePath) => this.loadProgrammaticRoutesModule(filePath), "loadModule")
@@ -2762,7 +2783,7 @@ var _RouteManager = class _RouteManager {
2762
2783
  }
2763
2784
  if (definition.kind === "layout") {
2764
2785
  const route = _chunk6V4TDWECcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
2765
- const pattern = _chunkIPXLADVOcjs.createRouteDirectoryPattern.call(void 0, route);
2786
+ const pattern = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
2766
2787
  const existing = this.layouts.get(pattern);
2767
2788
  if (_optionalChain([existing, 'optionalAccess', _134 => _134.sourceRoot]) === source.root) {
2768
2789
  throw new Error(
@@ -2794,11 +2815,11 @@ var _RouteManager = class _RouteManager {
2794
2815
  async loadProgrammaticRoutesModule(filePath) {
2795
2816
  if (this.viteServer) {
2796
2817
  const viteRoot = _optionalChain([this, 'access', _135 => _135.viteServer, 'access', _136 => _136.config, 'optionalAccess', _137 => _137.root]) || this.config.root || process.cwd();
2797
- return await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, filePath, viteRoot));
2818
+ return await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, filePath, viteRoot));
2798
2819
  }
2799
2820
  return await import(
2800
2821
  /* @vite-ignore */
2801
- _chunkBMWDEBXOcjs.toFileModuleUrl.call(void 0, filePath)
2822
+ _chunkSHLXACIOcjs.toFileModuleUrl.call(void 0, filePath)
2802
2823
  );
2803
2824
  }
2804
2825
  /**
@@ -2809,7 +2830,7 @@ var _RouteManager = class _RouteManager {
2809
2830
  const matchingLayouts = [];
2810
2831
  for (const { entry, groupScope } of this.orderedLayouts) {
2811
2832
  if (!_chunk5QIKR7RRcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
2812
- if (groupScope !== null && !_chunkIPXLADVOcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2833
+ if (groupScope !== null && !_chunkLOFKRKO7cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2813
2834
  continue;
2814
2835
  }
2815
2836
  matchingLayouts.push(entry);
@@ -2890,14 +2911,14 @@ var _RouteManager = class _RouteManager {
2890
2911
  let page = route;
2891
2912
  for (const boundaryEntry of boundaries.values()) {
2892
2913
  if (!_chunk5QIKR7RRcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
2893
- const groupScope = _chunkIPXLADVOcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2914
+ const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2894
2915
  if (groupScope !== null) {
2895
2916
  if (page === void 0) page = this.matchPageRoute(_chunk5QIKR7RRcjs.splitRoutePath.call(void 0, normalizedPath));
2896
- if (!_chunkIPXLADVOcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2917
+ if (!_chunkLOFKRKO7cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2897
2918
  }
2898
2919
  const depth = boundaryEntry.route.segments.length;
2899
2920
  const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _138 => _138.route, 'access', _139 => _139.segments, 'access', _140 => _140.length]), () => ( -1));
2900
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2921
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2901
2922
  bestMatch = boundaryEntry;
2902
2923
  }
2903
2924
  }
@@ -2934,7 +2955,7 @@ var _RouteManager = class _RouteManager {
2934
2955
  pattern: entry.pattern
2935
2956
  }));
2936
2957
  const i18n = this.getI18nConfig();
2937
- const result = await _chunk3BHT4WMPcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2958
+ const result = await _chunk5D2JIPLHcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2938
2959
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
2939
2960
  });
2940
2961
  if (!i18n) {
@@ -2979,7 +3000,7 @@ var _RouteManager = class _RouteManager {
2979
3000
  async isRouteSSG(modulePath) {
2980
3001
  try {
2981
3002
  const mod = await this.loadRouteModule(modulePath);
2982
- const rendering = await _chunk3BHT4WMPcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3003
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2983
3004
  return rendering.ssg;
2984
3005
  } catch (e10) {
2985
3006
  return false;
@@ -2991,7 +3012,7 @@ var _RouteManager = class _RouteManager {
2991
3012
  async hasRouteISR(modulePath) {
2992
3013
  try {
2993
3014
  const mod = await this.loadRouteModule(modulePath);
2994
- const rendering = await _chunk3BHT4WMPcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3015
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2995
3016
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
2996
3017
  } catch (e11) {
2997
3018
  return false;
@@ -3003,7 +3024,7 @@ var _RouteManager = class _RouteManager {
3003
3024
  async getRouteRevalidateInterval(modulePath) {
3004
3025
  try {
3005
3026
  const mod = await this.loadRouteModule(modulePath);
3006
- const rendering = await _chunk3BHT4WMPcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3027
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3007
3028
  return rendering.revalidate;
3008
3029
  } catch (e12) {
3009
3030
  return void 0;
@@ -3013,7 +3034,7 @@ var _RouteManager = class _RouteManager {
3013
3034
  _chunkS3JO3N4Hcjs.__name.call(void 0, _RouteManager, "RouteManager");
3014
3035
  var RouteManager = _RouteManager;
3015
3036
  function getPageDirectoryField(route, pattern) {
3016
- const directory = _chunkIPXLADVOcjs.createRouteDirectoryPattern.call(void 0, route);
3037
+ const directory = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
3017
3038
  return directory === pattern ? {} : { directory };
3018
3039
  }
3019
3040
  _chunkS3JO3N4Hcjs.__name.call(void 0, getPageDirectoryField, "getPageDirectoryField");
@@ -4393,7 +4414,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
4393
4414
  let hasClerkProvider = false;
4394
4415
  renderedProviders.forEach((provider, index) => {
4395
4416
  let componentExpression = "null";
4396
- if (_chunkFTFYRMQQcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4417
+ if (_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4397
4418
  const namespace = `FarmIntegrationProviderModule${index}`;
4398
4419
  imports.push(
4399
4420
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4452,7 +4473,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
4452
4473
  const entries = [];
4453
4474
  let needsMarkHelper = false;
4454
4475
  providers.forEach((provider, index) => {
4455
- if (!_chunkFTFYRMQQcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4476
+ if (!_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4456
4477
  const namespace = `FarmServerIntegrationProviderModule${index}`;
4457
4478
  imports.push(
4458
4479
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4674,7 +4695,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
4674
4695
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
4675
4696
  if (snapshot.routing === "none") return "";
4676
4697
  const url = new URL(requestPath, "http://farm.local");
4677
- return _chunkIPXLADVOcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4698
+ return _chunkLOFKRKO7cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4678
4699
  }
4679
4700
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
4680
4701
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
@@ -4805,6 +4826,16 @@ function createRouteStateProps(input) {
4805
4826
  };
4806
4827
  }
4807
4828
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteStateProps, "createRouteStateProps");
4829
+ function readAppPackageIdentity(root) {
4830
+ try {
4831
+ return JSON.parse(
4832
+ fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
4833
+ );
4834
+ } catch (e18) {
4835
+ return {};
4836
+ }
4837
+ }
4838
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readAppPackageIdentity, "readAppPackageIdentity");
4808
4839
  var _ServerRenderer = class _ServerRenderer {
4809
4840
  constructor(config, routeManager, i18nRuntime, viteServer) {
4810
4841
  this.ssgManifest = [];
@@ -4813,15 +4844,15 @@ var _ServerRenderer = class _ServerRenderer {
4813
4844
  this.routeManager = routeManager;
4814
4845
  this.i18nRuntime = i18nRuntime;
4815
4846
  this.viteServer = viteServer;
4816
- this.security = _chunkRU3M2FIKcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4847
+ this.security = _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4817
4848
  this.loadSSGManifest();
4818
4849
  }
4819
4850
  async initialize() {
4820
4851
  if (this.rendererRuntime) return;
4821
4852
  if (_optionalChain([this, 'access', _152 => _152.config, 'access', _153 => _153.notFound, 'optionalAccess', _154 => _154.component, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()])) {
4822
- resolveFarmNotFoundComponentPath(this.config, _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config));
4853
+ resolveFarmNotFoundComponentPath(this.config, _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, this.config));
4823
4854
  }
4824
- const loaded = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4855
+ const loaded = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4825
4856
  _chunkPSV6XKPOcjs.resolveFarmRendererModule.call(void 0,
4826
4857
  this.config.root || process.cwd(),
4827
4858
  this.config.renderer.server
@@ -4863,7 +4894,7 @@ var _ServerRenderer = class _ServerRenderer {
4863
4894
  `Renderer \`${this.config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`
4864
4895
  );
4865
4896
  }
4866
- const setupModule = this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
4897
+ const setupModule = this.viteServer ? await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
4867
4898
  if (setupModule === this.appliedAppSetupModule) return;
4868
4899
  this.appliedAppSetupModule = setupModule;
4869
4900
  configureApp(setupModule.default);
@@ -5047,7 +5078,7 @@ var _ServerRenderer = class _ServerRenderer {
5047
5078
  return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
5048
5079
  }
5049
5080
  async runWithRequestContext(request2, fn) {
5050
- return _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0,
5081
+ return _chunkNICDYKBScjs._runWithCurrentRequest.call(void 0,
5051
5082
  request2,
5052
5083
  () => _optionalChain([this, 'access', _162 => _162.i18nRuntime, 'optionalAccess', _163 => _163.config, 'access', _164 => _164.enabled]) ? _chunkXJXBIP67cjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
5053
5084
  redirect: false
@@ -5080,7 +5111,7 @@ var _ServerRenderer = class _ServerRenderer {
5080
5111
  * Check if a path should be served from SSG cache
5081
5112
  */
5082
5113
  async shouldServeSSG(pathname) {
5083
- const ssgPage = _chunk3BHT4WMPcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5114
+ const ssgPage = _chunk5D2JIPLHcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5084
5115
  if (!ssgPage) return null;
5085
5116
  const cached = await this.getCachedSSGPage(pathname);
5086
5117
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -5314,13 +5345,13 @@ var _ServerRenderer = class _ServerRenderer {
5314
5345
  if (this.viteServer) await this.applyRendererAppSetup();
5315
5346
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
5316
5347
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
5317
- const cspNonce = _chunkRU3M2FIKcjs.createFarmCspNonce.call(void 0, this.security);
5348
+ const cspNonce = _chunkMRMI32SNcjs.createFarmCspNonce.call(void 0, this.security);
5318
5349
  if (cspNonce) {
5319
5350
  req.__FARM_CSP_NONCE__ = cspNonce;
5320
- const header = _chunkRU3M2FIKcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5351
+ const header = _chunkMRMI32SNcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5321
5352
  res.setHeader(header.key, header.value);
5322
5353
  }
5323
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5354
+ const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
5324
5355
  trustProxy: _optionalChain([this, 'access', _167 => _167.config, 'access', _168 => _168.server, 'optionalAccess', _169 => _169.trustProxy])
5325
5356
  });
5326
5357
  const runtime = this.i18nRuntime;
@@ -5367,7 +5398,7 @@ var _ServerRenderer = class _ServerRenderer {
5367
5398
  });
5368
5399
  }, "completeRender");
5369
5400
  try {
5370
- const url = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5401
+ const url = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5371
5402
  pathname = url.pathname;
5372
5403
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
5373
5404
  searchParamsObject = _chunkQNPEUFHQcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -5388,6 +5419,11 @@ var _ServerRenderer = class _ServerRenderer {
5388
5419
  completeRender(res.statusCode || 200, pathname);
5389
5420
  return;
5390
5421
  }
5422
+ if (pathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
5423
+ await this.renderGeneratedSitemap(req, res);
5424
+ completeRender(res.statusCode || 200, pathname);
5425
+ return;
5426
+ }
5391
5427
  const metadataImageMatch = this.routeManager.matchMetadataImage(pathname);
5392
5428
  if (metadataImageMatch) {
5393
5429
  await this.renderMetadataImage(req, res, {
@@ -5425,6 +5461,11 @@ var _ServerRenderer = class _ServerRenderer {
5425
5461
  layouts = match.layouts;
5426
5462
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
5427
5463
  if (!route) {
5464
+ if (_chunkPTZ2TVNEcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5465
+ await this.renderDefaultMCP(req, res);
5466
+ completeRender(res.statusCode || 200, pathname);
5467
+ return;
5468
+ }
5428
5469
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "route.notFound", pathname });
5429
5470
  await this.render404(req, res);
5430
5471
  completeRender(404);
@@ -5440,10 +5481,10 @@ var _ServerRenderer = class _ServerRenderer {
5440
5481
  errorBoundaryEntry = this.routeManager.getMatchingError(pathname, route);
5441
5482
  middlewareMap = toMiddlewareMap(req.__FARM_MIDDLEWARE_DATA__);
5442
5483
  middlewareContext = toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__);
5443
- pluginExposedContext = _chunkOMVAU7NTcjs.getRequestContextSnapshot.call(void 0, req, {
5484
+ pluginExposedContext = _chunkKIIMAWOJcjs.getRequestContextSnapshot.call(void 0, req, {
5444
5485
  exposedOnly: true
5445
5486
  });
5446
- const currentRequest = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5487
+ const currentRequest = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
5447
5488
  trustProxy: _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.server, 'optionalAccess', _177 => _177.trustProxy])
5448
5489
  });
5449
5490
  const routeContext = await this.resolveRouteContext({
@@ -5498,7 +5539,7 @@ var _ServerRenderer = class _ServerRenderer {
5498
5539
  throw error;
5499
5540
  }
5500
5541
  }
5501
- const renderingConfig = await _chunk3BHT4WMPcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5542
+ const renderingConfig = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5502
5543
  routeModule,
5503
5544
  route.modulePath,
5504
5545
  { experimentalPPR: _optionalChain([this, 'access', _180 => _180.config, 'access', _181 => _181.experimental, 'optionalAccess', _182 => _182.ppr]) === true }
@@ -5558,8 +5599,8 @@ var _ServerRenderer = class _ServerRenderer {
5558
5599
  key: pprCacheKey
5559
5600
  });
5560
5601
  }
5561
- const outerRequest = _chunkU4KT7QP3cjs._resolveCurrentRequest.call(void 0, );
5562
- const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5602
+ const outerRequest = _chunkOW67PDDScjs._resolveCurrentRequest.call(void 0, );
5603
+ const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunkNICDYKBScjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkNICDYKBScjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5563
5604
  const requestReadsBeforeRender = countRequestReads();
5564
5605
  let LoadingFallbackComponent = null;
5565
5606
  if (loadingBoundaryEntry) {
@@ -5741,9 +5782,9 @@ var _ServerRenderer = class _ServerRenderer {
5741
5782
  });
5742
5783
  req.__FARM_METADATA__ = mergedMetadata;
5743
5784
  const middlewareDataForContext = middlewareMap;
5744
- await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5745
- await _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5746
- await _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5785
+ await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5786
+ await _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5787
+ await _chunkNICDYKBScjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5747
5788
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
5748
5789
  if (LoadingFallbackComponent) {
5749
5790
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
@@ -5830,8 +5871,8 @@ var _ServerRenderer = class _ServerRenderer {
5830
5871
  req,
5831
5872
  res,
5832
5873
  () => {
5833
- _chunk3BU22U3Mcjs._clearCurrentMiddlewareData.call(void 0, );
5834
- _chunk3BU22U3Mcjs._clearCurrentMiddlewareContext.call(void 0, );
5874
+ _chunkG2TEB74Scjs._clearCurrentMiddlewareData.call(void 0, );
5875
+ _chunkG2TEB74Scjs._clearCurrentMiddlewareContext.call(void 0, );
5835
5876
  },
5836
5877
  {
5837
5878
  responseHeaders: pprHeaders,
@@ -5921,7 +5962,7 @@ var _ServerRenderer = class _ServerRenderer {
5921
5962
  }
5922
5963
  }
5923
5964
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
5924
- const errorStatus = _chunkIPXLADVOcjs.resolveDefaultErrorStatus.call(void 0, error);
5965
+ const errorStatus = _chunkLOFKRKO7cjs.resolveDefaultErrorStatus.call(void 0, error);
5925
5966
  if (pprRefreshRoute) {
5926
5967
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
5927
5968
  type: "ppr.refresh.error",
@@ -5957,7 +5998,7 @@ var _ServerRenderer = class _ServerRenderer {
5957
5998
  }
5958
5999
  }
5959
6000
  async wrapWithIntegrationProviders(element) {
5960
- const providers = _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, this.config.integrations);
6001
+ const providers = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, this.config.integrations);
5961
6002
  let wrapped = element;
5962
6003
  for (let i = providers.length - 1; i >= 0; i--) {
5963
6004
  const provider = providers[i];
@@ -5975,13 +6016,13 @@ var _ServerRenderer = class _ServerRenderer {
5975
6016
  }
5976
6017
  let ProviderComponent;
5977
6018
  let providerSourceModule;
5978
- if (_chunkFTFYRMQQcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
6019
+ if (_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
5979
6020
  providerSourceModule = provider.component.module;
5980
6021
  const providerModuleId = provider.component.module.startsWith(".") ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0,
5981
6022
  path9.resolve(this.config.root, provider.component.module),
5982
6023
  this.config.root
5983
6024
  ) : provider.component.module;
5984
- const providerModule = this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
6025
+ const providerModule = this.viteServer ? await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
5985
6026
  provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
5986
6027
  );
5987
6028
  ProviderComponent = providerModule[provider.component.export || "default"];
@@ -6130,7 +6171,7 @@ var _ServerRenderer = class _ServerRenderer {
6130
6171
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
6131
6172
  );
6132
6173
  }
6133
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6174
+ const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6134
6175
  trustProxy: _optionalChain([this, 'access', _202 => _202.config, 'access', _203 => _203.server, 'optionalAccess', _204 => _204.trustProxy])
6135
6176
  });
6136
6177
  const url = new URL(request2.url);
@@ -6145,11 +6186,11 @@ var _ServerRenderer = class _ServerRenderer {
6145
6186
  path: match.routePath,
6146
6187
  ...llmsContext
6147
6188
  }) : routeModule.default;
6148
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkRU3M2FIKcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6189
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6149
6190
  origin: url.origin,
6150
6191
  readMarkdown: llmsContext.markdown
6151
6192
  }) : value;
6152
- const response = _chunkIPXLADVOcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6193
+ const response = _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6153
6194
  method,
6154
6195
  request: request2
6155
6196
  });
@@ -6167,25 +6208,25 @@ var _ServerRenderer = class _ServerRenderer {
6167
6208
  }
6168
6209
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
6169
6210
  getGeneratedLlmsKind(pathname) {
6170
- const config = _chunkRU3M2FIKcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6211
+ const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6171
6212
  if (!config.enabled) return null;
6172
6213
  if (pathname === "/llms.txt") return "llms";
6173
6214
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
6174
6215
  }
6175
6216
  async renderGeneratedLlmsTxt(req, res, kind) {
6176
6217
  try {
6177
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6218
+ const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6178
6219
  trustProxy: _optionalChain([this, 'access', _208 => _208.config, 'access', _209 => _209.server, 'optionalAccess', _210 => _210.trustProxy])
6179
6220
  });
6180
- const config = _chunkRU3M2FIKcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6221
+ const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6181
6222
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
6182
- const body = kind === "llms-full" ? await _chunkRU3M2FIKcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6223
+ const body = kind === "llms-full" ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6183
6224
  origin: new URL(request2.url).origin,
6184
6225
  readMarkdown: context.markdown
6185
6226
  }) : context.defaults;
6186
6227
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6187
6228
  res,
6188
- _chunkIPXLADVOcjs.createFarmMetadataRouteResponse.call(void 0,
6229
+ _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0,
6189
6230
  kind,
6190
6231
  body,
6191
6232
  { revalidate: config.revalidate },
@@ -6204,15 +6245,15 @@ var _ServerRenderer = class _ServerRenderer {
6204
6245
  }
6205
6246
  }
6206
6247
  getAgentCrawlers() {
6207
- return _chunkRU3M2FIKcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6248
+ return _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6208
6249
  }
6209
6250
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
6210
6251
  async renderGeneratedRobotsTxt(req, res) {
6211
6252
  try {
6212
- const sitemapPath = _optionalChain([this, 'access', _217 => _217.routeManager, 'access', _218 => _218.matchMetadataRoute, 'call', _219 => _219("/sitemap.xml"), 'optionalAccess', _220 => _220.metadata, 'access', _221 => _221.kind]) === "sitemap" ? "/sitemap.xml" : void 0;
6253
+ const sitemapPath = _optionalChain([this, 'access', _217 => _217.routeManager, 'access', _218 => _218.matchMetadataRoute, 'call', _219 => _219("/sitemap.xml"), 'optionalAccess', _220 => _220.metadata, 'access', _221 => _221.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
6213
6254
  const rootLayout = this.routeManager.getLayouts().get("/");
6214
6255
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6215
- const robots = _chunkRU3M2FIKcjs.createFarmAgentRobots.call(void 0, {
6256
+ const robots = _chunkMRMI32SNcjs.createFarmAgentRobots.call(void 0, {
6216
6257
  crawlers: this.getAgentCrawlers(),
6217
6258
  sitemapPath,
6218
6259
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _222 => _222.metadataBase]),
@@ -6220,7 +6261,7 @@ var _ServerRenderer = class _ServerRenderer {
6220
6261
  });
6221
6262
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6222
6263
  res,
6223
- _chunkIPXLADVOcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6264
+ _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6224
6265
  );
6225
6266
  } catch (error) {
6226
6267
  _chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -6233,9 +6274,115 @@ var _ServerRenderer = class _ServerRenderer {
6233
6274
  );
6234
6275
  }
6235
6276
  }
6277
+ getAgentSitemap() {
6278
+ return _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.sitemap]));
6279
+ }
6280
+ /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
6281
+ async renderGeneratedSitemap(req, res) {
6282
+ try {
6283
+ const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6284
+ trustProxy: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.server, 'optionalAccess', _228 => _228.trustProxy])
6285
+ });
6286
+ const sources = await Promise.all(
6287
+ [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => {
6288
+ const [module, stat] = await Promise.all([
6289
+ this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
6290
+ _chunk5QIKR7RRcjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
6291
+ return void 0;
6292
+ }),
6293
+ fs5.promises.stat(route.modulePath).catch(() => void 0)
6294
+ ]);
6295
+ return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _229 => _229.mtime, 'access', _230 => _230.toISOString, 'call', _231 => _231()]) };
6296
+ })
6297
+ );
6298
+ const rootLayout = this.routeManager.getLayouts().get("/");
6299
+ const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6300
+ const sitemap = _chunkMRMI32SNcjs.createFarmDefaultSitemap.call(void 0, sources, {
6301
+ origin: new URL(request2.url).origin,
6302
+ config: this.getAgentSitemap(),
6303
+ metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _232 => _232.metadataBase]),
6304
+ basePath: this.config.basePath
6305
+ });
6306
+ await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6307
+ res,
6308
+ _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6309
+ );
6310
+ } catch (error) {
6311
+ _chunk5QIKR7RRcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
6312
+ await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6313
+ res,
6314
+ new Response("Internal Server Error", {
6315
+ status: 500,
6316
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
6317
+ })
6318
+ );
6319
+ }
6320
+ }
6321
+ /** Lets the default MCP server see the app's API routes, which the dev server owns. */
6322
+ setAPIRouteLookup(exists) {
6323
+ this.apiRouteExists = exists;
6324
+ }
6325
+ /**
6326
+ * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
6327
+ * server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
6328
+ * or a registered server such as the docs engine's. Production applies the same rules.
6329
+ */
6330
+ getDefaultMCPServer() {
6331
+ if (_optionalChain([this, 'access', _233 => _233.config, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.mcp]) !== true || _chunkPTZ2TVNEcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6332
+ if (_optionalChain([this, 'access', _236 => _236.apiRouteExists, 'optionalCall', _237 => _237("/api/mcp")])) return void 0;
6333
+ if (this.routeManager.matchRoute(_chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6334
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0,
6335
+ readAppPackageIdentity(this.config.root),
6336
+ _chunkNQ6QFZWDcjs.FARM_VERSION
6337
+ ))));
6338
+ return _chunkPTZ2TVNEcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6339
+ }
6340
+ async renderDefaultMCP(req, res) {
6341
+ const server = this.getDefaultMCPServer();
6342
+ const request2 = _nullishCoalesce(_chunkNICDYKBScjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _238 => _238.config, 'access', _239 => _239.server, 'optionalAccess', _240 => _240.trustProxy]) })));
6343
+ try {
6344
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-SJAHFSPI.cjs");
6345
+ const origin = new URL(request2.url).origin;
6346
+ const response = await handleFarmDefaultMCPRequest(request2, {
6347
+ server,
6348
+ basePath: this.config.basePath,
6349
+ listPages: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
6350
+ const sources = await Promise.all(
6351
+ [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => ({
6352
+ pattern,
6353
+ // The page itself surfaces a load error. Without its module a guard cannot
6354
+ // be ruled out, so the page is left out.
6355
+ module: await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }))
6356
+ }))
6357
+ );
6358
+ return _chunkPTZ2TVNEcjs.collectFarmDefaultMCPPages.call(void 0, sources, {
6359
+ origin,
6360
+ basePath: this.config.basePath,
6361
+ markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md)
6362
+ });
6363
+ }, "listPages"),
6364
+ // Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
6365
+ readMarkdown: this.createDevMarkdownReader(req)
6366
+ });
6367
+ await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
6368
+ } catch (error) {
6369
+ _chunk5QIKR7RRcjs.logger.error(`Default MCP server failed: ${error}`);
6370
+ await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6371
+ res,
6372
+ new Response(
6373
+ JSON.stringify({
6374
+ jsonrpc: "2.0",
6375
+ id: null,
6376
+ error: { code: -32603, message: "Internal error." }
6377
+ }),
6378
+ { status: 500, headers: { "Content-Type": "application/json" } }
6379
+ )
6380
+ );
6381
+ }
6382
+ }
6236
6383
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
6237
6384
  async createLlmsTxtContext(request2, options = {}) {
6238
- const config = _chunkRU3M2FIKcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.llmsTxt]));
6385
+ const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _241 => _241.config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.llmsTxt]));
6239
6386
  const origin = new URL(request2.url).origin;
6240
6387
  const staticRoutes = [...this.routeManager.getRoutes()].filter(
6241
6388
  ([pattern]) => !pattern.includes("[")
@@ -6253,7 +6400,7 @@ var _ServerRenderer = class _ServerRenderer {
6253
6400
  );
6254
6401
  const rootLayout = this.routeManager.getLayouts().get("/");
6255
6402
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6256
- const pages = _chunkRU3M2FIKcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6403
+ const pages = _chunk4WQ6PGSJcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6257
6404
  origin,
6258
6405
  basePath: this.config.basePath,
6259
6406
  markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md),
@@ -6262,18 +6409,19 @@ var _ServerRenderer = class _ServerRenderer {
6262
6409
  });
6263
6410
  return {
6264
6411
  pages,
6265
- defaults: _chunkRU3M2FIKcjs.createFarmDefaultLlmsTxt.call(void 0, {
6412
+ defaults: _chunk4WQ6PGSJcjs.createFarmDefaultLlmsTxt.call(void 0, {
6266
6413
  origin,
6267
6414
  pages,
6268
6415
  config,
6269
6416
  rootMetadata,
6270
- mcp: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.aiCatalog]) === false ? [] : _chunkIPXLADVOcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6417
+ mcp: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.aiCatalog]) === false ? [] : _chunkLOFKRKO7cjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6271
6418
  basePath: this.config.basePath,
6272
6419
  apiServerBasePath: _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0,
6273
6420
  _chunkS3A45T7Fcjs.normalizeFarmAPIConfig.call(void 0,
6274
6421
  this.config.api
6275
6422
  )
6276
- )
6423
+ ),
6424
+ defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => this.getDefaultMCPServer(), "defaultMCP")
6277
6425
  })
6278
6426
  }),
6279
6427
  ...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
@@ -6289,17 +6437,17 @@ var _ServerRenderer = class _ServerRenderer {
6289
6437
  * body is discarded.
6290
6438
  */
6291
6439
  createDevMarkdownReader(req) {
6292
- const socket = _optionalChain([req, 'optionalAccess', _229 => _229.socket]);
6293
- if (_optionalChain([req, 'optionalAccess', _230 => _230.method, 'optionalAccess', _231 => _231.toUpperCase, 'call', _232 => _232()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _233 => _233.localAddress]) || !socket.localPort) {
6440
+ const socket = _optionalChain([req, 'optionalAccess', _247 => _247.socket]);
6441
+ if (_optionalChain([req, 'optionalAccess', _248 => _248.method, 'optionalAccess', _249 => _249.toUpperCase, 'call', _250 => _250()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _251 => _251.localAddress]) || !socket.localPort) {
6294
6442
  return async () => null;
6295
6443
  }
6296
6444
  if (socket.encrypted) {
6297
6445
  const address = { host: socket.localAddress, port: socket.localPort };
6298
- return _chunkRU3M2FIKcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6446
+ return _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6299
6447
  }
6300
6448
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
6301
6449
  const localOrigin = `http://${host}:${socket.localPort}`;
6302
- const read = _chunkRU3M2FIKcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6450
+ const read = _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6303
6451
  return (url) => {
6304
6452
  const target = new URL(url);
6305
6453
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -6339,7 +6487,7 @@ var _ServerRenderer = class _ServerRenderer {
6339
6487
  }
6340
6488
  async writeMetadataImageResponse(req, res, value, imageModule) {
6341
6489
  const ifNoneMatch = req.headers["if-none-match"];
6342
- const response = await _chunkEJQT6KZNcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
6490
+ const response = await _chunkWC5UV2HQcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
6343
6491
  method: req.method,
6344
6492
  ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch
6345
6493
  });
@@ -6354,8 +6502,8 @@ var _ServerRenderer = class _ServerRenderer {
6354
6502
  return;
6355
6503
  }
6356
6504
  const etag = `"${image.staticInfo.hash}"`;
6357
- const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
6358
- trustProxy: _optionalChain([this, 'access', _234 => _234.config, 'access', _235 => _235.server, 'optionalAccess', _236 => _236.trustProxy])
6505
+ const requestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
6506
+ trustProxy: _optionalChain([this, 'access', _252 => _252.config, 'access', _253 => _253.server, 'optionalAccess', _254 => _254.trustProxy])
6359
6507
  });
6360
6508
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
6361
6509
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -6366,7 +6514,7 @@ var _ServerRenderer = class _ServerRenderer {
6366
6514
  "Cache-Control",
6367
6515
  isVersioned ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate"
6368
6516
  );
6369
- if (_chunkOMVAU7NTcjs.matchesFarmIfNoneMatch.call(void 0, req.headers["if-none-match"], etag)) {
6517
+ if (_chunkKIIMAWOJcjs.matchesFarmIfNoneMatch.call(void 0, req.headers["if-none-match"], etag)) {
6370
6518
  res.statusCode = 304;
6371
6519
  res.end();
6372
6520
  return;
@@ -6416,9 +6564,9 @@ var _ServerRenderer = class _ServerRenderer {
6416
6564
  });
6417
6565
  }
6418
6566
  wrapped = await this.wrapWithIntegrationProviders(wrapped);
6419
- const html = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
6567
+ const html = await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0,
6420
6568
  options.middlewareMap,
6421
- () => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
6569
+ () => _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0,
6422
6570
  options.middlewareContext,
6423
6571
  () => this.rendererRuntime.renderToString(wrapped)
6424
6572
  )
@@ -6527,11 +6675,11 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
6527
6675
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
6528
6676
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
6529
6677
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6530
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkFTFYRMQQcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6678
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6531
6679
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6532
6680
  </script>`;
6533
6681
  const deferredScript = createDeferredHydrationScript(deferredProps.records);
6534
- const rendererHydrationScript = _optionalChain([this, 'access', _237 => _237.rendererRuntime, 'access', _238 => _238.generateHydrationScript, 'optionalCall', _239 => _239()]) || "";
6682
+ const rendererHydrationScript = _optionalChain([this, 'access', _255 => _255.rendererRuntime, 'access', _256 => _256.generateHydrationScript, 'optionalCall', _257 => _257()]) || "";
6535
6683
  const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(element);
6536
6684
  const {
6537
6685
  title,
@@ -6541,7 +6689,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6541
6689
  viewport: viewportTags
6542
6690
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6543
6691
  pathname: getFarmMetadataPathname(req),
6544
- jsonLd: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.jsonLd])
6692
+ jsonLd: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.agent, 'optionalAccess', _260 => _260.jsonLd])
6545
6693
  });
6546
6694
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
6547
6695
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
@@ -6551,18 +6699,18 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6551
6699
  i18nSnapshot,
6552
6700
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6553
6701
  ) : "";
6554
- const themeDocument = _chunkIPXLADVOcjs.createFarmThemeDocumentParts.call(void 0,
6702
+ const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
6555
6703
  this.config.theme,
6556
6704
  this.config.basePath,
6557
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
6705
+ _chunk4GPOC4LNcjs.getTheme.call(void 0, )
6558
6706
  );
6559
- const fullDocument = _chunkIPXLADVOcjs.extractFarmFullDocument.call(void 0, content);
6707
+ const fullDocument = _chunkLOFKRKO7cjs.extractFarmFullDocument.call(void 0, content);
6560
6708
  let html;
6561
6709
  if (fullDocument) {
6562
6710
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
6563
- const documentHtml = shouldReplaceLayoutTitle ? _chunkIPXLADVOcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6564
- const effectiveRendererHead = hasExplicitTitle ? _chunkIPXLADVOcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6565
- html = _chunkIPXLADVOcjs.composeFarmFullDocument.call(void 0, documentHtml, {
6711
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6712
+ const effectiveRendererHead = hasExplicitTitle ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6713
+ html = _chunkLOFKRKO7cjs.composeFarmFullDocument.call(void 0, documentHtml, {
6566
6714
  fallbackIcon: !hasFavicon,
6567
6715
  viewport: viewportTags,
6568
6716
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -6588,7 +6736,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6588
6736
  });
6589
6737
  } else {
6590
6738
  html = `<!DOCTYPE html>
6591
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _243 => _243.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6739
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _261 => _261.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6592
6740
  <head>
6593
6741
  ${themeDocument.head}
6594
6742
  <meta charset="utf-8">
@@ -6619,7 +6767,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6619
6767
  const securedHtml = this.secureDocumentHTML(req, html);
6620
6768
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
6621
6769
  res.end();
6622
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _244 => _244.onComplete, 'optionalCall', _245 => _245(securedHtml)]);
6770
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _262 => _262.onComplete, 'optionalCall', _263 => _263(securedHtml)]);
6623
6771
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
6624
6772
  type: "render.stream.complete",
6625
6773
  route,
@@ -6629,7 +6777,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6629
6777
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
6630
6778
  throw error;
6631
6779
  } finally {
6632
- _optionalChain([clearMiddlewareData, 'optionalCall', _246 => _246()]);
6780
+ _optionalChain([clearMiddlewareData, 'optionalCall', _264 => _264()]);
6633
6781
  }
6634
6782
  }
6635
6783
  /**
@@ -6644,7 +6792,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6644
6792
  if (!rootLayout) return false;
6645
6793
  try {
6646
6794
  const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
6647
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _247 => _247.prototype, 'optionalAccess', _248 => _248.isReactComponent]) || _optionalChain([Layout, 'access', _249 => _249.constructor, 'optionalAccess', _250 => _250.name]) === "AsyncFunction") {
6795
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _265 => _265.prototype, 'optionalAccess', _266 => _266.isReactComponent]) || _optionalChain([Layout, 'access', _267 => _267.constructor, 'optionalAccess', _268 => _268.name]) === "AsyncFunction") {
6648
6796
  return false;
6649
6797
  }
6650
6798
  const cached = documentLayouts.get(Layout);
@@ -6656,12 +6804,12 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6656
6804
  params: {}
6657
6805
  });
6658
6806
  rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
6659
- } catch (e18) {
6807
+ } catch (e19) {
6660
6808
  rendersDocument = false;
6661
6809
  }
6662
6810
  documentLayouts.set(Layout, rendersDocument);
6663
6811
  return rendersDocument;
6664
- } catch (e19) {
6812
+ } catch (e20) {
6665
6813
  return false;
6666
6814
  }
6667
6815
  }
@@ -6770,7 +6918,7 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
6770
6918
  req.__FARM_LOADING_MODULE_PATH__ || null
6771
6919
  )};
6772
6920
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6773
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkFTFYRMQQcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6921
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6774
6922
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6775
6923
  </script>`;
6776
6924
  const hydrationClickQueueScript = isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true ? createPreHydrationClickQueueScript() : "";
@@ -6781,7 +6929,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6781
6929
  viewport: viewportTags
6782
6930
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6783
6931
  pathname: getFarmMetadataPathname(req),
6784
- jsonLd: _optionalChain([this, 'access', _251 => _251.config, 'access', _252 => _252.agent, 'optionalAccess', _253 => _253.jsonLd])
6932
+ jsonLd: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.agent, 'optionalAccess', _271 => _271.jsonLd])
6785
6933
  });
6786
6934
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
6787
6935
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6790,22 +6938,22 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6790
6938
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6791
6939
  ) : "";
6792
6940
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6793
- const themeDocument = _chunkIPXLADVOcjs.createFarmThemeDocumentParts.call(void 0,
6941
+ const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
6794
6942
  this.config.theme,
6795
6943
  this.config.basePath,
6796
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
6944
+ _chunk4GPOC4LNcjs.getTheme.call(void 0, )
6797
6945
  );
6798
6946
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
6799
6947
  const devStyleLinks = this.collectDevStyleLinks();
6800
6948
  const globalStylesheetLink = this.devGlobalStylesheetLink(true);
6801
6949
  const cspNonce = this.getCspNonce(req);
6802
- const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkRU3M2FIKcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
6950
+ const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
6803
6951
  const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
6804
6952
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
6805
6953
  nonce: cspNonce,
6806
6954
  onShellReady() {
6807
6955
  if (pendingNavigationError) {
6808
- _optionalChain([abort, 'optionalCall', _254 => _254(pendingNavigationError)]);
6956
+ _optionalChain([abort, 'optionalCall', _272 => _272(pendingNavigationError)]);
6809
6957
  if (clearMiddlewareData) {
6810
6958
  clearMiddlewareData();
6811
6959
  }
@@ -6823,7 +6971,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6823
6971
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
6824
6972
  }
6825
6973
  const shell = `<!DOCTYPE html>
6826
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _255 => _255.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6974
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _273 => _273.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6827
6975
  <head>
6828
6976
  ${themeDocument.head}
6829
6977
  <meta charset="utf-8">
@@ -6842,17 +6990,17 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6842
6990
  <div id="root">`;
6843
6991
  const securedShell = secureDocumentHTML(shell);
6844
6992
  htmlParts.push(securedShell);
6845
- _optionalChain([staticShellParts, 'optionalAccess', _256 => _256.push, 'call', _257 => _257(securedShell)]);
6993
+ _optionalChain([staticShellParts, 'optionalAccess', _274 => _274.push, 'call', _275 => _275(securedShell)]);
6846
6994
  let firstChunk = true;
6847
6995
  let checkedFullDocument = false;
6848
6996
  let documentPrefix = "";
6849
- const cspNonceRewriter = cspNonce ? _chunkRU3M2FIKcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6997
+ const cspNonceRewriter = cspNonce ? _chunkMRMI32SNcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6850
6998
  const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
6851
6999
  const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
6852
7000
  if (!chunkText) return;
6853
7001
  if (!checkedFullDocument) {
6854
7002
  documentPrefix += chunkText;
6855
- const prefix = _chunkIPXLADVOcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7003
+ const prefix = _chunkLOFKRKO7cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6856
7004
  if (prefix !== "pending") {
6857
7005
  checkedFullDocument = true;
6858
7006
  documentPrefix = "";
@@ -6869,7 +7017,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6869
7017
  staticShellClosed = true;
6870
7018
  if (!suspenseHoleEmitted) {
6871
7019
  suspenseHoleEmitted = true;
6872
- _optionalChain([options, 'access', _258 => _258.onSuspenseHoleDetected, 'optionalCall', _259 => _259()]);
7020
+ _optionalChain([options, 'access', _276 => _276.onSuspenseHoleDetected, 'optionalCall', _277 => _277()]);
6873
7021
  }
6874
7022
  } else {
6875
7023
  staticShellParts.push(chunkText);
@@ -7020,13 +7168,13 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7020
7168
  async loadNotFoundModule() {
7021
7169
  const notFoundPath = resolveFarmNotFoundComponentPath(
7022
7170
  this.config,
7023
- _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config)
7171
+ _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, this.config)
7024
7172
  );
7025
7173
  if (!notFoundPath) return null;
7026
7174
  return await this.routeManager.loadRouteModule(notFoundPath);
7027
7175
  }
7028
7176
  async loadNotFoundComponent() {
7029
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _260 => _260.default]), async () => ( null));
7177
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _278 => _278.default]), async () => ( null));
7030
7178
  }
7031
7179
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
7032
7180
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -7049,10 +7197,10 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7049
7197
  */
7050
7198
  async createLateNavigationRecoveryHTML(req, error) {
7051
7199
  if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
7052
- return _chunkIPXLADVOcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
7200
+ return _chunkLOFKRKO7cjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
7053
7201
  }
7054
- const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7055
- trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
7202
+ const pathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7203
+ trustProxy: _optionalChain([this, 'access', _279 => _279.config, 'access', _280 => _280.server, 'optionalAccess', _281 => _281.trustProxy])
7056
7204
  }).pathname;
7057
7205
  let content = this.defaultNotFoundContent();
7058
7206
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -7067,12 +7215,12 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7067
7215
  _chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
7068
7216
  }
7069
7217
  }
7070
- return _chunkIPXLADVOcjs.createLateNotFoundRecovery.call(void 0, content);
7218
+ return _chunkLOFKRKO7cjs.createLateNotFoundRecovery.call(void 0, content);
7071
7219
  }
7072
7220
  async render404(req, res) {
7073
7221
  res.statusCode = 404;
7074
- const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7075
- trustProxy: _optionalChain([this, 'access', _264 => _264.config, 'access', _265 => _265.server, 'optionalAccess', _266 => _266.trustProxy])
7222
+ const pathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7223
+ trustProxy: _optionalChain([this, 'access', _282 => _282.config, 'access', _283 => _283.server, 'optionalAccess', _284 => _284.trustProxy])
7076
7224
  }).pathname;
7077
7225
  const acceptHeader = req.headers.accept;
7078
7226
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
@@ -7096,13 +7244,13 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7096
7244
  }
7097
7245
  const notFoundPath = resolveFarmNotFoundComponentPath(
7098
7246
  this.config,
7099
- _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config)
7247
+ _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, this.config)
7100
7248
  );
7101
7249
  if (notFoundPath) {
7102
7250
  const notFoundModule = await this.loadNotFoundModule();
7103
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _267 => _267.default]), () => ( null));
7251
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _285 => _285.default]), () => ( null));
7104
7252
  if (NotFoundComponent) {
7105
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _268 => _268.default]), () => ( null));
7253
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _286 => _286.default]), () => ( null));
7106
7254
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
7107
7255
  if (LayoutComponent) {
7108
7256
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -7138,22 +7286,22 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7138
7286
  }
7139
7287
  res.statusCode = statusCode;
7140
7288
  const isDev = process.env.NODE_ENV === "development";
7141
- const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7142
- trustProxy: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.server, 'optionalAccess', _271 => _271.trustProxy])
7289
+ const requestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7290
+ trustProxy: _optionalChain([this, 'access', _287 => _287.config, 'access', _288 => _288.server, 'optionalAccess', _289 => _289.trustProxy])
7143
7291
  });
7144
7292
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
7145
- const statusText = _chunkIPXLADVOcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7146
- const content = _chunkIPXLADVOcjs.createDefaultErrorMarkup.call(void 0, {
7293
+ const statusText = _chunkLOFKRKO7cjs.getDefaultErrorStatusText.call(void 0, statusCode);
7294
+ const content = _chunkLOFKRKO7cjs.createDefaultErrorMarkup.call(void 0, {
7147
7295
  statusCode,
7148
7296
  statusText,
7149
7297
  requestPath: requestUrl.pathname,
7150
7298
  method: req.method || "GET",
7151
- message: _optionalChain([diagnostics, 'optionalAccess', _272 => _272.message]),
7152
- errorName: _optionalChain([diagnostics, 'optionalAccess', _273 => _273.name]),
7153
- stack: _optionalChain([diagnostics, 'optionalAccess', _274 => _274.stack]),
7154
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _275 => _275.sourceFrame]),
7299
+ message: _optionalChain([diagnostics, 'optionalAccess', _290 => _290.message]),
7300
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _291 => _291.name]),
7301
+ stack: _optionalChain([diagnostics, 'optionalAccess', _292 => _292.stack]),
7302
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _293 => _293.sourceFrame]),
7155
7303
  development: isDev,
7156
- farmVersion: _chunkYC6V7PWEcjs.FARM_VERSION,
7304
+ farmVersion: _chunkNQ6QFZWDcjs.FARM_VERSION,
7157
7305
  nodeVersion: process.version,
7158
7306
  mode: isDev ? "development" : "production"
7159
7307
  });
@@ -7178,8 +7326,8 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7178
7326
  */
7179
7327
  getI18nAlternateOptions(req, metadata) {
7180
7328
  return {
7181
- metadataBase: _optionalChain([metadata, 'optionalAccess', _276 => _276.metadataBase]),
7182
- origin: req ? _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _277 => _277.config, 'access', _278 => _278.server, 'optionalAccess', _279 => _279.trustProxy]) }).origin : void 0
7329
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _294 => _294.metadataBase]),
7330
+ origin: req ? _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _295 => _295.config, 'access', _296 => _296.server, 'optionalAccess', _297 => _297.trustProxy]) }).origin : void 0
7183
7331
  };
7184
7332
  }
7185
7333
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
@@ -7187,7 +7335,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7187
7335
  const clientScript = isClientComponent ? ` <script type="module" src="/@farm/client.js"></script>` : "";
7188
7336
  const integrationManifestScript = `<script>
7189
7337
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
7190
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkFTFYRMQQcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7338
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7191
7339
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
7192
7340
  </script>`;
7193
7341
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
@@ -7196,17 +7344,17 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7196
7344
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
7197
7345
  ) : "";
7198
7346
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
7199
- const themeDocument = _chunkIPXLADVOcjs.createFarmThemeDocumentParts.call(void 0,
7347
+ const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
7200
7348
  this.config.theme,
7201
7349
  this.config.basePath,
7202
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
7350
+ _chunk4GPOC4LNcjs.getTheme.call(void 0, )
7203
7351
  );
7204
- const rendererHydrationScript = _optionalChain([this, 'access', _280 => _280.rendererRuntime, 'access', _281 => _281.generateHydrationScript, 'optionalCall', _282 => _282()]) || "";
7205
- const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _283 => _283.metadata, 'optionalAccess', _284 => _284.viewport]));
7206
- const fullDocument = _chunkIPXLADVOcjs.extractFarmFullDocument.call(void 0, content);
7352
+ const rendererHydrationScript = _optionalChain([this, 'access', _298 => _298.rendererRuntime, 'access', _299 => _299.generateHydrationScript, 'optionalCall', _300 => _300()]) || "";
7353
+ const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _301 => _301.metadata, 'optionalAccess', _302 => _302.viewport]));
7354
+ const fullDocument = _chunkLOFKRKO7cjs.extractFarmFullDocument.call(void 0, content);
7207
7355
  if (fullDocument) {
7208
- return _chunkIPXLADVOcjs.composeFarmFullDocument.call(void 0,
7209
- metadataHead ? _chunkIPXLADVOcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7356
+ return _chunkLOFKRKO7cjs.composeFarmFullDocument.call(void 0,
7357
+ metadataHead ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7210
7358
  {
7211
7359
  fallbackIcon: !metadataHead,
7212
7360
  viewport: viewportTags,
@@ -7232,7 +7380,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7232
7380
  );
7233
7381
  }
7234
7382
  return `<!DOCTYPE html>
7235
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _285 => _285.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7383
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _303 => _303.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7236
7384
  <head>
7237
7385
  ${themeDocument.head}
7238
7386
  <meta charset="utf-8">
@@ -7258,14 +7406,14 @@ ${clientScript}
7258
7406
  }
7259
7407
  secureDocumentHTML(req, html) {
7260
7408
  const nonce = this.getCspNonce(req);
7261
- return nonce ? _chunkRU3M2FIKcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7409
+ return nonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7262
7410
  }
7263
7411
  applyDeploymentHeaders(req, res) {
7264
7412
  const deploymentId = this.getDeploymentId();
7265
7413
  res.setHeader(_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
7266
7414
  if ((req.method || "GET").toUpperCase() !== "GET") return;
7267
7415
  const forwardedProto = req.headers["x-forwarded-proto"];
7268
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _286 => _286.split, 'call', _287 => _287(","), 'access', _288 => _288[0], 'optionalAccess', _289 => _289.trim, 'call', _290 => _290()]) === "https" || Boolean(_optionalChain([req, 'access', _291 => _291.socket, 'optionalAccess', _292 => _292.encrypted]));
7416
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _304 => _304.split, 'call', _305 => _305(","), 'access', _306 => _306[0], 'optionalAccess', _307 => _307.trim, 'call', _308 => _308()]) === "https" || Boolean(_optionalChain([req, 'access', _309 => _309.socket, 'optionalAccess', _310 => _310.encrypted]));
7269
7417
  const cookie = _chunkC5GUTBZKcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
7270
7418
  const existing = res.getHeader("Set-Cookie");
7271
7419
  if (Array.isArray(existing)) {
@@ -7298,7 +7446,7 @@ var _FarmApp = class _FarmApp {
7298
7446
  constructor(config = {}, viteServer) {
7299
7447
  this.config = this.normalizeConfig(config);
7300
7448
  _chunkE3UK5IIBcjs.configureFarmObservability.call(void 0, this.config.observability);
7301
- _chunkKXWRO25Scjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7449
+ _chunk4GPOC4LNcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7302
7450
  this.i18nRuntime = _chunkXJXBIP67cjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
7303
7451
  _chunkXJXBIP67cjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
7304
7452
  this.viteServer = viteServer;
@@ -7359,16 +7507,16 @@ var _FarmApp = class _FarmApp {
7359
7507
  plugins: config.plugins || [],
7360
7508
  migrations: config.migrations || { commands: [] },
7361
7509
  cron: _chunk6EXBPJ24cjs.resolveCronConfig.call(void 0, config.cron),
7362
- workflows: _chunkVFQT3LAOcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7510
+ workflows: _chunkSDOTRX3Vcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7363
7511
  api: normalizeFarmAppAPIConfig(config.api),
7364
7512
  middleware: config.middleware || {},
7365
7513
  routeRules: _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, config.routeRules),
7366
7514
  context: config.context || (() => void 0),
7367
- server: _chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, config.server),
7368
- serverActions: _chunkZXGAFZDOcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7369
- security: _chunkRU3M2FIKcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7515
+ server: _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, config.server),
7516
+ serverActions: _chunkT5OJPTVNcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7517
+ security: _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7370
7518
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
7371
- performance: _chunkRU3M2FIKcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7519
+ performance: _chunkMRMI32SNcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7372
7520
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
7373
7521
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
7374
7522
  root,
@@ -7396,10 +7544,10 @@ var _FarmApp = class _FarmApp {
7396
7544
  env: config.env || { server: {}, public: {} },
7397
7545
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
7398
7546
  experimental: {
7399
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _293 => _293.experimental, 'optionalAccess', _294 => _294.serverComponents]), () => ( false)),
7400
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _295 => _295.experimental, 'optionalAccess', _296 => _296.serverActions]), () => ( false)),
7401
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _297 => _297.experimental, 'optionalAccess', _298 => _298.isolatedClientHydration]), () => ( "off")),
7402
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _299 => _299.experimental, 'optionalAccess', _300 => _300.ppr]), () => ( false)),
7547
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents]), () => ( false)),
7548
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _313 => _313.experimental, 'optionalAccess', _314 => _314.serverActions]), () => ( false)),
7549
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _315 => _315.experimental, 'optionalAccess', _316 => _316.isolatedClientHydration]), () => ( "off")),
7550
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _317 => _317.experimental, 'optionalAccess', _318 => _318.ppr]), () => ( false)),
7403
7551
  ...config.experimental
7404
7552
  },
7405
7553
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -7407,13 +7555,13 @@ var _FarmApp = class _FarmApp {
7407
7555
  };
7408
7556
  }
7409
7557
  async verifyAppStructure() {
7410
- const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config);
7558
+ const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, this.config);
7411
7559
  const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk5QIKR7RRcjs.fileExists.call(void 0, appDir)))).some(
7412
7560
  Boolean
7413
7561
  );
7414
7562
  if (!hasAppDirectory) {
7415
- const routeFiles = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7416
- (source) => _chunkSJNMVDDFcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7563
+ const routeFiles = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7564
+ (source) => _chunkFUCSUGDMcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7417
7565
  );
7418
7566
  if (routeFiles.length > 0) {
7419
7567
  return;
@@ -7450,7 +7598,7 @@ function isResolvedAuthConfig(value) {
7450
7598
  }
7451
7599
  _chunkS3JO3N4Hcjs.__name.call(void 0, isResolvedAuthConfig, "isResolvedAuthConfig");
7452
7600
  function normalizeFarmAppAPIConfig(config) {
7453
- if (typeof _optionalChain([config, 'optionalAccess', _301 => _301.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _302 => _302.basePath]) === "function") {
7601
+ if (typeof _optionalChain([config, 'optionalAccess', _319 => _319.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _320 => _320.basePath]) === "function") {
7454
7602
  throw new Error(
7455
7603
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
7456
7604
  );
@@ -7476,7 +7624,7 @@ function adaptPluginOption(pluginOption) {
7476
7624
  if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
7477
7625
  if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
7478
7626
  const plugin = pluginOption;
7479
- if (!_optionalChain([plugin, 'access', _303 => _303.name, 'optionalAccess', _304 => _304.startsWith, 'call', _305 => _305("@tailwindcss/vite:generate:")])) return pluginOption;
7627
+ if (!_optionalChain([plugin, 'access', _321 => _321.name, 'optionalAccess', _322 => _322.startsWith, 'call', _323 => _323("@tailwindcss/vite:generate:")])) return pluginOption;
7480
7628
  if (isVitePluginHook(plugin.transform)) {
7481
7629
  return {
7482
7630
  ...plugin,
@@ -7562,7 +7710,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createMissingTailwindPlugin, "createMissin
7562
7710
  var SHARP_INSTALL_HINT = _chunkLYLEZIG3cjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
7563
7711
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
7564
7712
  function resolveFarmImageProviderForRuntime(images, options) {
7565
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _306 => _306.provider]), () => ( "auto"));
7713
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _324 => _324.provider]), () => ( "auto"));
7566
7714
  if (provider === "none") return images;
7567
7715
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
7568
7716
  if (!usesSharp || _chunkLYLEZIG3cjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -7587,7 +7735,7 @@ function validateSchemaSteps(owner, schema, steps) {
7587
7735
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
7588
7736
  const ids = /* @__PURE__ */ new Set();
7589
7737
  for (const step of steps) {
7590
- const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _307 => _307.id])}"`;
7738
+ const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _325 => _325.id])}"`;
7591
7739
  if (!step || typeof step.id !== "string" || step.id.trim() === "") {
7592
7740
  throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
7593
7741
  }
@@ -7676,7 +7824,7 @@ ${lines.join("\n")}`);
7676
7824
  _chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
7677
7825
  var FarmPluginOptionsError = _FarmPluginOptionsError;
7678
7826
  function formatIssuePath(path22) {
7679
- if (!_optionalChain([path22, 'optionalAccess', _308 => _308.length])) return "";
7827
+ if (!_optionalChain([path22, 'optionalAccess', _326 => _326.length])) return "";
7680
7828
  return path22.map((segment) => {
7681
7829
  const key = typeof segment === "object" && segment !== null ? segment.key : segment;
7682
7830
  return typeof key === "symbol" ? key.toString() : String(key);
@@ -7690,11 +7838,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
7690
7838
  function isPluginOptionsSchema(value) {
7691
7839
  if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
7692
7840
  const standard = value["~standard"];
7693
- return typeof _optionalChain([standard, 'optionalAccess', _309 => _309.validate]) === "function";
7841
+ return typeof _optionalChain([standard, 'optionalAccess', _327 => _327.validate]) === "function";
7694
7842
  }
7695
7843
  _chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
7696
7844
  function parsePluginOptions(schema, options) {
7697
- const standard = _optionalChain([schema, 'optionalAccess', _310 => _310["~standard"]]);
7845
+ const standard = _optionalChain([schema, 'optionalAccess', _328 => _328["~standard"]]);
7698
7846
  if (!standard || typeof standard.validate !== "function") {
7699
7847
  throw new TypeError(
7700
7848
  "A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
@@ -7729,7 +7877,7 @@ function normalizeFarmPluginRuntimeEndpointPath(pathname, label = "Farm plugin r
7729
7877
  let decoded = segment;
7730
7878
  try {
7731
7879
  decoded = decodeURIComponent(segment);
7732
- } catch (e20) {
7880
+ } catch (e21) {
7733
7881
  throw new TypeError(`${label} path contains a malformed percent escape`);
7734
7882
  }
7735
7883
  if (decoded.includes("/") || decoded.includes("\\")) {
@@ -7754,9 +7902,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
7754
7902
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
7755
7903
  function farmPluginMayAffectRuntimePath(plugin, pathname) {
7756
7904
  const runtime = plugin.runtime;
7757
- const endpoints = _optionalChain([runtime, 'optionalAccess', _311 => _311.endpoints]);
7905
+ const endpoints = _optionalChain([runtime, 'optionalAccess', _329 => _329.endpoints]);
7758
7906
  const hasUnscopedRequestHooks = Boolean(
7759
- plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _312 => _312.context]) || _optionalChain([runtime, 'optionalAccess', _313 => _313.before]) || _optionalChain([runtime, 'optionalAccess', _314 => _314.after]) || _optionalChain([runtime, 'optionalAccess', _315 => _315.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7907
+ plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _330 => _330.context]) || _optionalChain([runtime, 'optionalAccess', _331 => _331.before]) || _optionalChain([runtime, 'optionalAccess', _332 => _332.after]) || _optionalChain([runtime, 'optionalAccess', _333 => _333.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7760
7908
  );
7761
7909
  if (hasUnscopedRequestHooks) return true;
7762
7910
  if (Array.isArray(endpoints) && endpoints.length > 0) {
@@ -7768,7 +7916,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
7768
7916
  ) === normalizedPathname
7769
7917
  );
7770
7918
  }
7771
- return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _316 => _316.start]) || _optionalChain([runtime, 'optionalAccess', _317 => _317.close]));
7919
+ return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _334 => _334.start]) || _optionalChain([runtime, 'optionalAccess', _335 => _335.close]));
7772
7920
  }
7773
7921
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
7774
7922
 
@@ -7827,28 +7975,28 @@ var _PluginManager = class _PluginManager {
7827
7975
  },
7828
7976
  requestContext: {
7829
7977
  set(target, key, value, options) {
7830
- _chunkOMVAU7NTcjs.setRequestContext.call(void 0, target, key, value, options);
7978
+ _chunkKIIMAWOJcjs.setRequestContext.call(void 0, target, key, value, options);
7831
7979
  },
7832
7980
  get(target, key) {
7833
- return _chunkOMVAU7NTcjs.getRequestContext.call(void 0, target, key);
7981
+ return _chunkKIIMAWOJcjs.getRequestContext.call(void 0, target, key);
7834
7982
  },
7835
7983
  has(target, key) {
7836
- return _chunkOMVAU7NTcjs.hasRequestContext.call(void 0, target, key);
7984
+ return _chunkKIIMAWOJcjs.hasRequestContext.call(void 0, target, key);
7837
7985
  },
7838
7986
  delete(target, key) {
7839
- return _chunkOMVAU7NTcjs.deleteRequestContext.call(void 0, target, key);
7987
+ return _chunkKIIMAWOJcjs.deleteRequestContext.call(void 0, target, key);
7840
7988
  },
7841
7989
  clear(target) {
7842
- _chunkOMVAU7NTcjs.clearRequestContext.call(void 0, target);
7990
+ _chunkKIIMAWOJcjs.clearRequestContext.call(void 0, target);
7843
7991
  },
7844
7992
  getAll(target, options) {
7845
- return _chunkOMVAU7NTcjs.getRequestContextSnapshot.call(void 0, target, options);
7993
+ return _chunkKIIMAWOJcjs.getRequestContextSnapshot.call(void 0, target, options);
7846
7994
  }
7847
7995
  }
7848
7996
  };
7849
7997
  }
7850
7998
  createPluginHookContext(plugin, context = this.context) {
7851
- const integration = _chunkFTFYRMQQcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
7999
+ const integration = _chunkUJZLSXUBcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
7852
8000
  return integration ? { ...context, integration } : context;
7853
8001
  }
7854
8002
  createRequestHookContext(target, plugin) {
@@ -7878,7 +8026,7 @@ var _PluginManager = class _PluginManager {
7878
8026
  };
7879
8027
  }
7880
8028
  copyRequestStore(source, target) {
7881
- _chunkOMVAU7NTcjs.copyRequestContext.call(void 0, source, target);
8029
+ _chunkKIIMAWOJcjs.copyRequestContext.call(void 0, source, target);
7882
8030
  }
7883
8031
  copyRuntimeRequestContext(source, target) {
7884
8032
  const runtimeContext = this.runtimeRequestContexts.get(source);
@@ -7902,7 +8050,7 @@ var _PluginManager = class _PluginManager {
7902
8050
  const endpoints = [];
7903
8051
  const owners = /* @__PURE__ */ new Map();
7904
8052
  for (const plugin of this.getSortedPlugins()) {
7905
- const configured = _optionalChain([plugin, 'access', _318 => _318.runtime, 'optionalAccess', _319 => _319.endpoints]);
8053
+ const configured = _optionalChain([plugin, 'access', _336 => _336.runtime, 'optionalAccess', _337 => _337.endpoints]);
7906
8054
  if (configured === void 0) continue;
7907
8055
  if (!Array.isArray(configured)) {
7908
8056
  throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
@@ -7973,7 +8121,7 @@ var _PluginManager = class _PluginManager {
7973
8121
  const values = {};
7974
8122
  const owners = /* @__PURE__ */ new Map();
7975
8123
  for (const plugin of this.getSortedPlugins()) {
7976
- const createContext = _optionalChain([plugin, 'access', _320 => _320.runtime, 'optionalAccess', _321 => _321.context]);
8124
+ const createContext = _optionalChain([plugin, 'access', _338 => _338.runtime, 'optionalAccess', _339 => _339.context]);
7977
8125
  if (!createContext) continue;
7978
8126
  const result = await createContext(
7979
8127
  this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
@@ -7999,7 +8147,7 @@ var _PluginManager = class _PluginManager {
7999
8147
  }
8000
8148
  async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
8001
8149
  for (const plugin of this.getSortedPlugins()) {
8002
- const onError = _optionalChain([plugin, 'access', _322 => _322.runtime, 'optionalAccess', _323 => _323.error]);
8150
+ const onError = _optionalChain([plugin, 'access', _340 => _340.runtime, 'optionalAccess', _341 => _341.error]);
8003
8151
  if (!onError) continue;
8004
8152
  try {
8005
8153
  await onError({
@@ -8043,19 +8191,19 @@ var _PluginManager = class _PluginManager {
8043
8191
  case "config":
8044
8192
  if (plugin.configure) {
8045
8193
  hooks.push(
8046
- (config, context) => _optionalChain([plugin, 'access', _324 => _324.configure, 'optionalCall', _325 => _325(config, context)])
8194
+ (config, context) => _optionalChain([plugin, 'access', _342 => _342.configure, 'optionalCall', _343 => _343(config, context)])
8047
8195
  );
8048
8196
  }
8049
8197
  break;
8050
8198
  case "ready":
8051
- if (_optionalChain([plugin, 'access', _326 => _326.runtime, 'optionalAccess', _327 => _327.start])) {
8052
- hooks.push((context) => _optionalChain([plugin, 'access', _328 => _328.runtime, 'optionalAccess', _329 => _329.start, 'optionalCall', _330 => _330(withState(context))]));
8199
+ if (_optionalChain([plugin, 'access', _344 => _344.runtime, 'optionalAccess', _345 => _345.start])) {
8200
+ hooks.push((context) => _optionalChain([plugin, 'access', _346 => _346.runtime, 'optionalAccess', _347 => _347.start, 'optionalCall', _348 => _348(withState(context))]));
8053
8201
  }
8054
8202
  break;
8055
8203
  case "shutdown":
8056
- if (_optionalChain([plugin, 'access', _331 => _331.runtime, 'optionalAccess', _332 => _332.close])) {
8204
+ if (_optionalChain([plugin, 'access', _349 => _349.runtime, 'optionalAccess', _350 => _350.close])) {
8057
8205
  hooks.push(
8058
- (payload, context) => _optionalChain([plugin, 'access', _333 => _333.runtime, 'optionalAccess', _334 => _334.close, 'optionalCall', _335 => _335({
8206
+ (payload, context) => _optionalChain([plugin, 'access', _351 => _351.runtime, 'optionalAccess', _352 => _352.close, 'optionalCall', _353 => _353({
8059
8207
  ...withState(context),
8060
8208
  reason: payload.reason
8061
8209
  })])
@@ -8063,93 +8211,93 @@ var _PluginManager = class _PluginManager {
8063
8211
  }
8064
8212
  break;
8065
8213
  case "routeDiscovered":
8066
- if (_optionalChain([plugin, 'access', _336 => _336.router, 'optionalAccess', _337 => _337.discovered])) {
8214
+ if (_optionalChain([plugin, 'access', _354 => _354.router, 'optionalAccess', _355 => _355.discovered])) {
8067
8215
  hooks.push(
8068
- (route, context) => _optionalChain([plugin, 'access', _338 => _338.router, 'optionalAccess', _339 => _339.discovered, 'optionalCall', _340 => _340(route, withState(context))])
8216
+ (route, context) => _optionalChain([plugin, 'access', _356 => _356.router, 'optionalAccess', _357 => _357.discovered, 'optionalCall', _358 => _358(route, withState(context))])
8069
8217
  );
8070
8218
  }
8071
8219
  break;
8072
8220
  case "middlewareDiscovered":
8073
- if (_optionalChain([plugin, 'access', _341 => _341.router, 'optionalAccess', _342 => _342.discovered])) {
8221
+ if (_optionalChain([plugin, 'access', _359 => _359.router, 'optionalAccess', _360 => _360.discovered])) {
8074
8222
  hooks.push(
8075
- (route, context) => _optionalChain([plugin, 'access', _343 => _343.router, 'optionalAccess', _344 => _344.discovered, 'optionalCall', _345 => _345({ kind: "middleware", ...route }, withState(context))])
8223
+ (route, context) => _optionalChain([plugin, 'access', _361 => _361.router, 'optionalAccess', _362 => _362.discovered, 'optionalCall', _363 => _363({ kind: "middleware", ...route }, withState(context))])
8076
8224
  );
8077
8225
  }
8078
8226
  break;
8079
8227
  case "apiRouteDiscovered":
8080
- if (_optionalChain([plugin, 'access', _346 => _346.router, 'optionalAccess', _347 => _347.discovered])) {
8228
+ if (_optionalChain([plugin, 'access', _364 => _364.router, 'optionalAccess', _365 => _365.discovered])) {
8081
8229
  hooks.push(
8082
- (route, context) => _optionalChain([plugin, 'access', _348 => _348.router, 'optionalAccess', _349 => _349.discovered, 'optionalCall', _350 => _350({ kind: "api", ...route }, withState(context))])
8230
+ (route, context) => _optionalChain([plugin, 'access', _366 => _366.router, 'optionalAccess', _367 => _367.discovered, 'optionalCall', _368 => _368({ kind: "api", ...route }, withState(context))])
8083
8231
  );
8084
8232
  }
8085
8233
  break;
8086
8234
  case "routesGenerated":
8087
- if (_optionalChain([plugin, 'access', _351 => _351.router, 'optionalAccess', _352 => _352.generated])) {
8235
+ if (_optionalChain([plugin, 'access', _369 => _369.router, 'optionalAccess', _370 => _370.generated])) {
8088
8236
  hooks.push(
8089
- (routes, context) => _optionalChain([plugin, 'access', _353 => _353.router, 'optionalAccess', _354 => _354.generated, 'optionalCall', _355 => _355(routes, withState(context))])
8237
+ (routes, context) => _optionalChain([plugin, 'access', _371 => _371.router, 'optionalAccess', _372 => _372.generated, 'optionalCall', _373 => _373(routes, withState(context))])
8090
8238
  );
8091
8239
  }
8092
8240
  break;
8093
8241
  case "beforeRouteMatch":
8094
- if (_optionalChain([plugin, 'access', _356 => _356.router, 'optionalAccess', _357 => _357.before])) {
8242
+ if (_optionalChain([plugin, 'access', _374 => _374.router, 'optionalAccess', _375 => _375.before])) {
8095
8243
  hooks.push(
8096
- (route, context) => _optionalChain([plugin, 'access', _358 => _358.router, 'optionalAccess', _359 => _359.before, 'optionalCall', _360 => _360(route, withState(context))])
8244
+ (route, context) => _optionalChain([plugin, 'access', _376 => _376.router, 'optionalAccess', _377 => _377.before, 'optionalCall', _378 => _378(route, withState(context))])
8097
8245
  );
8098
8246
  }
8099
8247
  break;
8100
8248
  case "afterRouteMatch":
8101
- if (_optionalChain([plugin, 'access', _361 => _361.router, 'optionalAccess', _362 => _362.after])) {
8249
+ if (_optionalChain([plugin, 'access', _379 => _379.router, 'optionalAccess', _380 => _380.after])) {
8102
8250
  hooks.push(
8103
- (result, context) => _optionalChain([plugin, 'access', _363 => _363.router, 'optionalAccess', _364 => _364.after, 'optionalCall', _365 => _365(result, withState(context))])
8251
+ (result, context) => _optionalChain([plugin, 'access', _381 => _381.router, 'optionalAccess', _382 => _382.after, 'optionalCall', _383 => _383(result, withState(context))])
8104
8252
  );
8105
8253
  }
8106
8254
  break;
8107
8255
  case "beforeRender":
8108
- if (_optionalChain([plugin, 'access', _366 => _366.render, 'optionalAccess', _367 => _367.before])) {
8256
+ if (_optionalChain([plugin, 'access', _384 => _384.render, 'optionalAccess', _385 => _385.before])) {
8109
8257
  hooks.push(
8110
- (render, context) => _optionalChain([plugin, 'access', _368 => _368.render, 'optionalAccess', _369 => _369.before, 'optionalCall', _370 => _370(render, withState(context))])
8258
+ (render, context) => _optionalChain([plugin, 'access', _386 => _386.render, 'optionalAccess', _387 => _387.before, 'optionalCall', _388 => _388(render, withState(context))])
8111
8259
  );
8112
8260
  }
8113
8261
  break;
8114
8262
  case "afterRender":
8115
- if (_optionalChain([plugin, 'access', _371 => _371.render, 'optionalAccess', _372 => _372.html])) {
8263
+ if (_optionalChain([plugin, 'access', _389 => _389.render, 'optionalAccess', _390 => _390.html])) {
8116
8264
  hooks.push(
8117
- (html, render, context) => _optionalChain([plugin, 'access', _373 => _373.render, 'optionalAccess', _374 => _374.html, 'optionalCall', _375 => _375(html, render, withState(context))])
8265
+ (html, render, context) => _optionalChain([plugin, 'access', _391 => _391.render, 'optionalAccess', _392 => _392.html, 'optionalCall', _393 => _393(html, render, withState(context))])
8118
8266
  );
8119
8267
  }
8120
8268
  break;
8121
8269
  case "beforeBundle":
8122
- if (_optionalChain([plugin, 'access', _376 => _376.build, 'optionalAccess', _377 => _377.before])) {
8270
+ if (_optionalChain([plugin, 'access', _394 => _394.build, 'optionalAccess', _395 => _395.before])) {
8123
8271
  hooks.push(
8124
- (bundle, context) => _optionalChain([plugin, 'access', _378 => _378.build, 'optionalAccess', _379 => _379.before, 'optionalCall', _380 => _380(bundle, withState(context))])
8272
+ (bundle, context) => _optionalChain([plugin, 'access', _396 => _396.build, 'optionalAccess', _397 => _397.before, 'optionalCall', _398 => _398(bundle, withState(context))])
8125
8273
  );
8126
8274
  }
8127
8275
  break;
8128
8276
  case "beforeNitroBuild":
8129
- if (_optionalChain([plugin, 'access', _381 => _381.build, 'optionalAccess', _382 => _382.configure])) {
8277
+ if (_optionalChain([plugin, 'access', _399 => _399.build, 'optionalAccess', _400 => _400.configure])) {
8130
8278
  hooks.push(
8131
- (buildConfig, context) => _optionalChain([plugin, 'access', _383 => _383.build, 'optionalAccess', _384 => _384.configure, 'optionalCall', _385 => _385(buildConfig, withState(context))])
8279
+ (buildConfig, context) => _optionalChain([plugin, 'access', _401 => _401.build, 'optionalAccess', _402 => _402.configure, 'optionalCall', _403 => _403(buildConfig, withState(context))])
8132
8280
  );
8133
8281
  }
8134
8282
  break;
8135
8283
  case "afterBundle":
8136
- if (_optionalChain([plugin, 'access', _386 => _386.build, 'optionalAccess', _387 => _387.after])) {
8284
+ if (_optionalChain([plugin, 'access', _404 => _404.build, 'optionalAccess', _405 => _405.after])) {
8137
8285
  hooks.push(
8138
- (result, context) => _optionalChain([plugin, 'access', _388 => _388.build, 'optionalAccess', _389 => _389.after, 'optionalCall', _390 => _390(result, withState(context))])
8286
+ (result, context) => _optionalChain([plugin, 'access', _406 => _406.build, 'optionalAccess', _407 => _407.after, 'optionalCall', _408 => _408(result, withState(context))])
8139
8287
  );
8140
8288
  }
8141
8289
  break;
8142
8290
  case "devServerCreated":
8143
- if (_optionalChain([plugin, 'access', _391 => _391.dev, 'optionalAccess', _392 => _392.server])) {
8291
+ if (_optionalChain([plugin, 'access', _409 => _409.dev, 'optionalAccess', _410 => _410.server])) {
8144
8292
  hooks.push(
8145
- (server, context) => _optionalChain([plugin, 'access', _393 => _393.dev, 'optionalAccess', _394 => _394.server, 'optionalCall', _395 => _395(server, withState(context))])
8293
+ (server, context) => _optionalChain([plugin, 'access', _411 => _411.dev, 'optionalAccess', _412 => _412.server, 'optionalCall', _413 => _413(server, withState(context))])
8146
8294
  );
8147
8295
  }
8148
8296
  break;
8149
8297
  case "hmrUpdate":
8150
- if (_optionalChain([plugin, 'access', _396 => _396.dev, 'optionalAccess', _397 => _397.update])) {
8298
+ if (_optionalChain([plugin, 'access', _414 => _414.dev, 'optionalAccess', _415 => _415.update])) {
8151
8299
  hooks.push(
8152
- (update, context) => _optionalChain([plugin, 'access', _398 => _398.dev, 'optionalAccess', _399 => _399.update, 'optionalCall', _400 => _400(update, withState(context))])
8300
+ (update, context) => _optionalChain([plugin, 'access', _416 => _416.dev, 'optionalAccess', _417 => _417.update, 'optionalCall', _418 => _418(update, withState(context))])
8153
8301
  );
8154
8302
  }
8155
8303
  break;
@@ -8195,7 +8343,7 @@ var _PluginManager = class _PluginManager {
8195
8343
  hasRuntimeHook(hookName) {
8196
8344
  const cached = this.runtimeHookPresence.get(hookName);
8197
8345
  if (cached !== void 0) return cached;
8198
- const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _401 => _401.runtime, 'optionalAccess', _402 => _402[hookName]]) === "function");
8346
+ const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _419 => _419.runtime, 'optionalAccess', _420 => _420[hookName]]) === "function");
8199
8347
  this.runtimeHookPresence.set(hookName, present);
8200
8348
  return present;
8201
8349
  }
@@ -8274,7 +8422,7 @@ var _PluginManager = class _PluginManager {
8274
8422
  async beginRuntimeRequest(request2, options = {}) {
8275
8423
  await this.startRuntime();
8276
8424
  const startedAt = Date.now();
8277
- const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _403 => _403.waitUntil, 'optionalCall', _404 => _404(Promise.resolve(promise))]) : (promise) => {
8425
+ const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _421 => _421.waitUntil, 'optionalCall', _422 => _422(Promise.resolve(promise))]) : (promise) => {
8278
8426
  void Promise.resolve(promise).catch(() => {
8279
8427
  });
8280
8428
  };
@@ -8307,7 +8455,7 @@ var _PluginManager = class _PluginManager {
8307
8455
  );
8308
8456
  let response;
8309
8457
  for (const plugin of this.getSortedPlugins()) {
8310
- const before = _optionalChain([plugin, 'access', _405 => _405.runtime, 'optionalAccess', _406 => _406.before]);
8458
+ const before = _optionalChain([plugin, 'access', _423 => _423.runtime, 'optionalAccess', _424 => _424.before]);
8311
8459
  if (!before) continue;
8312
8460
  const result = await before({
8313
8461
  ...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
@@ -8353,7 +8501,7 @@ var _PluginManager = class _PluginManager {
8353
8501
  let response = initialResponse;
8354
8502
  try {
8355
8503
  for (const plugin of this.getSortedPlugins()) {
8356
- const after = _optionalChain([plugin, 'access', _407 => _407.runtime, 'optionalAccess', _408 => _408.after]);
8504
+ const after = _optionalChain([plugin, 'access', _425 => _425.runtime, 'optionalAccess', _426 => _426.after]);
8357
8505
  if (!after) continue;
8358
8506
  const result = await after({
8359
8507
  ...this.createRuntimeBaseEvent(
@@ -8442,7 +8590,7 @@ var _PluginManager = class _PluginManager {
8442
8590
  /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
8443
8591
  async runHookParallelFiltered(hookName, include, ...args) {
8444
8592
  if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
8445
- await this.closeRuntime(_optionalChain([args, 'access', _409 => _409[0], 'optionalAccess', _410 => _410.reason]));
8593
+ await this.closeRuntime(_optionalChain([args, 'access', _427 => _427[0], 'optionalAccess', _428 => _428.reason]));
8446
8594
  return false;
8447
8595
  }
8448
8596
  const plugins = this.getSortedPlugins().filter(include);
@@ -8555,7 +8703,7 @@ function createPluginFactory(definition) {
8555
8703
  configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
8556
8704
  } : {},
8557
8705
  setup(context) {
8558
- const state = _optionalChain([setup, 'optionalCall', _411 => _411({ ...context, options })]);
8706
+ const state = _optionalChain([setup, 'optionalCall', _429 => _429({ ...context, options })]);
8559
8707
  return state instanceof Promise ? state.then(resolveState) : resolveState(state);
8560
8708
  }
8561
8709
  });
@@ -8596,10 +8744,10 @@ function declarePluginSchema(plugin) {
8596
8744
  models: Object.keys(models).filter((key) => !models[key].external),
8597
8745
  ...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunk6MVFL3R5cjs.pluginShortName) } : {},
8598
8746
  ...plugin.version ? { version: plugin.version } : {},
8599
- ..._optionalChain([plugin, 'access', _412 => _412.migrations, 'optionalAccess', _413 => _413.length]) ? { migrations: plugin.migrations } : {},
8600
- dialect: _optionalChain([database, 'optionalAccess', _414 => _414.dialect]),
8747
+ ..._optionalChain([plugin, 'access', _430 => _430.migrations, 'optionalAccess', _431 => _431.length]) ? { migrations: plugin.migrations } : {},
8748
+ dialect: _optionalChain([database, 'optionalAccess', _432 => _432.dialect]),
8601
8749
  resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
8602
- if (_optionalChain([database, 'optionalAccess', _415 => _415.client]) !== void 0 && database.client !== null) {
8750
+ if (_optionalChain([database, 'optionalAccess', _433 => _433.client]) !== void 0 && database.client !== null) {
8603
8751
  const client2 = typeof database.client === "function" ? await database.client() : database.client;
8604
8752
  if (client2 === void 0 || client2 === null) {
8605
8753
  throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
@@ -8653,7 +8801,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
8653
8801
  }
8654
8802
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
8655
8803
  function resolveFarmClientPlugins(plugins, _root) {
8656
- if (!_optionalChain([plugins, 'optionalAccess', _416 => _416.length])) return [];
8804
+ if (!_optionalChain([plugins, 'optionalAccess', _434 => _434.length])) return [];
8657
8805
  return plugins.flatMap((plugin) => {
8658
8806
  if (!plugin.client) return [];
8659
8807
  assertClientLifecycle(plugin.client, plugin.name);
@@ -8733,7 +8881,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
8733
8881
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
8734
8882
  }
8735
8883
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
8736
- if (!_optionalChain([descriptor, 'optionalAccess', _417 => _417.enumerable])) {
8884
+ if (!_optionalChain([descriptor, 'optionalAccess', _435 => _435.enumerable])) {
8737
8885
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
8738
8886
  }
8739
8887
  if (!("value" in descriptor)) {
@@ -8857,7 +9005,7 @@ function assertPublicData(value, pluginName) {
8857
9005
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
8858
9006
  }
8859
9007
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
8860
- if (!_optionalChain([descriptor, 'optionalAccess', _418 => _418.enumerable])) {
9008
+ if (!_optionalChain([descriptor, 'optionalAccess', _436 => _436.enumerable])) {
8861
9009
  throwPublicDataError(
8862
9010
  pluginName,
8863
9011
  [...pathSegments, key],
@@ -8903,8 +9051,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
8903
9051
 
8904
9052
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
8905
9053
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
8906
- const client = _optionalChain([cache2, 'optionalAccess', _419 => _419.client]);
8907
- const adapter = _optionalChain([client, 'optionalAccess', _420 => _420.adapter]);
9054
+ const client = _optionalChain([cache2, 'optionalAccess', _437 => _437.client]);
9055
+ const adapter = _optionalChain([client, 'optionalAccess', _438 => _438.adapter]);
8908
9056
  if (adapter === void 0) return void 0;
8909
9057
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
8910
9058
  throw new Error(
@@ -8919,8 +9067,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
8919
9067
  );
8920
9068
  }
8921
9069
  const options = {};
8922
- if (_optionalChain([client, 'optionalAccess', _421 => _421.version]) !== void 0) options.version = client.version;
8923
- if (_optionalChain([client, 'optionalAccess', _422 => _422.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
9070
+ if (_optionalChain([client, 'optionalAccess', _439 => _439.version]) !== void 0) options.version = client.version;
9071
+ if (_optionalChain([client, 'optionalAccess', _440 => _440.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8924
9072
  return { importPath: found.replace(/\\/g, "/"), options };
8925
9073
  }
8926
9074
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
@@ -8953,7 +9101,7 @@ function resolveFarmAppPackages(root) {
8953
9101
  let manifest;
8954
9102
  try {
8955
9103
  manifest = JSON.parse(fs5.default.readFileSync(path9.default.join(root, "package.json"), "utf8"));
8956
- } catch (e21) {
9104
+ } catch (e22) {
8957
9105
  return {};
8958
9106
  }
8959
9107
  const names = new Set(
@@ -8972,7 +9120,7 @@ function resolveFarmAppPackages(root) {
8972
9120
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
8973
9121
  versions[name] = version;
8974
9122
  break;
8975
- } catch (e22) {
9123
+ } catch (e23) {
8976
9124
  const parent = path9.default.dirname(dir);
8977
9125
  if (parent === dir) break;
8978
9126
  dir = parent;
@@ -9049,9 +9197,9 @@ function staticValue(node) {
9049
9197
  }
9050
9198
  _chunkS3JO3N4Hcjs.__name.call(void 0, staticValue, "staticValue");
9051
9199
  function property(object, name) {
9052
- return _optionalChain([object, 'access', _423 => _423.properties, 'access', _424 => _424.find, 'call', _425 => _425(
9200
+ return _optionalChain([object, 'access', _441 => _441.properties, 'access', _442 => _442.find, 'call', _443 => _443(
9053
9201
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
9054
- ), 'optionalAccess', _426 => _426.value]);
9202
+ ), 'optionalAccess', _444 => _444.value]);
9055
9203
  }
9056
9204
  _chunkS3JO3N4Hcjs.__name.call(void 0, property, "property");
9057
9205
  function toolFromObject(object) {
@@ -9091,7 +9239,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9091
9239
  let program;
9092
9240
  try {
9093
9241
  program = parseAst(code, { lang });
9094
- } catch (e23) {
9242
+ } catch (e24) {
9095
9243
  return [];
9096
9244
  }
9097
9245
  const locals = /* @__PURE__ */ new Map();
@@ -9099,7 +9247,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9099
9247
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
9100
9248
  continue;
9101
9249
  for (const specifier of statement.specifiers) {
9102
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _427 => _427.imported, 'optionalAccess', _428 => _428.name]), () => ( _optionalChain([specifier, 'access', _429 => _429.imported, 'optionalAccess', _430 => _430.value])));
9250
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _445 => _445.imported, 'optionalAccess', _446 => _446.name]), () => ( _optionalChain([specifier, 'access', _447 => _447.imported, 'optionalAccess', _448 => _448.value])));
9103
9251
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
9104
9252
  locals.set(specifier.local.name, imported);
9105
9253
  }
@@ -9115,7 +9263,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9115
9263
  const [argument] = current.arguments;
9116
9264
  if (definer && argument) {
9117
9265
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
9118
- (element) => _optionalChain([element, 'optionalAccess', _431 => _431.type]) === "ObjectExpression"
9266
+ (element) => _optionalChain([element, 'optionalAccess', _449 => _449.type]) === "ObjectExpression"
9119
9267
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
9120
9268
  for (const object of objects) {
9121
9269
  const tool = toolFromObject(object);
@@ -9140,7 +9288,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
9140
9288
  absolute: true,
9141
9289
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
9142
9290
  });
9143
- } catch (e24) {
9291
+ } catch (e25) {
9144
9292
  return [];
9145
9293
  }
9146
9294
  const seen = /* @__PURE__ */ new Set();
@@ -9149,7 +9297,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
9149
9297
  let mtimeMs;
9150
9298
  try {
9151
9299
  mtimeMs = fs5.default.statSync(file).mtimeMs;
9152
- } catch (e25) {
9300
+ } catch (e26) {
9153
9301
  continue;
9154
9302
  }
9155
9303
  let entry = cache.get(file);
@@ -9157,7 +9305,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
9157
9305
  let code = "";
9158
9306
  try {
9159
9307
  code = fs5.default.readFileSync(file, "utf8");
9160
- } catch (e26) {
9308
+ } catch (e27) {
9161
9309
  }
9162
9310
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
9163
9311
  cache.set(file, entry);
@@ -9269,13 +9417,13 @@ var SOURCE_QUERY_FLAGS = ["raw", "inline", "url"];
9269
9417
  var MODULE_EXTENSION = /\.(?:[cm]?[jt]sx?|vue|svelte|astro|mdx?|css|scss|sass|less|styl|stylus|pcss|postcss|sss)$/i;
9270
9418
  var ASSET_EXTENSION = /\.(?:apng|bmp|png|jpe?g|jfif|pjpeg|pjp|gif|svg|ico|webp|avif|cur|jxl|mp4|webm|ogg|mp3|wav|flac|aac|opus|mov|m4a|vtt|woff2?|eot|ttf|otf|webmanifest|pdf|txt|wasm)$/i;
9271
9419
  var INTERNAL_PREFIXES = ["/@vite/", "/@farm/", "/@react-refresh", "/__vite_ping"];
9272
- var DEVELOPER_ONLY_PREFIXES = ["/__farm/devtools", "/__open-in-editor"];
9420
+ var DEVELOPER_ONLY_PREFIXES = ["/__farm/devtools", "/__open-in-editor", "/__mf_runner__"];
9273
9421
  function createFarmDevPreviewGuard(server, options) {
9274
9422
  return /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async function farmDevPreviewGuard(req, res, next) {
9275
9423
  if (!isFarmPreviewTunnelRequest(req.headers)) return next();
9276
9424
  try {
9277
9425
  if (await isAllowedPreviewRequest(server, options, req)) return next();
9278
- } catch (e27) {
9426
+ } catch (e28) {
9279
9427
  }
9280
9428
  res.statusCode = 403;
9281
9429
  res.setHeader("Content-Type", "text/plain; charset=utf-8");
@@ -9301,8 +9449,8 @@ async function isAllowedPreviewRequest(server, options, req) {
9301
9449
  if (method !== "GET" && method !== "HEAD") return true;
9302
9450
  const file = await resolveRequestedFile(server, pathname);
9303
9451
  if (!file) return true;
9304
- const client = _optionalChain([server, 'access', _432 => _432.environments, 'optionalAccess', _433 => _433.client]);
9305
- const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _434 => _434.moduleGraph, 'access', _435 => _435.getModuleByUrl, 'call', _436 => _436(url)])), "inClientGraph");
9452
+ const client = _optionalChain([server, 'access', _450 => _450.environments, 'optionalAccess', _451 => _451.client]);
9453
+ const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _452 => _452.moduleGraph, 'access', _453 => _453.getModuleByUrl, 'call', _454 => _454(url)])), "inClientGraph");
9306
9454
  if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
9307
9455
  if (await inClientGraph()) return true;
9308
9456
  if (file.split(path16.sep).includes("node_modules")) return true;
@@ -9331,17 +9479,17 @@ async function resolveRequestedFile(server, pathname) {
9331
9479
  id = id.slice("/@id/".length).replace(/^__x00__/, "\0");
9332
9480
  if (id.startsWith("\0")) return void 0;
9333
9481
  }
9334
- const resolved = await _optionalChain([server, 'access', _437 => _437.environments, 'optionalAccess', _438 => _438.client, 'optionalAccess', _439 => _439.pluginContainer, 'access', _440 => _440.resolveId, 'call', _441 => _441(id, void 0)]);
9335
- const resolvedId = _optionalChain([resolved, 'optionalAccess', _442 => _442.id, 'access', _443 => _443.replace, 'call', _444 => _444(/[?#].*$/, "")]);
9482
+ const resolved = await _optionalChain([server, 'access', _455 => _455.environments, 'optionalAccess', _456 => _456.client, 'optionalAccess', _457 => _457.pluginContainer, 'access', _458 => _458.resolveId, 'call', _459 => _459(id, void 0)]);
9483
+ const resolvedId = _optionalChain([resolved, 'optionalAccess', _460 => _460.id, 'access', _461 => _461.replace, 'call', _462 => _462(/[?#].*$/, "")]);
9336
9484
  if (resolvedId && path16.isAbsolute(resolvedId)) candidate = resolvedId;
9337
- else if (_optionalChain([resolvedId, 'optionalAccess', _445 => _445.startsWith, 'call', _446 => _446("\0")])) return void 0;
9485
+ else if (_optionalChain([resolvedId, 'optionalAccess', _463 => _463.startsWith, 'call', _464 => _464("\0")])) return void 0;
9338
9486
  else if (id.startsWith("/")) candidate = path16.join(server.config.root, id);
9339
9487
  }
9340
9488
  if (!candidate) return void 0;
9341
9489
  try {
9342
9490
  const real = await _fs.promises.realpath(candidate);
9343
9491
  return (await _fs.promises.stat(real)).isFile() ? real : void 0;
9344
- } catch (e28) {
9492
+ } catch (e29) {
9345
9493
  return void 0;
9346
9494
  }
9347
9495
  }
@@ -9349,7 +9497,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveRequestedFile, "resolveRequestedFil
9349
9497
  async function realpathOr(directory) {
9350
9498
  try {
9351
9499
  return await _fs.promises.realpath(directory);
9352
- } catch (e29) {
9500
+ } catch (e30) {
9353
9501
  return path16.resolve(directory);
9354
9502
  }
9355
9503
  }
@@ -9371,7 +9519,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
9371
9519
  function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
9372
9520
  if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
9373
9521
  const matchesAppRoute = Boolean(
9374
- _optionalChain([routeManager, 'optionalAccess', _447 => _447.matchRoute, 'call', _448 => _448(pathname), 'optionalAccess', _449 => _449.route]) || _optionalChain([routeManager, 'optionalAccess', _450 => _450.matchMetadataRoute, 'call', _451 => _451(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _452 => _452.matchMetadataImage, 'call', _453 => _453(pathname)]) || generatedPaths.includes(pathname)
9522
+ _optionalChain([routeManager, 'optionalAccess', _465 => _465.matchRoute, 'call', _466 => _466(pathname), 'optionalAccess', _467 => _467.route]) || _optionalChain([routeManager, 'optionalAccess', _468 => _468.matchMetadataRoute, 'call', _469 => _469(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _470 => _470.matchMetadataImage, 'call', _471 => _471(pathname)]) || generatedPaths.includes(pathname)
9375
9523
  );
9376
9524
  return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
9377
9525
  }
@@ -9400,14 +9548,14 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
9400
9548
  ]);
9401
9549
  function farmAppOwnsDocsEnginePath(pathname, options) {
9402
9550
  if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
9403
- return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _454 => _454.routeManager, 'optionalAccess', _455 => _455.matchMetadataRoute, 'call', _456 => _456(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9551
+ return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _472 => _472.routeManager, 'optionalAccess', _473 => _473.matchMetadataRoute, 'call', _474 => _474(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9404
9552
  }
9405
9553
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
9406
9554
  function devServableFileExists(pathname, baseDirs) {
9407
9555
  let decodedPathname;
9408
9556
  try {
9409
9557
  decodedPathname = decodeURIComponent(pathname);
9410
- } catch (e30) {
9558
+ } catch (e31) {
9411
9559
  return false;
9412
9560
  }
9413
9561
  const relativePathname = decodedPathname.replace(/^\/+/, "");
@@ -9421,7 +9569,7 @@ function devServableFileExists(pathname, baseDirs) {
9421
9569
  if (fs10.existsSync(candidate) && fs10.statSync(candidate).isFile()) {
9422
9570
  return true;
9423
9571
  }
9424
- } catch (e31) {
9572
+ } catch (e32) {
9425
9573
  }
9426
9574
  }
9427
9575
  return false;
@@ -9507,14 +9655,14 @@ function analyzeClientBoundary(program, publicKeys) {
9507
9655
  _chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
9508
9656
  function readNodeBuiltinSource(node) {
9509
9657
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
9510
- const value = _optionalChain([node, 'access', _457 => _457.source, 'optionalAccess', _458 => _458.value]);
9658
+ const value = _optionalChain([node, 'access', _475 => _475.source, 'optionalAccess', _476 => _476.value]);
9511
9659
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9512
9660
  }
9513
9661
  if (node.type === "CallExpression") {
9514
9662
  const callee = node.callee;
9515
- if (_optionalChain([callee, 'optionalAccess', _459 => _459.type]) === "Identifier" && callee.name === "require") {
9516
- const arg = _optionalChain([node, 'access', _460 => _460.arguments, 'optionalAccess', _461 => _461[0]]);
9517
- const value = _optionalChain([arg, 'optionalAccess', _462 => _462.type]) === "Literal" ? arg.value : void 0;
9663
+ if (_optionalChain([callee, 'optionalAccess', _477 => _477.type]) === "Identifier" && callee.name === "require") {
9664
+ const arg = _optionalChain([node, 'access', _478 => _478.arguments, 'optionalAccess', _479 => _479[0]]);
9665
+ const value = _optionalChain([arg, 'optionalAccess', _480 => _480.type]) === "Literal" ? arg.value : void 0;
9518
9666
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9519
9667
  }
9520
9668
  }
@@ -9524,7 +9672,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
9524
9672
  function readProcessEnvKey(node) {
9525
9673
  if (node.type !== "MemberExpression") return void 0;
9526
9674
  const object = node.object;
9527
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _463 => _463.object, 'optionalAccess', _464 => _464.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _465 => _465.property, 'optionalAccess', _466 => _466.name]) !== "env") {
9675
+ if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _481 => _481.object, 'optionalAccess', _482 => _482.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _483 => _483.property, 'optionalAccess', _484 => _484.name]) !== "env") {
9528
9676
  return void 0;
9529
9677
  }
9530
9678
  const property2 = node.property;
@@ -9589,7 +9737,7 @@ function farmImageImportsPlugin() {
9589
9737
  async transform(code, id) {
9590
9738
  const filePath = id.split("?", 1)[0];
9591
9739
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
9592
- const defaultExport = _optionalChain([code, 'access', _467 => _467.match, 'call', _468 => _468(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _469 => _469[1]]);
9740
+ const defaultExport = _optionalChain([code, 'access', _485 => _485.match, 'call', _486 => _486(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _487 => _487[1]]);
9593
9741
  if (!defaultExport) return null;
9594
9742
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
9595
9743
  }
@@ -9624,7 +9772,7 @@ async function createBlurDataURL(bytes) {
9624
9772
  const { default: sharp } = await import("sharp");
9625
9773
  const placeholder = await sharp(bytes).rotate().resize({ width: 8, height: 8, fit: "inside", withoutEnlargement: true }).webp({ quality: 35 }).toBuffer();
9626
9774
  return `data:image/webp;base64,${placeholder.toString("base64")}`;
9627
- } catch (e32) {
9775
+ } catch (e33) {
9628
9776
  return void 0;
9629
9777
  }
9630
9778
  }
@@ -9650,7 +9798,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9650
9798
  ];
9651
9799
  function getFarmClientOptimizeDepsInclude(renderer) {
9652
9800
  return Array.from(
9653
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _470 => _470.optimizeDeps]) || []])
9801
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _488 => _488.optimizeDeps]) || []])
9654
9802
  );
9655
9803
  }
9656
9804
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
@@ -9675,7 +9823,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9675
9823
  // Farm's HTML boots through a virtual module and imports route UI lazily.
9676
9824
  // Explicit entries let Vite finish that crawl before a navigation can
9677
9825
  // rotate the optimizer hash underneath a hydrated React runtime.
9678
- ..._optionalChain([entries, 'optionalAccess', _471 => _471.length]) ? { entries: [...entries] } : {}
9826
+ ..._optionalChain([entries, 'optionalAccess', _489 => _489.length]) ? { entries: [...entries] } : {}
9679
9827
  };
9680
9828
  }
9681
9829
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
@@ -9705,8 +9853,8 @@ function mergeAlias(farmValue, userValue) {
9705
9853
  }
9706
9854
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
9707
9855
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9708
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _472 => _472.optimizeDeps, 'optionalAccess', _473 => _473.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _474 => _474.optimizeDeps, 'optionalAccess', _475 => _475.noDiscovery])));
9709
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _476 => _476.optimizeDeps, 'optionalAccess', _477 => _477.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _478 => _478.optimizeDeps, 'optionalAccess', _479 => _479.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _480 => _480.optimizeDeps, 'optionalAccess', _481 => _481.holdUntilCrawlEnd]))));
9856
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _490 => _490.optimizeDeps, 'optionalAccess', _491 => _491.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _492 => _492.optimizeDeps, 'optionalAccess', _493 => _493.noDiscovery])));
9857
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _494 => _494.optimizeDeps, 'optionalAccess', _495 => _495.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _498 => _498.optimizeDeps, 'optionalAccess', _499 => _499.holdUntilCrawlEnd]))));
9710
9858
  return {
9711
9859
  ...farmConfig,
9712
9860
  ...userConfig,
@@ -9718,9 +9866,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9718
9866
  resolve: {
9719
9867
  ...farmConfig.resolve,
9720
9868
  ...userConfig.resolve,
9721
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _482 => _482.resolve, 'optionalAccess', _483 => _483.alias]), _optionalChain([userConfig, 'access', _484 => _484.resolve, 'optionalAccess', _485 => _485.alias])),
9869
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _500 => _500.resolve, 'optionalAccess', _501 => _501.alias]), _optionalChain([userConfig, 'access', _502 => _502.resolve, 'optionalAccess', _503 => _503.alias])),
9722
9870
  dedupe: Array.from(
9723
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _486 => _486.resolve, 'optionalAccess', _487 => _487.dedupe]) || [], ..._optionalChain([userConfig, 'access', _488 => _488.resolve, 'optionalAccess', _489 => _489.dedupe]) || []])
9871
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _504 => _504.resolve, 'optionalAccess', _505 => _505.dedupe]) || [], ..._optionalChain([userConfig, 'access', _506 => _506.resolve, 'optionalAccess', _507 => _507.dedupe]) || []])
9724
9872
  )
9725
9873
  },
9726
9874
  optimizeDeps: {
@@ -9730,21 +9878,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9730
9878
  holdUntilCrawlEnd,
9731
9879
  include: Array.from(
9732
9880
  /* @__PURE__ */ new Set([
9733
- ..._optionalChain([farmConfig, 'access', _490 => _490.optimizeDeps, 'optionalAccess', _491 => _491.include]) || [],
9734
- ..._optionalChain([userConfig, 'access', _492 => _492.optimizeDeps, 'optionalAccess', _493 => _493.include]) || []
9881
+ ..._optionalChain([farmConfig, 'access', _508 => _508.optimizeDeps, 'optionalAccess', _509 => _509.include]) || [],
9882
+ ..._optionalChain([userConfig, 'access', _510 => _510.optimizeDeps, 'optionalAccess', _511 => _511.include]) || []
9735
9883
  ])
9736
9884
  ),
9737
9885
  exclude: Array.from(
9738
9886
  /* @__PURE__ */ new Set([
9739
- ..._optionalChain([farmConfig, 'access', _494 => _494.optimizeDeps, 'optionalAccess', _495 => _495.exclude]) || [],
9740
- ..._optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.exclude]) || []
9887
+ ..._optionalChain([farmConfig, 'access', _512 => _512.optimizeDeps, 'optionalAccess', _513 => _513.exclude]) || [],
9888
+ ..._optionalChain([userConfig, 'access', _514 => _514.optimizeDeps, 'optionalAccess', _515 => _515.exclude]) || []
9741
9889
  ])
9742
9890
  )
9743
9891
  },
9744
9892
  ssr: {
9745
9893
  ...farmConfig.ssr,
9746
9894
  ...userConfig.ssr,
9747
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _498 => _498.ssr, 'optionalAccess', _499 => _499.noExternal]), _optionalChain([userConfig, 'access', _500 => _500.ssr, 'optionalAccess', _501 => _501.noExternal]))
9895
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _516 => _516.ssr, 'optionalAccess', _517 => _517.noExternal]), _optionalChain([userConfig, 'access', _518 => _518.ssr, 'optionalAccess', _519 => _519.noExternal]))
9748
9896
  }
9749
9897
  };
9750
9898
  }
@@ -9798,7 +9946,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9798
9946
  ...farmConfig.build,
9799
9947
  rollupOptions: {
9800
9948
  ...userBundlerOptions,
9801
- ..._optionalChain([farmConfig, 'access', _502 => _502.build, 'optionalAccess', _503 => _503.rollupOptions])
9949
+ ..._optionalChain([farmConfig, 'access', _520 => _520.build, 'optionalAccess', _521 => _521.rollupOptions])
9802
9950
  }
9803
9951
  },
9804
9952
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -9806,7 +9954,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9806
9954
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
9807
9955
  ssr: {
9808
9956
  ...merged.ssr,
9809
- external: mergeExternal(_optionalChain([farmConfig, 'access', _504 => _504.ssr, 'optionalAccess', _505 => _505.external]), _optionalChain([userConfig, 'access', _506 => _506.ssr, 'optionalAccess', _507 => _507.external]))
9957
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _522 => _522.ssr, 'optionalAccess', _523 => _523.external]), _optionalChain([userConfig, 'access', _524 => _524.ssr, 'optionalAccess', _525 => _525.external]))
9810
9958
  }
9811
9959
  };
9812
9960
  }
@@ -9843,7 +9991,7 @@ function redactFarmDocsClientConfig(code, filename) {
9843
9991
  const current = node;
9844
9992
  if (current.type === "Property") {
9845
9993
  const name = propertyKeyName(current);
9846
- const valueType = _optionalChain([current, 'access', _508 => _508.value, 'optionalAccess', _509 => _509.type]);
9994
+ const valueType = _optionalChain([current, 'access', _526 => _526.value, 'optionalAccess', _527 => _527.type]);
9847
9995
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkHITLGIAOcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
9848
9996
  if (name && credential) {
9849
9997
  edits.push(
@@ -9875,7 +10023,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
9875
10023
  if (file === configModule) return true;
9876
10024
  try {
9877
10025
  return file === _fs.realpathSync.call(void 0, configModule).replace(/\\/g, "/");
9878
- } catch (e33) {
10026
+ } catch (e34) {
9879
10027
  return false;
9880
10028
  }
9881
10029
  }
@@ -9885,7 +10033,7 @@ function farmDocsClientConfigPlugin(configModule) {
9885
10033
  name: "farm:docs-client-config",
9886
10034
  enforce: "pre",
9887
10035
  transform(code, id, options) {
9888
- if (_optionalChain([options, 'optionalAccess', _510 => _510.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
10036
+ if (_optionalChain([options, 'optionalAccess', _528 => _528.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
9889
10037
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
9890
10038
  return redacted === null ? null : { code: redacted, map: null };
9891
10039
  }
@@ -9960,14 +10108,19 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
9960
10108
  // src/vite.ts
9961
10109
  var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
9962
10110
  function farmLlmsTxtGeneratedPaths(config) {
9963
- const llms = _chunkRU3M2FIKcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _511 => _511.agent, 'optionalAccess', _512 => _512.llmsTxt]));
10111
+ const llms = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _529 => _529.agent, 'optionalAccess', _530 => _530.llmsTxt]));
9964
10112
  if (!llms.enabled) return [];
9965
10113
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
9966
10114
  }
9967
10115
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
9968
10116
  function farmAgentGeneratedPaths(config) {
9969
- const crawlers = _chunkRU3M2FIKcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _513 => _513.agent, 'optionalAccess', _514 => _514.crawlers]));
9970
- return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
10117
+ const crawlers = _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _531 => _531.agent, 'optionalAccess', _532 => _532.crawlers]));
10118
+ const sitemap = _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _533 => _533.agent, 'optionalAccess', _534 => _534.sitemap]));
10119
+ return [
10120
+ ...farmLlmsTxtGeneratedPaths(config),
10121
+ ...sitemap.enabled ? ["/sitemap.xml"] : [],
10122
+ ...crawlers.enabled ? ["/robots.txt"] : []
10123
+ ];
9971
10124
  }
9972
10125
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
9973
10126
  var ALL_TYPE_ARTIFACTS = {
@@ -10012,7 +10165,7 @@ function loadFarmWorkflowsDevRuntime() {
10012
10165
  }
10013
10166
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
10014
10167
  function loadFarmDevtoolsSnapshotRuntime() {
10015
- return import("./devtools-EAUY43BS.cjs");
10168
+ return import("./devtools-JXFQNWSH.cjs");
10016
10169
  }
10017
10170
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
10018
10171
  function loadFarmDevtoolsUIRuntime() {
@@ -10028,7 +10181,7 @@ function farmI18nClientBridgePlugin() {
10028
10181
  name: "farm:i18n-client-bridge",
10029
10182
  enforce: "pre",
10030
10183
  resolveId(id, _importer, options) {
10031
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _515 => _515.ssr])) {
10184
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _535 => _535.ssr])) {
10032
10185
  return FARM_I18N_CLIENT_BRIDGE_ID;
10033
10186
  }
10034
10187
  return null;
@@ -10053,7 +10206,7 @@ function farmServerOnlyEntriesPlugin() {
10053
10206
  resolveId(id, importer, options) {
10054
10207
  if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
10055
10208
  const importedBy = importer ? ` (imported by ${importer})` : "";
10056
- if (!_optionalChain([options, 'optionalAccess', _516 => _516.ssr])) {
10209
+ if (!_optionalChain([options, 'optionalAccess', _536 => _536.ssr])) {
10057
10210
  this.error(
10058
10211
  `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
10059
10212
  );
@@ -10099,11 +10252,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
10099
10252
  if (!snapshot) return "";
10100
10253
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
10101
10254
  if (snapshot.routing === "none") return runtime;
10102
- return `${_chunkIPXLADVOcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10255
+ return `${_chunkLOFKRKO7cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10103
10256
  }
10104
10257
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
10105
10258
  function getPublicEnvDefine(config) {
10106
- const publicEnv = _optionalChain([config, 'access', _517 => _517.env, 'optionalAccess', _518 => _518.public]);
10259
+ const publicEnv = _optionalChain([config, 'access', _537 => _537.env, 'optionalAccess', _538 => _538.public]);
10107
10260
  if (!isResolvedEnvScope(publicEnv)) {
10108
10261
  return {};
10109
10262
  }
@@ -10126,7 +10279,7 @@ function createRequestFromNodeRequest(req, url, signal) {
10126
10279
  });
10127
10280
  }
10128
10281
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRequestFromNodeRequest, "createRequestFromNodeRequest");
10129
- function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2)) {
10282
+ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, request2)) {
10130
10283
  const middleware = _chunkMQ3H6LT5cjs._withAfterNodeMiddleware.call(void 0, handler);
10131
10284
  return (req, res, next) => {
10132
10285
  const traceUrl = resolveTraceUrl(req);
@@ -10144,7 +10297,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
10144
10297
  return;
10145
10298
  }
10146
10299
  if (res.headersSent) {
10147
- _optionalChain([res, 'access', _519 => _519.destroy, 'optionalCall', _520 => _520(error instanceof Error ? error : new Error(String(error)))]);
10300
+ _optionalChain([res, 'access', _539 => _539.destroy, 'optionalCall', _540 => _540(error instanceof Error ? error : new Error(String(error)))]);
10148
10301
  return;
10149
10302
  }
10150
10303
  res.statusCode = 500;
@@ -10243,7 +10396,7 @@ function interceptFarmDevPageResponse(options) {
10243
10396
  const originalWrite = res.write.bind(res);
10244
10397
  const originalEnd = res.end.bind(res);
10245
10398
  const originalWriteHead = res.writeHead.bind(res);
10246
- const originalFlushHeaders = _optionalChain([res, 'access', _521 => _521.flushHeaders, 'optionalAccess', _522 => _522.bind, 'call', _523 => _523(res)]);
10399
+ const originalFlushHeaders = _optionalChain([res, 'access', _541 => _541.flushHeaders, 'optionalAccess', _542 => _542.bind, 'call', _543 => _543(res)]);
10247
10400
  let afterResponseCalled = false;
10248
10401
  let interceptedEnd = false;
10249
10402
  const htmlChunks = [];
@@ -10283,7 +10436,7 @@ function interceptFarmDevPageResponse(options) {
10283
10436
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
10284
10437
  if (shouldBufferResponse) {
10285
10438
  const callback = args.find((arg) => typeof arg === "function");
10286
- _optionalChain([callback, 'optionalCall', _524 => _524()]);
10439
+ _optionalChain([callback, 'optionalCall', _544 => _544()]);
10287
10440
  return true;
10288
10441
  }
10289
10442
  const writeResult = originalWrite(chunk, ...args);
@@ -10398,14 +10551,14 @@ function getEnvDefines(config, configEnv) {
10398
10551
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
10399
10552
  )
10400
10553
  };
10401
- if (_optionalChain([configEnv, 'optionalAccess', _525 => _525.isSsrBuild])) {
10554
+ if (_optionalChain([configEnv, 'optionalAccess', _545 => _545.isSsrBuild])) {
10402
10555
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
10403
10556
  }
10404
10557
  return defines;
10405
10558
  }
10406
10559
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
10407
10560
  function getFarmAPIBaseURLDefine(config) {
10408
- const baseURL = _optionalChain([config, 'access', _526 => _526.api, 'optionalAccess', _527 => _527.baseURL]);
10561
+ const baseURL = _optionalChain([config, 'access', _546 => _546.api, 'optionalAccess', _547 => _547.baseURL]);
10409
10562
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
10410
10563
  }
10411
10564
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -10428,7 +10581,7 @@ function fileContainsProgrammaticPageRoute(file) {
10428
10581
  }
10429
10582
  try {
10430
10583
  return _chunk6V4TDWECcjs.scanProgrammaticPagePaths.call(void 0, fs11.readFileSync(file, "utf8")).length > 0;
10431
- } catch (e34) {
10584
+ } catch (e35) {
10432
10585
  return false;
10433
10586
  }
10434
10587
  }
@@ -10442,7 +10595,7 @@ function rewriteEarlySsrRelativeImports(options) {
10442
10595
  let ast;
10443
10596
  try {
10444
10597
  ast = options.parse(options.code);
10445
- } catch (e35) {
10598
+ } catch (e36) {
10446
10599
  return null;
10447
10600
  }
10448
10601
  walkModuleAst(ast, (node) => {
@@ -10474,7 +10627,7 @@ function transformIsolatedClientBoundaryModule(options) {
10474
10627
  let ast;
10475
10628
  try {
10476
10629
  ast = options.parse(options.code);
10477
- } catch (e36) {
10630
+ } catch (e37) {
10478
10631
  return null;
10479
10632
  }
10480
10633
  const body = Array.isArray(ast.body) ? ast.body : [];
@@ -10495,9 +10648,9 @@ function transformIsolatedClientBoundaryModule(options) {
10495
10648
  transformedExports++;
10496
10649
  }, "addWrapper");
10497
10650
  for (const node of body) {
10498
- if (_optionalChain([node, 'optionalAccess', _528 => _528.type]) === "ExportDefaultDeclaration" && node.declaration) {
10651
+ if (_optionalChain([node, 'optionalAccess', _548 => _548.type]) === "ExportDefaultDeclaration" && node.declaration) {
10499
10652
  const declaration2 = node.declaration;
10500
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _529 => _529.id, 'optionalAccess', _530 => _530.name])) {
10653
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _549 => _549.id, 'optionalAccess', _550 => _550.name])) {
10501
10654
  replacements.push({
10502
10655
  start: node.start,
10503
10656
  end: node.end,
@@ -10515,14 +10668,14 @@ function transformIsolatedClientBoundaryModule(options) {
10515
10668
  }
10516
10669
  continue;
10517
10670
  }
10518
- if (_optionalChain([node, 'optionalAccess', _531 => _531.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10671
+ if (_optionalChain([node, 'optionalAccess', _551 => _551.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10519
10672
  const declaration = node.declaration;
10520
10673
  const declaredNames = [];
10521
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _532 => _532.id, 'optionalAccess', _533 => _533.name])) {
10674
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _552 => _552.id, 'optionalAccess', _553 => _553.name])) {
10522
10675
  declaredNames.push(declaration.id.name);
10523
10676
  } else if (declaration.type === "VariableDeclaration") {
10524
10677
  for (const declarator of declaration.declarations || []) {
10525
- if (_optionalChain([declarator, 'access', _534 => _534.id, 'optionalAccess', _535 => _535.type]) === "Identifier") declaredNames.push(declarator.id.name);
10678
+ if (_optionalChain([declarator, 'access', _554 => _554.id, 'optionalAccess', _555 => _555.type]) === "Identifier") declaredNames.push(declarator.id.name);
10526
10679
  }
10527
10680
  }
10528
10681
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -10583,10 +10736,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
10583
10736
  let program;
10584
10737
  try {
10585
10738
  program = context.parse(code);
10586
- } catch (e37) {
10739
+ } catch (e38) {
10587
10740
  return;
10588
10741
  }
10589
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _536 => _536.env, 'optionalAccess', _537 => _537.public]), () => ( {}))));
10742
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _556 => _556.env, 'optionalAccess', _557 => _557.public]), () => ( {}))));
10590
10743
  const findings = analyzeClientBoundary(program, publicKeys);
10591
10744
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
10592
10745
  return;
@@ -10642,8 +10795,8 @@ function farmPlugin(options = {}, initialPluginManager) {
10642
10795
  name: "farm",
10643
10796
  config(userConfig, configEnv) {
10644
10797
  isBuild = configEnv.command === "build";
10645
- const layerAliases = _chunkVPTDD5XFcjs.getFarmLayerAliases.call(void 0, options.layers);
10646
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _538 => _538.resolve, 'optionalAccess', _539 => _539.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10798
+ const layerAliases = _chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, options.layers);
10799
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _558 => _558.resolve, 'optionalAccess', _559 => _559.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10647
10800
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
10648
10801
  return {
10649
10802
  // Honor Farm's publicDir so the dev server serves the same static
@@ -10659,7 +10812,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10659
10812
  server: {
10660
10813
  fs: {
10661
10814
  ...layerRoots.length ? { allow: [path21.resolve(options.root || process.cwd()), ...layerRoots] } : {},
10662
- deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _540 => _540.server, 'optionalAccess', _541 => _541.fs, 'optionalAccess', _542 => _542.deny]), options)
10815
+ deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _560 => _560.server, 'optionalAccess', _561 => _561.fs, 'optionalAccess', _562 => _562.deny]), options)
10663
10816
  }
10664
10817
  }
10665
10818
  };
@@ -10671,7 +10824,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10671
10824
  serverFnTransformActive = config.plugins.some(
10672
10825
  (plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
10673
10826
  );
10674
- if (_optionalChain([options, 'access', _543 => _543.experimental, 'optionalAccess', _544 => _544.serverActions]) === true && !serverFnTransformActive) {
10827
+ if (_optionalChain([options, 'access', _563 => _563.experimental, 'optionalAccess', _564 => _564.serverActions]) === true && !serverFnTransformActive) {
10675
10828
  _chunk5QIKR7RRcjs.logger.warn(
10676
10829
  "experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
10677
10830
  );
@@ -10680,7 +10833,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10680
10833
  async configureServer(viteServer) {
10681
10834
  viteServer.middlewares.use(
10682
10835
  createFarmDevPreviewGuard(viteServer, {
10683
- getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _545 => _545.getConfig, 'call', _546 => _546()]), () => ( options))), "getSourceRoots")
10836
+ getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _565 => _565.getConfig, 'call', _566 => _566()]), () => ( options))), "getSourceRoots")
10684
10837
  })
10685
10838
  );
10686
10839
  if (typeof fontImports.configureServer === "function") {
@@ -10692,7 +10845,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10692
10845
  if (!pm) return;
10693
10846
  try {
10694
10847
  await pm.runHookParallel("onError", { phase, error, meta });
10695
- } catch (e38) {
10848
+ } catch (e39) {
10696
10849
  }
10697
10850
  }, "emitPluginError");
10698
10851
  farmApp = new FarmApp(
@@ -10705,27 +10858,27 @@ function farmPlugin(options = {}, initialPluginManager) {
10705
10858
  await farmApp.initialize();
10706
10859
  const farmConfig = farmApp.getConfig();
10707
10860
  let farmAppPackages;
10708
- if (_optionalChain([farmConfig, 'access', _547 => _547.agent, 'optionalAccess', _548 => _548.noindexPreviews])) {
10861
+ if (_optionalChain([farmConfig, 'access', _567 => _567.agent, 'optionalAccess', _568 => _568.noindexPreviews])) {
10709
10862
  server.middlewares.use((_req, res, next) => {
10710
10863
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
10711
- res.setHeader("X-Robots-Tag", _chunkRU3M2FIKcjs.FARM_PREVIEW_ROBOTS_TAG);
10864
+ res.setHeader("X-Robots-Tag", _chunkMRMI32SNcjs.FARM_PREVIEW_ROBOTS_TAG);
10712
10865
  }
10713
10866
  next();
10714
10867
  });
10715
10868
  }
10716
10869
  const apiServerBasePath = _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
10717
- const serverConfig = _chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, farmConfig.server);
10870
+ const serverConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, farmConfig.server);
10718
10871
  globalThis.__FARM_IMAGE_CONFIG__ = _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, farmConfig.images);
10719
10872
  let imageHandler = null;
10720
10873
  if (farmConfig.images.provider !== "none") {
10721
10874
  const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
10722
- imageHandler = _chunk7GLPRTTFcjs.createFarmImageHandler.call(void 0, farmConfig.images, {
10875
+ imageHandler = _chunkCGBDNNSMcjs.createFarmImageHandler.call(void 0, farmConfig.images, {
10723
10876
  transform: createSharpImageTransformer(),
10724
10877
  fetchRemote: createNodeImageFetcher(farmConfig.images),
10725
10878
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
10726
10879
  // Vite owns this address. Unlike request.url, it cannot be replaced by
10727
10880
  // a caller-controlled Host header.
10728
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _549 => _549.resolvedUrls, 'optionalAccess', _550 => _550.local, 'access', _551 => _551[0]]), "trustedLocalOrigin"),
10881
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _569 => _569.resolvedUrls, 'optionalAccess', _570 => _570.local, 'access', _571 => _571[0]]), "trustedLocalOrigin"),
10729
10882
  onError(error) {
10730
10883
  _chunk5QIKR7RRcjs.logger.error(
10731
10884
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -10733,7 +10886,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10733
10886
  }
10734
10887
  });
10735
10888
  }
10736
- const sourceRoots = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, farmConfig);
10889
+ const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, farmConfig);
10737
10890
  server.watcher.add(sourceRoots.map((source) => path21.join(source.root, source.srcDir)));
10738
10891
  if (farmConfig.i18n.enabled) {
10739
10892
  server.watcher.add(
@@ -10745,15 +10898,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10745
10898
  const workflowConfig = farmConfig.workflows;
10746
10899
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
10747
10900
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
10748
- ..._optionalChain([options, 'access', _552 => _552.openapi, 'optionalAccess', _553 => _553.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10749
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _554 => _554.getFarmDocsRouteTypeEntries, 'call', _555 => _555(farmConfig.docs)]), () => ( []))
10901
+ ..._optionalChain([options, 'access', _572 => _572.openapi, 'optionalAccess', _573 => _573.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10902
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _574 => _574.getFarmDocsRouteTypeEntries, 'call', _575 => _575(farmConfig.docs)]), () => ( []))
10750
10903
  ], "getExtraRouteTypes");
10751
10904
  const appDirSlugs = sourceRoots.map(
10752
10905
  (source) => path21.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
10753
10906
  );
10754
10907
  const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
10755
10908
  try {
10756
- const result = await _chunk3BHT4WMPcjs.generateFarmTypeArtifacts.call(void 0, {
10909
+ const result = await _chunk5D2JIPLHcjs.generateFarmTypeArtifacts.call(void 0, {
10757
10910
  root: farmConfig.root,
10758
10911
  srcDir: farmConfig.srcDir,
10759
10912
  layers: farmConfig.layers,
@@ -10793,7 +10946,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10793
10946
  (source) => path21.join(source.root, source.srcDir).replace(/\\/g, "/")
10794
10947
  );
10795
10948
  const layerConfigFiles = new Set(
10796
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _556 => _556.configFile, 'optionalAccess', _557 => _557.replace, 'call', _558 => _558(/\\/g, "/")])).filter((file) => Boolean(file))
10949
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _576 => _576.configFile, 'optionalAccess', _577 => _577.replace, 'call', _578 => _578(/\\/g, "/")])).filter((file) => Boolean(file))
10797
10950
  );
10798
10951
  const routeModuleExtensions = /* @__PURE__ */ new Set([
10799
10952
  ..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
@@ -10856,7 +11009,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10856
11009
  ["add", "change", "unlink"].forEach((ev) => {
10857
11010
  server.watcher.on(ev, (file) => {
10858
11011
  if (ev === "add") {
10859
- _chunkBMWDEBXOcjs.invalidateFailedFarmDevModules.call(void 0, server);
11012
+ _chunkSHLXACIOcjs.invalidateFailedFarmDevModules.call(void 0, server);
10860
11013
  }
10861
11014
  const normalizedFile = file.replace(/\\/g, "/");
10862
11015
  const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
@@ -10872,7 +11025,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10872
11025
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
10873
11026
  }
10874
11027
  if (isI18nCatalogFile(file)) {
10875
- _optionalChain([farmApp, 'optionalAccess', _559 => _559.getI18nRuntime, 'call', _560 => _560(), 'access', _561 => _561.reload, 'call', _562 => _562(), 'access', _563 => _563.then, 'call', _564 => _564(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _565 => _565.catch, 'call', _566 => _566((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
11028
+ _optionalChain([farmApp, 'optionalAccess', _579 => _579.getI18nRuntime, 'call', _580 => _580(), 'access', _581 => _581.reload, 'call', _582 => _582(), 'access', _583 => _583.then, 'call', _584 => _584(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _585 => _585.catch, 'call', _586 => _586((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
10876
11029
  }
10877
11030
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
10878
11031
  if (isRouteRefreshEvent) {
@@ -10885,15 +11038,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10885
11038
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
10886
11039
  pendingRouteRefreshIncludesMiddleware = false;
10887
11040
  Promise.all([
10888
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _567 => _567(`${ev} ${file}`)]),
10889
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _568 => _568.reload, 'call', _569 => _569()]) : void 0
11041
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _587 => _587(`${ev} ${file}`)]),
11042
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _588 => _588.reload, 'call', _589 => _589()]) : void 0
10890
11043
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
10891
11044
  }, 50);
10892
11045
  }
10893
11046
  }
10894
11047
  });
10895
11048
  });
10896
- const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, farmConfig);
11049
+ const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, farmConfig);
10897
11050
  const routeManager = farmApp.getRouteManager();
10898
11051
  const discoveredRoutes = [];
10899
11052
  for (const [pattern, entry] of routeManager.getRoutes()) {
@@ -10920,13 +11073,22 @@ function farmPlugin(options = {}, initialPluginManager) {
10920
11073
  layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
10921
11074
  });
10922
11075
  }
10923
- apiRouteManager = new (0, _chunkXBML5KMGcjs.APIRouteManager)(appDirs, server, {
11076
+ const dispatchToDevServer = _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server);
11077
+ apiRouteManager = new (0, _chunkU6MPZ35Qcjs.APIRouteManager)(appDirs, server, {
10924
11078
  plugins: farmConfig.plugins,
10925
11079
  i18n: farmApp.getI18nRuntime(),
10926
11080
  bodySizeLimit: serverConfig.bodySizeLimit,
10927
- basePath: apiServerBasePath
11081
+ basePath: apiServerBasePath,
11082
+ // A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
11083
+ // so the endpoint's middleware and integration guards run for it, as in production.
11084
+ dispatch: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (request2) => {
11085
+ const url = new URL(request2.url);
11086
+ url.pathname = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, url.pathname, farmConfig.basePath);
11087
+ return dispatchToDevServer(new Request(url, request2));
11088
+ }, "dispatch")
10928
11089
  });
10929
11090
  await apiRouteManager.discoverRoutes();
11091
+ farmApp.getServerRenderer().setAPIRouteLookup((routePath) => apiRouteManager.getRoutes().has(routePath));
10930
11092
  let discoveredWorkflows = [];
10931
11093
  const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
10932
11094
  (dir) => fs11.existsSync(path21.isAbsolute(dir) ? dir : path21.join(farmConfig.root, dir))
@@ -10936,14 +11098,14 @@ function farmPlugin(options = {}, initialPluginManager) {
10936
11098
  discoveredWorkflows = await discoverFarmWorkflows(
10937
11099
  { ...farmConfig, workflows: workflowConfig },
10938
11100
  {
10939
- loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath), "loadModule")
11101
+ loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) => _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, filePath), "loadModule")
10940
11102
  }
10941
11103
  );
10942
11104
  if (discoveredWorkflows.length > 0) {
10943
11105
  workflowHandler = createFarmWorkflowRequestHandler({
10944
11106
  workflows: discoveredWorkflows,
10945
11107
  config: workflowConfig,
10946
- loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, workflow.filePath), "loadModule"),
11108
+ loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) => _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, workflow.filePath), "loadModule"),
10947
11109
  server: farmConfig.server
10948
11110
  });
10949
11111
  _chunk5QIKR7RRcjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
@@ -10958,7 +11120,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10958
11120
  });
10959
11121
  }
10960
11122
  }
10961
- middlewareManager = new (0, _chunkULAWS2PAcjs.MiddlewareManager)(
11123
+ middlewareManager = new (0, _chunkLPFV45AYcjs.MiddlewareManager)(
10962
11124
  appDirs,
10963
11125
  server,
10964
11126
  farmConfig.middleware,
@@ -10976,11 +11138,11 @@ function farmPlugin(options = {}, initialPluginManager) {
10976
11138
  });
10977
11139
  }
10978
11140
  }
10979
- if (_optionalChain([options, 'access', _570 => _570.openapi, 'optionalAccess', _571 => _571.enabled])) {
11141
+ if (_optionalChain([options, 'access', _590 => _590.openapi, 'optionalAccess', _591 => _591.enabled])) {
10980
11142
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
10981
11143
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
10982
11144
  mode: "development",
10983
- apiBaseURL: typeof _optionalChain([options, 'access', _572 => _572.api, 'optionalAccess', _573 => _573.baseURL]) === "string" ? options.api.baseURL : void 0
11145
+ apiBaseURL: typeof _optionalChain([options, 'access', _592 => _592.api, 'optionalAccess', _593 => _593.baseURL]) === "string" ? options.api.baseURL : void 0
10984
11146
  });
10985
11147
  const spec = await openAPIManager.generateSpec();
10986
11148
  reportOpenAPIDevGenerationResult(spec);
@@ -11020,13 +11182,13 @@ function farmPlugin(options = {}, initialPluginManager) {
11020
11182
  ),
11021
11183
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
11022
11184
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
11023
- if (specifier === _optionalChain([farmConfig, 'access', _574 => _574.docs, 'access', _575 => _575.adapter, 'optionalAccess', _576 => _576.server]) && _optionalChain([resolved, 'optionalAccess', _577 => _577.id])) {
11185
+ if (specifier === _optionalChain([farmConfig, 'access', _594 => _594.docs, 'access', _595 => _595.adapter, 'optionalAccess', _596 => _596.server]) && _optionalChain([resolved, 'optionalAccess', _597 => _597.id])) {
11024
11186
  return import(
11025
11187
  /* @vite-ignore */
11026
11188
  _url.pathToFileURL.call(void 0, resolved.id).href
11027
11189
  );
11028
11190
  }
11029
- return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _578 => _578.id]), () => ( specifier)));
11191
+ return _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _598 => _598.id]), () => ( specifier)));
11030
11192
  }, "loadModule"),
11031
11193
  registerMCPServer: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (mcpServer) => {
11032
11194
  const dispose = _chunk75RZHGLScjs.registerFarmMCPServer.call(void 0, mcpServer);
@@ -11049,7 +11211,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11049
11211
  )
11050
11212
  }) : null;
11051
11213
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
11052
- if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _579 => _579.headers, 'access', _580 => _580.get, 'call', _581 => _581("content-type"), 'optionalAccess', _582 => _582.toLowerCase, 'call', _583 => _583(), 'access', _584 => _584.includes, 'call', _585 => _585("text/html")])) {
11214
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _599 => _599.headers, 'access', _600 => _600.get, 'call', _601 => _601("content-type"), 'optionalAccess', _602 => _602.toLowerCase, 'call', _603 => _603(), 'access', _604 => _604.includes, 'call', _605 => _605("text/html")])) {
11053
11215
  return response;
11054
11216
  }
11055
11217
  const pathname = new URL(request2.url).pathname;
@@ -11070,9 +11232,9 @@ function farmPlugin(options = {}, initialPluginManager) {
11070
11232
  headers: response.headers
11071
11233
  });
11072
11234
  }
11073
- const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _586 => _586.getConfig, 'call', _587 => _587()]), () => ( options))).renderer);
11235
+ const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _606 => _606.getConfig, 'call', _607 => _607()]), () => ( options))).renderer);
11074
11236
  const [rendererRuntime, layoutModules] = await Promise.all([
11075
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
11237
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
11076
11238
  Promise.all(
11077
11239
  layoutEntries.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
11078
11240
  )
@@ -11099,7 +11261,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11099
11261
  ])
11100
11262
  );
11101
11263
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
11102
- const pageModulePath = _optionalChain([matchedRoute, 'access', _588 => _588.route, 'optionalAccess', _589 => _589.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11264
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _608 => _608.route, 'optionalAccess', _609 => _609.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11103
11265
  const bootstrapScript = `<script>
11104
11266
  window.__FARM_PROPS__ = ${inlineValue({ params })};
11105
11267
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -11194,9 +11356,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11194
11356
  }, "dispatch")
11195
11357
  },
11196
11358
  (request2) => {
11197
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _590 => _590.getConfig, 'call', _591 => _591()]), () => ( options));
11198
- const currentServerConfig = _chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11199
- return _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2, {
11359
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _610 => _610.getConfig, 'call', _611 => _611()]), () => ( options));
11360
+ const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11361
+ return _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, request2, {
11200
11362
  trustProxy: currentServerConfig.trustProxy
11201
11363
  });
11202
11364
  }
@@ -11205,9 +11367,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11205
11367
  withAPIRequestTracing(async (req, res, next) => {
11206
11368
  const requestUrl = req.url || "/";
11207
11369
  const requestMethod = req.method || "GET";
11208
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _592 => _592.getConfig, 'call', _593 => _593()]), () => ( options));
11209
- const currentServerConfig = _chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11210
- const parsedRequestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
11370
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _612 => _612.getConfig, 'call', _613 => _613()]), () => ( options));
11371
+ const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11372
+ const parsedRequestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
11211
11373
  trustProxy: currentServerConfig.trustProxy
11212
11374
  });
11213
11375
  const fullUrl = parsedRequestUrl.toString();
@@ -11247,7 +11409,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11247
11409
  if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH)) {
11248
11410
  launchUrl = referrerUrl;
11249
11411
  }
11250
- } catch (e39) {
11412
+ } catch (e40) {
11251
11413
  }
11252
11414
  }
11253
11415
  launchUrl.searchParams.set(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
@@ -11273,7 +11435,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11273
11435
  openapi: options.openapi
11274
11436
  },
11275
11437
  workflows: discoveredWorkflows,
11276
- plugins: _optionalChain([pm, 'optionalAccess', _594 => _594.getSortedPlugins, 'call', _595 => _595()])
11438
+ plugins: _optionalChain([pm, 'optionalAccess', _614 => _614.getSortedPlugins, 'call', _615 => _615()])
11277
11439
  });
11278
11440
  res.statusCode = 200;
11279
11441
  res.setHeader(
@@ -11296,7 +11458,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11296
11458
  return;
11297
11459
  }
11298
11460
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11299
- if (!_optionalChain([middlewareManager, 'optionalAccess', _596 => _596.hasMiddleware, 'call', _597 => _597()])) return false;
11461
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _616 => _616.hasMiddleware, 'call', _617 => _617()])) return false;
11300
11462
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
11301
11463
  return runFarmMiddlewareWithNavigation(
11302
11464
  farmApp.getServerRenderer(),
@@ -11307,7 +11469,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11307
11469
  );
11308
11470
  }, "runAppMiddlewareForContentRoute");
11309
11471
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
11310
- if (openAPIManager && _optionalChain([options, 'access', _598 => _598.openapi, 'optionalAccess', _599 => _599.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11472
+ if (openAPIManager && _optionalChain([options, 'access', _618 => _618.openapi, 'optionalAccess', _619 => _619.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11311
11473
  if (await runAppMiddlewareForContentRoute()) return;
11312
11474
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
11313
11475
  res.statusCode = 405;
@@ -11324,35 +11486,43 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11324
11486
  res.end(requestMethod === "HEAD" ? void 0 : body);
11325
11487
  return;
11326
11488
  }
11327
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _600 => _600.openapi, 'optionalAccess', _601 => _601.route])) {
11489
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _620 => _620.openapi, 'optionalAccess', _621 => _621.route])) {
11328
11490
  if (await runAppMiddlewareForContentRoute()) return;
11329
11491
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
11330
11492
  return docsHandler(req, res);
11331
11493
  }
11332
- if (_chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkIPXLADVOcjs.FARM_APP_MANIFEST_PATH) {
11494
+ if (_optionalChain([options, 'access', _622 => _622.agent, 'optionalAccess', _623 => _623.manifest]) !== false && _chunkLOFKRKO7cjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
11495
+ if (await runAppMiddlewareForContentRoute()) return;
11333
11496
  _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = resolveFarmAppPackages(_nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
11334
- const manifest = await _chunkIPXLADVOcjs.createFarmAppManifestResponse.call(void 0,
11335
- new Request(parsedRequestUrl, { method: requestMethod }),
11336
- _chunkIPXLADVOcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11337
- build: "development",
11338
- packages: farmAppPackages,
11339
- // Read again on each request; unchanged files come from a cache.
11340
- webmcpTools: _optionalChain([farmConfig, 'access', _602 => _602.plugins, 'optionalAccess', _603 => _603.some, 'call', _604 => _604(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11497
+ const header = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (name) => String(_nullishCoalesce(req.headers[name], () => ( ""))), "header");
11498
+ const manifest = await _chunkLOFKRKO7cjs.createFarmAppManifestResponse.call(void 0,
11499
+ new Request(parsedRequestUrl, {
11500
+ method: requestMethod,
11501
+ headers: {
11502
+ "if-none-match": header("if-none-match"),
11503
+ [_chunkLOFKRKO7cjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunkLOFKRKO7cjs.FARM_INFRA_SIGNATURE_HEADER)
11504
+ }
11341
11505
  }),
11342
- { development: true }
11506
+ {
11507
+ ..._chunkLOFKRKO7cjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11508
+ build: "development",
11509
+ packages: farmAppPackages,
11510
+ // Read again on each request; unchanged files come from a cache.
11511
+ webmcpTools: _optionalChain([farmConfig, 'access', _624 => _624.plugins, 'optionalAccess', _625 => _625.some, 'call', _626 => _626(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11512
+ }),
11513
+ defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
11514
+ }
11343
11515
  );
11344
- if (manifest) {
11345
- await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, manifest);
11346
- return;
11347
- }
11516
+ await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, manifest);
11517
+ return;
11348
11518
  }
11349
- if (_optionalChain([options, 'access', _605 => _605.agent, 'optionalAccess', _606 => _606.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkIPXLADVOcjs.FARM_API_CATALOG_PATH) {
11519
+ if (_optionalChain([options, 'access', _627 => _627.agent, 'optionalAccess', _628 => _628.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkLOFKRKO7cjs.FARM_API_CATALOG_PATH) {
11350
11520
  if (await runAppMiddlewareForContentRoute()) return;
11351
11521
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
11352
11522
  res,
11353
- _chunkIPXLADVOcjs.createFarmApiCatalogResponse.call(void 0,
11523
+ _chunkLOFKRKO7cjs.createFarmApiCatalogResponse.call(void 0,
11354
11524
  requestMethod,
11355
- _chunkIPXLADVOcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11525
+ _chunkLOFKRKO7cjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11356
11526
  new Request(parsedRequestUrl, {
11357
11527
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
11358
11528
  })
@@ -11360,8 +11530,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11360
11530
  );
11361
11531
  return;
11362
11532
  }
11363
- if (_optionalChain([options, 'access', _607 => _607.agent, 'optionalAccess', _608 => _608.aiCatalog]) !== false) {
11364
- const aiCatalog = _chunkIPXLADVOcjs.createFarmAiCatalogResponse.call(void 0,
11533
+ if (_optionalChain([options, 'access', _629 => _629.agent, 'optionalAccess', _630 => _630.aiCatalog]) !== false) {
11534
+ const aiCatalog = _chunkLOFKRKO7cjs.createFarmAiCatalogResponse.call(void 0,
11365
11535
  new Request(parsedRequestUrl, {
11366
11536
  method: requestMethod,
11367
11537
  headers: {
@@ -11369,7 +11539,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11369
11539
  "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( "")))
11370
11540
  }
11371
11541
  }),
11372
- { basePath: farmConfig.basePath, apiServerBasePath }
11542
+ {
11543
+ basePath: farmConfig.basePath,
11544
+ apiServerBasePath,
11545
+ defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
11546
+ }
11373
11547
  );
11374
11548
  if (aiCatalog) {
11375
11549
  if (await runAppMiddlewareForContentRoute()) return;
@@ -11394,7 +11568,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11394
11568
  method: requestMethod,
11395
11569
  headers: docsHeaders
11396
11570
  });
11397
- const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunkOMVAU7NTcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
11571
+ const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunkKIIMAWOJcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
11398
11572
  const docsResponse = await farmDocsHandler(new Request(docsRequest, docsBodyInit));
11399
11573
  if (docsResponse) {
11400
11574
  if (await runAppMiddlewareForContentRoute()) return;
@@ -11405,7 +11579,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11405
11579
  return;
11406
11580
  }
11407
11581
  }
11408
- const markdownSourceResponse = viteModuleRequest ? null : await _chunkEFCQPQMGcjs.createFarmMarkdownSourceResponse.call(void 0, {
11582
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunkB5PFZLKVcjs.createFarmMarkdownSourceResponse.call(void 0, {
11409
11583
  request: new Request(fullUrl, {
11410
11584
  method: requestMethod,
11411
11585
  headers: docsHeaders
@@ -11413,7 +11587,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11413
11587
  config: farmApp.getConfig().mdx,
11414
11588
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
11415
11589
  const match = farmApp.getRouteManager().matchRoute(pathname2);
11416
- const sourcePath = _optionalChain([match, 'access', _609 => _609.route, 'optionalAccess', _610 => _610.markdownSourcePath]) || (match.route && _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11590
+ const sourcePath = _optionalChain([match, 'access', _631 => _631.route, 'optionalAccess', _632 => _632.markdownSourcePath]) || (match.route && _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11417
11591
  if (!sourcePath) {
11418
11592
  return null;
11419
11593
  }
@@ -11423,11 +11597,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11423
11597
  };
11424
11598
  }, "resolveSource"),
11425
11599
  // The anonymous check goes through this server, so its guards and
11426
- // middleware see the page's own path, as in production.
11427
- renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, {
11428
- redirect: "manual",
11429
- signal: res.destroyed ? AbortSignal.abort() : _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11430
- }), "renderPage")
11600
+ // middleware see the page's own path, as in production. It connects to
11601
+ // this server's own listener, never the host the caller's Host names.
11602
+ renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server)(
11603
+ new Request(request2, {
11604
+ signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11605
+ })
11606
+ ), "renderPage")
11431
11607
  });
11432
11608
  if (markdownSourceResponse) {
11433
11609
  if (await runAppMiddlewareForContentRoute()) return;
@@ -11441,14 +11617,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11441
11617
  }),
11442
11618
  config: farmApp.getConfig().md,
11443
11619
  routeExists: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname2) => Boolean(farmApp.getRouteManager().matchRoute(pathname2).route), "routeExists"),
11444
- // Keep the page's own redirect (a sign-in gate, say) so the mirror
11445
- // answers with it, as production does, instead of the target page.
11446
- renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, {
11447
- redirect: "manual",
11448
- // Only accepted mirrors need disconnect listeners. An earlier
11449
- // close (for example while the docs handler ran) must also abort.
11450
- signal: res.destroyed ? AbortSignal.abort() : _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11451
- }), "renderPage"),
11620
+ // The page is rendered by this server's own listener, never the host the
11621
+ // caller's Host names. Redirects are not followed, so the mirror answers with
11622
+ // the page's own (a sign-in gate, say), as production does.
11623
+ renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
11624
+ const headers = new Headers(request2.headers);
11625
+ headers.delete("accept-encoding");
11626
+ return _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server)(
11627
+ new Request(request2, {
11628
+ headers,
11629
+ // Only accepted mirrors need disconnect listeners. An earlier
11630
+ // close (for example while the docs handler ran) must also abort.
11631
+ signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11632
+ })
11633
+ );
11634
+ }, "renderPage"),
11452
11635
  apiServerBasePath
11453
11636
  });
11454
11637
  if (markdownResponse) {
@@ -11457,7 +11640,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11457
11640
  return;
11458
11641
  }
11459
11642
  if (!viteModuleRequest && _chunkEUV4YR3Vcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
11460
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkEFCQPQMGcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11643
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkB5PFZLKVcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11461
11644
  if (!markdownRoute.route) {
11462
11645
  if (await runAppMiddlewareForContentRoute()) return;
11463
11646
  res.statusCode = 404;
@@ -11495,13 +11678,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11495
11678
  let workflowBody;
11496
11679
  try {
11497
11680
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
11498
- workflowBody = await _chunkOMVAU7NTcjs.readNodeRequestBody.call(void 0,
11681
+ workflowBody = await _chunkKIIMAWOJcjs.readNodeRequestBody.call(void 0,
11499
11682
  req,
11500
11683
  currentServerConfig.bodySizeLimit
11501
11684
  );
11502
11685
  }
11503
11686
  } catch (error) {
11504
- const response = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11687
+ const response = _chunkKIIMAWOJcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11505
11688
  if (!response) throw error;
11506
11689
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
11507
11690
  return;
@@ -11511,7 +11694,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11511
11694
  method: requestMethod,
11512
11695
  headers: docsHeaders,
11513
11696
  body: toRequestBody(workflowBody),
11514
- signal: _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11697
+ signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11515
11698
  })
11516
11699
  );
11517
11700
  if (workflowResponse) {
@@ -11521,7 +11704,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11521
11704
  }
11522
11705
  const configuredIntegrations = currentConfig.integrations;
11523
11706
  const tryConfiguredIntegrationRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11524
- const matchedRoute = _chunkFTFYRMQQcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11707
+ const matchedRoute = _chunkUJZLSXUBcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11525
11708
  pathname: requestPathname,
11526
11709
  method: requestMethod
11527
11710
  });
@@ -11534,8 +11717,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11534
11717
  await pm.runHookParallelFiltered(
11535
11718
  "beforeRequest",
11536
11719
  (plugin) => {
11537
- const owner = _chunkFTFYRMQQcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11538
- return plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _611 => _611.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11720
+ const owner = _chunkUJZLSXUBcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11721
+ return plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _633 => _633.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11539
11722
  },
11540
11723
  req,
11541
11724
  res
@@ -11554,16 +11737,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11554
11737
  }
11555
11738
  let body;
11556
11739
  if (req.method !== "GET" && req.method !== "HEAD") {
11557
- body = await _chunkOMVAU7NTcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11740
+ body = await _chunkKIIMAWOJcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11558
11741
  }
11559
11742
  const integrationRequest = new Request(fullUrl, {
11560
11743
  method: req.method,
11561
11744
  headers,
11562
11745
  body: toRequestBody(body),
11563
- signal: _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11746
+ signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11564
11747
  });
11565
11748
  const dispatchIntegration = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
11566
- const result = await _chunkFTFYRMQQcjs.dispatchIntegrationRequest.call(void 0,
11749
+ const result = await _chunkUJZLSXUBcjs.dispatchIntegrationRequest.call(void 0,
11567
11750
  {
11568
11751
  integration: matchedRoute.integration,
11569
11752
  config: currentConfig,
@@ -11592,7 +11775,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11592
11775
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
11593
11776
  return true;
11594
11777
  } catch (error) {
11595
- const bodyErrorResponse = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11778
+ const bodyErrorResponse = _chunkKIIMAWOJcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11596
11779
  if (bodyErrorResponse) {
11597
11780
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
11598
11781
  return true;
@@ -11626,11 +11809,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11626
11809
  }
11627
11810
  const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
11628
11811
  const hasMatchedApiRoute = Boolean(matchedApiRoute);
11629
- if (hasMatchedApiRoute || _chunkXCACDAZZcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11812
+ if (hasMatchedApiRoute || _chunkNDILNQ4Lcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11630
11813
  const startTime2 = Date.now();
11631
11814
  const method2 = req.method || "GET";
11632
11815
  const urlPath2 = req.url || "/";
11633
- const pathname2 = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
11816
+ const pathname2 = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
11634
11817
  trustProxy: currentServerConfig.trustProxy
11635
11818
  }).pathname;
11636
11819
  try {
@@ -11638,7 +11821,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11638
11821
  if (hasMatchedApiRoute) {
11639
11822
  await pm.runHookParallelFiltered(
11640
11823
  "beforeRequest",
11641
- (plugin) => plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11824
+ (plugin) => plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11642
11825
  req,
11643
11826
  res
11644
11827
  );
@@ -11665,7 +11848,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11665
11848
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
11666
11849
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
11667
11850
  if (apiHandler && hasExplicitAPIRoute) {
11668
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _612 => _612.route, 'access', _613 => _613.path]) || _optionalChain([apiRouteManager, 'access', _614 => _614.matchRoute, 'call', _615 => _615(pathname2), 'optionalAccess', _616 => _616.route, 'access', _617 => _617.path]) || urlPath2;
11851
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _634 => _634.route, 'access', _635 => _635.path]) || _optionalChain([apiRouteManager, 'access', _636 => _636.matchRoute, 'call', _637 => _637(pathname2), 'optionalAccess', _638 => _638.route, 'access', _639 => _639.path]) || urlPath2;
11669
11852
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
11670
11853
  type: "route.matched",
11671
11854
  pathname: pathname2,
@@ -11687,13 +11870,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11687
11870
  }
11688
11871
  let body;
11689
11872
  if (req.method !== "GET" && req.method !== "HEAD") {
11690
- body = await _chunkOMVAU7NTcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11873
+ body = await _chunkKIIMAWOJcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11691
11874
  }
11692
11875
  const request2 = new Request(url, {
11693
11876
  method: req.method,
11694
11877
  headers,
11695
11878
  body: toRequestBody(body),
11696
- signal: _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11879
+ signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11697
11880
  });
11698
11881
  const apiLifecyclePayload = {
11699
11882
  pathname: new URL(url).pathname,
@@ -11738,7 +11921,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11738
11921
  durationMs: duration2,
11739
11922
  error
11740
11923
  });
11741
- const bodyErrorResponse = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11924
+ const bodyErrorResponse = _chunkKIIMAWOJcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11742
11925
  if (bodyErrorResponse) {
11743
11926
  logResponse(method2, urlPath2, bodyErrorResponse.status, duration2, "API");
11744
11927
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
@@ -11755,7 +11938,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11755
11938
  return;
11756
11939
  }
11757
11940
  }
11758
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _618 => _618.isFarmDocsAPIRequest, 'call', _619 => _619(pathname2)])) {
11941
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _640 => _640.isFarmDocsAPIRequest, 'call', _641 => _641(pathname2)])) {
11759
11942
  try {
11760
11943
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
11761
11944
  const headers = new Headers();
@@ -11766,13 +11949,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11766
11949
  }
11767
11950
  let body;
11768
11951
  if (req.method !== "GET" && req.method !== "HEAD") {
11769
- body = await _chunkOMVAU7NTcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11952
+ body = await _chunkKIIMAWOJcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
11770
11953
  }
11771
11954
  const request2 = new Request(url, {
11772
11955
  method: req.method,
11773
11956
  headers,
11774
11957
  body: toRequestBody(body),
11775
- signal: _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11958
+ signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11776
11959
  });
11777
11960
  const apiLifecyclePayload = {
11778
11961
  pathname: pathname2,
@@ -11805,7 +11988,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11805
11988
  return;
11806
11989
  }
11807
11990
  } catch (error) {
11808
- const bodyErrorResponse = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11991
+ const bodyErrorResponse = _chunkKIIMAWOJcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
11809
11992
  if (bodyErrorResponse) {
11810
11993
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
11811
11994
  return;
@@ -11828,25 +12011,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11828
12011
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
11829
12012
  return;
11830
12013
  }
11831
- if (_optionalChain([req, 'access', _620 => _620.url, 'optionalAccess', _621 => _621.startsWith, 'call', _622 => _622("/@")]) || _optionalChain([req, 'access', _623 => _623.url, 'optionalAccess', _624 => _624.startsWith, 'call', _625 => _625("/node_modules")])) {
12014
+ if (_optionalChain([req, 'access', _642 => _642.url, 'optionalAccess', _643 => _643.startsWith, 'call', _644 => _644("/@")]) || _optionalChain([req, 'access', _645 => _645.url, 'optionalAccess', _646 => _646.startsWith, 'call', _647 => _647("/node_modules")])) {
11832
12015
  return next();
11833
12016
  }
11834
12017
  if (shouldBypassFarmRouterForDottedPath(
11835
12018
  requestPathname,
11836
- _optionalChain([farmApp, 'optionalAccess', _626 => _626.getRouteManager, 'call', _627 => _627()]),
12019
+ _optionalChain([farmApp, 'optionalAccess', _648 => _648.getRouteManager, 'call', _649 => _649()]),
11837
12020
  [server.config.publicDir, server.config.root],
11838
12021
  farmAgentGeneratedPaths(farmConfig)
11839
12022
  )) {
11840
12023
  return next();
11841
12024
  }
11842
- if (_optionalChain([req, 'access', _628 => _628.url, 'optionalAccess', _629 => _629.startsWith, 'call', _630 => _630("/__farm/page-data")])) {
12025
+ if (_optionalChain([req, 'access', _650 => _650.url, 'optionalAccess', _651 => _651.startsWith, 'call', _652 => _652("/__farm/page-data")])) {
11843
12026
  const urlObj = parsedRequestUrl;
11844
12027
  const targetPath = urlObj.searchParams.get("path") || "/";
11845
12028
  try {
11846
12029
  const request2 = createRequestFromNodeRequest(
11847
12030
  req,
11848
12031
  urlObj,
11849
- _chunkOMVAU7NTcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
12032
+ _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11850
12033
  );
11851
12034
  const deploymentMismatch = _chunkC5GUTBZKcjs.getFarmDeploymentMismatch.call(void 0,
11852
12035
  request2,
@@ -11867,7 +12050,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11867
12050
  });
11868
12051
  let middlewareMap = /* @__PURE__ */ new Map();
11869
12052
  let middlewareContext = /* @__PURE__ */ new Map();
11870
- if (_optionalChain([middlewareManager, 'optionalAccess', _631 => _631.hasMiddleware, 'call', _632 => _632()])) {
12053
+ if (_optionalChain([middlewareManager, 'optionalAccess', _653 => _653.hasMiddleware, 'call', _654 => _654()])) {
11871
12054
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
11872
12055
  const handled = await runFarmMiddlewareWithNavigation(
11873
12056
  farmApp.getServerRenderer(),
@@ -11895,10 +12078,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11895
12078
  if (pm) {
11896
12079
  await pm.runHookParallel("afterRouteMatch", {
11897
12080
  pathname: targetPath,
11898
- matched: !!_optionalChain([match, 'optionalAccess', _633 => _633.route]),
11899
- routePattern: _optionalChain([match, 'optionalAccess', _634 => _634.route, 'optionalAccess', _635 => _635.pattern]) || null,
11900
- params: _optionalChain([match, 'optionalAccess', _636 => _636.params]) || {},
11901
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _637 => _637.layouts]) || []).map((l) => l.pattern)
12081
+ matched: !!_optionalChain([match, 'optionalAccess', _655 => _655.route]),
12082
+ routePattern: _optionalChain([match, 'optionalAccess', _656 => _656.route, 'optionalAccess', _657 => _657.pattern]) || null,
12083
+ params: _optionalChain([match, 'optionalAccess', _658 => _658.params]) || {},
12084
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _659 => _659.layouts]) || []).map((l) => l.pattern)
11902
12085
  });
11903
12086
  }
11904
12087
  if (!match) {
@@ -12043,7 +12226,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12043
12226
  pageShouldHydrate: shouldHydrate,
12044
12227
  layoutShouldHydrate: shouldHydrateLayout,
12045
12228
  islandStrategy: hydrationIslandStrategy,
12046
- rendering: _chunk3BHT4WMPcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
12229
+ rendering: _chunk5D2JIPLHcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
12047
12230
  });
12048
12231
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
12049
12232
  const layoutStartIndex = getSharedLayoutPrefixLength(
@@ -12051,13 +12234,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12051
12234
  destinationLayoutPatterns
12052
12235
  );
12053
12236
  const renderer = farmApp.getServerRenderer();
12054
- const fragmentHtml = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
12237
+ const fragmentHtml = await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0,
12055
12238
  middlewareMap,
12056
- () => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
12239
+ () => _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0,
12057
12240
  middlewareContext,
12058
12241
  () => renderer.renderNavigationFragment({
12059
12242
  PageComponent: routeModule.default,
12060
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _638 => _638.default]),
12243
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _660 => _660.default]),
12061
12244
  pageProps: routeProps,
12062
12245
  params,
12063
12246
  layouts: layouts.map((layout, index) => ({
@@ -12161,18 +12344,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12161
12344
  const startTime = Date.now();
12162
12345
  const method = req.method || "GET";
12163
12346
  const urlPath = req.url || "/";
12164
- const requestedPathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
12347
+ const requestedPathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
12165
12348
  trustProxy: currentServerConfig.trustProxy
12166
12349
  }).pathname;
12167
12350
  const routeManager2 = farmApp.getRouteManager();
12168
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _639 => _639.hasHook, 'call', _640 => _640("beforeRouteMatch")]), () => ( false));
12169
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _641 => _641.hasHook, 'call', _642 => _642("afterRouteMatch")]), () => ( false));
12170
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _643 => _643.hasHook, 'call', _644 => _644("beforeRequest")]), () => ( false));
12171
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _645 => _645.hasHook, 'call', _646 => _646("beforeRender")]), () => ( false));
12172
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _647 => _647.hasHook, 'call', _648 => _648("afterResponse")]), () => ( false));
12173
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _649 => _649.hasHook, 'call', _650 => _650("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _651 => _651.hasHook, 'call', _652 => _652("afterRender")]), () => ( false)));
12174
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _653 => _653.hasRuntimeRequestHooks, 'call', _654 => _654()]), () => ( false));
12175
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _655 => _655.hasRuntimeHook, 'call', _656 => _656("after")]), () => ( false));
12351
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _661 => _661.hasHook, 'call', _662 => _662("beforeRouteMatch")]), () => ( false));
12352
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _663 => _663.hasHook, 'call', _664 => _664("afterRouteMatch")]), () => ( false));
12353
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _665 => _665.hasHook, 'call', _666 => _666("beforeRequest")]), () => ( false));
12354
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _667 => _667.hasHook, 'call', _668 => _668("beforeRender")]), () => ( false));
12355
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _669 => _669.hasHook, 'call', _670 => _670("afterResponse")]), () => ( false));
12356
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _671 => _671.hasHook, 'call', _672 => _672("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _673 => _673.hasHook, 'call', _674 => _674("afterRender")]), () => ( false)));
12357
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _675 => _675.hasRuntimeRequestHooks, 'call', _676 => _676()]), () => ( false));
12358
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _677 => _677.hasRuntimeHook, 'call', _678 => _678("after")]), () => ( false));
12176
12359
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
12177
12360
  let runtimeSession;
12178
12361
  if (pm && hasRuntimeRequestHooks) {
@@ -12183,8 +12366,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12183
12366
  kind: "page",
12184
12367
  route: {
12185
12368
  pathname: requestedPathname,
12186
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _657 => _657.route, 'optionalAccess', _658 => _658.pattern]) || null,
12187
- params: _optionalChain([requestedMatch, 'optionalAccess', _659 => _659.params]) || {}
12369
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _679 => _679.route, 'optionalAccess', _680 => _680.pattern]) || null,
12370
+ params: _optionalChain([requestedMatch, 'optionalAccess', _681 => _681.params]) || {}
12188
12371
  }
12189
12372
  }
12190
12373
  );
@@ -12217,17 +12400,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12217
12400
  if (pm && hasAfterRouteMatchHook) {
12218
12401
  await pm.runHookParallel("afterRouteMatch", {
12219
12402
  pathname,
12220
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _660 => _660.route]),
12221
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _661 => _661.route, 'optionalAccess', _662 => _662.pattern]) || null,
12222
- params: _optionalChain([routeMatch, 'optionalAccess', _663 => _663.params]) || {},
12223
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _664 => _664.layouts]) || []).map((l) => l.pattern)
12403
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _682 => _682.route]),
12404
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _683 => _683.route, 'optionalAccess', _684 => _684.pattern]) || null,
12405
+ params: _optionalChain([routeMatch, 'optionalAccess', _685 => _685.params]) || {},
12406
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _686 => _686.layouts]) || []).map((l) => l.pattern)
12224
12407
  });
12225
12408
  }
12226
12409
  const renderPayload = {
12227
12410
  pathname,
12228
12411
  method,
12229
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _665 => _665.route, 'optionalAccess', _666 => _666.pattern]) || null,
12230
- params: _optionalChain([routeMatch, 'optionalAccess', _667 => _667.params]) || {}
12412
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _687 => _687.route, 'optionalAccess', _688 => _688.pattern]) || null,
12413
+ params: _optionalChain([routeMatch, 'optionalAccess', _689 => _689.params]) || {}
12231
12414
  };
12232
12415
  const shouldInterceptResponse = Boolean(
12233
12416
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -12249,7 +12432,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12249
12432
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
12250
12433
  }) : void 0;
12251
12434
  try {
12252
- if (_optionalChain([middlewareManager, 'optionalAccess', _668 => _668.hasMiddleware, 'call', _669 => _669()])) {
12435
+ if (_optionalChain([middlewareManager, 'optionalAccess', _690 => _690.hasMiddleware, 'call', _691 => _691()])) {
12253
12436
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
12254
12437
  const handled = await runFarmMiddlewareWithNavigation(
12255
12438
  farmApp.getServerRenderer(),
@@ -12259,7 +12442,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12259
12442
  () => middlewareManager.execute(req, res)
12260
12443
  );
12261
12444
  if (handled) {
12262
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _670 => _670.isEnded, 'call', _671 => _671()])) {
12445
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _692 => _692.isEnded, 'call', _693 => _693()])) {
12263
12446
  const duration = Date.now() - startTime;
12264
12447
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12265
12448
  }
@@ -12271,16 +12454,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12271
12454
  req.url || "/",
12272
12455
  `http://${req.headers.host || "localhost:3000"}`
12273
12456
  ).pathname;
12274
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _672 => _672.matchRoute, 'call', _673 => _673(currentPathname), 'optionalAccess', _674 => _674.route]));
12457
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _694 => _694.matchRoute, 'call', _695 => _695(currentPathname), 'optionalAccess', _696 => _696.route]));
12275
12458
  await pm.runHookParallelFiltered(
12276
12459
  "beforeRequest",
12277
- (plugin) => !hasLocalPageRoute || plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12460
+ (plugin) => !hasLocalPageRoute || plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12278
12461
  req,
12279
12462
  res
12280
12463
  );
12281
12464
  }
12282
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _675 => _675.isEnded, 'call', _676 => _676()])) {
12283
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _677 => _677.isEnded, 'call', _678 => _678()])) {
12465
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _697 => _697.isEnded, 'call', _698 => _698()])) {
12466
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _699 => _699.isEnded, 'call', _700 => _700()])) {
12284
12467
  const duration = Date.now() - startTime;
12285
12468
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12286
12469
  }
@@ -12338,59 +12521,59 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12338
12521
  if (imageModule) return imageModule;
12339
12522
  }
12340
12523
  if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
12341
- const renderer = _optionalChain([farmApp, 'optionalAccess', _679 => _679.getConfig, 'call', _680 => _680(), 'access', _681 => _681.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12342
- return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _682 => _682.config, 'access', _683 => _683.root]) || options.root, renderer);
12524
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _701 => _701.getConfig, 'call', _702 => _702(), 'access', _703 => _703.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12525
+ return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _704 => _704.config, 'access', _705 => _705.root]) || options.root, renderer);
12343
12526
  }
12344
12527
  if (isFarmClientVirtualId(id)) {
12345
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _684 => _684.getConfig, 'call', _685 => _685()]);
12346
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _686 => _686.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12347
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _687 => _687.integrations]) || options.integrations;
12348
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _688 => _688.root]) || _optionalChain([server, 'optionalAccess', _689 => _689.config, 'access', _690 => _690.root]) || process.cwd();
12349
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _691 => _691.docs]);
12528
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _706 => _706.getConfig, 'call', _707 => _707()]);
12529
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _708 => _708.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12530
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _709 => _709.integrations]) || options.integrations;
12531
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _710 => _710.root]) || _optionalChain([server, 'optionalAccess', _711 => _711.config, 'access', _712 => _712.root]) || process.cwd();
12532
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _713 => _713.docs]);
12350
12533
  const adapterOwnsDocsRuntime = Boolean(
12351
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _692 => _692.adapter, 'optionalAccess', _693 => _693.server]) && docs.adapter.react
12534
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _714 => _714.adapter, 'optionalAccess', _715 => _715.server]) && docs.adapter.react
12352
12535
  );
12353
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _694 => _694.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12536
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12354
12537
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
12355
- _optionalChain([docs, 'optionalAccess', _695 => _695.enabled]) ? loadFarmDocsDevRuntime() : null,
12356
- _optionalChain([docs, 'optionalAccess', _696 => _696.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12538
+ _optionalChain([docs, 'optionalAccess', _717 => _717.enabled]) ? loadFarmDocsDevRuntime() : null,
12539
+ _optionalChain([docs, 'optionalAccess', _718 => _718.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12357
12540
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
12358
12541
  ]);
12359
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _697 => _697.isFarmDocsSearchEnabled, 'call', _698 => _698(docs)]), () => ( false));
12542
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _719 => _719.isFarmDocsSearchEnabled, 'call', _720 => _720(docs)]), () => ( false));
12360
12543
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
12361
12544
  docsSearchEnabled,
12362
12545
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
12363
12546
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
12364
12547
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
12365
12548
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunk6MVFL3R5cjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
12366
- const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, integrations) : [];
12549
+ const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, integrations) : [];
12367
12550
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
12368
- _optionalChain([resolvedConfig, 'optionalAccess', _699 => _699.experimental, 'optionalAccess', _700 => _700.isolatedClientHydration]),
12551
+ _optionalChain([resolvedConfig, 'optionalAccess', _721 => _721.experimental, 'optionalAccess', _722 => _722.isolatedClientHydration]),
12369
12552
  {
12370
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _701 => _701.experimental, 'optionalAccess', _702 => _702.serverComponents]) === true,
12553
+ serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _723 => _723.experimental, 'optionalAccess', _724 => _724.serverComponents]) === true,
12371
12554
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
12372
12555
  }
12373
12556
  );
12374
12557
  return generateClientCode(
12375
12558
  integrationProviders,
12376
12559
  [
12377
- ..._chunkFTFYRMQQcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12378
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _703 => _703.getFarmDocsDocumentNavigationMatchers, 'call', _704 => _704(docs)]), () => ( []))
12560
+ ..._chunkUJZLSXUBcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12561
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _725 => _725.getFarmDocsDocumentNavigationMatchers, 'call', _726 => _726(docs)]), () => ( []))
12379
12562
  ],
12380
12563
  generatedDocsSearchRuntime,
12381
12564
  `${generatedDevtoolsClientRuntime}
12382
12565
  ${generatedDevIndicatorsClientRuntime}`,
12383
- _optionalChain([resolvedConfig, 'optionalAccess', _705 => _705.plugins]) || [],
12566
+ _optionalChain([resolvedConfig, 'optionalAccess', _727 => _727.plugins]) || [],
12384
12567
  root,
12385
- _optionalChain([resolvedConfig, 'optionalAccess', _706 => _706.srcDir]) || options.srcDir || "src",
12386
- _optionalChain([resolvedConfig, 'optionalAccess', _707 => _707.publicRuntimeConfig]) || options.publicRuntimeConfig,
12387
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _708 => _708.adapter, 'optionalAccess', _709 => _709.react]) : void 0,
12568
+ _optionalChain([resolvedConfig, 'optionalAccess', _728 => _728.srcDir]) || options.srcDir || "src",
12569
+ _optionalChain([resolvedConfig, 'optionalAccess', _729 => _729.publicRuntimeConfig]) || options.publicRuntimeConfig,
12570
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _730 => _730.adapter, 'optionalAccess', _731 => _731.react]) : void 0,
12388
12571
  renderer,
12389
- isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _710 => _710.getRouteManager, 'call', _711 => _711(), 'access', _712 => _712.getIsolatedClientBoundaryModules, 'call', _713 => _713(root)])))), 'optionalAccess', _714 => _714.size]) > 0,
12390
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _715 => _715.trailingSlash]), () => ( false)),
12391
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.basePath]), () => ( "/")),
12572
+ isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _732 => _732.getRouteManager, 'call', _733 => _733(), 'access', _734 => _734.getIsolatedClientBoundaryModules, 'call', _735 => _735(root)])))), 'optionalAccess', _736 => _736.size]) > 0,
12573
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _737 => _737.trailingSlash]), () => ( false)),
12574
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _738 => _738.basePath]), () => ( "/")),
12392
12575
  generateClientCachePersistenceCode(
12393
- resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _717 => _717.cache]))
12576
+ resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _739 => _739.cache]))
12394
12577
  ),
12395
12578
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
12396
12579
  );
@@ -12399,7 +12582,7 @@ ${generatedDevIndicatorsClientRuntime}`,
12399
12582
  return generateServerCode();
12400
12583
  }
12401
12584
  if (id === "/@farm/manifest") {
12402
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _718 => _718.getRouteManager, 'call', _719 => _719()]);
12585
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _740 => _740.getRouteManager, 'call', _741 => _741()]);
12403
12586
  if (!routeManager) {
12404
12587
  return `
12405
12588
  export const getManifest = () => ({
@@ -12414,7 +12597,7 @@ export const getManifest = () => ({
12414
12597
  const manifest = routeManager.generateClientManifest(server.config.root);
12415
12598
  const globalStylesheetHref = resolveDevGlobalStylesheetHref(
12416
12599
  server.config.root,
12417
- _optionalChain([farmApp, 'optionalAccess', _720 => _720.getConfig, 'call', _721 => _721(), 'access', _722 => _722.srcDir])
12600
+ _optionalChain([farmApp, 'optionalAccess', _742 => _742.getConfig, 'call', _743 => _743(), 'access', _744 => _744.srcDir])
12418
12601
  );
12419
12602
  const fullManifest = {
12420
12603
  clientEntry: "/@farm/client.js",
@@ -12440,11 +12623,11 @@ export const getManifest = () => ({
12440
12623
  };
12441
12624
  }
12442
12625
  for (const layout of manifest.layouts) {
12443
- const groupScope = _chunkIPXLADVOcjs.getRouteGroupScope.call(void 0, layout.pattern);
12626
+ const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, layout.pattern);
12444
12627
  fullManifest.layouts[layout.pattern] = {
12445
12628
  modulePath: layout.modulePath,
12446
12629
  pattern: layout.pattern,
12447
- ...groupScope ? { urlPattern: _chunkIPXLADVOcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12630
+ ...groupScope ? { urlPattern: _chunkLOFKRKO7cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12448
12631
  shouldHydrate: layout.shouldHydrate,
12449
12632
  islandStrategy: layout.islandStrategy,
12450
12633
  preloads: [layout.modulePath],
@@ -12468,24 +12651,24 @@ export const manifest = getManifest();
12468
12651
  }
12469
12652
  },
12470
12653
  async transform(code, id, transformOptions) {
12471
- if (!_optionalChain([transformOptions, 'optionalAccess', _723 => _723.ssr])) {
12472
- const docsConfigModule = _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _724 => _724.getConfig, 'call', _725 => _725(), 'optionalAccess', _726 => _726.docs]));
12654
+ if (!_optionalChain([transformOptions, 'optionalAccess', _745 => _745.ssr])) {
12655
+ const docsConfigModule = _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _746 => _746.getConfig, 'call', _747 => _747(), 'optionalAccess', _748 => _748.docs]));
12473
12656
  if (isFarmDocsClientConfigModule(id, docsConfigModule)) {
12474
12657
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
12475
12658
  if (redacted !== null) return { code: redacted, map: null };
12476
12659
  }
12477
12660
  }
12478
- if (!_optionalChain([transformOptions, 'optionalAccess', _727 => _727.ssr])) {
12479
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _728 => _728.getConfig, 'call', _729 => _729()]), () => ( options));
12480
- if (_optionalChain([currentConfig, 'access', _730 => _730.experimental, 'optionalAccess', _731 => _731.serverActions]) !== true || !serverFnTransformActive) {
12661
+ if (!_optionalChain([transformOptions, 'optionalAccess', _749 => _749.ssr])) {
12662
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _750 => _750.getConfig, 'call', _751 => _751()]), () => ( options));
12663
+ if (_optionalChain([currentConfig, 'access', _752 => _752.experimental, 'optionalAccess', _753 => _753.serverActions]) !== true || !serverFnTransformActive) {
12481
12664
  const violation = findClientServerFnViolation(code, id);
12482
12665
  if (violation) {
12483
12666
  this.error(formatServerFnBoundaryError(violation, id));
12484
12667
  }
12485
12668
  }
12486
12669
  }
12487
- if (!_optionalChain([transformOptions, 'optionalAccess', _732 => _732.ssr]) && shouldInspectClientBoundary(id, code)) {
12488
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _733 => _733.getConfig, 'call', _734 => _734()]), () => ( options)));
12670
+ if (!_optionalChain([transformOptions, 'optionalAccess', _754 => _754.ssr]) && shouldInspectClientBoundary(id, code)) {
12671
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _755 => _755.getConfig, 'call', _756 => _756()]), () => ( options)));
12489
12672
  }
12490
12673
  if (typeof imageImports.transform === "function") {
12491
12674
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -12500,13 +12683,13 @@ export const manifest = getManifest();
12500
12683
  id,
12501
12684
  transformOptions
12502
12685
  );
12503
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _735 => _735.code, 'optionalAccess', _736 => _736.toString, 'call', _737 => _737()]);
12686
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _757 => _757.code, 'optionalAccess', _758 => _758.toString, 'call', _759 => _759()]);
12504
12687
  if (fontCode) {
12505
12688
  transformedCode = fontCode;
12506
12689
  transformed = true;
12507
12690
  }
12508
12691
  }
12509
- if (_optionalChain([transformOptions, 'optionalAccess', _738 => _738.ssr]) && server) {
12692
+ if (_optionalChain([transformOptions, 'optionalAccess', _760 => _760.ssr]) && server) {
12510
12693
  const rewrittenImports = rewriteEarlySsrRelativeImports({
12511
12694
  code: transformedCode,
12512
12695
  id,
@@ -12526,12 +12709,12 @@ export const manifest = getManifest();
12526
12709
  }
12527
12710
  transformedCode = stripUseClientDirective(transformedCode);
12528
12711
  transformed = true;
12529
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _739 => _739.getConfig, 'call', _740 => _740()]), () => ( options));
12712
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _761 => _761.getConfig, 'call', _762 => _762()]), () => ( options));
12530
12713
  let isolatedModuleReference = null;
12531
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _741 => _741.config, 'access', _742 => _742.root]) || process.cwd();
12714
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _763 => _763.config, 'access', _764 => _764.root]) || process.cwd();
12532
12715
  const cleanId = id.split("?", 1)[0];
12533
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _743 => _743.getRouteManager, 'call', _744 => _744(), 'access', _745 => _745.getIsolatedClientBoundaryModules, 'call', _746 => _746(root)])));
12534
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _747 => _747.has, 'call', _748 => _748(path21.resolve(cleanId))]) === true;
12716
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _765 => _765.getRouteManager, 'call', _766 => _766(), 'access', _767 => _767.getIsolatedClientBoundaryModules, 'call', _768 => _768(root)])));
12717
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _769 => _769.has, 'call', _770 => _770(path21.resolve(cleanId))]) === true;
12535
12718
  if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
12536
12719
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
12537
12720
  const transformedBoundary = transformIsolatedClientBoundaryModule({
@@ -12568,7 +12751,7 @@ export const manifest = getManifest();
12568
12751
  );
12569
12752
  return;
12570
12753
  }` : "";
12571
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _749 => _749.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12754
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _771 => _771.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12572
12755
  if (import.meta.hot) {
12573
12756
  import.meta.hot.accept((newModule) => {
12574
12757
  ${isolatedHmrUpdate}
@@ -12623,14 +12806,14 @@ if (import.meta.hot) {
12623
12806
  }
12624
12807
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
12625
12808
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
12626
- const outDir = path21.join(_optionalChain([server, 'optionalAccess', _750 => _750.config, 'access', _751 => _751.root]) || process.cwd(), options.outDir || "dist");
12809
+ const outDir = path21.join(_optionalChain([server, 'optionalAccess', _772 => _772.config, 'access', _773 => _773.root]) || process.cwd(), options.outDir || "dist");
12627
12810
  const clientDir = path21.join(outDir, "client");
12628
12811
  for (const page of ssgPages) {
12629
12812
  try {
12630
12813
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
12631
12814
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
12632
12815
  const mod = await routeManager.loadRouteModule(page.filePath);
12633
- if (!_optionalChain([mod, 'optionalAccess', _752 => _752.default])) return;
12816
+ if (!_optionalChain([mod, 'optionalAccess', _774 => _774.default])) return;
12634
12817
  const { layouts } = routeManager.matchRoute(page.urlPath);
12635
12818
  const layoutModules = await Promise.all(
12636
12819
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -12662,7 +12845,7 @@ if (import.meta.hot) {
12662
12845
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
12663
12846
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
12664
12847
  const fullHtml = `<!DOCTYPE html>
12665
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _753 => _753.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12848
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _775 => _775.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12666
12849
  <head>
12667
12850
  <meta charset="utf-8">
12668
12851
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -12720,23 +12903,23 @@ if (import.meta.hot) {
12720
12903
  });
12721
12904
  }
12722
12905
  }
12723
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _754 => _754.getConfig, 'call', _755 => _755()]);
12906
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _776 => _776.getConfig, 'call', _777 => _777()]);
12724
12907
  const normalizedFile = file.replace(/\\/g, "/");
12725
- if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
12908
+ if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
12726
12909
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
12727
12910
  )) {
12728
12911
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
12729
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _756 => _756(`updated ${file}`)]);
12912
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _778 => _778(`updated ${file}`)]);
12730
12913
  server2.ws.send({ type: "full-reload", path: "*" });
12731
12914
  return [];
12732
12915
  }
12733
- const currentSrcRoot = currentFarmConfig ? _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path21.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
12916
+ const currentSrcRoot = currentFarmConfig ? _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path21.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
12734
12917
  if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunk6V4TDWECcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
12735
12918
  logUpdate("PAGE", `updated ${path21.basename(file)}`);
12736
12919
  for (const mod of modules) {
12737
12920
  server2.moduleGraph.invalidateModule(mod);
12738
12921
  }
12739
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _757 => _757(`updated ${file}`)]);
12922
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _779 => _779(`updated ${file}`)]);
12740
12923
  server2.ws.send({
12741
12924
  type: "full-reload",
12742
12925
  path: "*"
@@ -12749,17 +12932,20 @@ if (import.meta.hot) {
12749
12932
  for (const mod of modules) {
12750
12933
  server2.moduleGraph.invalidateModule(mod);
12751
12934
  }
12752
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _758 => _758(`updated ${file}`)]);
12935
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _780 => _780(`updated ${file}`)]);
12753
12936
  server2.ws.send({
12754
12937
  type: "full-reload",
12755
12938
  path: "*"
12756
12939
  });
12757
12940
  return [];
12758
12941
  }
12759
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _759 => _759.experimental, 'optionalAccess', _760 => _760.isolatedClientHydration]);
12760
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _761 => _761.getRouteManager, 'call', _762 => _762()]);
12942
+ if (apiRouteManager && _chunkSHLXACIOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
12943
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _781 => _781(`updated ${file}`)]);
12944
+ }
12945
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _782 => _782.experimental, 'optionalAccess', _783 => _783.isolatedClientHydration]);
12946
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _784 => _784.getRouteManager, 'call', _785 => _785()]);
12761
12947
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
12762
- const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _763 => _763.renderer])) && planRouteManager !== void 0;
12948
+ const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _786 => _786.renderer])) && planRouteManager !== void 0;
12763
12949
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
12764
12950
  const routeManager = planRouteManager;
12765
12951
  if (routeManager) {
@@ -12819,7 +13005,7 @@ if (import.meta.hot) {
12819
13005
  }
12820
13006
  return [];
12821
13007
  }
12822
- _optionalChain([farmApp, 'optionalAccess', _764 => _764.getRouteManager, 'call', _765 => _765(), 'access', _766 => _766.invalidateClientManifest, 'call', _767 => _767()]);
13008
+ _optionalChain([farmApp, 'optionalAccess', _787 => _787.getRouteManager, 'call', _788 => _788(), 'access', _789 => _789.invalidateClientManifest, 'call', _790 => _790()]);
12823
13009
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
12824
13010
  if (manifestModule) {
12825
13011
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -12868,7 +13054,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
12868
13054
  if (fs11.realpathSync(farmRoot) === fs11.realpathSync(viteRoot)) {
12869
13055
  return path21.resolve(viteRoot);
12870
13056
  }
12871
- } catch (e40) {
13057
+ } catch (e41) {
12872
13058
  }
12873
13059
  return farmRoot;
12874
13060
  }
@@ -13188,12 +13374,12 @@ async function parseRouteModuleProps2(routeModule, input) {
13188
13374
  }
13189
13375
  const schemas = routeModule.__farmRouteSchemas;
13190
13376
  const params = parseRouteModuleSchema2(
13191
- _optionalChain([schemas, 'optionalAccess', _768 => _768.params]),
13377
+ _optionalChain([schemas, 'optionalAccess', _791 => _791.params]),
13192
13378
  input.props.params,
13193
13379
  "params",
13194
13380
  input.routePath
13195
13381
  );
13196
- const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _769 => _769.search]), input.search, "search", input.routePath);
13382
+ const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _792 => _792.search]), input.search, "search", input.routePath);
13197
13383
  return {
13198
13384
  ...input.props,
13199
13385
  params,
@@ -14854,8 +15040,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
14854
15040
  async function defineConfig(config = {}) {
14855
15041
  const tailwindVitePlugin = await loadTailwindVitePlugin();
14856
15042
  const appRoot = path21.resolve(config.root || process.cwd());
14857
- if (_optionalChain([config, 'access', _770 => _770.extends, 'optionalAccess', _771 => _771.length])) {
14858
- const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
15043
+ if (_optionalChain([config, 'access', _793 => _793.extends, 'optionalAccess', _794 => _794.length])) {
15044
+ const { config: layeredConfig } = await import("./layers-VUWIOFEO.cjs").then(
14859
15045
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
14860
15046
  root: appRoot,
14861
15047
  mode: process.env.NODE_ENV === "production" ? "production" : "development"
@@ -14955,13 +15141,13 @@ async function defineConfig(config = {}) {
14955
15141
  if (!serverStarted) {
14956
15142
  serverStarted = true;
14957
15143
  const elapsed = Date.now() - startTime;
14958
- const address = _optionalChain([server, 'access', _772 => _772.httpServer, 'optionalAccess', _773 => _773.address, 'call', _774 => _774()]);
15144
+ const address = _optionalChain([server, 'access', _795 => _795.httpServer, 'optionalAccess', _796 => _796.address, 'call', _797 => _797()]);
14959
15145
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
14960
15146
  const hostConfig = server.config.server.host;
14961
15147
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
14962
15148
  console.log("");
14963
15149
  console.log(
14964
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkYC6V7PWEcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
15150
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkNQ6QFZWDcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
14965
15151
  );
14966
15152
  console.log("");
14967
15153
  console.log(
@@ -15009,7 +15195,7 @@ async function defineConfig(config = {}) {
15009
15195
  ...createFarmClientOptimizeDepsConfig(
15010
15196
  createFarmClientOptimizeDepsEntries(
15011
15197
  appRoot,
15012
- _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
15198
+ _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
15013
15199
  ),
15014
15200
  config.renderer
15015
15201
  ),
@@ -15049,7 +15235,7 @@ async function defineConfig(config = {}) {
15049
15235
  dedupe: [...config.renderer.dedupe || []],
15050
15236
  // Stub out problematic server-only modules during dev mode
15051
15237
  alias: {
15052
- ..._chunkVPTDD5XFcjs.getFarmLayerAliases.call(void 0, config.layers),
15238
+ ..._chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, config.layers),
15053
15239
  ...createFarmSourceAlias(appRoot, config.srcDir),
15054
15240
  // Nitro internals that should not be resolved in browser
15055
15241
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",