@farm.js/core 0.1.70 → 0.1.71

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 (184) hide show
  1. package/dist/{agent-mcp-handler-6T2Z7TB6.cjs → agent-mcp-handler-KE4J3W7S.cjs} +3 -3
  2. package/dist/{agent-mcp-handler-CPU354QQ.mjs → agent-mcp-handler-VIT4GOSR.mjs} +2 -2
  3. package/dist/{agent-mcp.d-DulgFLBt.d.ts → agent-mcp.d-BzNw6JI8.d.ts} +14 -4
  4. package/dist/{agent-mcp.d-TAs1ES2F.d.mts → agent-mcp.d-CgFen3EH.d.mts} +14 -4
  5. package/dist/agent-runtime.d.mts +1 -1
  6. package/dist/agent-runtime.d.ts +1 -1
  7. package/dist/analyzer-LPIVRSTJ.cjs +16 -0
  8. package/dist/{analyzer-QGRBLETM.mjs → analyzer-VK3BAOFI.mjs} +2 -2
  9. package/dist/api/node.d.mts +3 -3
  10. package/dist/api/node.d.ts +3 -3
  11. package/dist/api/route-manager.d.mts +3 -3
  12. package/dist/api/route-manager.d.ts +3 -3
  13. package/dist/api/runtime.d.mts +2 -2
  14. package/dist/api/runtime.d.ts +2 -2
  15. package/dist/api.d.mts +4 -4
  16. package/dist/api.d.ts +4 -4
  17. package/dist/{app-manifest.d-C-nf3Vmm.d.ts → app-manifest.d-DY4JfJxi.d.ts} +1 -1
  18. package/dist/{app-manifest.d-6zXb90o6.d.mts → app-manifest.d-DpDK_B1k.d.mts} +1 -1
  19. package/dist/app-markdown.cjs +5 -3
  20. package/dist/app-markdown.d.mts +3 -3
  21. package/dist/app-markdown.d.ts +3 -3
  22. package/dist/app-markdown.mjs +4 -2
  23. package/dist/{app.d-C2xeMIYT.d.ts → app.d-BeK6bb1c.d.ts} +8 -6
  24. package/dist/{app.d-DF0aundc.d.mts → app.d-D-5UNrFd.d.mts} +8 -6
  25. package/dist/{chunk-HAXFV2CD.mjs → chunk-2CQC5CMD.mjs} +1 -1
  26. package/dist/{chunk-IEN2EFE5.cjs → chunk-2IFT2CSA.cjs} +4 -4
  27. package/dist/{chunk-BPUVDCGG.cjs → chunk-3BQ7QHUH.cjs} +3 -3
  28. package/dist/{chunk-JFVT5ZZV.mjs → chunk-4OD2LXF2.mjs} +1 -1
  29. package/dist/{chunk-CCHJWJGP.mjs → chunk-7BUE2GM6.mjs} +141 -86
  30. package/dist/{chunk-FJ5YCERM.cjs → chunk-7OHJWFLB.cjs} +387 -331
  31. package/dist/{chunk-5R3JQPWD.mjs → chunk-AYVGD3PK.mjs} +1 -1
  32. package/dist/{chunk-K7JMTAFH.cjs → chunk-CSQPMV3Q.cjs} +16 -6
  33. package/dist/{chunk-N62IYXYD.mjs → chunk-DPIGYXSV.mjs} +1 -1
  34. package/dist/{chunk-LECZ5DPZ.cjs → chunk-DPYBVVL3.cjs} +2 -2
  35. package/dist/{chunk-RMOU3PR4.mjs → chunk-GUU3IZSM.mjs} +63 -23
  36. package/dist/{chunk-EDZU7YRK.mjs → chunk-IGXS54GC.mjs} +2 -2
  37. package/dist/{chunk-3WS5AZ3R.mjs → chunk-IYDJNCR7.mjs} +1 -1
  38. package/dist/{chunk-R7254L3R.mjs → chunk-J5ASGNKF.mjs} +23 -0
  39. package/dist/{chunk-75E5FDX2.mjs → chunk-JMFTKNBA.mjs} +10 -10
  40. package/dist/{chunk-DIHBWZDZ.cjs → chunk-JVA4PIYN.cjs} +408 -294
  41. package/dist/{chunk-XYVPTTUT.cjs → chunk-KEB7AGS6.cjs} +4 -4
  42. package/dist/{chunk-TLSSIYAL.mjs → chunk-KQAB5LML.mjs} +10 -3
  43. package/dist/{chunk-M6U6E4F7.cjs → chunk-KWST2O22.cjs} +108 -68
  44. package/dist/{chunk-NSZY3EWG.cjs → chunk-L6E4SHUB.cjs} +31 -8
  45. package/dist/{chunk-MZLJFNMH.cjs → chunk-MEJCP2LX.cjs} +1 -1
  46. package/dist/{chunk-A2TH5MKE.mjs → chunk-MITIAOUQ.mjs} +3 -3
  47. package/dist/{chunk-OCNV4CI2.cjs → chunk-MQ4DYVFS.cjs} +26 -0
  48. package/dist/{chunk-4AC4PXZO.cjs → chunk-N3XO5AL5.cjs} +2 -2
  49. package/dist/{chunk-R2ZHU37O.mjs → chunk-NLRAQXAA.mjs} +26 -0
  50. package/dist/{chunk-32SYRIQ7.cjs → chunk-PLXD2MJV.cjs} +3 -3
  51. package/dist/{chunk-JFPKARWM.cjs → chunk-PMU4U2W2.cjs} +1 -0
  52. package/dist/{chunk-3EXCZJEN.mjs → chunk-QUFENL7Q.mjs} +1 -1
  53. package/dist/{chunk-NYF7A4UW.mjs → chunk-RJUCNO7R.mjs} +1 -1
  54. package/dist/{chunk-K4UGCUXX.cjs → chunk-SXMWVP2L.cjs} +7 -7
  55. package/dist/{chunk-VG6HYT5K.cjs → chunk-TP4RAV7Y.cjs} +9 -9
  56. package/dist/{chunk-I7NUT24Z.cjs → chunk-UISZLYKY.cjs} +2 -2
  57. package/dist/{chunk-KPMLDT3B.mjs → chunk-UQUOSNRN.mjs} +378 -264
  58. package/dist/{chunk-QZHTDVH4.mjs → chunk-V25GSH43.mjs} +1 -1
  59. package/dist/{chunk-65FPDDT4.cjs → chunk-VXB5CMNC.cjs} +2 -2
  60. package/dist/{chunk-5IJRJWJS.mjs → chunk-W2T6NDNP.mjs} +10 -0
  61. package/dist/{chunk-JRF2SKCD.mjs → chunk-X7LGLF33.mjs} +1 -1
  62. package/dist/{chunk-QEWWKYDL.cjs → chunk-YCNHUIPR.cjs} +17 -10
  63. package/dist/{chunk-PJQ5W356.mjs → chunk-Z5ZZAGIH.mjs} +1 -0
  64. package/dist/{chunk-A7HCBHMC.cjs → chunk-ZPUAOKHV.cjs} +3 -3
  65. package/dist/{client-component.d-Bk5qKJM-.d.mts → client-component.d-DwpH251K.d.mts} +2 -2
  66. package/dist/{client-component.d-DNbC4oWI.d.ts → client-component.d-fYupugbZ.d.ts} +2 -2
  67. package/dist/{client-plugins.d-DwUqh4gp.d.ts → client-plugins.d-BxqFfHpM.d.ts} +8 -5
  68. package/dist/{client-plugins.d-Pi9nG0W0.d.mts → client-plugins.d-k3bOT5gz.d.mts} +8 -5
  69. package/dist/client-plugins.d.mts +1 -1
  70. package/dist/client-plugins.d.ts +1 -1
  71. package/dist/client.d.mts +6 -6
  72. package/dist/client.d.ts +6 -6
  73. package/dist/config.d.mts +1 -1
  74. package/dist/config.d.ts +1 -1
  75. package/dist/desktop.d.mts +2 -2
  76. package/dist/desktop.d.ts +2 -2
  77. package/dist/{devtools-CB43AHEP.mjs → devtools-6MXPFPNJ.mjs} +2 -2
  78. package/dist/{devtools-L5DUNDF3.cjs → devtools-O5625KCK.cjs} +3 -3
  79. package/dist/docs.cjs +4 -4
  80. package/dist/docs.d.mts +2 -2
  81. package/dist/docs.d.ts +2 -2
  82. package/dist/docs.mjs +3 -3
  83. package/dist/environment/vite.cjs +3 -3
  84. package/dist/environment/vite.mjs +2 -2
  85. package/dist/{headers.d-CE6OWB-n.d.ts → headers.d-DalIGbVO.d.ts} +1 -1
  86. package/dist/{headers.d-DED1hHh4.d.mts → headers.d-sNT7ZQiU.d.mts} +1 -1
  87. package/dist/index.cjs +20 -18
  88. package/dist/{index.d-c9UwIqDy.d.ts → index.d-BcA-secm.d.ts} +1 -1
  89. package/dist/{index.d-CbvOjJcp.d.mts → index.d-DDHHAv7j.d.mts} +1 -1
  90. package/dist/index.d.mts +18 -18
  91. package/dist/index.d.ts +18 -18
  92. package/dist/index.mjs +19 -17
  93. package/dist/integrations/orm.d.mts +1 -1
  94. package/dist/integrations/orm.d.ts +1 -1
  95. package/dist/integrations.d.mts +1 -1
  96. package/dist/integrations.d.ts +1 -1
  97. package/dist/internal/app-markdown-runtime.cjs +4 -2
  98. package/dist/internal/app-markdown-runtime.d.mts +11 -3
  99. package/dist/internal/app-markdown-runtime.d.ts +11 -3
  100. package/dist/internal/app-markdown-runtime.mjs +3 -1
  101. package/dist/internal/build-runtime.cjs +19 -19
  102. package/dist/internal/build-runtime.d.mts +3 -3
  103. package/dist/internal/build-runtime.d.ts +3 -3
  104. package/dist/internal/build-runtime.mjs +18 -18
  105. package/dist/internal/cli-runtime.cjs +6 -4
  106. package/dist/internal/cli-runtime.mjs +5 -3
  107. package/dist/internal/client-error-overlay.cjs +4 -4
  108. package/dist/internal/client-error-overlay.mjs +1 -1
  109. package/dist/internal/client-runtime.d.mts +4 -4
  110. package/dist/internal/client-runtime.d.ts +4 -4
  111. package/dist/internal/compression-runtime.d.mts +1 -1
  112. package/dist/internal/compression-runtime.d.ts +1 -1
  113. package/dist/internal/config-runtime.cjs +4 -4
  114. package/dist/internal/config-runtime.d.mts +3 -3
  115. package/dist/internal/config-runtime.d.ts +3 -3
  116. package/dist/internal/config-runtime.mjs +3 -3
  117. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  118. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  119. package/dist/internal/native-server-fns.cjs +4 -4
  120. package/dist/internal/native-server-fns.mjs +3 -3
  121. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  122. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  123. package/dist/internal/production-runtime.cjs +6 -6
  124. package/dist/internal/production-runtime.d.mts +14 -9
  125. package/dist/internal/production-runtime.d.ts +14 -9
  126. package/dist/internal/production-runtime.mjs +5 -5
  127. package/dist/markdown.d.mts +1 -1
  128. package/dist/markdown.d.ts +1 -1
  129. package/dist/middleware.d.mts +1 -1
  130. package/dist/middleware.d.ts +1 -1
  131. package/dist/{mount.d-BvWxf8ZE.d.mts → mount.d-C1PONsEe.d.mts} +1 -1
  132. package/dist/{mount.d-DngLY7NL.d.ts → mount.d-D3JOux2V.d.ts} +1 -1
  133. package/dist/{navigation-delegate.d-CMyl1h2l.d.mts → navigation-delegate.d-CJQQHboA.d.mts} +1 -1
  134. package/dist/{navigation-delegate.d-zZogiDfa.d.ts → navigation-delegate.d-CQQPbdkE.d.ts} +1 -1
  135. package/dist/navigation.d.mts +4 -4
  136. package/dist/navigation.d.ts +4 -4
  137. package/dist/{nitro-Y3LGITW3.cjs → nitro-2LMOMIST.cjs} +2 -2
  138. package/dist/{nitro-NSTXT7LB.mjs → nitro-72TFIGGO.mjs} +1 -1
  139. package/dist/{plugin-F2O4BFTK.cjs → plugin-5PIQQVRP.cjs} +2 -2
  140. package/dist/{plugin-VEBRN7A3.mjs → plugin-QZT747YW.mjs} +1 -1
  141. package/dist/plugin.cjs +13 -13
  142. package/dist/plugin.d.mts +4 -4
  143. package/dist/plugin.d.ts +4 -4
  144. package/dist/plugin.mjs +12 -12
  145. package/dist/{render-plan.d-Di1znBDW.d.mts → render-plan.d-CiUj0rq5.d.mts} +1 -1
  146. package/dist/{render-plan.d-DQj2bzd2.d.ts → render-plan.d-DHuJMJRP.d.ts} +1 -1
  147. package/dist/renderer-client.d.mts +4 -4
  148. package/dist/renderer-client.d.ts +4 -4
  149. package/dist/{request.d-CJWzfDYJ.d.mts → request.d-D-F7o7tb.d.mts} +1 -1
  150. package/dist/{request.d-C5vyoYeL.d.ts → request.d-DRUbOmYD.d.ts} +1 -1
  151. package/dist/request.d.mts +2 -2
  152. package/dist/request.d.ts +2 -2
  153. package/dist/{route-rendering.d-C-et2TZ1.d.mts → route-rendering.d-6smgwT2t.d.mts} +1 -1
  154. package/dist/{route-rendering.d-DhsY5M2I.d.ts → route-rendering.d-KwqM_mlK.d.ts} +1 -1
  155. package/dist/{router.d-CJB-Ntni.d.ts → router.d-B6sesMRD.d.ts} +1 -1
  156. package/dist/{router.d-BMDS5s5X.d.mts → router.d-BYmDeDlp.d.mts} +1 -1
  157. package/dist/routes.d.mts +1 -1
  158. package/dist/routes.d.ts +1 -1
  159. package/dist/{rsc-pipeline-NJKLZ3YE.cjs → rsc-pipeline-P4PCWDO2.cjs} +4 -4
  160. package/dist/{rsc-pipeline-AXQJCCHI.mjs → rsc-pipeline-R2GOKIMU.mjs} +3 -3
  161. package/dist/{runtime-JXNEKOSE.mjs → runtime-DP5DYGW5.mjs} +3 -3
  162. package/dist/{runtime-DMW6DDOI.cjs → runtime-WA2Q4SLG.cjs} +5 -5
  163. package/dist/{runtime.d-BonodRI9.d.mts → runtime.d-BFSJf-ww.d.mts} +1 -1
  164. package/dist/{runtime.d-uw4123iI.d.ts → runtime.d-CbdMI0Oy.d.ts} +1 -1
  165. package/dist/server-plugins.d.mts +3 -3
  166. package/dist/server-plugins.d.ts +3 -3
  167. package/dist/server.cjs +33 -33
  168. package/dist/server.d.mts +10 -10
  169. package/dist/server.d.ts +10 -10
  170. package/dist/server.mjs +15 -15
  171. package/dist/{spa-router.d-rha3M95y.d.mts → spa-router.d-D4EDwR20.d.mts} +2 -2
  172. package/dist/{spa-router.d-l0d9pPZj.d.ts → spa-router.d-mC1D5cTN.d.ts} +2 -2
  173. package/dist/testing.d.mts +1 -1
  174. package/dist/testing.d.ts +1 -1
  175. package/dist/{utils.d-BK-PTOF8.d.ts → utils.d-A2X3a6z_.d.ts} +1 -1
  176. package/dist/{utils.d-BzuTobEc.d.mts → utils.d-DxMzteqE.d.mts} +1 -1
  177. package/dist/version.cjs +2 -2
  178. package/dist/version.mjs +1 -1
  179. package/dist/vite.cjs +13 -13
  180. package/dist/vite.d.mts +7 -5
  181. package/dist/vite.d.ts +7 -5
  182. package/dist/vite.mjs +12 -12
  183. package/package.json +2 -2
  184. package/dist/analyzer-GUIRJWZH.cjs +0 -16
@@ -26,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkA7HCBHMCcjs = require('./chunk-A7HCBHMC.cjs');
29
+ var _chunkZPUAOKHVcjs = require('./chunk-ZPUAOKHV.cjs');
30
30
 
31
31
 
32
32
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
@@ -41,7 +41,7 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkI7NUT24Zcjs = require('./chunk-I7NUT24Z.cjs');
44
+ var _chunkUISZLYKYcjs = require('./chunk-UISZLYKY.cjs');
45
45
 
46
46
 
47
47
 
@@ -65,7 +65,7 @@ var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
65
65
  var _chunkJWY66PIDcjs = require('./chunk-JWY66PID.cjs');
66
66
 
67
67
 
68
- var _chunkBPUVDCGGcjs = require('./chunk-BPUVDCGG.cjs');
68
+ var _chunk3BQ7QHUHcjs = require('./chunk-3BQ7QHUH.cjs');
69
69
 
70
70
 
71
71
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
@@ -74,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkXYVPTTUTcjs = require('./chunk-XYVPTTUT.cjs');
77
+ var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
78
78
 
79
79
 
80
80
  var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
@@ -110,7 +110,7 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
110
110
 
111
111
 
112
112
 
113
- var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
113
+ var _chunkKWST2O22cjs = require('./chunk-KWST2O22.cjs');
114
114
 
115
115
 
116
116
 
@@ -118,12 +118,12 @@ var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
118
118
  var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
119
119
 
120
120
 
121
- var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
121
+ var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
122
122
 
123
123
 
124
124
 
125
125
 
126
- var _chunkK7JMTAFHcjs = require('./chunk-K7JMTAFH.cjs');
126
+ var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
127
127
 
128
128
 
129
129
 
@@ -150,15 +150,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
150
150
 
151
151
 
152
152
 
153
- var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
153
+ var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
154
154
 
155
155
 
156
156
 
157
157
 
158
- var _chunkVG6HYT5Kcjs = require('./chunk-VG6HYT5K.cjs');
158
+ var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
159
159
 
160
160
 
161
- var _chunkLECZ5DPZcjs = require('./chunk-LECZ5DPZ.cjs');
161
+ var _chunkDPYBVVL3cjs = require('./chunk-DPYBVVL3.cjs');
162
162
 
163
163
 
164
164
  var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
@@ -176,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
176
176
 
177
177
 
178
178
 
179
- var _chunkIEN2EFE5cjs = require('./chunk-IEN2EFE5.cjs');
179
+ var _chunk2IFT2CSAcjs = require('./chunk-2IFT2CSA.cjs');
180
180
 
181
181
 
182
182
 
@@ -188,7 +188,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
188
188
 
189
189
 
190
190
 
191
- var _chunkOCNV4CI2cjs = require('./chunk-OCNV4CI2.cjs');
191
+ var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
192
192
 
193
193
 
194
194
 
@@ -223,7 +223,7 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
223
223
  var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
224
224
 
225
225
 
226
- var _chunkNSZY3EWGcjs = require('./chunk-NSZY3EWG.cjs');
226
+ var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
227
227
 
228
228
 
229
229
 
@@ -270,6 +270,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
270
270
 
271
271
 
272
272
 
273
+
273
274
  var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
274
275
 
275
276
 
@@ -282,7 +283,7 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
282
283
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
283
284
 
284
285
 
285
- var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
286
+ var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
286
287
 
287
288
 
288
289
  var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
@@ -455,7 +456,7 @@ async function compileFarmDocsManifest(docs, options) {
455
456
  isPathGuarded: options.isPathGuarded,
456
457
  basePath
457
458
  });
458
- const apiHandler = _chunkI7NUT24Zcjs.createFarmDocsAPIHandler.call(void 0, {
459
+ const apiHandler = _chunkUISZLYKYcjs.createFarmDocsAPIHandler.call(void 0, {
459
460
  rootDir: options.root,
460
461
  srcDir: options.srcDir,
461
462
  docs,
@@ -615,6 +616,7 @@ function collectFarmClientModulePreloads(bundle, options) {
615
616
  function createFarmClientModulePreloadPlugin(options) {
616
617
  return {
617
618
  name: "farm-client-module-preloads",
619
+ enforce: "post",
618
620
  async generateBundle(_output, bundle) {
619
621
  await _promises2.default.mkdir(options.buildDir, { recursive: true });
620
622
  await _promises2.default.writeFile(
@@ -689,6 +691,8 @@ function createFarmDocsModulePreloadPlugin(options) {
689
691
  let runtimeModuleIds = [];
690
692
  return {
691
693
  name: "farm-docs-module-preloads",
694
+ // After Vite's CSS plugin deletes stylesheet-only chunks (see client-module-preloads.ts).
695
+ enforce: "post",
692
696
  async buildStart() {
693
697
  const resolved = await Promise.all(
694
698
  options.modules.map((specifier) => this.resolve(specifier, options.importer))
@@ -730,7 +734,7 @@ async function createFarmRouteRuntimeManifest(options) {
730
734
  const routes = [];
731
735
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
732
736
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
733
- const rendering = await _chunkK7JMTAFHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
737
+ const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
734
738
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
735
739
  routes.push({
736
740
  kind: "page",
@@ -953,12 +957,65 @@ function escapeRegExp(value) {
953
957
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
954
958
  }
955
959
 
956
- // src/nitro/vercel-assets.ts
960
+ // src/nitro/immutable-assets.ts
961
+
957
962
  var FARM_IMMUTABLE_ASSET_CACHE_CONTROL = "public, max-age=31536000, immutable";
963
+ var FARM_IMMUTABLE_ASSET_MAX_AGE = 31536e3;
964
+ var FARM_IMMUTABLE_ASSET_PATH_SOURCE = "^/(?:(?:assets|chunks)/(?:.+/)*[^/]+|farm-(?:mobile-)?client(?:-boot)?)-h(?:[a-fA-F0-9]{8}|[a-fA-F0-9]{12}|[a-fA-F0-9]{16})\\.(?!(?:[hH][tT][mM][lL]?)$)[^/]+$";
965
+ var FARM_IMMUTABLE_ASSET_PATH = new RegExp(FARM_IMMUTABLE_ASSET_PATH_SOURCE);
966
+ function isFarmImmutableAssetPath(pathname) {
967
+ return FARM_IMMUTABLE_ASSET_PATH.test(pathname);
968
+ }
969
+ var FARM_HASHED_ASSET_DIRS = ["assets", "chunks"];
970
+ var LITERAL_ROUTE_PATH = /^\/[\w.~@/-]+$/;
971
+ function planFarmImmutableAssets(options) {
972
+ const cacheRulePatterns = Object.entries(_nullishCoalesce(options.routeRules, () => ( {}))).filter(
973
+ ([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess', _16 => _16.headers]), () => ( {}))).some((name) => name.toLowerCase() === "cache-control")
974
+ ).map(([pattern]) => pattern);
975
+ const isImmutable = (file) => isFarmImmutableAssetPath(file) && !cacheRulePatterns.some((pattern) => _chunkIUKBPBM7cjs.farmRouteRuleMatches.call(void 0, pattern, file));
976
+ const routeDirs = new Set(
977
+ (_nullishCoalesce(options.routePaths, () => ( []))).map((routePath) => routePath.split("/").filter(Boolean)[0])
978
+ );
979
+ const plan = { publicAssets: [], routeRules: {} };
980
+ const addRule = (file) => {
981
+ if (!LITERAL_ROUTE_PATH.test(file)) return;
982
+ plan.routeRules[file] = { headers: { "cache-control": FARM_IMMUTABLE_ASSET_CACHE_CONTROL } };
983
+ };
984
+ const dirFiles = /* @__PURE__ */ new Map();
985
+ for (const file of options.files) {
986
+ const dir = file.split("/")[1];
987
+ if (file.split("/").length > 2 && FARM_HASHED_ASSET_DIRS.includes(dir)) {
988
+ dirFiles.set(dir, [..._nullishCoalesce(dirFiles.get(dir), () => ( [])), file]);
989
+ } else if (isImmutable(file)) {
990
+ addRule(file);
991
+ }
992
+ }
993
+ for (const [dir, files] of dirFiles) {
994
+ if (!routeDirs.has(dir) && files.every(isImmutable)) {
995
+ plan.publicAssets.push({
996
+ dir: _path2.default.join(options.clientOutputDir, dir),
997
+ baseURL: `/${dir}`,
998
+ maxAge: FARM_IMMUTABLE_ASSET_MAX_AGE
999
+ });
1000
+ } else {
1001
+ for (const file of files) if (isImmutable(file)) addRule(file);
1002
+ }
1003
+ }
1004
+ return plan;
1005
+ }
1006
+ async function listFarmClientOutputFiles(dir) {
1007
+ const fs4 = await import("fs/promises");
1008
+ const entries = await fs4.readdir(dir, { recursive: true, withFileTypes: true }).catch(() => []);
1009
+ return entries.filter((entry) => entry.isFile()).map((entry) => {
1010
+ const relative = _path2.default.relative(dir, _path2.default.join(entry.parentPath, entry.name));
1011
+ return `/${relative.split(_path2.default.sep).join("/")}`;
1012
+ });
1013
+ }
1014
+
1015
+ // src/nitro/vercel-assets.ts
958
1016
  function createFarmVercelImmutableAssetRoute() {
959
- const fingerprint = "-h(?:[a-fA-F0-9]{8}|[a-fA-F0-9]{12}|[a-fA-F0-9]{16})";
960
1017
  return {
961
- src: `^/(?:(?:assets|chunks)/(?:.+/)*[^/]+|farm-client)${fingerprint}\\.(?!(?:[hH][tT][mM][lL]?)$)[^/]+$`,
1018
+ src: FARM_IMMUTABLE_ASSET_PATH_SOURCE,
962
1019
  headers: {
963
1020
  "Cache-Control": FARM_IMMUTABLE_ASSET_CACHE_CONTROL
964
1021
  },
@@ -1015,7 +1072,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
1015
1072
  function replaceServerFileReferences(bundle, chunkFileName, code, replace) {
1016
1073
  return code.replace(SERVER_FILE_URL_RE, (reference, _quote, relativeUrl) => {
1017
1074
  const target = resolveBundleFileName(chunkFileName, relativeUrl);
1018
- return target && _optionalChain([bundle, 'access', _16 => _16[target], 'optionalAccess', _17 => _17.type]) === "asset" ? replace(target) : reference;
1075
+ return target && _optionalChain([bundle, 'access', _17 => _17[target], 'optionalAccess', _18 => _18.type]) === "asset" ? replace(target) : reference;
1019
1076
  });
1020
1077
  }
1021
1078
  function collectServerReadSSRAssets(bundle) {
@@ -1068,7 +1125,7 @@ function assertServerReadSSRAssetsSupported(bundle, preset, root) {
1068
1125
  if (assets.length === 0) return;
1069
1126
  const sources = assets.map((fileName) => {
1070
1127
  const output = bundle[fileName];
1071
- const original = _optionalChain([output, 'optionalAccess', _18 => _18.type]) === "asset" ? _optionalChain([output, 'access', _19 => _19.originalFileNames, 'optionalAccess', _20 => _20[0]]) : void 0;
1128
+ const original = _optionalChain([output, 'optionalAccess', _19 => _19.type]) === "asset" ? _optionalChain([output, 'access', _20 => _20.originalFileNames, 'optionalAccess', _21 => _21[0]]) : void 0;
1072
1129
  if (!original) return fileName;
1073
1130
  return _path2.default.relative(root, _path2.default.resolve(root, original)).split(_path2.default.sep).join("/");
1074
1131
  });
@@ -1087,7 +1144,7 @@ function createServerReadSSRAssetsPlugin(bundle, ssrOutputDir) {
1087
1144
  transform(code, id) {
1088
1145
  if (!code.includes("import.meta.url")) return null;
1089
1146
  const chunkFileName = _path2.default.relative(ssrOutputDir, id.split("?", 1)[0]).split(_path2.default.sep).join("/");
1090
- if (_optionalChain([bundle, 'access', _21 => _21[chunkFileName], 'optionalAccess', _22 => _22.type]) !== "chunk") return null;
1147
+ if (_optionalChain([bundle, 'access', _22 => _22[chunkFileName], 'optionalAccess', _23 => _23.type]) !== "chunk") return null;
1091
1148
  let changed = false;
1092
1149
  const transformed = replaceServerFileReferences(
1093
1150
  bundle,
@@ -1183,7 +1240,7 @@ export default async function farmNetlifyHandler(request, context) {
1183
1240
  var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
1184
1241
  var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
1185
1242
  function isConfigObject(node) {
1186
- return _optionalChain([node, 'optionalAccess', _23 => _23.type]) === "ObjectExpression";
1243
+ return _optionalChain([node, 'optionalAccess', _24 => _24.type]) === "ObjectExpression";
1187
1244
  }
1188
1245
  function propertyName(property) {
1189
1246
  if (property.type !== "Property" || property.computed) return void 0;
@@ -1204,7 +1261,7 @@ function collectConfigObjects(node, found) {
1204
1261
  }
1205
1262
  if (current.type === "CallExpression") {
1206
1263
  const callee = current.callee;
1207
- const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _24 => _24.property, 'optionalAccess', _25 => _25.name]);
1264
+ const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _25 => _25.property, 'optionalAccess', _26 => _26.name]);
1208
1265
  const argument = current.arguments[0];
1209
1266
  if (name && CONFIG_FACTORIES.has(name) && isConfigObject(argument)) found.push(argument);
1210
1267
  }
@@ -1237,7 +1294,7 @@ function stripPlatformConfigSource(code, parse) {
1237
1294
  const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
1238
1295
  removals.push([
1239
1296
  properties[first].start,
1240
- properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _26 => _26[0], 'access', _27 => _27.length]), () => ( 0)))
1297
+ properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _27 => _27[0], 'access', _28 => _28.length]), () => ( 0)))
1241
1298
  ]);
1242
1299
  }
1243
1300
  first = last;
@@ -1264,7 +1321,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
1264
1321
  // removed block used (`readFileSync` for a version, say).
1265
1322
  enforce: "pre",
1266
1323
  transform: {
1267
- filter: { id: _chunkM6U6E4F7cjs.fileNamePattern.call(void 0, configFiles) },
1324
+ filter: { id: _chunkKWST2O22cjs.fileNamePattern.call(void 0, configFiles) },
1268
1325
  async handler(code, id) {
1269
1326
  const file = id.split("?", 1)[0];
1270
1327
  if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
@@ -1316,7 +1373,7 @@ function literalMatcher(node) {
1316
1373
  if (node.type === "Literal" && node.regex)
1317
1374
  return new RegExp(node.regex.pattern, node.regex.flags);
1318
1375
  if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
1319
- return _nullishCoalesce(_optionalChain([node, 'access', _28 => _28.quasis, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.value, 'optionalAccess', _31 => _31.cooked]), () => ( void 0));
1376
+ return _nullishCoalesce(_optionalChain([node, 'access', _29 => _29.quasis, 'access', _30 => _30[0], 'optionalAccess', _31 => _31.value, 'optionalAccess', _32 => _32.cooked]), () => ( void 0));
1320
1377
  }
1321
1378
  return void 0;
1322
1379
  }
@@ -1340,7 +1397,7 @@ function readStaticMiddlewareConfig(program) {
1340
1397
  let found = null;
1341
1398
  for (const statement of program.body) {
1342
1399
  if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
1343
- if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _32 => _32.exported, 'optionalAccess', _33 => _33.name]) === "config")) {
1400
+ if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _33 => _33.exported, 'optionalAccess', _34 => _34.name]) === "config")) {
1344
1401
  return "unknown";
1345
1402
  }
1346
1403
  continue;
@@ -1348,14 +1405,14 @@ function readStaticMiddlewareConfig(program) {
1348
1405
  const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
1349
1406
  if (!declaration || declaration.type !== "VariableDeclaration") continue;
1350
1407
  for (const declarator of declaration.declarations) {
1351
- if (_optionalChain([declarator, 'access', _34 => _34.id, 'optionalAccess', _35 => _35.type]) !== "Identifier" || declarator.id.name !== "config") continue;
1408
+ if (_optionalChain([declarator, 'access', _35 => _35.id, 'optionalAccess', _36 => _36.type]) !== "Identifier" || declarator.id.name !== "config") continue;
1352
1409
  if (declaration.kind !== "const" || !declarator.init) return "unknown";
1353
1410
  const init = unwrap(declarator.init);
1354
1411
  if (init.type !== "ObjectExpression") return "unknown";
1355
1412
  const config = {};
1356
1413
  for (const property of init.properties) {
1357
1414
  if (property.type !== "Property" || property.computed) return "unknown";
1358
- const key = _nullishCoalesce(_optionalChain([property, 'access', _36 => _36.key, 'optionalAccess', _37 => _37.name]), () => ( _optionalChain([property, 'access', _38 => _38.key, 'optionalAccess', _39 => _39.value])));
1415
+ const key = _nullishCoalesce(_optionalChain([property, 'access', _37 => _37.key, 'optionalAccess', _38 => _38.name]), () => ( _optionalChain([property, 'access', _39 => _39.key, 'optionalAccess', _40 => _40.value])));
1359
1416
  if (key === "runtime") {
1360
1417
  const runtime = literalMatcher(unwrap(property.value));
1361
1418
  if (runtime === "edge" || runtime === "nodejs") config.runtime = runtime;
@@ -1376,7 +1433,7 @@ async function readMiddlewareFileConfig(filePath) {
1376
1433
  try {
1377
1434
  const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1378
1435
  const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1379
- if (_optionalChain([parsed, 'access', _40 => _40.errors, 'optionalAccess', _41 => _41.length])) return "unknown";
1436
+ if (_optionalChain([parsed, 'access', _41 => _41.errors, 'optionalAccess', _42 => _42.length])) return "unknown";
1380
1437
  return readStaticMiddlewareConfig(parsed.program);
1381
1438
  } catch (e9) {
1382
1439
  return "unknown";
@@ -1395,7 +1452,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
1395
1452
  return preset === "vercel";
1396
1453
  }
1397
1454
  function isFarmEdgeMiddlewareRoute(route) {
1398
- return typeof route.config === "object" && _optionalChain([route, 'access', _42 => _42.config, 'optionalAccess', _43 => _43.runtime]) === "edge";
1455
+ return typeof route.config === "object" && _optionalChain([route, 'access', _43 => _43.config, 'optionalAccess', _44 => _44.runtime]) === "edge";
1399
1456
  }
1400
1457
  function escapeRegExp3(value) {
1401
1458
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -1433,7 +1490,7 @@ export default createFarmVercelEdgeMiddleware({
1433
1490
  ${modules.join("\n")}
1434
1491
  ],
1435
1492
  i18n: ${JSON.stringify(config.i18n)},
1436
- server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _44 => _44.server, 'optionalAccess', _45 => _45.trustProxy]) === true })},
1493
+ server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _45 => _45.server, 'optionalAccess', _46 => _46.trustProxy]) === true })},
1437
1494
  apiBasePath: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
1438
1495
  notFoundPath: ${JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, FARM_VERCEL_EDGE_NOT_FOUND_PATH, config.basePath))},
1439
1496
  pages: ${JSON.stringify(toFarmVercelEdgeGuardedUrls(guardedPages, config.basePath))},
@@ -1492,7 +1549,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1492
1549
  logLevel: "silent",
1493
1550
  plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
1494
1551
  resolve: {
1495
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1552
+ alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1496
1553
  conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
1497
1554
  },
1498
1555
  transform: {
@@ -1711,7 +1768,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1711
1768
  return {
1712
1769
  name: "farm-prerender-runtime-resolver",
1713
1770
  async resolveId(id, _importer, options) {
1714
- if (_optionalChain([options, 'access', _46 => _46.custom, 'optionalAccess', _47 => _47.farmPrerenderRuntimeResolve])) return null;
1771
+ if (_optionalChain([options, 'access', _47 => _47.custom, 'optionalAccess', _48 => _48.farmPrerenderRuntimeResolve])) return null;
1715
1772
  if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
1716
1773
  return null;
1717
1774
  }
@@ -1881,7 +1938,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1881
1938
  return {
1882
1939
  name: "farm-omitted-metadata-image-runtime",
1883
1940
  resolveId: {
1884
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1941
+ filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1885
1942
  handler(source, importer) {
1886
1943
  if (source !== "@vercel/og") return null;
1887
1944
  const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
@@ -1890,7 +1947,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1890
1947
  }
1891
1948
  },
1892
1949
  load: {
1893
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1950
+ filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1894
1951
  handler(id) {
1895
1952
  if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
1896
1953
  return `
@@ -1918,8 +1975,8 @@ function readVercelOgManifest(file) {
1918
1975
  }
1919
1976
  function resolveVercelOgConditionEntry(resolvedId, condition) {
1920
1977
  const vercelOg = readVercelOgManifest(resolvedId);
1921
- const entry = _optionalChain([vercelOg, 'optionalAccess', _48 => _48.manifest, 'access', _49 => _49.exports, 'optionalAccess', _50 => _50["."], 'optionalAccess', _51 => _51[condition]]);
1922
- const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _52 => _52.default]);
1978
+ const entry = _optionalChain([vercelOg, 'optionalAccess', _49 => _49.manifest, 'access', _50 => _50.exports, 'optionalAccess', _51 => _51["."], 'optionalAccess', _52 => _52[condition]]);
1979
+ const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _53 => _53.default]);
1923
1980
  return vercelOg && typeof file === "string" ? _path2.default.join(vercelOg.dir, file) : null;
1924
1981
  }
1925
1982
  function createEdgeMetadataImageRuntimePlugin({
@@ -1935,7 +1992,7 @@ function createEdgeMetadataImageRuntimePlugin({
1935
1992
  const edgeEntry = resolveVercelOgConditionEntry(resolved.id, condition);
1936
1993
  return edgeEntry ? { ...resolved, id: edgeEntry } : resolved;
1937
1994
  }
1938
- if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _53 => _53.replace, 'call', _54 => _54(/\\/g, "/"), 'access', _55 => _55.includes, 'call', _56 => _56("/@vercel/og/")])) {
1995
+ if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _54 => _54.replace, 'call', _55 => _55(/\\/g, "/"), 'access', _56 => _56.includes, 'call', _57 => _57("/@vercel/og/")])) {
1939
1996
  return null;
1940
1997
  }
1941
1998
  const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
@@ -1957,7 +2014,7 @@ function createVercelOgFontInlinePlugin(runtime = "Cloudflare Workers") {
1957
2014
  return `Promise.resolve({ arrayBuffer: () => Uint8Array.from(atob(${JSON.stringify(encoded)}), (character) => character.charCodeAt(0)).buffer })`;
1958
2015
  });
1959
2016
  if (inlined !== code) return { code: inlined, map: null };
1960
- const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _57 => _57(file), 'optionalAccess', _58 => _58.manifest, 'access', _59 => _59.version]), () => ( "(unknown version)"));
2017
+ const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _58 => _58(file), 'optionalAccess', _59 => _59.manifest, 'access', _60 => _60.version]), () => ( "(unknown version)"));
1961
2018
  this.error(
1962
2019
  `@vercel/og ${version} cannot be bundled for ${runtime}: ${file} does not load its default font with fetch(new URL("./<font>.ttf", import.meta.url)), the pattern Farm inlines because an edge function cannot fetch it. Install a @vercel/og version whose edge build does, such as 1.0.1.`
1963
2020
  );
@@ -1968,7 +2025,7 @@ function createMetadataImageWasmPlugin() {
1968
2025
  return {
1969
2026
  name: "farm-metadata-image-wasm",
1970
2027
  resolveId(source, importer) {
1971
- if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _60 => _60.replace, 'call', _61 => _61(/\\/g, "/"), 'access', _62 => _62.includes, 'call', _63 => _63("/@vercel/og/")])) {
2028
+ if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _61 => _61.replace, 'call', _62 => _62(/\\/g, "/"), 'access', _63 => _63.includes, 'call', _64 => _64("/@vercel/og/")])) {
1972
2029
  return null;
1973
2030
  }
1974
2031
  const requestPath = source.slice(0, -"?module".length);
@@ -2044,9 +2101,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
2044
2101
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
2045
2102
  }
2046
2103
  function nameCodeSplittingGroups(bundlerConfig) {
2047
- const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _64 => _64.output]);
2104
+ const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _65 => _65.output]);
2048
2105
  for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
2049
- const groups = _optionalChain([output, 'optionalAccess', _65 => _65.codeSplitting, 'optionalAccess', _66 => _66.groups]);
2106
+ const groups = _optionalChain([output, 'optionalAccess', _66 => _66.codeSplitting, 'optionalAccess', _67 => _67.groups]);
2050
2107
  if (!Array.isArray(groups)) continue;
2051
2108
  groups.forEach((group, index) => {
2052
2109
  if (group && typeof group.name === "function" && !group.debugName) {
@@ -2102,9 +2159,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
2102
2159
  if (needsAst) {
2103
2160
  replacements.length = 0;
2104
2161
  const restore = (node) => {
2105
- if (_optionalChain([node, 'optionalAccess', _67 => _67.type]) !== "TemplateLiteral") return;
2162
+ if (_optionalChain([node, 'optionalAccess', _68 => _68.type]) !== "TemplateLiteral") return;
2106
2163
  const template = node;
2107
- const value = _optionalChain([template, 'access', _68 => _68.quasis, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.value, 'access', _71 => _71.cooked]);
2164
+ const value = _optionalChain([template, 'access', _69 => _69.quasis, 'access', _70 => _70[0], 'optionalAccess', _71 => _71.value, 'access', _72 => _72.cooked]);
2108
2165
  if (template.expressions.length > 0 || typeof value !== "string") return;
2109
2166
  replacements.push({
2110
2167
  start: template.start,
@@ -2262,7 +2319,7 @@ async function discoverMiddlewareRoutes(appDir) {
2262
2319
  return Array.from(routes.values()).sort(_chunkMHLNWRCJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
2263
2320
  }
2264
2321
  function assertFarmDocsRuntimeSupported(config, preset) {
2265
- if (!_optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) || !_optionalChain([config, 'access', _74 => _74.docs, 'access', _75 => _75.adapter, 'optionalAccess', _76 => _76.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
2322
+ if (!_optionalChain([config, 'access', _73 => _73.docs, 'optionalAccess', _74 => _74.enabled]) || !_optionalChain([config, 'access', _75 => _75.docs, 'access', _76 => _76.adapter, 'optionalAccess', _77 => _77.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
2266
2323
  return;
2267
2324
  }
2268
2325
  throw new Error(
@@ -2275,7 +2332,6 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2275
2332
  assertFarmDocsRuntimeSupported(config, preset);
2276
2333
  const srcDir = config.srcDir || "src";
2277
2334
  const distDir = config.distDir || ".farm";
2278
- const deployOutputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
2279
2335
  const lifecyclePluginManager = options.pluginManager;
2280
2336
  const productionViteResultPromise = Promise.allSettled([
2281
2337
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
@@ -2294,7 +2350,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2294
2350
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
2295
2351
  const pageRoutes = [];
2296
2352
  for (const [pattern, entry] of routeManager.getRoutes()) {
2297
- const markdownSourcePath = entry.markdownSourcePath || (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2353
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2298
2354
  pageRoutes.push({
2299
2355
  pattern,
2300
2356
  ...entry.directory ? { directory: entry.directory } : {},
@@ -2500,7 +2556,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2500
2556
  _chunkQMNWKQL4cjs.logger.error(`\u274C Build failed: ${error}`);
2501
2557
  throw error;
2502
2558
  } finally {
2503
- _optionalChain([rendererBuild, 'optionalAccess', _77 => _77.abort, 'call', _78 => _78()]);
2559
+ _optionalChain([rendererBuild, 'optionalAccess', _78 => _78.abort, 'call', _79 => _79()]);
2504
2560
  }
2505
2561
  }
2506
2562
  function shouldBuildFarmMobileClient(config) {
@@ -2510,7 +2566,7 @@ function varyFarmNitroCacheRules(rules, headerNames) {
2510
2566
  if (headerNames.length === 0) return rules;
2511
2567
  return Object.fromEntries(
2512
2568
  Object.entries(rules).map(([source, rule]) => {
2513
- const cached = _optionalChain([rule, 'optionalAccess', _79 => _79.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _80 => _80.cache]) !== void 0 && rule.cache !== false;
2569
+ const cached = _optionalChain([rule, 'optionalAccess', _80 => _80.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _81 => _81.cache]) !== void 0 && rule.cache !== false;
2514
2570
  if (!cached || rule.cache === false) return [source, rule];
2515
2571
  const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
2516
2572
  const varies = [
@@ -2563,7 +2619,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
2563
2619
  }
2564
2620
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
2565
2621
  await fs4.writeFile(fontCssPath, normalizedFontCss);
2566
- await fs4.writeFile(clientCssPath, _chunkM6U6E4F7cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2622
+ await fs4.writeFile(clientCssPath, _chunkKWST2O22cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2567
2623
  }
2568
2624
  function importsFarmClientBlockedPackage(id, packageName) {
2569
2625
  return id === packageName || id.startsWith(`${packageName}/`);
@@ -2616,7 +2672,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2616
2672
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
2617
2673
  let plan = cache.get(key);
2618
2674
  if (!plan) {
2619
- plan = _chunkIEN2EFE5cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2675
+ plan = _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2620
2676
  cache.set(key, plan);
2621
2677
  }
2622
2678
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2625,7 +2681,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2625
2681
  if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
2626
2682
  const viteBuild = productionVite.build;
2627
2683
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
2628
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
2684
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
2629
2685
  const fs4 = await import("fs/promises");
2630
2686
  const pluginManager = new PluginManager2({
2631
2687
  config,
@@ -2640,25 +2696,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2640
2696
  const unsupportedIntegrationProvider = integrationProviders.find(
2641
2697
  (provider) => provider.supportsIsolatedHydration !== true
2642
2698
  );
2643
- if (_optionalChain([config, 'access', _81 => _81.experimental, 'optionalAccess', _82 => _82.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _83 => _83.experimental, 'optionalAccess', _84 => _84.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2699
+ if (_optionalChain([config, 'access', _82 => _82.experimental, 'optionalAccess', _83 => _83.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _84 => _84.experimental, 'optionalAccess', _85 => _85.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2644
2700
  _chunkQMNWKQL4cjs.logger.warn(
2645
2701
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2646
2702
  );
2647
2703
  }
2648
- const isolatedMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2649
- _optionalChain([config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.isolatedClientHydration]),
2704
+ const isolatedMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2705
+ _optionalChain([config, 'access', _86 => _86.experimental, 'optionalAccess', _87 => _87.isolatedClientHydration]),
2650
2706
  {
2651
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.serverComponents])) === "rsc",
2707
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _88 => _88.experimental, 'optionalAccess', _89 => _89.serverComponents])) === "rsc",
2652
2708
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2653
2709
  }
2654
2710
  );
2655
- const planOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
2711
+ const planOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
2656
2712
  config.renderer,
2657
2713
  Boolean(unsupportedIntegrationProvider)
2658
2714
  );
2659
2715
  const pagePlanOptions = {
2660
2716
  ...planOptions,
2661
- serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.serverComponents])) === "islands"
2717
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _90 => _90.experimental, 'optionalAccess', _91 => _91.serverComponents])) === "islands"
2662
2718
  };
2663
2719
  const layoutPlanOptions = {
2664
2720
  ...planOptions,
@@ -2711,20 +2767,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2711
2767
  });
2712
2768
  const layoutAppliesToRoute = _chunk2MR4MABGcjs.routeBoundaryCoversDirectory;
2713
2769
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2714
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents])) === "islands";
2770
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _92 => _92.experimental, 'optionalAccess', _93 => _93.serverComponents])) === "islands";
2715
2771
  const adapterOwnsDocsRuntime = Boolean(
2716
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) && _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) && config.docs.adapter.react
2772
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && _optionalChain([config, 'access', _96 => _96.docs, 'access', _97 => _97.adapter, 'optionalAccess', _98 => _98.server]) && config.docs.adapter.react
2717
2773
  );
2718
- const docsEntries = _optionalChain([config, 'access', _98 => _98.docs, 'optionalAccess', _99 => _99.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2774
+ const docsEntries = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2719
2775
  (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
2720
2776
  ) : [];
2721
2777
  const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
2722
2778
  const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
2723
2779
  (docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
2724
2780
  );
2725
- const syntheticDocsEntry = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2781
+ const syntheticDocsEntry = _optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2726
2782
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2727
- const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
2783
+ const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
2728
2784
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2729
2785
  root,
2730
2786
  isolatedMode,
@@ -2732,7 +2788,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2732
2788
  );
2733
2789
  const routePlans = pageRoutes.map((route) => ({
2734
2790
  route,
2735
- metadata: _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2791
+ metadata: _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2736
2792
  route.modulePath,
2737
2793
  root,
2738
2794
  isolatedMode,
@@ -2740,7 +2796,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2740
2796
  pagePlanOptions
2741
2797
  )
2742
2798
  }));
2743
- _chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2799
+ _chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2744
2800
  clientLayouts.map((layout) => ({
2745
2801
  pattern: layout.pattern,
2746
2802
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2773,7 +2829,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2773
2829
  for (const layout of clientLayouts) {
2774
2830
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
2775
2831
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2776
- _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2832
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2777
2833
  }
2778
2834
  }
2779
2835
  if (isolatedMode === "analyze") {
@@ -2807,7 +2863,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2807
2863
  );
2808
2864
  if (metadata.suppressedAsyncHydration) {
2809
2865
  _chunkQMNWKQL4cjs.logger.warn(
2810
- `\u26A0\uFE0F ${_chunkIEN2EFE5cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2866
+ `\u26A0\uFE0F ${_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2811
2867
  );
2812
2868
  }
2813
2869
  const slotBoundaries = serverSlotPlans.filter(
@@ -2815,7 +2871,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2815
2871
  ).flatMap(({ plan }) => plan.isolatedBoundaries);
2816
2872
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
2817
2873
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
2818
- const islandStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
2874
+ const islandStrategy = _chunkKWST2O22cjs.resolveFarmRouteRootStrategy.call(void 0,
2819
2875
  route,
2820
2876
  metadata,
2821
2877
  clientLayouts,
@@ -2834,7 +2890,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2834
2890
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2835
2891
  ],
2836
2892
  // The server renders a server tree only below a hydrating layout.
2837
- ..._chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2893
+ ..._chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2838
2894
  });
2839
2895
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2840
2896
  }
@@ -2871,7 +2927,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2871
2927
  }
2872
2928
  const clientRouteSlots = routeSlots.filter((slot) => {
2873
2929
  try {
2874
- const metadata = _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2930
+ const metadata = _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2875
2931
  return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
2876
2932
  } catch (error) {
2877
2933
  _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
@@ -2894,8 +2950,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2894
2950
  srcDir,
2895
2951
  adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2896
2952
  adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2897
- _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2898
- adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _104 => _104.docs, 'access', _105 => _105.adapter, 'optionalAccess', _106 => _106.react]) : void 0,
2953
+ _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) ? _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2954
+ adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.react]) : void 0,
2899
2955
  config.i18n,
2900
2956
  config.plugins,
2901
2957
  config.renderer,
@@ -2903,11 +2959,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2903
2959
  config.trailingSlash,
2904
2960
  _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations),
2905
2961
  config.basePath,
2906
- _chunkM6U6E4F7cjs.generateClientCachePersistenceCode.call(void 0, _chunkM6U6E4F7cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2962
+ _chunkKWST2O22cjs.generateClientCachePersistenceCode.call(void 0, _chunkKWST2O22cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2907
2963
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2908
- _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands",
2964
+ _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents])) === "islands",
2909
2965
  platform,
2910
- islandsMode ? _chunkIEN2EFE5cjs.collectFarmServerStylesheets.call(void 0,
2966
+ islandsMode ? _chunk2IFT2CSAcjs.collectFarmServerStylesheets.call(void 0,
2911
2967
  [
2912
2968
  ...layoutRoutes.map((layout) => layout.modulePath),
2913
2969
  ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
@@ -2922,7 +2978,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2922
2978
  await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
2923
2979
  }
2924
2980
  const clientInput = { [entryName]: clientEntryPath };
2925
- if (platform === "web" && _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config)) {
2981
+ if (platform === "web" && _chunkKWST2O22cjs.canBootFarmIslandsClient.call(void 0, config)) {
2926
2982
  const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
2927
2983
  await fs4.writeFile(
2928
2984
  clientBootPath,
@@ -2965,7 +3021,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2965
3021
  outDir: outputDir,
2966
3022
  emptyOutDir: platform === "web",
2967
3023
  // Never public: see resolveFarmClientSourcemap.
2968
- sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _109 => _109.vite, 'optionalAccess', _110 => _110.build, 'optionalAccess', _111 => _111.sourcemap])),
3024
+ sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _110 => _110.vite, 'optionalAccess', _111 => _111.build, 'optionalAccess', _112 => _112.sourcemap])),
2969
3025
  assetsInlineLimit: 0,
2970
3026
  cssCodeSplit: false,
2971
3027
  // Bundle all CSS into one file
@@ -2977,7 +3033,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2977
3033
  hashCharacters: "hex",
2978
3034
  // Use predictable name for CSS so we can reference it in SSR HTML
2979
3035
  assetFileNames: (assetInfo) => {
2980
- if (_optionalChain([assetInfo, 'access', _112 => _112.name, 'optionalAccess', _113 => _113.endsWith, 'call', _114 => _114(".css")])) {
3036
+ if (_optionalChain([assetInfo, 'access', _113 => _113.name, 'optionalAccess', _114 => _114.endsWith, 'call', _115 => _115(".css")])) {
2981
3037
  return `${entryName}.css`;
2982
3038
  }
2983
3039
  return "assets/[name]-h[hash][extname]";
@@ -2994,7 +3050,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2994
3050
  }
2995
3051
  },
2996
3052
  plugins: [
2997
- _chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3053
+ _chunkKWST2O22cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2998
3054
  createFarmPrivateClientSourcemapsPlugin({
2999
3055
  outDir: _path2.default.join(
3000
3056
  _path2.default.dirname(outputDir),
@@ -3026,7 +3082,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3026
3082
  ...rendererVitePlugins,
3027
3083
  ...config.vite.plugins || [],
3028
3084
  farmServerOnlyEntriesPlugin({ platform }),
3029
- _chunkM6U6E4F7cjs.farmDocsClientConfigPlugin.call(void 0,
3085
+ _chunkKWST2O22cjs.farmDocsClientConfigPlugin.call(void 0,
3030
3086
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
3031
3087
  ),
3032
3088
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -3059,7 +3115,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3059
3115
  },
3060
3116
  load: {
3061
3117
  filter: {
3062
- id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [
3118
+ id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [
3063
3119
  "\0empty-module",
3064
3120
  "\0empty-api-route",
3065
3121
  "\0farm-i18n-client-bridge",
@@ -3096,7 +3152,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3096
3152
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
3097
3153
  pluginManager
3098
3154
  ),
3099
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3155
+ _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3100
3156
  ],
3101
3157
  mode: "production",
3102
3158
  css: postcssSearchPath ? {
@@ -3104,7 +3160,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3104
3160
  } : void 0,
3105
3161
  // Ensure React is bundled for client
3106
3162
  resolve: {
3107
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3163
+ alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3108
3164
  dedupe: [...config.renderer.dedupe || []]
3109
3165
  },
3110
3166
  // Optimize dependencies - exclude server-side code from client bundle
@@ -3117,7 +3173,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3117
3173
  ]
3118
3174
  }
3119
3175
  };
3120
- await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
3176
+ await viteBuild(
3177
+ _chunkKWST2O22cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3178
+ );
3121
3179
  if (platform === "mobile") {
3122
3180
  await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
3123
3181
  if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
@@ -3217,7 +3275,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3217
3275
  return response;
3218
3276
  }
3219
3277
 
3220
- ${streamNavigations ? _chunkM6U6E4F7cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3278
+ ${streamNavigations ? _chunkKWST2O22cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3221
3279
 
3222
3280
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3223
3281
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4079,7 +4137,7 @@ function readFarmEntryImports(source) {
4079
4137
  for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
4080
4138
  const from = match[2];
4081
4139
  const named = /\{([^}]*)\}/.exec(match[1]);
4082
- for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _115 => _115[1], 'optionalAccess', _116 => _116.split, 'call', _117 => _117(",")]), () => ( []))) {
4140
+ for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _116 => _116[1], 'optionalAccess', _117 => _117.split, 'call', _118 => _118(",")]), () => ( []))) {
4083
4141
  const [imported, local] = specifier.trim().split(/\s+as\s+/);
4084
4142
  if (imported)
4085
4143
  bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
@@ -4186,7 +4244,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4186
4244
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4187
4245
  import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
4188
4246
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
4189
- const providerClientCode = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderClientCode.call(void 0,
4247
+ const providerClientCode = _chunkKWST2O22cjs.generateFarmIntegrationProviderClientCode.call(void 0,
4190
4248
  integrationProviders,
4191
4249
  root,
4192
4250
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -4307,7 +4365,7 @@ mountFarmDocsSearch();
4307
4365
 
4308
4366
  ${generateUniversalRouterStateRuntime()}
4309
4367
 
4310
- ${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4368
+ ${_chunkKWST2O22cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4311
4369
 
4312
4370
  // SPA Router for server-rendered pages (HTML swap)
4313
4371
  const spaRouter = {
@@ -4631,7 +4689,8 @@ async function createFarmServerTreePageElement(source, pathname) {
4631
4689
  return await createFarmServerTreeElement(React, source, {
4632
4690
  load: loadFarmIsolatedBoundary,
4633
4691
  ServerHtml: FarmServerPage,
4634
- key: pathname,
4692
+ // No key: the next page of the same layout updates this one in place, as React Server
4693
+ // Components do, instead of unmounting it and building every node again.
4635
4694
  });
4636
4695
  } catch (error) {
4637
4696
  console.warn("[Farm.js] Could not rebuild the server tree of " + pathname + "; its server HTML was kept.", error);
@@ -4743,7 +4802,7 @@ function hasHydratableLayout(pathname) {
4743
4802
  });
4744
4803
  }
4745
4804
 
4746
- ${_chunkM6U6E4F7cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4805
+ ${_chunkKWST2O22cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4747
4806
  // Wrap a page element with applicable layouts
4748
4807
  function wrapWithLayouts(pageElement, pathname, params) {
4749
4808
  const layouts = getApplicableLayouts(pathname);
@@ -4778,7 +4837,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
4778
4837
  return React.createElement("div", props, pageElement);
4779
4838
  }
4780
4839
  let farmLastRouteState = null;
4781
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkM6U6E4F7cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4840
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkKWST2O22cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4782
4841
  function farmTreeLayoutsOf(pathname) {
4783
4842
  return getApplicableLayouts(pathname).filter(function(layout) {
4784
4843
  return layout.serverTree === true;
@@ -5342,7 +5401,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
5342
5401
  return true;
5343
5402
  }` : ""}
5344
5403
 
5345
- ${_chunkM6U6E4F7cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5404
+ ${_chunkKWST2O22cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5346
5405
 
5347
5406
  function activateNavigationScripts(root) {
5348
5407
  for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
@@ -5445,7 +5504,7 @@ function getLayoutShell(root, patterns, index) {
5445
5504
  return shell.innerHTML;
5446
5505
  }
5447
5506
 
5448
- ${islandValues ? _chunkM6U6E4F7cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5507
+ ${islandValues ? _chunkKWST2O22cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5449
5508
  // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
5450
5509
  if (refresh) revealFarmStreamedContent(nextRoot);
5451
5510
  const currentPatterns = getLayoutPatterns(currentRoot);
@@ -6027,7 +6086,7 @@ void hydrate();
6027
6086
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
6028
6087
  const viteBuild = productionVite.build;
6029
6088
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
6030
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
6089
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
6031
6090
  const fs4 = await import("fs/promises");
6032
6091
  const pluginManager = new PluginManager2({
6033
6092
  config,
@@ -6155,7 +6214,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6155
6214
  }))
6156
6215
  ) : discoveredMiddlewareRoutes;
6157
6216
  const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
6158
- const notFoundPath = _chunkM6U6E4F7cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6217
+ const notFoundPath = _chunkKWST2O22cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6159
6218
  if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
6160
6219
  layoutRoutes.sort((a, b) => {
6161
6220
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -6176,9 +6235,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6176
6235
  (provider) => provider.component || provider.type === "clerk"
6177
6236
  );
6178
6237
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
6179
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _118 => _118.mdx, 'optionalAccess', _119 => _119.components]));
6238
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _119 => _119.mdx, 'optionalAccess', _120 => _120.components]));
6180
6239
  const hasMiddlewareConfig = _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6181
- const hasRouteContextConfig = _chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config);
6240
+ const hasRouteContextConfig = _chunkKEB7AGS6cjs.hasCustomFarmRouteContext.call(void 0, config);
6182
6241
  const hasServerRuntimePlugins = _chunkDMXMIE2Ccjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
6183
6242
  const hasPluginRoutes = hasFarmPluginRoutes(config);
6184
6243
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -6188,9 +6247,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6188
6247
  const hasConfiguredRuntimePlugins = Boolean(
6189
6248
  hasRuntimeConfigModule && (config.plugins || []).length > 0
6190
6249
  );
6191
- if (_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6250
+ if (_chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6192
6251
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
6193
- _chunkI7NUT24Zcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6252
+ _chunkUISZLYKYcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6194
6253
  config.docs,
6195
6254
  { root, srcDir: config.srcDir },
6196
6255
  (pathname) => adapterGuardedPaths.has(pathname),
@@ -6198,9 +6257,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6198
6257
  );
6199
6258
  }
6200
6259
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
6201
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
6260
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
6202
6261
  farmDocsCspNonceMarker,
6203
- async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await _chunkI7NUT24Zcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6262
+ async () => _optionalChain([config, 'access', _123 => _123.docs, 'access', _124 => _124.adapter, 'optionalAccess', _125 => _125.server]) ? await _chunkUISZLYKYcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6204
6263
  root,
6205
6264
  srcDir: config.srcDir,
6206
6265
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -6314,7 +6373,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6314
6373
  // Adapters can render provider scripts by serializing function source.
6315
6374
  // keepNames injects helper calls into those functions; after Nitro
6316
6375
  // minifies the server chunk the helper is no longer in script scope.
6317
- keepNames: !(_optionalChain([config, 'access', _125 => _125.docs, 'optionalAccess', _126 => _126.enabled]) && _optionalChain([config, 'access', _127 => _127.docs, 'access', _128 => _128.adapter, 'optionalAccess', _129 => _129.server])),
6376
+ keepNames: !(_optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) && _optionalChain([config, 'access', _128 => _128.docs, 'access', _129 => _129.adapter, 'optionalAccess', _130 => _130.server])),
6318
6377
  jsxDev: false
6319
6378
  },
6320
6379
  // SSR configuration to externalize problematic modules
@@ -6364,10 +6423,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6364
6423
  define: {
6365
6424
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
6366
6425
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
6367
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _130 => _130.env, 'optionalAccess', _131 => _131.public]) || {})
6426
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _131 => _131.env, 'optionalAccess', _132 => _132.public]) || {})
6368
6427
  },
6369
6428
  plugins: [
6370
- _chunkM6U6E4F7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6429
+ _chunkKWST2O22cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6371
6430
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
6372
6431
  ...rendererVitePlugins,
6373
6432
  ...config.vite.plugins || [],
@@ -6390,7 +6449,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6390
6449
  { ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
6391
6450
  farmServerOnlyEntriesPlugin(),
6392
6451
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
6393
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6452
+ _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6394
6453
  ...hasRuntimeConfigModule ? [
6395
6454
  farmStripPlatformConfigPlugin(
6396
6455
  [
@@ -6402,7 +6461,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6402
6461
  {
6403
6462
  name: "farm-virtual-ssr-entry",
6404
6463
  resolveId: {
6405
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6464
+ filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6406
6465
  handler(id) {
6407
6466
  if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
6408
6467
  return virtualEntryId;
@@ -6411,7 +6470,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6411
6470
  }
6412
6471
  },
6413
6472
  load: {
6414
- filter: { id: _chunkM6U6E4F7cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6473
+ filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6415
6474
  handler(id) {
6416
6475
  if (id === virtualEntryId) {
6417
6476
  return virtualEntryCode;
@@ -6443,7 +6502,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6443
6502
  resolve: {
6444
6503
  alias: [
6445
6504
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
6446
- ...Object.entries(_chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6505
+ ...Object.entries(_chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6447
6506
  ([find, replacement]) => ({ find, replacement })
6448
6507
  )
6449
6508
  ],
@@ -6451,7 +6510,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6451
6510
  dedupe: [...config.renderer.dedupe || []]
6452
6511
  }
6453
6512
  };
6454
- await viteBuild(_chunkM6U6E4F7cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6513
+ await viteBuild(_chunkKWST2O22cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6455
6514
  } finally {
6456
6515
  if (postcssConfigDir) {
6457
6516
  try {
@@ -6487,7 +6546,7 @@ function readFarmPageLastModified(pageRoutes) {
6487
6546
  return lastModified;
6488
6547
  }
6489
6548
  function getFarmDocsGuardedPaths(config, middlewareRoutes) {
6490
- if (!_optionalChain([config, 'access', _132 => _132.docs, 'optionalAccess', _133 => _133.enabled])) return [];
6549
+ if (!_optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled])) return [];
6491
6550
  const options = { root: config.root, srcDir: config.srcDir };
6492
6551
  const guards = {
6493
6552
  config: { middleware: config.middleware, integrations: config.integrations },
@@ -6498,15 +6557,15 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
6498
6557
  ).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
6499
6558
  }
6500
6559
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
6501
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _134 => _134.llmsTxt]);
6560
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _135 => _135.llmsTxt]);
6502
6561
  const ownedByFile = (kind) => applicationMetadataRoutes.some(
6503
6562
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
6504
6563
  );
6505
6564
  return [
6506
- ..._optionalChain([llmsTxt, 'optionalAccess', _135 => _135.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
6507
- ..._optionalChain([llmsTxt, 'optionalAccess', _136 => _136.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
6508
- ..._optionalChain([agent, 'optionalAccess', _137 => _137.sitemap, 'optionalAccess', _138 => _138.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
6509
- ..._optionalChain([agent, 'optionalAccess', _139 => _139.crawlers, 'optionalAccess', _140 => _140.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
6565
+ ..._optionalChain([llmsTxt, 'optionalAccess', _136 => _136.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
6566
+ ..._optionalChain([llmsTxt, 'optionalAccess', _137 => _137.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
6567
+ ..._optionalChain([agent, 'optionalAccess', _138 => _138.sitemap, 'optionalAccess', _139 => _139.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
6568
+ ..._optionalChain([agent, 'optionalAccess', _140 => _140.crawlers, 'optionalAccess', _141 => _141.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
6510
6569
  ];
6511
6570
  }
6512
6571
  function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
@@ -6517,7 +6576,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
6517
6576
  docsPath: ${root}.entry,
6518
6577
  contentDir: ${root}.contentDir || ${root}.config?.contentDir,
6519
6578
  }`;
6520
- if (_optionalChain([docs, 'optionalAccess', _141 => _141.roots, 'optionalAccess', _142 => _142.length])) {
6579
+ if (_optionalChain([docs, 'optionalAccess', _142 => _142.roots, 'optionalAccess', _143 => _143.length])) {
6521
6580
  return {
6522
6581
  factory: "createFarmDocsAdapterMultiRuntimeHandler",
6523
6582
  config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
@@ -6530,7 +6589,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
6530
6589
  }
6531
6590
  function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
6532
6591
  if (!docs.enabled) return "null";
6533
- const serializableDocs = _optionalChain([docs, 'access', _143 => _143.roots, 'optionalAccess', _144 => _144.length]) ? {
6592
+ const serializableDocs = _optionalChain([docs, 'access', _144 => _144.roots, 'optionalAccess', _145 => _145.length]) ? {
6534
6593
  ...docs,
6535
6594
  // React elements and functions do not survive JSON; see runtimeConfig below.
6536
6595
  roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
@@ -6564,7 +6623,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
6564
6623
  },
6565
6624
  }
6566
6625
  : ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
6567
- if (!_optionalChain([docs, 'access', _145 => _145.roots, 'optionalAccess', _146 => _146.length])) return expression;
6626
+ if (!_optionalChain([docs, 'access', _146 => _146.roots, 'optionalAccess', _147 => _147.length])) return expression;
6568
6627
  return `((farmDocs) => ({
6569
6628
  ...farmDocs,
6570
6629
  roots: farmDocs.roots.map((farmDocsRoot, index) => {
@@ -6581,7 +6640,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
6581
6640
  return JSON.stringify(modulePath.replace(/\\/g, "/"));
6582
6641
  }
6583
6642
  function generateNativeAuthIntegrationSource(auth) {
6584
- if (_optionalChain([auth, 'optionalAccess', _147 => _147.enabled]) !== true) {
6643
+ if (_optionalChain([auth, 'optionalAccess', _148 => _148.enabled]) !== true) {
6585
6644
  return { importSource: "", registerSource: "" };
6586
6645
  }
6587
6646
  return {
@@ -6891,26 +6950,26 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
6891
6950
  }
6892
6951
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
6893
6952
  const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
6894
- const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _148 => _148.experimental, 'optionalAccess', _149 => _149.serverComponents])) === "islands";
6895
- const farmClientBoot = _chunkM6U6E4F7cjs.canBootFarmIslandsClient.call(void 0, config);
6953
+ const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.serverComponents])) === "islands";
6954
+ const farmClientBoot = _chunkKWST2O22cjs.canBootFarmIslandsClient.call(void 0, config);
6896
6955
  const farmMobileClient = shouldBuildFarmMobileClient(config);
6897
6956
  const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
6898
6957
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
6899
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.crawlers, 'optionalAccess', _152 => _152.enabled])) && !applicationMetadataRoutes.some(
6958
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _151 => _151.agent, 'optionalAccess', _152 => _152.crawlers, 'optionalAccess', _153 => _153.enabled])) && !applicationMetadataRoutes.some(
6900
6959
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
6901
6960
  );
6902
- const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.sitemap, 'optionalAccess', _155 => _155.enabled])) && !applicationMetadataRoutes.some(
6961
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.sitemap, 'optionalAccess', _156 => _156.enabled])) && !applicationMetadataRoutes.some(
6903
6962
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
6904
6963
  );
6905
- const servesDefaultMCP = _optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.mcp]) === true && !_chunkVG6HYT5Kcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6906
- const servesAiCatalog = _optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.aiCatalog]) !== false;
6964
+ const servesDefaultMCP = _optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.mcp]) === true && !_chunkTP4RAV7Ycjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
6965
+ const servesAiCatalog = _optionalChain([config, 'access', _159 => _159.agent, 'optionalAccess', _160 => _160.aiCatalog]) !== false;
6907
6966
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
6908
6967
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
6909
6968
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
6910
6969
  const adapterOwnsDocsRuntime = Boolean(
6911
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _160 => _160.docs, 'optionalAccess', _161 => _161.enabled]) && _optionalChain([config, 'access', _162 => _162.docs, 'access', _163 => _163.adapter, 'optionalAccess', _164 => _164.server]) && config.docs.adapter.react
6970
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _161 => _161.docs, 'optionalAccess', _162 => _162.enabled]) && _optionalChain([config, 'access', _163 => _163.docs, 'access', _164 => _164.adapter, 'optionalAccess', _165 => _165.server]) && config.docs.adapter.react
6912
6971
  );
6913
- if (_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) && _optionalChain([config, 'access', _167 => _167.docs, 'access', _168 => _168.roots, 'optionalAccess', _169 => _169.length]) && !adapterOwnsDocsRuntime) {
6972
+ if (_optionalChain([config, 'access', _166 => _166.docs, 'optionalAccess', _167 => _167.enabled]) && _optionalChain([config, 'access', _168 => _168.docs, 'access', _169 => _169.roots, 'optionalAccess', _170 => _170.length]) && !adapterOwnsDocsRuntime) {
6914
6973
  throw new Error(
6915
6974
  "Several docs roots need the docs adapter, which serves the React renderer only; Farm's built-in docs renderer serves a single docs root."
6916
6975
  );
@@ -6961,7 +7020,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6961
7020
  );
6962
7021
  const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
6963
7022
  const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6964
- const farmDocsFontAssets = _optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 => _171.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
7023
+ const farmDocsFontAssets = _optionalChain([config, 'access', _171 => _171.docs, 'optionalAccess', _172 => _172.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
6965
7024
  const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations);
6966
7025
  const renderedIntegrationProviders = integrationProviders.filter(
6967
7026
  (provider) => provider.component || provider.type === "clerk"
@@ -6971,16 +7030,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6971
7030
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
6972
7031
  );
6973
7032
  }
6974
- const providerServerModules = _chunkM6U6E4F7cjs.generateFarmIntegrationProviderServerModules.call(void 0,
7033
+ const providerServerModules = _chunkKWST2O22cjs.generateFarmIntegrationProviderServerModules.call(void 0,
6975
7034
  renderedIntegrationProviders,
6976
7035
  config.root,
6977
7036
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
6978
7037
  );
6979
7038
  const resolvedIntegrationProviderFallback = Object.fromEntries(
6980
7039
  Object.entries(config.integrations).flatMap(([name, integration]) => {
6981
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _172 => _172.providers]);
7040
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _173 => _173.providers]);
6982
7041
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
6983
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _173 => _173.component]) === "function")) {
7042
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _174 => _174.component]) === "function")) {
6984
7043
  throw new Error(
6985
7044
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
6986
7045
  );
@@ -6991,20 +7050,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6991
7050
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
6992
7051
  (provider) => provider.supportsIsolatedHydration !== true
6993
7052
  );
6994
- const isolatedHydrationMode = _chunkIEN2EFE5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
6995
- _optionalChain([config, 'access', _174 => _174.experimental, 'optionalAccess', _175 => _175.isolatedClientHydration]),
7053
+ const isolatedHydrationMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7054
+ _optionalChain([config, 'access', _175 => _175.experimental, 'optionalAccess', _176 => _176.isolatedClientHydration]),
6996
7055
  {
6997
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _176 => _176.experimental, 'optionalAccess', _177 => _177.serverComponents])) === "rsc",
7056
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.serverComponents])) === "rsc",
6998
7057
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
6999
7058
  }
7000
7059
  );
7001
- const hydrationPlanOptions = _chunkIEN2EFE5cjs.getFarmClientHydrationPlanOptions.call(void 0,
7060
+ const hydrationPlanOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
7002
7061
  config.renderer,
7003
7062
  Boolean(unsupportedIntegrationProvider)
7004
7063
  );
7005
7064
  const pageHydrationPlanOptions = {
7006
7065
  ...hydrationPlanOptions,
7007
- serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _178 => _178.experimental, 'optionalAccess', _179 => _179.serverComponents])) === "islands"
7066
+ serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _179 => _179.experimental, 'optionalAccess', _180 => _180.serverComponents])) === "islands"
7008
7067
  };
7009
7068
  const layoutHydrationPlans = layoutRoutes.map((layout) => ({
7010
7069
  ...layout,
@@ -7016,7 +7075,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7016
7075
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
7017
7076
  )
7018
7077
  }));
7019
- const markdownPagePlan = _chunkIEN2EFE5cjs.createMarkdownPageHydrationPlanner.call(void 0,
7078
+ const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
7020
7079
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
7021
7080
  config.root,
7022
7081
  isolatedHydrationMode,
@@ -7025,7 +7084,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7025
7084
  const pageHydrationPlans = new Map(
7026
7085
  pageRoutes.map((route) => [
7027
7086
  route.modulePath,
7028
- _chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7087
+ _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7029
7088
  route.modulePath,
7030
7089
  config.root,
7031
7090
  isolatedHydrationMode,
@@ -7034,7 +7093,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7034
7093
  )
7035
7094
  ])
7036
7095
  );
7037
- _chunkIEN2EFE5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7096
+ _chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7038
7097
  layoutHydrationPlans.map((layout) => ({
7039
7098
  pattern: layout.pattern,
7040
7099
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -7064,7 +7123,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7064
7123
  apiRegistrations.push(`
7065
7124
  {
7066
7125
  path: ${JSON.stringify(route.path)},
7067
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _180 => _180.pluginMethods, 'optionalAccess', _181 => _181.includes, 'call', _182 => _182(method)])))},
7126
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _181 => _181.pluginMethods, 'optionalAccess', _182 => _182.includes, 'call', _183 => _183(method)])))},
7068
7127
  endpoints: ${varName},
7069
7128
  }`);
7070
7129
  });
@@ -7077,11 +7136,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7077
7136
  }).map(({ route }) => route);
7078
7137
  orderedPageRoutes.forEach((route, index) => {
7079
7138
  const varName = `pageRoute${index}`;
7080
- if (_chunkNSZY3EWGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7139
+ if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7140
+ const renderingDirective2 = _chunkCSQPMV3Qcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7081
7141
  pageRegistrations.push(`
7082
7142
  {
7083
7143
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
7084
- directory: ${JSON.stringify(route.directory)},` : ""}
7144
+ directory: ${JSON.stringify(route.directory)},` : ""}${renderingDirective2 ? `
7145
+ rendering: ${JSON.stringify(renderingDirective2)},` : ""}
7085
7146
  module: createFarmMarkdownRouteModule({
7086
7147
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
7087
7148
  filePath: ${JSON.stringify(toBakedMarkdownSourcePath(config.root, route.modulePath))},
@@ -7101,7 +7162,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7101
7162
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
7102
7163
  );
7103
7164
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
7104
- const renderingDirective = _chunkK7JMTAFHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7165
+ const renderingDirective = _chunkCSQPMV3Qcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7105
7166
  pageRegistrations.push(`
7106
7167
  {
7107
7168
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -7109,8 +7170,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7109
7170
  module: ${varName},
7110
7171
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
7111
7172
  clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
7112
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkIEN2EFE5cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7113
- const rootStrategy = _chunkM6U6E4F7cjs.resolveFarmRouteRootStrategy.call(void 0,
7173
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7174
+ const rootStrategy = _chunkKWST2O22cjs.resolveFarmRouteRootStrategy.call(void 0,
7114
7175
  route,
7115
7176
  clientMetadata,
7116
7177
  layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
@@ -7173,7 +7234,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7173
7234
  containerId: ${JSON.stringify(slot.containerId)},
7174
7235
  interception: ${JSON.stringify(slot.interception)},
7175
7236
  fallback: ${JSON.stringify(slot.fallback)},
7176
- hydrates: ${!farmIslandsMode || _chunkIEN2EFE5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7237
+ hydrates: ${!farmIslandsMode || _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7177
7238
  module: ${varName},
7178
7239
  }`);
7179
7240
  });
@@ -7369,7 +7430,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7369
7430
  createFarmDeploymentMismatchResponse,
7370
7431
  FARM_DEPLOYMENT_ID_HEADER,
7371
7432
  getFarmDeploymentMismatch,
7372
- withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _183 => _183.md, 'optionalAccess', _184 => _184.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7433
+ withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _184 => _184.md, 'optionalAccess', _185 => _185.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7373
7434
  } from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
7374
7435
  import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
7375
7436
  // The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
@@ -7438,25 +7499,25 @@ function farmFormStateScript() { return ""; }`}`;
7438
7499
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
7439
7500
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
7440
7501
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
7441
- const docsHandlerImport = _optionalChain([config, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
7502
+ const docsHandlerImport = _optionalChain([config, 'access', _186 => _186.docs, 'optionalAccess', _187 => _187.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
7442
7503
  const isFarmDocsAPIRequest = (requestOrPathname) => {
7443
7504
  const pathname = typeof requestOrPathname === "string"
7444
7505
  ? requestOrPathname
7445
7506
  : new URL(requestOrPathname.url).pathname;
7446
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _187 => _187.apiPath]) || "/api/docs")};
7507
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _188 => _188.apiPath]) || "/api/docs")};
7447
7508
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
7448
7509
  };` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
7449
- import { ${_optionalChain([config, 'access', _188 => _188.docs, 'access', _189 => _189.roots, 'optionalAccess', _190 => _190.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
7510
+ import { ${_optionalChain([config, 'access', _189 => _189.docs, 'access', _190 => _190.roots, 'optionalAccess', _191 => _191.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
7450
7511
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
7451
7512
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
7452
- const docsFontImport = _optionalChain([config, 'access', _191 => _191.docs, 'optionalAccess', _192 => _192.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
7453
- const docsRuntimeImport = _optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
7513
+ const docsFontImport = _optionalChain([config, 'access', _192 => _192.docs, 'optionalAccess', _193 => _193.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
7514
+ const docsRuntimeImport = _optionalChain([config, 'access', _194 => _194.docs, 'optionalAccess', _195 => _195.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
7454
7515
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
7455
7516
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
7456
- const markdownHandlerImport = _optionalChain([config, 'access', _195 => _195.md, 'optionalAccess', _196 => _196.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
7517
+ const markdownHandlerImport = _optionalChain([config, 'access', _196 => _196.md, 'optionalAccess', _197 => _197.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
7457
7518
  const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
7458
7519
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
7459
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _197 => _197.mdx, 'optionalAccess', _198 => _198.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
7520
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _198 => _198.mdx, 'optionalAccess', _199 => _199.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
7460
7521
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
7461
7522
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
7462
7523
  const layerConfigImports = layerConfigPaths.map(
@@ -7476,14 +7537,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
7476
7537
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
7477
7538
  const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
7478
7539
  const mobileSession = (config.plugins || []).some(
7479
- (plugin) => _optionalChain([plugin, 'optionalAccess', _199 => _199.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
7540
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4BS3HSY7cjs.FARM_MOBILE_SESSION_PLUGIN
7480
7541
  );
7481
7542
  const nativeServerFns = (config.plugins || []).some(
7482
- (plugin) => _optionalChain([plugin, 'optionalAccess', _200 => _200.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
7483
- ) ? _chunkA7HCBHMCcjs.collectFarmNativeServerFns.call(void 0, {
7543
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _201 => _201.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
7544
+ ) ? _chunkZPUAOKHVcjs.collectFarmNativeServerFns.call(void 0, {
7484
7545
  root: config.root,
7485
7546
  srcDir: config.srcDir,
7486
- entries: _chunkA7HCBHMCcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7547
+ entries: _chunkZPUAOKHVcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7487
7548
  }) : void 0;
7488
7549
  const integrationImports = `
7489
7550
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -7498,7 +7559,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
7498
7559
  ${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
7499
7560
  });` : ""}
7500
7561
  `;
7501
- const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7562
+ const imageRuntime = _chunkKWST2O22cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7502
7563
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
7503
7564
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
7504
7565
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -7680,7 +7741,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
7680
7741
 
7681
7742
  function FarmDefault404Page() {
7682
7743
  return React.createElement(React.Fragment, null,
7683
- React.createElement("style", null, ${JSON.stringify(_chunkM6U6E4F7cjs.DEFAULT_NOT_FOUND_STYLES)}),
7744
+ React.createElement("style", null, ${JSON.stringify(_chunkKWST2O22cjs.DEFAULT_NOT_FOUND_STYLES)}),
7684
7745
  React.createElement("main", {
7685
7746
  className: "farm-default-not-found",
7686
7747
  "aria-labelledby": "farm-default-not-found-title",
@@ -7817,24 +7878,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
7817
7878
  validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
7818
7879
  onError(error) { console.error("[Farm Image]", error); },
7819
7880
  })`};
7820
- const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _201 => _201.md, 'optionalAccess', _202 => _202.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
7881
+ const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _202 => _202.md, 'optionalAccess', _203 => _203.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
7821
7882
  // A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
7822
7883
  // ('/about/'), so the trailing-slash 308 never answers in its place.
7823
7884
  const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
7824
7885
  const toFarmMarkdownPageRequest = (request) => request;` : ""}
7825
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _203 => _203.agent, 'optionalAccess', _204 => _204.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
7826
- ${_optionalChain([config, 'access', _205 => _205.agent, 'optionalAccess', _206 => _206.llmsTxt, 'optionalAccess', _207 => _207.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
7886
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _204 => _204.agent, 'optionalAccess', _205 => _205.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
7887
+ ${_optionalChain([config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt, 'optionalAccess', _208 => _208.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
7827
7888
  const farmMdxConfig = ${JSON.stringify({
7828
7889
  ...config.mdx,
7829
- components: typeof _optionalChain([config, 'access', _208 => _208.mdx, 'optionalAccess', _209 => _209.components]) === "string" ? config.mdx.components : void 0
7890
+ components: typeof _optionalChain([config, 'access', _209 => _209.mdx, 'optionalAccess', _210 => _210.components]) === "string" ? config.mdx.components : void 0
7830
7891
  })};
7831
7892
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
7832
- ${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
7893
+ ${_optionalChain([config, 'access', _211 => _211.agent, 'optionalAccess', _212 => _212.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
7833
7894
  // environment this was built in, since Netlify exposes its deploy context only
7834
7895
  // to the build.
7835
7896
  const farmNoindexPreview = resolveFarmPreviewDeployment(
7836
7897
  globalThis.process?.env,
7837
- ${JSON.stringify(_chunkLECZ5DPZcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7898
+ ${JSON.stringify(_chunkDPYBVVL3cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7838
7899
  );` : ""}
7839
7900
  const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
7840
7901
  const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
@@ -7880,7 +7941,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
7880
7941
  });
7881
7942
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
7882
7943
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
7883
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _212.docs, 'optionalAccess', _213 => _213.enabled]) && !hasPrecompiledDocs ? `(() => {
7944
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `(() => {
7884
7945
  try {
7885
7946
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
7886
7947
  const candidates = [
@@ -7892,7 +7953,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _212 => _2
7892
7953
  } catch {
7893
7954
  return null;
7894
7955
  }
7895
- })()` : "null"};${_optionalChain([config, 'access', _214 => _214.docs, 'optionalAccess', _215 => _215.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _216 => _216.docs, 'access', _217 => _217.roots, 'optionalAccess', _218 => _218.length]) ? `
7956
+ })()` : "null"};${_optionalChain([config, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _217 => _217.docs, 'access', _218 => _218.roots, 'optionalAccess', _219 => _219.length]) ? `
7896
7957
  const farmDocsBundledRootsDir = (() => {
7897
7958
  try {
7898
7959
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
@@ -7944,7 +8005,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
7944
8005
  ),
7945
8006
  }
7946
8007
  : undefined;
7947
- const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, 'optionalAccess', _220 => _220.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8008
+ const farmDocsHandler = ${_optionalChain([config, 'access', _220 => _220.docs, 'optionalAccess', _221 => _221.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
7948
8009
  rootDir: farmDocsRuntimeRoot,
7949
8010
  // A production build's content cannot change, so the adapter reads its
7950
8011
  // navigation once instead of scanning the content directory per request.
@@ -7965,7 +8026,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, '
7965
8026
  registerMCPServer: registerFarmMCPServer,
7966
8027
  // A page built with this keeps its HTML string, so the preload budget and the response
7967
8028
  // writer use it instead of reading and re-encoding the body. Older adapters ignore it.
7968
- createHtmlResponse: farmOwnedHtmlResponse,${_chunkI7NUT24Zcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8029
+ createHtmlResponse: farmOwnedHtmlResponse,${_chunkUISZLYKYcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
7969
8030
  // The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
7970
8031
  // asks about any path its own content lists, so the guards decide here, not a page list.
7971
8032
  isPathGuarded: (pathname) =>
@@ -7991,11 +8052,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _219 => _219.docs, '
7991
8052
  isPathGuarded: isFarmDocsPathGuarded,
7992
8053
  basePath: ${JSON.stringify(config.basePath)},
7993
8054
  })` : "null"};
7994
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _221 => _221.docs, 'optionalAccess', _222 => _222.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
8055
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _222 => _222.docs, 'optionalAccess', _223 => _223.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
7995
8056
 
7996
8057
  // API routes bundled at build time
7997
8058
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
7998
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path14, methods }) => ({ path: path14, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
8059
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path15, methods }) => ({ path: path15, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
7999
8060
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
8000
8061
  // pipeline, so the endpoint's middleware and integration guards run for it.
8001
8062
  function dispatchFarmPluginAPIRequest(request) {
@@ -8023,12 +8084,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
8023
8084
  // runtime request.
8024
8085
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
8025
8086
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
8026
- ${_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkK4UGCUXXcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8027
- ` : ""}${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8028
- _chunkK4UGCUXXcjs.resolveFarmAppManifestInput.call(void 0, config, {
8087
+ ${_optionalChain([config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkSXMWVP2Lcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8088
+ ` : ""}${_optionalChain([config, 'access', _226 => _226.agent, 'optionalAccess', _227 => _227.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8089
+ _chunkSXMWVP2Lcjs.resolveFarmAppManifestInput.call(void 0, config, {
8029
8090
  build: config.deploymentId,
8030
- packages: _chunkM6U6E4F7cjs.resolveFarmAppPackages.call(void 0, config.root),
8031
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkM6U6E4F7cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8091
+ packages: _chunkKWST2O22cjs.resolveFarmAppPackages.call(void 0, config.root),
8092
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkKWST2O22cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8032
8093
  })
8033
8094
  )};
8034
8095
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -8834,8 +8895,9 @@ const farmClientEntryPreloadTags = farmClientModulePreloads
8834
8895
  ? farmClientModulePreloads.entry.map(renderFarmClientModulePreload).join("")
8835
8896
  : "";
8836
8897
  // The client modules a document's markup loads: its islands' boundaries and the
8837
- // client references of its server tree.
8838
- const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"|"r":"(\\/[^"]+)"/g;
8898
+ // client references of its server tree. An island with a deferred strategy loads its
8899
+ // module on its own trigger, so it is not preloaded.
8900
+ const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"([^>]*)>|"r":"(\\/[^"]+)"/g;
8839
8901
 
8840
8902
  function renderFarmClientModulePreload(index) {
8841
8903
  return '\\n <link rel="modulepreload" href="/' +
@@ -8863,7 +8925,10 @@ function renderFarmClientModulePreloads(markup, pageModule) {
8863
8925
  };
8864
8926
  add(pageModule);
8865
8927
  if (typeof markup === "string") {
8866
- for (const match of markup.matchAll(FARM_CLIENT_MODULE_REFERENCE_PATTERN)) add(match[1] || match[2]);
8928
+ for (const match of markup.matchAll(FARM_CLIENT_MODULE_REFERENCE_PATTERN)) {
8929
+ if (match[1] && FARM_DEFERRED_ISLAND_STRATEGY.test(match[2])) continue;
8930
+ add(match[1] || match[3]);
8931
+ }
8867
8932
  }
8868
8933
  return tags;
8869
8934
  }
@@ -9255,27 +9320,31 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
9255
9320
  // aside for a page route that answers /mcp and for any MCP server published or
9256
9321
  // registered at runtime, such as the docs engine's.
9257
9322
  const farmDefaultMCPServer = ${JSON.stringify(
9258
- _chunkVG6HYT5Kcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMZLJFNMHcjs.FARM_VERSION)
9323
+ _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMEJCP2LXcjs.FARM_VERSION)
9259
9324
  )};
9260
9325
  let farmDefaultMCPRouteFree;
9261
9326
  function getFarmDefaultMCPServer() {
9262
9327
  if (farmDefaultMCPRouteFree === undefined) {
9263
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)});
9328
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH)});
9264
9329
  }
9265
9330
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
9266
9331
  }
9267
9332
  async function handleFarmDefaultMCP(request) {
9268
9333
  const origin = new URL(request.url).origin;
9334
+ // Pages are linked on metadataBase, as sitemap.xml and llms.txt link them.
9335
+ const metadataBase = getFarmRootMetadataBase();
9269
9336
  return handleFarmDefaultMCPRequest(request, {
9270
9337
  server: getFarmDefaultMCPServer(),
9271
9338
  basePath: ${JSON.stringify(config.basePath)},
9272
9339
  i18n: farmI18nConfig,
9340
+ metadataBase,
9273
9341
  // Each page at the URL it answers at, as in development and as the sitemap lists it.
9274
9342
  listPages: () =>
9275
9343
  collectFarmDefaultMCPPages(
9276
9344
  getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
9277
9345
  {
9278
9346
  origin,
9347
+ metadataBase,
9279
9348
  basePath: ${JSON.stringify(config.basePath)},
9280
9349
  markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
9281
9350
  i18n: farmI18nConfig,
@@ -9291,16 +9360,16 @@ async function handleFarmDefaultMCP(request) {
9291
9360
  // gets its own request context, as for a direct request.
9292
9361
  const farmDefaultMCPReadMarkdown = createFarmLlmsMarkdownReader((page) => fetch(page));
9293
9362
  ` : ""}
9294
- // The origin llms.txt and llms-full.txt link to: the root layout's metadataBase, else the
9295
- // request's origin, as for the sitemap and in development.
9363
+ // The origin llms.txt, llms-full.txt and list_pages link to: the root layout's metadataBase,
9364
+ // else the request's origin, as for the sitemap and in development.
9296
9365
  function getFarmAgentOrigin(request) {
9366
+ return resolveFarmAgentOrigin(getFarmRootMetadataBase(), new URL(request.url).origin);
9367
+ }
9368
+ function getFarmRootMetadataBase() {
9297
9369
  const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
9298
- return resolveFarmAgentOrigin(
9299
- rootLayout && rootLayout.module && rootLayout.module.metadata
9300
- ? rootLayout.module.metadata.metadataBase
9301
- : undefined,
9302
- new URL(request.url).origin,
9303
- );
9370
+ return rootLayout && rootLayout.module && rootLayout.module.metadata
9371
+ ? rootLayout.module.metadata.metadataBase
9372
+ : undefined;
9304
9373
  }
9305
9374
 
9306
9375
  // Static pages and root metadata for llms.txt, built the same way as in development.
@@ -9445,7 +9514,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
9445
9514
  // middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
9446
9515
  const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
9447
9516
  const farmPrerendering =
9448
- typeof process !== "undefined" && process.env?.${_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV} === "1";
9517
+ typeof process !== "undefined" && process.env?.${_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV} === "1";
9449
9518
  ` : ""}
9450
9519
  const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
9451
9520
  config: farmMiddlewareConfig,
@@ -9589,7 +9658,7 @@ function hasLocalRequestRoute(request, routePathname) {
9589
9658
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
9590
9659
  return true;
9591
9660
  }
9592
- ${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
9661
+ ${_optionalChain([config, 'access', _228 => _228.docs, 'optionalAccess', _229 => _229.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
9593
9662
  // The docs answer below the basePath; their API stays at /api/docs, as API routes do.
9594
9663
  const docsRoutePathname = stripFarmBasePath(pathname);
9595
9664
  if (
@@ -9617,7 +9686,7 @@ function getFarmPluginRequestOptions(request) {
9617
9686
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
9618
9687
  };
9619
9688
  }
9620
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
9689
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _230 => _230.docs, 'optionalAccess', _231 => _231.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
9621
9690
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
9622
9691
  pathname,
9623
9692
  method: request.method,
@@ -9701,7 +9770,7 @@ ${hasInfraAnalyticsRuntime ? `
9701
9770
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
9702
9771
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
9703
9772
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
9704
- _chunkK4UGCUXXcjs.listFarmBuiltInRoutePaths.call(void 0, {
9773
+ _chunkSXMWVP2Lcjs.listFarmBuiltInRoutePaths.call(void 0, {
9705
9774
  agent: {
9706
9775
  ...config.agent,
9707
9776
  aiCatalog: servesAiCatalog,
@@ -9712,9 +9781,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
9712
9781
  openapi: openAPIReference
9713
9782
  })
9714
9783
  )});
9715
- ${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) ? `const farmDocsRouteLabelInput = {
9784
+ ${_optionalChain([config, 'access', _232 => _232.docs, 'optionalAccess', _233 => _233.enabled]) ? `const farmDocsRouteLabelInput = {
9716
9785
  path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
9717
- apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _233 => _233.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _234 => _234.docs, 'access', _235 => _235.roots, 'optionalAccess', _236 => _236.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
9786
+ apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _234 => _234.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _235 => _235.docs, 'access', _236 => _236.roots, 'optionalAccess', _237 => _237.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
9718
9787
  pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
9719
9788
  };
9720
9789
  ` : ""}// The request's route payload, for a handler that learns what answered while it handles.
@@ -9730,11 +9799,11 @@ function labelFarmRequestOptions(options) {
9730
9799
  setFarmRouteLabel(options.route, mcpLabel);
9731
9800
  return options;
9732
9801
  }
9733
- ${_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled]) ? `if (options.kind === "docs") {
9802
+ ${_optionalChain([config, 'access', _238 => _238.docs, 'optionalAccess', _239 => _239.enabled]) ? `if (options.kind === "docs") {
9734
9803
  setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
9735
9804
  return options;
9736
9805
  }` : ""}
9737
- ${_optionalChain([config, 'access', _239 => _239.md, 'optionalAccess', _240 => _240.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
9806
+ ${_optionalChain([config, 'access', _240 => _240.md, 'optionalAccess', _241 => _241.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
9738
9807
  routePathname,
9739
9808
  (page) => matchPageRoute(page)?.route.pattern,
9740
9809
  );
@@ -9769,7 +9838,7 @@ function getApplicableLayouts(pathname, directory) {
9769
9838
  return applicable;
9770
9839
  }
9771
9840
 
9772
- ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
9841
+ ${_optionalChain([config, 'access', _242 => _242.docs, 'optionalAccess', _243 => _243.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
9773
9842
  if (request.method === "HEAD") return response;
9774
9843
  if (response.headers.get("x-farm-docs-adapter")) return response;
9775
9844
 
@@ -9877,7 +9946,7 @@ ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 =>
9877
9946
 
9878
9947
  // Shells keep their own LRU so query-string variants never evict app cache entries.
9879
9948
  const pprShellCache = getFarmDataCache().pprShellCache;
9880
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _243 => _243.experimental, 'optionalAccess', _244 => _244.ppr]) === true)};
9949
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _244 => _244.experimental, 'optionalAccess', _245 => _245.ppr]) === true)};
9881
9950
 
9882
9951
  function resolveRouteRenderingView(route) {
9883
9952
  // The same merge development uses: baked directive config under the
@@ -10005,7 +10074,7 @@ async function handleFarmRequest(request, adapterContext) {
10005
10074
  },
10006
10075
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
10007
10076
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
10008
- ${_optionalChain([config, 'access', _245 => _245.md, 'optionalAccess', _246 => _246.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
10077
+ ${_optionalChain([config, 'access', _246 => _246.md, 'optionalAccess', _247 => _247.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
10009
10078
  if (matchPageRoute(pathname)) {
10010
10079
  // The Link header advertises the public .md URL, like the head alternate.
10011
10080
  return applyMarkdownNegotiationHeaders(response, {
@@ -10222,7 +10291,7 @@ ${hasServerRuntimeIntegrations ? `
10222
10291
  return renderFarmErrorJSONResponse();` : `
10223
10292
  if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
10224
10293
  // No page was selected, so only the root error boundary and layouts apply.
10225
- const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _247 => _247.md, 'optionalAccess', _248 => _248.enabled]) ? `
10294
+ const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _248 => _248.md, 'optionalAccess', _249 => _249.enabled]) ? `
10226
10295
  // An agent asking for Markdown reads the error document as Markdown, as it
10227
10296
  // does when a page throws. The helper answers null when Markdown is off.
10228
10297
  const markdownErrorResponse = await createMarkdownMirrorResponse({
@@ -10264,7 +10333,7 @@ ${hasServerRuntimeIntegrations ? `
10264
10333
  }
10265
10334
  ` : ""}
10266
10335
 
10267
- ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `
10336
+ ${_optionalChain([config, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.enabled]) ? `
10268
10337
  // Docs responses are served after app middleware so route guards and
10269
10338
  // middleware headers apply to the docs engine like any other page content.
10270
10339
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -10362,7 +10431,7 @@ ${hasServerRuntimeIntegrations ? `
10362
10431
  }
10363
10432
  ` : ""}
10364
10433
 
10365
- ${_optionalChain([config, 'access', _251 => _251.md, 'optionalAccess', _252 => _252.enabled]) ? `
10434
+ ${_optionalChain([config, 'access', _252 => _252.md, 'optionalAccess', _253 => _253.enabled]) ? `
10366
10435
  if (farmMarkdownConfig?.enabled) {
10367
10436
  const markdownResponse = await createMarkdownMirrorResponse({
10368
10437
  // The mirror helper only reads metadata and creates its own GET request.
@@ -10466,11 +10535,11 @@ ${hasServerRuntimeIntegrations ? `
10466
10535
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
10467
10536
  }
10468
10537
  ` : ""}
10469
- ${_optionalChain([config, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.manifest]) !== false ? `
10538
+ ${_optionalChain([config, 'access', _254 => _254.agent, 'optionalAccess', _255 => _255.manifest]) !== false ? `
10470
10539
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
10471
10540
  // public manifest, the same document for every request.
10472
10541
  if (
10473
- [${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10542
+ [${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10474
10543
  normalizeRuntimePath(routePathname),
10475
10544
  )
10476
10545
  ) {
@@ -10480,9 +10549,9 @@ ${hasServerRuntimeIntegrations ? `
10480
10549
  );
10481
10550
  }
10482
10551
  ` : ""}
10483
- ${_optionalChain([config, 'access', _255 => _255.agent, 'optionalAccess', _256 => _256.apiCatalog]) ? `
10552
+ ${_optionalChain([config, 'access', _256 => _256.agent, 'optionalAccess', _257 => _257.apiCatalog]) ? `
10484
10553
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
10485
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkK4UGCUXXcjs.FARM_API_CATALOG_PATH)}) {
10554
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_API_CATALOG_PATH)}) {
10486
10555
  return applyProductionMiddlewareHeaders(
10487
10556
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
10488
10557
  middlewareHeaders,
@@ -10507,11 +10576,11 @@ ${hasServerRuntimeIntegrations ? `
10507
10576
  );
10508
10577
  }
10509
10578
  ` : ""}
10510
- ${_optionalChain([config, 'access', _257 => _257.agent, 'optionalAccess', _258 => _258.llmsTxt, 'optionalAccess', _259 => _259.enabled]) ? `
10579
+ ${_optionalChain([config, 'access', _258 => _258.agent, 'optionalAccess', _259 => _259.llmsTxt, 'optionalAccess', _260 => _260.enabled]) ? `
10511
10580
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
10512
10581
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
10513
10582
  ? "llms"
10514
- : ${_optionalChain([config, 'access', _260 => _260.agent, 'optionalAccess', _261 => _261.llmsTxt, 'optionalAccess', _262 => _262.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
10583
+ : ${_optionalChain([config, 'access', _261 => _261.agent, 'optionalAccess', _262 => _262.llmsTxt, 'optionalAccess', _263 => _263.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
10515
10584
  if (farmGeneratedLlmsKind) {
10516
10585
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
10517
10586
  // Renders are shared per origin the request reached, which is where pages are read.
@@ -10547,7 +10616,7 @@ ${hasServerRuntimeIntegrations ? `
10547
10616
  }
10548
10617
  ` : ""}
10549
10618
 
10550
- ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
10619
+ ${_optionalChain([config, 'access', _264 => _264.docs, 'optionalAccess', _265 => _265.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
10551
10620
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
10552
10621
  if (docsAPIResponse) {
10553
10622
  return applyProductionMiddlewareHeaders(
@@ -10685,6 +10754,12 @@ ${hasServerRuntimeIntegrations ? `
10685
10754
 
10686
10755
  // Reads from here on belong to the page render, not to middleware.
10687
10756
  const requestReadsBeforeRender = _getRequestReadCount();
10757
+ // A swr or cache route rule stores this page by URL for every visitor. Nitro hands Farm the
10758
+ // request without its cookies, Authorization, or any header the rule does not key on, so a
10759
+ // render that reads nothing of the request is that shared page, whatever its route config.
10760
+ const farmRouteRuleCached =
10761
+ Boolean(adapterContext?.routeRuleCache) &&
10762
+ (request.method === "GET" || request.method === "HEAD");
10688
10763
 
10689
10764
  // Get the page component and metadata
10690
10765
  let PageComponent = route.module.default;
@@ -10918,7 +10993,8 @@ ${hasServerRuntimeIntegrations ? `
10918
10993
  ${farmIslandsMode ? `// Islands mode: a route a shared cache may store (a PPR shell, a static page) renders
10919
10994
  // whole for every request, so a cache hit stays a hit. Other routes leave out what the
10920
10995
  // navigating browser keeps: the layouts it shows and the values it holds.
10921
- const farmSharedCacheableRoute = Boolean(getRouteSharedCacheControl(route, pprCanCache));
10996
+ const farmSharedCacheableRoute =
10997
+ farmRouteRuleCached || Boolean(getRouteSharedCacheControl(route, pprCanCache));
10922
10998
  if (farmSharedCacheableRoute) ignoreFarmHeldValues();
10923
10999
  const farmLayoutKeyOf = getFarmLayoutKey;
10924
11000
  // A navigation the browser renders in its layout's React root rebuilds a server-tree page
@@ -11145,7 +11221,7 @@ ${hasServerRuntimeIntegrations ? `
11145
11221
  );
11146
11222
  }
11147
11223
  }
11148
- ${_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled]) ? `
11224
+ ${_optionalChain([config, 'access', _266 => _266.md, 'optionalAccess', _267 => _267.enabled]) ? `
11149
11225
  // Advertise the Markdown mirror in the head as well as the Link header,
11150
11226
  // using the public path the .md request will be resolved against.
11151
11227
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -11164,7 +11240,7 @@ ${hasServerRuntimeIntegrations ? `
11164
11240
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
11165
11241
  }
11166
11242
 
11167
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.jsonLd]), () => ( false)))} });
11243
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _268 => _268.agent, 'optionalAccess', _269 => _269.jsonLd]), () => ( false)))} });
11168
11244
  const title = renderedMetadata.title;
11169
11245
  const metaTags = renderedMetadata.tags;
11170
11246
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -11183,6 +11259,24 @@ ${hasServerRuntimeIntegrations ? `
11183
11259
  middlewareData?.size ||
11184
11260
  middlewareContext?.size
11185
11261
  );
11262
+ if (farmRouteRuleCached && (renderedPage.stream || hasRequestScopedRender)) {
11263
+ // The route rule's cache refuses a private page: say why it renders on every request.
11264
+ emitFarmEvent({
11265
+ type: "cache.bypass",
11266
+ route: pathname,
11267
+ reason: pageStatus >= 400
11268
+ ? "error-status"
11269
+ : renderReadRequest
11270
+ ? "request-read"
11271
+ : middlewareData?.size || middlewareContext?.size
11272
+ ? "middleware-data"
11273
+ : hasConfiguredRouteContext
11274
+ ? "route-context"
11275
+ : renderedPage.stream
11276
+ ? "suspense-stream"
11277
+ : "request-scoped",
11278
+ });
11279
+ }
11186
11280
  const sharedCacheControl = getRouteSharedCacheControl(route, pprCanCache);
11187
11281
  const responseHeaders = {
11188
11282
  "Content-Type": "text/html; charset=utf-8",
@@ -11192,8 +11286,16 @@ ${hasServerRuntimeIntegrations ? `
11192
11286
  };
11193
11287
  // An error status or a request-scoped render is never shareable, even when
11194
11288
  // the PPR shell headers would otherwise grant a shared max-age.
11195
- if (renderedPage.stream || hasRequestScopedRender || !sharedCacheControl) {
11289
+ if (
11290
+ renderedPage.stream ||
11291
+ hasRequestScopedRender ||
11292
+ (!sharedCacheControl && !farmRouteRuleCached)
11293
+ ) {
11196
11294
  responseHeaders["Cache-Control"] = "private, no-store";
11295
+ } else if (responseHeaders["Cache-Control"] == null) {
11296
+ // A page with no policy of its own under a swr or cache route rule: the rule's cache
11297
+ // stores it and sends the rule's Cache-Control.
11298
+ delete responseHeaders["Cache-Control"];
11197
11299
  }
11198
11300
  const farmI18nSnapshot = getFarmI18nSnapshot();${farmIslandsMode ? `
11199
11301
  // Islands mode: a navigation that names the values it holds, or the layouts it shows,
@@ -11566,7 +11668,7 @@ ${hasServerRuntimeIntegrations ? `
11566
11668
  ${servesDefaultMCP ? `
11567
11669
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
11568
11670
  if (
11569
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkVG6HYT5Kcjs.FARM_DEFAULT_MCP_PATH)} &&
11671
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH)} &&
11570
11672
  getFarmDefaultMCPServer()
11571
11673
  ) {
11572
11674
  return applyProductionMiddlewareHeaders(
@@ -11931,11 +12033,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
11931
12033
  export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
11932
12034
  // The image optimizer's fetch of a local source is not a loopback visitor.
11933
12035
  context = _withFarmImageSourceClientAddress(request, context);`}
11934
- ${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
12036
+ ${_optionalChain([config, 'access', _270 => _270.agent, 'optionalAccess', _271 => _271.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
11935
12037
  basePath: farmLocalAPIBasePath,
11936
12038
  dispatch: async (localRequest) =>
11937
12039
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
11938
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _271 => _271.agent, 'optionalAccess', _272 => _272.noindexPreviews]) ? `
12040
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _272 => _272.agent, 'optionalAccess', _273 => _273.noindexPreviews]) ? `
11939
12041
  // Keep every response of a preview deployment out of search indexes.
11940
12042
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
11941
12043
  }
@@ -12165,11 +12267,11 @@ function getPhysicalPrerenderBypassReason(options) {
12165
12267
  }
12166
12268
  if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
12167
12269
  if (_chunk2MR4MABGcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
12168
- if (_chunkXYVPTTUTcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12270
+ if (_chunkKEB7AGS6cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12169
12271
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
12170
12272
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
12171
- if (_optionalChain([manifestEntry, 'optionalAccess', _273 => _273.rendering]) === "dynamic") return "dynamic runtime manifest";
12172
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _274 => _274.regions, 'optionalAccess', _275 => _275.length])) || manifestEntry.maxDuration !== void 0)) {
12273
+ if (_optionalChain([manifestEntry, 'optionalAccess', _274 => _274.rendering]) === "dynamic") return "dynamic runtime manifest";
12274
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _275 => _275.regions, 'optionalAccess', _276 => _276.length])) || manifestEntry.maxDuration !== void 0)) {
12173
12275
  return "route runtime controls";
12174
12276
  }
12175
12277
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -12182,14 +12284,14 @@ function getPhysicalPrerenderBypassReason(options) {
12182
12284
  return void 0;
12183
12285
  }
12184
12286
  async function getFarmDocsPrerenderPages(config, root, preset) {
12185
- if (!_optionalChain([config, 'access', _276 => _276.docs, 'optionalAccess', _277 => _277.enabled]) || !config.docs.prerender) return [];
12287
+ if (!_optionalChain([config, 'access', _277 => _277.docs, 'optionalAccess', _278 => _278.enabled]) || !config.docs.prerender) return [];
12186
12288
  if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
12187
12289
  _chunkQMNWKQL4cjs.logger.info(
12188
12290
  `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
12189
12291
  );
12190
12292
  return [];
12191
12293
  }
12192
- if (!_chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12294
+ if (!_chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12193
12295
  const { pages: pages2, originDependent } = _chunkNAXKOTPPcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
12194
12296
  root,
12195
12297
  srcDir: config.srcDir
@@ -12207,7 +12309,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12207
12309
  );
12208
12310
  return [];
12209
12311
  }
12210
- const pages = await _chunkI7NUT24Zcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12312
+ const pages = await _chunkUISZLYKYcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12211
12313
  if (!pages) {
12212
12314
  _chunkQMNWKQL4cjs.logger.warn(
12213
12315
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
@@ -12217,14 +12319,14 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12217
12319
  return pages;
12218
12320
  }
12219
12321
  async function listFarmDocsAnalyticsPages(config, root, preset) {
12220
- if (!_optionalChain([config, 'access', _278 => _278.docs, 'optionalAccess', _279 => _279.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
12322
+ if (!_optionalChain([config, 'access', _279 => _279.docs, 'optionalAccess', _280 => _280.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
12221
12323
  return [];
12222
12324
  }
12223
12325
  try {
12224
- return await _chunkI7NUT24Zcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12326
+ return await _chunkUISZLYKYcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12225
12327
  root,
12226
12328
  srcDir: config.srcDir,
12227
- adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkI7NUT24Zcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12329
+ adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12228
12330
  });
12229
12331
  } catch (error) {
12230
12332
  _chunkQMNWKQL4cjs.logger.warn(
@@ -12235,9 +12337,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
12235
12337
  }
12236
12338
  function hasFarmNitroCacheRouteRule(routeRules) {
12237
12339
  return Object.values(routeRules || {}).some((rule) => {
12238
- const swr = _optionalChain([rule, 'optionalAccess', _280 => _280.swr]);
12239
- const cache = _optionalChain([rule, 'optionalAccess', _281 => _281.cache]);
12240
- const headers = _optionalChain([rule, 'optionalAccess', _282 => _282.headers]);
12340
+ const swr = _optionalChain([rule, 'optionalAccess', _281 => _281.swr]);
12341
+ const cache = _optionalChain([rule, 'optionalAccess', _282 => _282.cache]);
12342
+ const headers = _optionalChain([rule, 'optionalAccess', _283 => _283.headers]);
12241
12343
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
12242
12344
  });
12243
12345
  }
@@ -12250,10 +12352,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12250
12352
  const nitroBuilder = nitroBuilderResult.value;
12251
12353
  const isVercel = preset === "vercel";
12252
12354
  const isCloudflareWorker = preset === "cloudflare-module";
12253
- const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12355
+ const outputDir = _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12254
12356
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
12255
12357
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
12256
- const imageRuntime = _chunkM6U6E4F7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12358
+ const imageRuntime = _chunkKWST2O22cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12257
12359
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
12258
12360
  (image) => image.sourceType === "module"
12259
12361
  );
@@ -12387,7 +12489,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12387
12489
  webEntry: clientJsSrc,
12388
12490
  webBoot: clientBootSrc,
12389
12491
  stylesheet: clientCssHref,
12390
- webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _283 => _283.files]), () => ( []))
12492
+ webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _284 => _284.files]), () => ( []))
12391
12493
  })
12392
12494
  ) : null;
12393
12495
  for (const output of Object.values(ssrBundle)) {
@@ -12604,7 +12706,9 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
12604
12706
  }${hasNitroCacheRouteRules ? `
12605
12707
  const farmCacheControl = response.headers.get('cache-control')
12606
12708
  if (
12607
- farmGuardedResponse &&
12709
+ // A guarded response, or any response Farm kept private under a swr or cache rule: the
12710
+ // rule's cache does not store it, and the rule's public Cache-Control must not reach a CDN.
12711
+ (farmGuardedResponse || event.context?.routeRules?.cache) &&
12608
12712
  farmCacheControl &&
12609
12713
  FARM_PRIVATE_CACHE_DIRECTIVE.test(farmCacheControl)
12610
12714
  ) {
@@ -12701,10 +12805,11 @@ function toFarmNodeResponse(request, response) {
12701
12805
  ssrOutputDir,
12702
12806
  ssrEntryFile
12703
12807
  );
12704
- const configuredNitroRouteRules = _chunkOCNV4CI2cjs.nitroRouteRulesBelowBasePath.call(void 0,
12705
- varyFarmNitroCacheRules(_chunkOCNV4CI2cjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
12808
+ const configuredNitroRouteRules = _chunkMQ4DYVFScjs.nitroRouteRulesBelowBasePath.call(void 0,
12809
+ varyFarmNitroCacheRules(_chunkMQ4DYVFScjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
12706
12810
  ...config.md.enabled ? ["accept"] : [],
12707
- ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
12811
+ ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
12812
+ ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.serverComponents])) === "islands" ? ["f-layouts"] : []
12708
12813
  ]),
12709
12814
  config.basePath,
12710
12815
  _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
@@ -12732,6 +12837,18 @@ function toFarmNodeResponse(request, response) {
12732
12837
  ];
12733
12838
  })
12734
12839
  );
12840
+ const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
12841
+ clientOutputDir,
12842
+ files: await listFarmClientOutputFiles(clientOutputDir),
12843
+ routeRules: configuredNitroRouteRules,
12844
+ routePaths: [
12845
+ ...[...routeManager.getRoutes().keys()].map(
12846
+ (pattern) => _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pattern, config.basePath)
12847
+ ),
12848
+ ...apiRouteManager.getRoutes().keys(),
12849
+ _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
12850
+ ]
12851
+ });
12735
12852
  let nitroConfig = {
12736
12853
  preset,
12737
12854
  ...farmNodeServerEntryPath ? { entry: farmNodeServerEntryPath } : {},
@@ -12750,13 +12867,9 @@ function toFarmNodeResponse(request, response) {
12750
12867
  alias: resolveNitroInternalRuntimeAliases(root),
12751
12868
  compatibilityDate: "2024-12-01",
12752
12869
  output: resolveFarmNitroOutputConfig(preset, outputDir),
12753
- publicAssets: [
12754
- {
12755
- dir: clientOutputDir,
12756
- maxAge: 31536e3,
12757
- baseURL: "/"
12758
- }
12759
- ],
12870
+ // Nitro gives the root directory no Cache-Control on any preset (it falls through to the
12871
+ // app), so public files keep revalidating; the hashed directories carry their own maxAge.
12872
+ publicAssets: [{ dir: clientOutputDir, baseURL: "/" }, ...immutableAssets.publicAssets],
12760
12873
  // A self-hosted Node server sends static files itself, so precompress them
12761
12874
  // with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
12762
12875
  // fixed top quality cost a docs app ~20 s of build CPU for a small further
@@ -12810,6 +12923,7 @@ function toFarmNodeResponse(request, response) {
12810
12923
  "/**": {
12811
12924
  prerender: false
12812
12925
  },
12926
+ ...immutableAssets.routeRules,
12813
12927
  ...configuredNitroRouteRules,
12814
12928
  // Exact user rules must retain their runtime settings without replacing
12815
12929
  // the headers and prerender marker generated for a safe physical page.
@@ -12851,23 +12965,23 @@ function toFarmNodeResponse(request, response) {
12851
12965
  snapshotSSRRebundleOptions(nitroConfig)
12852
12966
  );
12853
12967
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
12854
- const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _284 => _284.rollupConfig, 'optionalAccess', _285 => _285.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _286 => _286.rollupConfig, 'optionalAccess', _287 => _287.plugins])) && customRollupKeys.length === 0 && Boolean(
12855
- _optionalChain([nitroConfig, 'access', _288 => _288.handlers, 'optionalAccess', _289 => _289.some, 'call', _290 => _290(
12856
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _291 => _291.handler]) || "") === nitroEntryPath
12968
+ const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _287 => _287.rollupConfig, 'optionalAccess', _288 => _288.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _289 => _289.rollupConfig, 'optionalAccess', _290 => _290.plugins])) && customRollupKeys.length === 0 && Boolean(
12969
+ _optionalChain([nitroConfig, 'access', _291 => _291.handlers, 'optionalAccess', _292 => _292.some, 'call', _293 => _293(
12970
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _294 => _294.handler]) || "") === nitroEntryPath
12857
12971
  )])
12858
12972
  );
12859
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _292 => _292.output, 'optionalAccess', _293 => _293.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
12973
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _295 => _295.output, 'optionalAccess', _296 => _296.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
12860
12974
  const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
12861
12975
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
12862
12976
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
12863
12977
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
12864
12978
  const shouldMinify = nitroConfig.minify !== false;
12865
- const keepServerNames = !(_optionalChain([config, 'access', _294 => _294.docs, 'optionalAccess', _295 => _295.enabled]) && _optionalChain([config, 'access', _296 => _296.docs, 'access', _297 => _297.adapter, 'optionalAccess', _298 => _298.server]));
12979
+ const keepServerNames = !(_optionalChain([config, 'access', _297 => _297.docs, 'optionalAccess', _298 => _298.enabled]) && _optionalChain([config, 'access', _299 => _299.docs, 'access', _300 => _300.adapter, 'optionalAccess', _301 => _301.server]));
12866
12980
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
12867
12981
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
12868
12982
  const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
12869
12983
  if (ssrRollupPlugin) {
12870
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _299 => _299.rollupConfig, 'optionalAccess', _300 => _300.plugins]);
12984
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _302 => _302.rollupConfig, 'optionalAccess', _303 => _303.plugins]);
12871
12985
  nitroConfig.rollupConfig = {
12872
12986
  ...nitroConfig.rollupConfig,
12873
12987
  plugins: [
@@ -12894,9 +13008,9 @@ function toFarmNodeResponse(request, response) {
12894
13008
  const orderOf = (route) => _nullishCoalesce(prerenderOrder.get(route), () => ( Number.MAX_SAFE_INTEGER));
12895
13009
  prerenderedRoutes.sort((a, b) => orderOf(a.route) - orderOf(b.route));
12896
13010
  });
12897
- if (_optionalChain([config, 'access', _301 => _301.md, 'optionalAccess', _302 => _302.enabled])) {
13011
+ if (_optionalChain([config, 'access', _304 => _304.md, 'optionalAccess', _305 => _305.enabled])) {
12898
13012
  nitroInstance.hooks.hook("prerender:generate", (route) => {
12899
- if (!route.contents || !_optionalChain([route, 'access', _303 => _303.contentType, 'optionalAccess', _304 => _304.toLowerCase, 'call', _305 => _305(), 'access', _306 => _306.includes, 'call', _307 => _307("html")])) return;
13013
+ if (!route.contents || !_optionalChain([route, 'access', _306 => _306.contentType, 'optionalAccess', _307 => _307.toLowerCase, 'call', _308 => _308(), 'access', _309 => _309.includes, 'call', _310 => _310("html")])) return;
12900
13014
  const alternatePath = _chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
12901
13015
  routePathname: (pathname) => routeManager.toRoutePathname(pathname)
12902
13016
  });
@@ -12919,7 +13033,7 @@ function toFarmNodeResponse(request, response) {
12919
13033
  }
12920
13034
  if (config.security.csp && config.security.csp.nonce) {
12921
13035
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
12922
- if (!route.contents || !_optionalChain([route, 'access', _308 => _308.contentType, 'optionalAccess', _309 => _309.toLowerCase, 'call', _310 => _310(), 'access', _311 => _311.includes, 'call', _312 => _312("html")])) return;
13036
+ if (!route.contents || !_optionalChain([route, 'access', _311 => _311.contentType, 'optionalAccess', _312 => _312.toLowerCase, 'call', _313 => _313(), 'access', _314 => _314.includes, 'call', _315 => _315("html")])) return;
12923
13037
  const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
12924
13038
  if (!staticCsp) return;
12925
13039
  route.contents = staticCsp.html;
@@ -12954,7 +13068,7 @@ function toFarmNodeResponse(request, response) {
12954
13068
  await nitroBuilder.copyPublicAssets(nitroInstance);
12955
13069
  if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
12956
13070
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
12957
- const configuredPlugins = _optionalChain([prerendererConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins]);
13071
+ const configuredPlugins = _optionalChain([prerendererConfig, 'access', _316 => _316.rollupConfig, 'optionalAccess', _317 => _317.plugins]);
12958
13072
  const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
12959
13073
  prerendererConfig.rollupConfig = {
12960
13074
  ...prerendererConfig.rollupConfig,
@@ -13011,13 +13125,13 @@ function toFarmNodeResponse(request, response) {
13011
13125
  }
13012
13126
  if (prerenderRoutes.length > 0) {
13013
13127
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
13014
- const previousPrerender = process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
13015
- process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = "1";
13128
+ const previousPrerender = process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV];
13129
+ process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV] = "1";
13016
13130
  try {
13017
13131
  await nitroBuilder.prerender(nitroInstance);
13018
13132
  } finally {
13019
- if (previousPrerender === void 0) delete process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV];
13020
- else process.env[_chunkBPUVDCGGcjs.FARM_PRERENDER_ENV] = previousPrerender;
13133
+ if (previousPrerender === void 0) delete process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV];
13134
+ else process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV] = previousPrerender;
13021
13135
  }
13022
13136
  }
13023
13137
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -13193,7 +13307,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
13193
13307
  await fs4.rename(src, dest);
13194
13308
  return;
13195
13309
  } catch (error) {
13196
- const code = _optionalChain([error, 'optionalAccess', _315 => _315.code]);
13310
+ const code = _optionalChain([error, 'optionalAccess', _318 => _318.code]);
13197
13311
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
13198
13312
  throw error;
13199
13313
  }
@@ -13219,7 +13333,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13219
13333
  try {
13220
13334
  await moveVercelOutputPath(publicDir, staticDir, fs4);
13221
13335
  } catch (error) {
13222
- if (_optionalChain([error, 'optionalAccess', _316 => _316.code]) !== "ENOENT") throw error;
13336
+ if (_optionalChain([error, 'optionalAccess', _319 => _319.code]) !== "ENOENT") throw error;
13223
13337
  }
13224
13338
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
13225
13339
  await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
@@ -13261,7 +13375,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13261
13375
  _chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
13262
13376
  }
13263
13377
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
13264
- if (!_optionalChain([config, 'access', _317 => _317.docs, 'optionalAccess', _318 => _318.enabled])) return;
13378
+ if (!_optionalChain([config, 'access', _320 => _320.docs, 'optionalAccess', _321 => _321.enabled])) return;
13265
13379
  const [mainRoot, ...extraRoots] = _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs);
13266
13380
  await copyFarmDocsRootContent(
13267
13381
  mainRoot,
@@ -13286,7 +13400,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
13286
13400
  const lastModifiedManifest = _chunkNAXKOTPPcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
13287
13401
  fallback: "now"
13288
13402
  });
13289
- const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _319 => _319.unknown, 'optionalAccess', _320 => _320.length]), () => ( 0));
13403
+ const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _322 => _322.unknown, 'optionalAccess', _323 => _323.length]), () => ( 0));
13290
13404
  if (undatedPages > 0) {
13291
13405
  _chunkQMNWKQL4cjs.logger.warn(
13292
13406
  `${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
@@ -13371,7 +13485,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
13371
13485
  try {
13372
13486
  await copyPackage("sharp", sharpRequire);
13373
13487
  if (!copiedPackages.has("sharp")) {
13374
- throw new Error(`Farm image optimization requires sharp. ${_chunkM6U6E4F7cjs.SHARP_INSTALL_HINT}`);
13488
+ throw new Error(`Farm image optimization requires sharp. ${_chunkKWST2O22cjs.SHARP_INSTALL_HINT}`);
13375
13489
  }
13376
13490
  } catch (error) {
13377
13491
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -13601,7 +13715,7 @@ async function createFarmProjectModuleSsrEnvironment() {
13601
13715
  // src/build/index.ts
13602
13716
  async function build(config, options = {}) {
13603
13717
  return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
13604
- () => _chunkIEN2EFE5cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13718
+ () => _chunk2IFT2CSAcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13605
13719
  );
13606
13720
  }
13607
13721
  function createBuildTargetBaseline(config) {
@@ -13612,7 +13726,7 @@ function createBuildTargetBaseline(config) {
13612
13726
  preset,
13613
13727
  distDir,
13614
13728
  outputDir,
13615
- outputWasDerived: outputDir === _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13729
+ outputWasDerived: outputDir === _chunkKEB7AGS6cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13616
13730
  };
13617
13731
  }
13618
13732
  function resolveBuildTargets(config, options, baseline) {
@@ -13621,8 +13735,8 @@ function resolveBuildTargets(config, options, baseline) {
13621
13735
  const distDir = config.distDir || ".farm";
13622
13736
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
13623
13737
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
13624
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkXYVPTTUTcjs.getDeployTargetForPreset.call(void 0, preset);
13625
- const outputDir = shouldRefreshDerivedOutput ? _chunkXYVPTTUTcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13738
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkKEB7AGS6cjs.getDeployTargetForPreset.call(void 0, preset);
13739
+ const outputDir = shouldRefreshDerivedOutput ? _chunkKEB7AGS6cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13626
13740
  return {
13627
13741
  root,
13628
13742
  preset,
@@ -13630,7 +13744,7 @@ function resolveBuildTargets(config, options, baseline) {
13630
13744
  distDir,
13631
13745
  deployTarget,
13632
13746
  outputDir,
13633
- deployOutputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13747
+ deployOutputDir: _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13634
13748
  };
13635
13749
  }
13636
13750
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -13638,7 +13752,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13638
13752
  const targetBaseline = createBuildTargetBaseline(config);
13639
13753
  let targets;
13640
13754
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
13641
- const pluginManager = new (0, _chunkJFPKARWMcjs.PluginManager)({
13755
+ const pluginManager = new (0, _chunkPMU4U2W2cjs.PluginManager)({
13642
13756
  config,
13643
13757
  isDev: false,
13644
13758
  isProd: true
@@ -13667,15 +13781,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13667
13781
  };
13668
13782
  config = {
13669
13783
  ...config,
13670
- images: _chunkM6U6E4F7cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13784
+ images: _chunkKWST2O22cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13671
13785
  root: targets.root,
13672
13786
  preset: targets.preset
13673
13787
  })
13674
13788
  };
13675
- if (_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
13789
+ if (_optionalChain([config, 'access', _324 => _324.docs, 'optionalAccess', _325 => _325.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
13676
13790
  pluginManager.updateContext({ config });
13677
13791
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
13678
- _chunkIEN2EFE5cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkIEN2EFE5cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13792
+ _chunk2IFT2CSAcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunk2IFT2CSAcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13679
13793
  _chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
13680
13794
  await pluginManager.setupPlugins();
13681
13795
  await pluginManager.runHookParallel("beforeBundle", {
@@ -13687,8 +13801,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13687
13801
  });
13688
13802
  _chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
13689
13803
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
13690
- if (_optionalChain([productionViteResult, 'optionalAccess', _323 => _323.status]) === "rejected") throw productionViteResult.reason;
13691
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _324 => _324.value]);
13804
+ if (_optionalChain([productionViteResult, 'optionalAccess', _326 => _326.status]) === "rejected") throw productionViteResult.reason;
13805
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _327 => _327.value]);
13692
13806
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
13693
13807
  projectModuleServer = await createProjectModuleServer(
13694
13808
  createViteServer,
@@ -13696,17 +13810,17 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13696
13810
  root,
13697
13811
  rendererBuild.signal
13698
13812
  );
13699
- const farmApp = _chunkM6U6E4F7cjs.createFarmApp.call(void 0, config, projectModuleServer);
13813
+ const farmApp = _chunkKWST2O22cjs.createFarmApp.call(void 0, config, projectModuleServer);
13700
13814
  await farmApp.initialize();
13701
13815
  const routeManager = farmApp.getRouteManager();
13702
13816
  const serverRenderer = farmApp.getServerRenderer();
13703
- const typeArtifacts = _chunkK7JMTAFHcjs.generateFarmTypeArtifacts.call(void 0, {
13817
+ const typeArtifacts = _chunkCSQPMV3Qcjs.generateFarmTypeArtifacts.call(void 0, {
13704
13818
  root,
13705
13819
  srcDir,
13706
13820
  layers: config.layers,
13707
13821
  plugins: config.plugins,
13708
13822
  extraRoutes: [
13709
- ..._optionalChain([config, 'access', _325 => _325.openapi, 'optionalAccess', _326 => _326.enabled]) && config.openapi.route ? [config.openapi.route] : [],
13823
+ ..._optionalChain([config, 'access', _328 => _328.openapi, 'optionalAccess', _329 => _329.enabled]) && config.openapi.route ? [config.openapi.route] : [],
13710
13824
  ..._chunkNAXKOTPPcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
13711
13825
  ],
13712
13826
  suppressLintOnLink: config.suppressLintOnLink,
@@ -13791,7 +13905,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13791
13905
  throw error;
13792
13906
  } finally {
13793
13907
  try {
13794
- await _optionalChain([projectModuleServer, 'optionalAccess', _327 => _327.close, 'call', _328 => _328()]);
13908
+ await _optionalChain([projectModuleServer, 'optionalAccess', _330 => _330.close, 'call', _331 => _331()]);
13795
13909
  } finally {
13796
13910
  rendererBuild.abort();
13797
13911
  }
@@ -13803,7 +13917,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13803
13917
  ssr: true,
13804
13918
  buildLifetime
13805
13919
  });
13806
- const viteConfig = _chunkM6U6E4F7cjs.mergeFarmViteConfig.call(void 0,
13920
+ const viteConfig = _chunkKWST2O22cjs.mergeFarmViteConfig.call(void 0,
13807
13921
  {
13808
13922
  root,
13809
13923
  appType: "custom",
@@ -13815,12 +13929,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13815
13929
  },
13816
13930
  plugins: [
13817
13931
  ...rendererVitePlugins,
13818
- _chunkM6U6E4F7cjs.farmFontImportsPlugin.call(void 0, {
13932
+ _chunkKWST2O22cjs.farmFontImportsPlugin.call(void 0, {
13819
13933
  root,
13820
13934
  basePath: config.basePath,
13821
13935
  publicDir: config.publicDir
13822
13936
  }),
13823
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
13937
+ _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
13824
13938
  // Route modules load here at build time (rendering config, prerendering): `server-only`
13825
13939
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
13826
13940
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -13832,7 +13946,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13832
13946
  hmr: false
13833
13947
  },
13834
13948
  resolve: {
13835
- alias: _chunkM6U6E4F7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
13949
+ alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
13836
13950
  dedupe: [...config.renderer.dedupe || []]
13837
13951
  },
13838
13952
  optimizeDeps: {
@@ -13871,10 +13985,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13871
13985
  noDiscovery: true
13872
13986
  },
13873
13987
  // An app or plugin that brings its own SSR environment keeps it.
13874
- environments: _optionalChain([viteConfig, 'access', _329 => _329.environments, 'optionalAccess', _330 => _330.ssr, 'optionalAccess', _331 => _331.dev, 'optionalAccess', _332 => _332.createEnvironment]) ? viteConfig.environments : {
13988
+ environments: _optionalChain([viteConfig, 'access', _332 => _332.environments, 'optionalAccess', _333 => _333.ssr, 'optionalAccess', _334 => _334.dev, 'optionalAccess', _335 => _335.createEnvironment]) ? viteConfig.environments : {
13875
13989
  ...viteConfig.environments,
13876
13990
  ssr: {
13877
- ..._optionalChain([viteConfig, 'access', _333 => _333.environments, 'optionalAccess', _334 => _334.ssr]),
13991
+ ..._optionalChain([viteConfig, 'access', _336 => _336.environments, 'optionalAccess', _337 => _337.ssr]),
13878
13992
  ...await createFarmProjectModuleSsrEnvironment()
13879
13993
  }
13880
13994
  }
@@ -13882,7 +13996,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13882
13996
  }
13883
13997
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
13884
13998
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
13885
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
13999
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
13886
14000
  const pluginManager = new PluginManager2({
13887
14001
  config,
13888
14002
  isDev: false,
@@ -13902,14 +14016,14 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
13902
14016
  farmI18nClientBridgePlugin(),
13903
14017
  farmServerOnlyEntriesPlugin(),
13904
14018
  farmPlugin(config, pluginManager),
13905
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14019
+ _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
13906
14020
  ],
13907
14021
  mode: "production"
13908
14022
  });
13909
14023
  }
13910
14024
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
13911
14025
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
13912
- const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
14026
+ const { PluginManager: PluginManager2 } = await import("./plugin-5PIQQVRP.cjs");
13913
14027
  const pluginManager = new PluginManager2({
13914
14028
  config,
13915
14029
  isDev: false,
@@ -13930,12 +14044,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
13930
14044
  define: {
13931
14045
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
13932
14046
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
13933
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _335 => _335.env, 'optionalAccess', _336 => _336.public]) || {})
14047
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _338 => _338.env, 'optionalAccess', _339 => _339.public]) || {})
13934
14048
  },
13935
14049
  plugins: [
13936
14050
  farmI18nClientBridgePlugin(),
13937
14051
  farmPlugin(config, pluginManager),
13938
- _chunkIEN2EFE5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14052
+ _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
13939
14053
  ],
13940
14054
  mode: "production"
13941
14055
  });
@@ -13950,7 +14064,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
13950
14064
  }
13951
14065
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
13952
14066
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
13953
- import("./nitro-Y3LGITW3.cjs"),
14067
+ import("./nitro-2LMOMIST.cjs"),
13954
14068
  import("nitro/builder")
13955
14069
  ]);
13956
14070
  let nitroConfig = await createNitroConfig(
@@ -13963,7 +14077,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
13963
14077
  if (pluginManager) {
13964
14078
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
13965
14079
  }
13966
- const outputDir = _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
14080
+ const outputDir = _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13967
14081
  const serverOutputDir = _path2.default.join(outputDir, "server");
13968
14082
  const publicOutputDir = _path2.default.join(outputDir, "public");
13969
14083
  const { mkdir, cp } = await import("fs/promises");
@@ -14034,7 +14148,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
14034
14148
  root,
14035
14149
  preset,
14036
14150
  distDir,
14037
- outputDir: _chunkXYVPTTUTcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14151
+ outputDir: _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14038
14152
  });
14039
14153
  }
14040
14154
  }