@farm.js/core 0.1.24 → 0.1.26

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 (167) hide show
  1. package/dist/agent-runtime.d.mts +2 -2
  2. package/dist/agent-runtime.d.ts +2 -2
  3. package/dist/api/route-manager.cjs +4 -4
  4. package/dist/api/route-manager.d.mts +2 -2
  5. package/dist/api/route-manager.d.ts +2 -2
  6. package/dist/api/route-manager.mjs +3 -3
  7. package/dist/api/runtime.cjs +3 -3
  8. package/dist/api/runtime.mjs +2 -2
  9. package/dist/api.cjs +7 -7
  10. package/dist/api.d.mts +3 -3
  11. package/dist/api.d.ts +3 -3
  12. package/dist/api.mjs +6 -6
  13. package/dist/{app-BZDWwwFa.d.mts → app-29vG5tmY.d.mts} +3 -3
  14. package/dist/{app-BV-7wV5q.d.ts → app-Cx71s_PT.d.ts} +3 -3
  15. package/dist/app-markdown.cjs +6 -4
  16. package/dist/app-markdown.d.mts +3 -3
  17. package/dist/app-markdown.d.ts +3 -3
  18. package/dist/app-markdown.mjs +5 -3
  19. package/dist/{chunk-ISTFC3MZ.cjs → chunk-2CT6XUNO.cjs} +99 -26
  20. package/dist/{chunk-G6GNNB44.cjs → chunk-3TQG7CGC.cjs} +201 -180
  21. package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
  22. package/dist/{chunk-LYM7HY34.cjs → chunk-3WSWXPYM.cjs} +4 -4
  23. package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
  24. package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
  25. package/dist/{chunk-MVUREHPN.mjs → chunk-74RZNRY6.mjs} +1 -1
  26. package/dist/{chunk-BD7FZ63M.cjs → chunk-ALIFMS4A.cjs} +1 -1
  27. package/dist/{chunk-PGQBL5DN.mjs → chunk-ARXCHQLX.mjs} +79 -2
  28. package/dist/{chunk-2QLBIPFT.cjs → chunk-B6ZCT36X.cjs} +4 -4
  29. package/dist/{chunk-IMBMOEWT.cjs → chunk-BD2U4ZL6.cjs} +8 -8
  30. package/dist/{chunk-2M435BUE.mjs → chunk-CEYUWDWA.mjs} +7 -5
  31. package/dist/{chunk-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
  32. package/dist/{chunk-47H7VENP.mjs → chunk-DU2CASV6.mjs} +1 -1
  33. package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
  34. package/dist/chunk-J63ZH5OQ.cjs +62 -0
  35. package/dist/{chunk-N255VYFP.mjs → chunk-JM5GQL4H.mjs} +8 -3
  36. package/dist/{chunk-6VEHUKZ2.mjs → chunk-MM5D6VLP.mjs} +4 -20
  37. package/dist/chunk-MVL2RAJW.mjs +62 -0
  38. package/dist/{chunk-YA6LLTIJ.cjs → chunk-ND224OE2.cjs} +4 -20
  39. package/dist/{chunk-YGMK6ESJ.mjs → chunk-OFKG57MZ.mjs} +2 -2
  40. package/dist/chunk-OOIL3BWR.mjs +1229 -0
  41. package/dist/{chunk-BNSD3VDY.mjs → chunk-PPIW3MH6.mjs} +1 -1
  42. package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
  43. package/dist/chunk-QIH2HD6H.cjs +1229 -0
  44. package/dist/{chunk-OYDRPBBV.cjs → chunk-QJ4D3UKJ.cjs} +80 -3
  45. package/dist/{chunk-LQIRVSBY.cjs → chunk-QLXEYIAW.cjs} +13 -13
  46. package/dist/{chunk-ARHWIOUZ.mjs → chunk-QPPQHB6X.mjs} +111 -40
  47. package/dist/{chunk-7BC6GAL7.mjs → chunk-RAI7NULA.mjs} +76 -3
  48. package/dist/{chunk-AH7HOAQ3.cjs → chunk-RCYINC4A.cjs} +9 -4
  49. package/dist/{chunk-SIQMTHCZ.cjs → chunk-SZ4LYNUX.cjs} +212 -141
  50. package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
  51. package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
  52. package/dist/{chunk-6YSEHN46.mjs → chunk-UXQXGB5A.mjs} +36 -15
  53. package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
  54. package/dist/{chunk-I5YBCWQ6.cjs → chunk-W2HZKYES.cjs} +2 -2
  55. package/dist/{chunk-DNLQMFER.cjs → chunk-WFPRVVF2.cjs} +26 -19
  56. package/dist/{chunk-BDJNP7AQ.mjs → chunk-YMUH2BLR.mjs} +10 -3
  57. package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-B8RPJnot.d.mts} +129 -4
  58. package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-bPBf4haK.d.ts} +129 -4
  59. package/dist/client-plugins.d.mts +2 -2
  60. package/dist/client-plugins.d.ts +2 -2
  61. package/dist/client.cjs +4 -4
  62. package/dist/client.d.mts +6 -6
  63. package/dist/client.d.ts +6 -6
  64. package/dist/client.mjs +3 -3
  65. package/dist/config.d.mts +2 -2
  66. package/dist/config.d.ts +2 -2
  67. package/dist/{devtools-OY4SNU3P.mjs → devtools-5D4ZDRPR.mjs} +5 -3
  68. package/dist/{devtools-UHRSZ7VA.cjs → devtools-QZJEUOJW.cjs} +6 -4
  69. package/dist/docs.cjs +8 -6
  70. package/dist/docs.mjs +7 -5
  71. package/dist/index.cjs +29 -23
  72. package/dist/index.d.mts +14 -14
  73. package/dist/index.d.ts +14 -14
  74. package/dist/index.mjs +28 -22
  75. package/dist/integrations.d.mts +2 -2
  76. package/dist/integrations.d.ts +2 -2
  77. package/dist/internal/app-markdown-runtime.cjs +5 -3
  78. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  79. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  80. package/dist/internal/app-markdown-runtime.mjs +4 -2
  81. package/dist/internal/build-runtime.cjs +18 -17
  82. package/dist/internal/build-runtime.d.mts +4 -4
  83. package/dist/internal/build-runtime.d.ts +4 -4
  84. package/dist/internal/build-runtime.mjs +17 -16
  85. package/dist/internal/cli-runtime.cjs +6 -5
  86. package/dist/internal/cli-runtime.mjs +5 -4
  87. package/dist/internal/client-error-overlay.cjs +4 -4
  88. package/dist/internal/client-error-overlay.mjs +1 -1
  89. package/dist/internal/compression-runtime.d.mts +2 -2
  90. package/dist/internal/compression-runtime.d.ts +2 -2
  91. package/dist/internal/config-runtime.cjs +6 -4
  92. package/dist/internal/config-runtime.d.mts +3 -3
  93. package/dist/internal/config-runtime.d.ts +3 -3
  94. package/dist/internal/config-runtime.mjs +5 -3
  95. package/dist/internal/infra-analytics-runtime.cjs +4 -3
  96. package/dist/internal/infra-analytics-runtime.mjs +2 -1
  97. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  98. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  99. package/dist/internal/production-runtime.cjs +12 -5
  100. package/dist/internal/production-runtime.d.mts +33 -9
  101. package/dist/internal/production-runtime.d.ts +33 -9
  102. package/dist/internal/production-runtime.mjs +11 -4
  103. package/dist/markdown.cjs +6 -2
  104. package/dist/markdown.d.mts +63 -1
  105. package/dist/markdown.d.ts +63 -1
  106. package/dist/markdown.mjs +5 -1
  107. package/dist/{metadata-B08w4EYV.d.mts → metadata-C3na4CBj.d.mts} +1 -1
  108. package/dist/{metadata-IQEblkZp.d.ts → metadata-CzBP4Mfp.d.ts} +1 -1
  109. package/dist/middleware.d.mts +4 -4
  110. package/dist/middleware.d.ts +4 -4
  111. package/dist/navigation.cjs +5 -5
  112. package/dist/navigation.d.mts +5 -5
  113. package/dist/navigation.d.ts +5 -5
  114. package/dist/navigation.mjs +4 -4
  115. package/dist/observability-BupkiN0m.d.mts +447 -0
  116. package/dist/observability-BupkiN0m.d.ts +447 -0
  117. package/dist/observability.d.mts +2 -417
  118. package/dist/observability.d.ts +2 -417
  119. package/dist/plugin.cjs +13 -12
  120. package/dist/plugin.d.mts +2 -2
  121. package/dist/plugin.d.ts +2 -2
  122. package/dist/plugin.mjs +12 -11
  123. package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-CYg4wM4E.d.ts} +1 -1
  124. package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-DP94hPGe.d.mts} +1 -1
  125. package/dist/query/client.cjs +6 -6
  126. package/dist/query/client.mjs +2 -2
  127. package/dist/{render-plan-CCFuMLNS.d.ts → render-plan-Bl6Fzg5z.d.ts} +1 -1
  128. package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-CKAJg0jC.d.mts} +1 -1
  129. package/dist/renderer-client.cjs +5 -5
  130. package/dist/renderer-client.d.mts +4 -4
  131. package/dist/renderer-client.d.ts +4 -4
  132. package/dist/renderer-client.mjs +2 -2
  133. package/dist/{request-Dn6VURbE.d.ts → request-CR-Bp1Px.d.ts} +1 -1
  134. package/dist/{request-DgD1XsTx.d.mts → request-CrBCcPZZ.d.mts} +1 -1
  135. package/dist/request.d.mts +3 -3
  136. package/dist/request.d.ts +3 -3
  137. package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-C1NAHo-C.d.mts} +1 -1
  138. package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-CZH5FegB.d.ts} +1 -1
  139. package/dist/{router-CnrRSa9d.d.mts → router-B57eDJ3u.d.mts} +1 -1
  140. package/dist/{router-BSOOGya2.d.ts → router-Cg_kD3Bd.d.ts} +1 -1
  141. package/dist/routes.d.mts +2 -2
  142. package/dist/routes.d.ts +2 -2
  143. package/dist/server-plugins.d.mts +3 -3
  144. package/dist/server-plugins.d.ts +3 -3
  145. package/dist/server.cjs +163 -106
  146. package/dist/server.d.mts +8 -8
  147. package/dist/server.d.ts +8 -8
  148. package/dist/server.mjs +144 -87
  149. package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-BstQUO6Q.d.ts} +2 -2
  150. package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-DTdbuinx.d.mts} +2 -2
  151. package/dist/testing.cjs +4 -4
  152. package/dist/testing.d.mts +2 -2
  153. package/dist/testing.d.ts +2 -2
  154. package/dist/testing.mjs +3 -3
  155. package/dist/{utils-ABkktwku.d.mts → utils-CS3ZLnEJ.d.mts} +1 -1
  156. package/dist/{utils-C3GguS-Q.d.ts → utils-D3rdsIvM.d.ts} +1 -1
  157. package/dist/version.cjs +2 -2
  158. package/dist/version.mjs +1 -1
  159. package/dist/vite.cjs +13 -12
  160. package/dist/vite.d.mts +2 -2
  161. package/dist/vite.d.ts +2 -2
  162. package/dist/vite.mjs +12 -11
  163. package/package.json +1 -1
  164. package/dist/chunk-BBVSJVBZ.cjs +0 -600
  165. package/dist/chunk-OFEY6KHO.mjs +0 -600
  166. package/dist/{chunk-XP777LRD.mjs → chunk-GDUYXFIS.mjs} +3 -3
  167. package/dist/{chunk-4PNUXIVU.cjs → chunk-YAOX43YI.cjs} +3 -3
@@ -7,7 +7,7 @@ var _chunkMT763TDWcjs = require('./chunk-MT763TDW.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkLQIRVSBYcjs = require('./chunk-LQIRVSBY.cjs');
10
+ var _chunkQLXEYIAWcjs = require('./chunk-QLXEYIAW.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,7 +17,7 @@ var _chunkLQIRVSBYcjs = require('./chunk-LQIRVSBY.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunkLYM7HY34cjs = require('./chunk-LYM7HY34.cjs');
20
+ var _chunk3WSWXPYMcjs = require('./chunk-3WSWXPYM.cjs');
21
21
 
22
22
 
23
23
 
@@ -25,7 +25,7 @@ var _chunkLYM7HY34cjs = require('./chunk-LYM7HY34.cjs');
25
25
  var _chunkMWWVKDW3cjs = require('./chunk-MWWVKDW3.cjs');
26
26
 
27
27
 
28
- var _chunkYA6LLTIJcjs = require('./chunk-YA6LLTIJ.cjs');
28
+ var _chunkND224OE2cjs = require('./chunk-ND224OE2.cjs');
29
29
 
30
30
 
31
31
  var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
@@ -34,7 +34,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
34
34
 
35
35
 
36
36
 
37
- var _chunkDNLQMFERcjs = require('./chunk-DNLQMFER.cjs');
37
+ var _chunkWFPRVVF2cjs = require('./chunk-WFPRVVF2.cjs');
38
38
 
39
39
 
40
40
  var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
@@ -69,7 +69,8 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
69
69
 
70
70
 
71
71
 
72
- var _chunkG6GNNB44cjs = require('./chunk-G6GNNB44.cjs');
72
+
73
+ var _chunk3TQG7CGCcjs = require('./chunk-3TQG7CGC.cjs');
73
74
 
74
75
 
75
76
 
@@ -78,6 +79,10 @@ var _chunkG6GNNB44cjs = require('./chunk-G6GNNB44.cjs');
78
79
  var _chunkDW34V5SMcjs = require('./chunk-DW34V5SM.cjs');
79
80
 
80
81
 
82
+
83
+ var _chunkQJ4D3UKJcjs = require('./chunk-QJ4D3UKJ.cjs');
84
+
85
+
81
86
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
82
87
 
83
88
 
@@ -107,7 +112,7 @@ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
107
112
  var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
108
113
 
109
114
 
110
- var _chunkISTFC3MZcjs = require('./chunk-ISTFC3MZ.cjs');
115
+ var _chunk2CT6XUNOcjs = require('./chunk-2CT6XUNO.cjs');
111
116
 
112
117
 
113
118
 
@@ -119,13 +124,16 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
119
124
  var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
120
125
 
121
126
 
122
- var _chunkAH7HOAQ3cjs = require('./chunk-AH7HOAQ3.cjs');
127
+ var _chunkRCYINC4Acjs = require('./chunk-RCYINC4A.cjs');
123
128
 
124
129
 
125
130
 
126
131
  var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
127
132
 
128
133
 
134
+ var _chunkQIH2HD6Hcjs = require('./chunk-QIH2HD6H.cjs');
135
+
136
+
129
137
 
130
138
  var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
131
139
 
@@ -137,7 +145,7 @@ var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
137
145
  var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
138
146
 
139
147
 
140
- var _chunkIMBMOEWTcjs = require('./chunk-IMBMOEWT.cjs');
148
+ var _chunkBD2U4ZL6cjs = require('./chunk-BD2U4ZL6.cjs');
141
149
 
142
150
 
143
151
  var _chunkIQXFRNY2cjs = require('./chunk-IQXFRNY2.cjs');
@@ -271,7 +279,7 @@ function getDocsTitle(docs) {
271
279
  }
272
280
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
273
281
  function loadPages(contentDir, docs) {
274
- return _chunkLYM7HY34cjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkLYM7HY34cjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
282
+ return _chunk3WSWXPYMcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk3WSWXPYMcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
275
283
  }
276
284
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
277
285
  function findSocialImagePath(html) {
@@ -292,14 +300,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
292
300
  }
293
301
  _chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
294
302
  async function compileFarmDocsManifest(docs, options) {
295
- const contentDir = _chunkLYM7HY34cjs.resolveFarmDocsContentDir.call(void 0, docs, options);
303
+ const contentDir = _chunk3WSWXPYMcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
296
304
  const pages = loadPages(contentDir, docs);
297
305
  const absolutePaths = [
298
306
  _path2.default.resolve(options.root),
299
307
  _path2.default.resolve(contentDir),
300
308
  docs.configPath || ""
301
309
  ];
302
- const handler = _chunkLYM7HY34cjs.createFarmDocsHandler.call(void 0, docs, {
310
+ const handler = _chunk3WSWXPYMcjs.createFarmDocsHandler.call(void 0, docs, {
303
311
  root: options.root,
304
312
  srcDir: options.srcDir,
305
313
  clientEntry: options.clientEntry,
@@ -307,7 +315,7 @@ async function compileFarmDocsManifest(docs, options) {
307
315
  fontStylesheetHref: options.fontStylesheetHref,
308
316
  globalStylesheetHref: options.globalStylesheetHref
309
317
  });
310
- const apiHandler = _chunkLQIRVSBYcjs.createFarmDocsAPIHandler.call(void 0, {
318
+ const apiHandler = _chunkQLXEYIAWcjs.createFarmDocsAPIHandler.call(void 0, {
311
319
  rootDir: options.root,
312
320
  srcDir: options.srcDir,
313
321
  docs
@@ -399,7 +407,7 @@ async function compileFarmDocsManifest(docs, options) {
399
407
  post: await compileResponse(postResponse, absolutePaths),
400
408
  search: {
401
409
  pages: pages.map((page) => ({
402
- ..._chunkLYM7HY34cjs.toFarmDocsMarkdownPage.call(void 0, page),
410
+ ..._chunk3WSWXPYMcjs.toFarmDocsMarkdownPage.call(void 0, page),
403
411
  sourcePath: `farm-docs:${page.slug || "index"}`
404
412
  })),
405
413
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -1479,7 +1487,7 @@ function hasFarmPluginRoutes(config) {
1479
1487
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1480
1488
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1481
1489
  return (config.plugins || []).some(
1482
- (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkG6GNNB44cjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1490
+ (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk3TQG7CGCcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1483
1491
  );
1484
1492
  }
1485
1493
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
@@ -1541,7 +1549,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1541
1549
  assertFarmDocsRuntimeSupported(config, preset);
1542
1550
  const srcDir = config.srcDir || "src";
1543
1551
  const distDir = config.distDir || ".farm";
1544
- const deployOutputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1552
+ const deployOutputDir = _chunkWFPRVVF2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1545
1553
  const lifecyclePluginManager = options.pluginManager;
1546
1554
  const productionViteResultPromise = Promise.allSettled([
1547
1555
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1560,7 +1568,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1560
1568
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1561
1569
  const pageRoutes = [];
1562
1570
  for (const [pattern, entry] of routeManager.getRoutes()) {
1563
- const markdownSourcePath = entry.markdownSourcePath || (_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1571
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1564
1572
  pageRoutes.push({
1565
1573
  pattern,
1566
1574
  modulePath: entry.modulePath,
@@ -1789,7 +1797,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1789
1797
  }
1790
1798
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1791
1799
  await fs.writeFile(fontCssPath, normalizedFontCss);
1792
- await fs.writeFile(clientCssPath, _chunkG6GNNB44cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1800
+ await fs.writeFile(clientCssPath, _chunk3TQG7CGCcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1793
1801
  }
1794
1802
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1795
1803
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1839,7 +1847,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1839
1847
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1840
1848
  let plan = cache.get(key);
1841
1849
  if (!plan) {
1842
- plan = _chunkG6GNNB44cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1850
+ plan = _chunk3TQG7CGCcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1843
1851
  cache.set(key, plan);
1844
1852
  }
1845
1853
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -1868,14 +1876,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1868
1876
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1869
1877
  );
1870
1878
  }
1871
- const isolatedMode = _chunkG6GNNB44cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1879
+ const isolatedMode = _chunk3TQG7CGCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1872
1880
  _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
1873
1881
  {
1874
1882
  serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
1875
1883
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1876
1884
  }
1877
1885
  );
1878
- const planOptions = _chunkG6GNNB44cjs.getFarmClientHydrationPlanOptions.call(void 0,
1886
+ const planOptions = _chunk3TQG7CGCcjs.getFarmClientHydrationPlanOptions.call(void 0,
1879
1887
  config.renderer,
1880
1888
  Boolean(unsupportedIntegrationProvider)
1881
1889
  );
@@ -1932,7 +1940,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1932
1940
  ), "isAdapterDocsRoute");
1933
1941
  const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1934
1942
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
1935
- const markdownPagePlan = _chunkG6GNNB44cjs.createMarkdownPageHydrationPlanner.call(void 0,
1943
+ const markdownPagePlan = _chunk3TQG7CGCcjs.createMarkdownPageHydrationPlanner.call(void 0,
1936
1944
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
1937
1945
  root,
1938
1946
  isolatedMode,
@@ -1940,7 +1948,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1940
1948
  );
1941
1949
  const routePlans = pageRoutes.map((route) => ({
1942
1950
  route,
1943
- metadata: _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
1951
+ metadata: _chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
1944
1952
  route.modulePath,
1945
1953
  root,
1946
1954
  isolatedMode,
@@ -1948,7 +1956,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1948
1956
  planOptions
1949
1957
  )
1950
1958
  }));
1951
- _chunkG6GNNB44cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1959
+ _chunk3TQG7CGCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1952
1960
  clientLayouts.map((layout) => ({
1953
1961
  pattern: layout.pattern,
1954
1962
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -1980,7 +1988,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1980
1988
  for (const layout of clientLayouts) {
1981
1989
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, route.pattern)) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
1982
1990
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
1983
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkG6GNNB44cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
1991
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunk3TQG7CGCcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
1984
1992
  }
1985
1993
  }
1986
1994
  if (isolatedMode === "analyze") {
@@ -2004,7 +2012,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2004
2012
  );
2005
2013
  if (metadata.suppressedAsyncHydration) {
2006
2014
  _chunk5QIKR7RRcjs.logger.warn(
2007
- `\u26A0\uFE0F ${_chunkG6GNNB44cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2015
+ `\u26A0\uFE0F ${_chunk3TQG7CGCcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2008
2016
  );
2009
2017
  }
2010
2018
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2063,7 +2071,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2063
2071
  }
2064
2072
  const clientRouteSlots = routeSlots.filter((slot) => {
2065
2073
  try {
2066
- return _chunkG6GNNB44cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2074
+ return _chunk3TQG7CGCcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2067
2075
  } catch (error) {
2068
2076
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2069
2077
  return false;
@@ -2093,7 +2101,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2093
2101
  config.trailingSlash,
2094
2102
  _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations),
2095
2103
  config.basePath,
2096
- _chunkG6GNNB44cjs.generateClientCachePersistenceCode.call(void 0, _chunkG6GNNB44cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2104
+ _chunk3TQG7CGCcjs.generateClientCachePersistenceCode.call(void 0, _chunk3TQG7CGCcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2097
2105
  adapterOwnsDocsRuntime ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2098
2106
  );
2099
2107
  await fs.writeFile(clientEntryPath, clientHydrationCode);
@@ -2110,7 +2118,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2110
2118
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2111
2119
  await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2112
2120
  postcssSearchPath = clientEntryDir;
2113
- tailwindVitePlugin = await _chunkG6GNNB44cjs.loadTailwindVitePlugin.call(void 0, {
2121
+ tailwindVitePlugin = await _chunk3TQG7CGCcjs.loadTailwindVitePlugin.call(void 0, {
2114
2122
  builder: productionVite.builder,
2115
2123
  announce: true
2116
2124
  });
@@ -2179,7 +2187,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2179
2187
  }
2180
2188
  },
2181
2189
  plugins: [
2182
- _chunkG6GNNB44cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2190
+ _chunk3TQG7CGCcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2183
2191
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
2184
2192
  ...rendererVitePlugins,
2185
2193
  ...config.vite.plugins || [],
@@ -2240,7 +2248,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2240
2248
  } : void 0,
2241
2249
  // Ensure React is bundled for client
2242
2250
  resolve: {
2243
- alias: _chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2251
+ alias: _chunk3TQG7CGCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2244
2252
  dedupe: [...config.renderer.dedupe || []]
2245
2253
  },
2246
2254
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2253,7 +2261,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2253
2261
  ]
2254
2262
  }
2255
2263
  };
2256
- await viteBuild(_chunkG6GNNB44cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2264
+ await viteBuild(_chunk3TQG7CGCcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2257
2265
  await mergeBuiltFontCss(outputDir);
2258
2266
  await validateClientBuildOutput(root, srcDir, outputDir);
2259
2267
  } finally {
@@ -3012,7 +3020,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3012
3020
  direction: {}
3013
3021
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3014
3022
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3015
- const clientPluginEntry = _chunkG6GNNB44cjs.generateFarmClientPluginEntryCode.call(void 0,
3023
+ const clientPluginEntry = _chunk3TQG7CGCcjs.generateFarmClientPluginEntryCode.call(void 0,
3016
3024
  plugins,
3017
3025
  root,
3018
3026
  srcDir,
@@ -3023,7 +3031,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3023
3031
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3024
3032
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3025
3033
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3026
- const providerClientCode = _chunkG6GNNB44cjs.generateFarmIntegrationProviderClientCode.call(void 0,
3034
+ const providerClientCode = _chunk3TQG7CGCcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3027
3035
  integrationProviders,
3028
3036
  root,
3029
3037
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3508,7 +3516,7 @@ function hasHydratableLayout(pathname) {
3508
3516
  });
3509
3517
  }
3510
3518
 
3511
- ${_chunkG6GNNB44cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3519
+ ${_chunk3TQG7CGCcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3512
3520
  // Wrap a page element with applicable layouts
3513
3521
  function wrapWithLayouts(pageElement, pathname, params) {
3514
3522
  const layouts = getApplicableLayouts(pathname);
@@ -4423,7 +4431,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4423
4431
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4424
4432
  "module.exports = { plugins: [] };\n"
4425
4433
  );
4426
- tailwindVitePlugin = await _chunkG6GNNB44cjs.loadTailwindVitePlugin.call(void 0, {
4434
+ tailwindVitePlugin = await _chunk3TQG7CGCcjs.loadTailwindVitePlugin.call(void 0, {
4427
4435
  builder: productionVite.builder,
4428
4436
  label: "for SSR"
4429
4437
  });
@@ -4519,7 +4527,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4519
4527
  }
4520
4528
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4521
4529
  const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4522
- const notFoundPath = _chunkG6GNNB44cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4530
+ const notFoundPath = _chunk3TQG7CGCcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4523
4531
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4524
4532
  layoutRoutes.sort((a, b) => {
4525
4533
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4542,7 +4550,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4542
4550
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4543
4551
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
4544
4552
  const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
4545
- const hasRouteContextConfig = _chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config);
4553
+ const hasRouteContextConfig = _chunkWFPRVVF2cjs.hasCustomFarmRouteContext.call(void 0, config);
4546
4554
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4547
4555
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4548
4556
  const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
@@ -4551,7 +4559,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4551
4559
  const hasConfiguredRuntimePlugins = Boolean(
4552
4560
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4553
4561
  );
4554
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkLQIRVSBYcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4562
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkQLXEYIAWcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4555
4563
  root,
4556
4564
  srcDir: config.srcDir,
4557
4565
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4701,7 +4709,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4701
4709
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
4702
4710
  },
4703
4711
  plugins: [
4704
- _chunkG6GNNB44cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4712
+ _chunk3TQG7CGCcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4705
4713
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4706
4714
  ...rendererVitePlugins,
4707
4715
  ...config.vite.plugins || [],
@@ -4761,7 +4769,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4761
4769
  resolve: {
4762
4770
  alias: [
4763
4771
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4764
- ...Object.entries(_chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4772
+ ...Object.entries(_chunk3TQG7CGCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4765
4773
  ([find, replacement]) => ({ find, replacement })
4766
4774
  )
4767
4775
  ],
@@ -4769,7 +4777,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4769
4777
  dedupe: [...config.renderer.dedupe || []]
4770
4778
  }
4771
4779
  };
4772
- await viteBuild(_chunkG6GNNB44cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4780
+ await viteBuild(_chunk3TQG7CGCcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4773
4781
  } finally {
4774
4782
  if (postcssConfigDir) {
4775
4783
  try {
@@ -5146,7 +5154,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5146
5154
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5147
5155
  );
5148
5156
  }
5149
- const providerServerModules = _chunkG6GNNB44cjs.generateFarmIntegrationProviderServerModules.call(void 0,
5157
+ const providerServerModules = _chunk3TQG7CGCcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5150
5158
  renderedIntegrationProviders,
5151
5159
  config.root,
5152
5160
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -5166,14 +5174,14 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5166
5174
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5167
5175
  (provider) => provider.supportsIsolatedHydration !== true
5168
5176
  );
5169
- const isolatedHydrationMode = _chunkG6GNNB44cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5177
+ const isolatedHydrationMode = _chunk3TQG7CGCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5170
5178
  _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.isolatedClientHydration]),
5171
5179
  {
5172
5180
  serverComponents: _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents]) === true,
5173
5181
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5174
5182
  }
5175
5183
  );
5176
- const hydrationPlanOptions = _chunkG6GNNB44cjs.getFarmClientHydrationPlanOptions.call(void 0,
5184
+ const hydrationPlanOptions = _chunk3TQG7CGCcjs.getFarmClientHydrationPlanOptions.call(void 0,
5177
5185
  config.renderer,
5178
5186
  Boolean(unsupportedIntegrationProvider)
5179
5187
  );
@@ -5188,7 +5196,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5188
5196
  hydrationPlanOptions
5189
5197
  )
5190
5198
  }));
5191
- const markdownPagePlan = _chunkG6GNNB44cjs.createMarkdownPageHydrationPlanner.call(void 0,
5199
+ const markdownPagePlan = _chunk3TQG7CGCcjs.createMarkdownPageHydrationPlanner.call(void 0,
5192
5200
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5193
5201
  config.root,
5194
5202
  isolatedHydrationMode,
@@ -5197,7 +5205,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5197
5205
  const pageHydrationPlans = new Map(
5198
5206
  pageRoutes.map((route) => [
5199
5207
  route.modulePath,
5200
- _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5208
+ _chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5201
5209
  route.modulePath,
5202
5210
  config.root,
5203
5211
  isolatedHydrationMode,
@@ -5206,7 +5214,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5206
5214
  )
5207
5215
  ])
5208
5216
  );
5209
- _chunkG6GNNB44cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5217
+ _chunk3TQG7CGCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5210
5218
  layoutHydrationPlans.map((layout) => ({
5211
5219
  pattern: layout.pattern,
5212
5220
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5247,7 +5255,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5247
5255
  }).map(({ route }) => route);
5248
5256
  orderedPageRoutes.forEach((route, index) => {
5249
5257
  const varName = `pageRoute${index}`;
5250
- if (_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5258
+ if (_chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5251
5259
  pageRegistrations.push(`
5252
5260
  {
5253
5261
  pattern: ${JSON.stringify(route.pattern)},
@@ -5414,10 +5422,12 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5414
5422
  createFarmCacheKey,
5415
5423
  createFarmMetadataRouteResponse,
5416
5424
  createFarmAgentRobots,
5425
+ createFarmApiCatalogResponse,
5417
5426
  collectFarmLlmsTxtPages,
5418
5427
  createFarmDefaultLlmsTxt,
5419
5428
  createFarmLlmsMarkdownReader,
5420
5429
  renderFarmLlmsFullTxt,
5430
+ createFarmLlmsFullRenderer,
5421
5431
  createFarmThemeDocumentParts,
5422
5432
  createFarmLocaleCookie,
5423
5433
  createFarmProductionLifecycle,
@@ -5687,7 +5697,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5687
5697
 
5688
5698
  function FarmDefault404Page() {
5689
5699
  return React.createElement(React.Fragment, null,
5690
- React.createElement("style", null, ${JSON.stringify(_chunkG6GNNB44cjs.DEFAULT_NOT_FOUND_STYLES)}),
5700
+ React.createElement("style", null, ${JSON.stringify(_chunk3TQG7CGCcjs.DEFAULT_NOT_FOUND_STYLES)}),
5691
5701
  React.createElement("main", {
5692
5702
  className: "farm-default-not-found",
5693
5703
  "aria-labelledby": "farm-default-not-found-title",
@@ -5816,13 +5826,13 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
5816
5826
  })`};
5817
5827
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
5818
5828
  const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _107 => _107.agent, 'optionalAccess', _108 => _108.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
5819
- ${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
5829
+ ${_optionalChain([config, 'access', _109 => _109.agent, 'optionalAccess', _110 => _110.llmsTxt, 'optionalAccess', _111 => _111.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
5820
5830
  const farmMdxConfig = ${JSON.stringify({
5821
5831
  ...config.mdx,
5822
- components: typeof _optionalChain([config, 'access', _109 => _109.mdx, 'optionalAccess', _110 => _110.components]) === "string" ? config.mdx.components : void 0
5832
+ components: typeof _optionalChain([config, 'access', _112 => _112.mdx, 'optionalAccess', _113 => _113.components]) === "string" ? config.mdx.components : void 0
5823
5833
  })};
5824
5834
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
5825
- ${_optionalChain([config, 'access', _111 => _111.agent, 'optionalAccess', _112 => _112.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5835
+ ${_optionalChain([config, 'access', _114 => _114.agent, 'optionalAccess', _115 => _115.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5826
5836
  // environment this was built in, since Netlify exposes its deploy context only
5827
5837
  // to the build.
5828
5838
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -5870,7 +5880,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
5870
5880
  });
5871
5881
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
5872
5882
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
5873
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !hasPrecompiledDocs ? `(() => {
5883
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) && !hasPrecompiledDocs ? `(() => {
5874
5884
  try {
5875
5885
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
5876
5886
  const candidates = [
@@ -5891,7 +5901,7 @@ globalThis.__FARM_DOCS_RUNTIME_CONFIG__ = {
5891
5901
  docs: farmDocsResolvedConfig,
5892
5902
  };
5893
5903
  const farmDocsPrecompiledRuntime = ${hasPrecompiledDocs ? `createFarmDocsPrecompiledRuntime(${JSON.stringify(farmDocsPrecompiledManifest)})` : "null"};
5894
- const farmDocsHandler = ${_optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5904
+ const farmDocsHandler = ${_optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 => _119.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5895
5905
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
5896
5906
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
5897
5907
  docsPath: farmDocsResolvedConfig.entry,
@@ -5919,14 +5929,15 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _115 => _115.docs, '
5919
5929
  fontStylesheetHref: "/farm-fonts.css",
5920
5930
  globalStylesheetHref: "/assets/globals.css",
5921
5931
  })` : "null"};
5922
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _117 => _117.docs, 'optionalAccess', _118 => _118.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
5932
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
5923
5933
 
5924
5934
  // API routes bundled at build time
5925
5935
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
5926
5936
  ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path7, methods }) => ({ path: path7, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)} })` : ""};
5927
5937
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkWPYFSQKKcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
5928
5938
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
5929
-
5939
+ ${_optionalChain([config, 'access', _122 => _122.agent, 'optionalAccess', _123 => _123.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkQJ4D3UKJcjs.resolveFarmApiCatalogInput.call(void 0, config))};
5940
+ ` : ""}
5930
5941
  function isFarmLocalAPIPathname(pathname) {
5931
5942
  return farmLocalAPIBasePath !== "/" &&
5932
5943
  (pathname === farmLocalAPIBasePath ||
@@ -6316,12 +6327,13 @@ function stripFarmDocumentWrappers(markup) {
6316
6327
  }
6317
6328
 
6318
6329
  // Farm's display:contents wrappers, and the head elements React 19 hoists in front of them
6319
- // (charset, viewport, preloads, titles) when the layout's <html> is not the render root.
6330
+ // (charset, viewport, preloads, titles, async scripts, precedence styles) when the layout's
6331
+ // <html> is not the render root. The hoistable pattern is shared with the dev renderer.
6320
6332
  function peelFarmDocumentPrefix(markup) {
6321
6333
  let inner = markup.replace(/^\\s+/, "");
6322
6334
  let hoisted = "";
6323
6335
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
6324
- const hoistable = /^(?:<(?:meta|link|base)\\b[^>]*>|<title\\b[^>]*>[\\s\\S]*?<\\/title>)/i;
6336
+ const hoistable = /${_chunk3TQG7CGCcjs.HOISTED_HEAD_ELEMENT.source}/i;
6325
6337
  let match;
6326
6338
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
6327
6339
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -6833,7 +6845,7 @@ async function handleApplicationMetadataRouteRequest(request, routePathname) {
6833
6845
  const body = isLlmsFull && !(value instanceof Response)
6834
6846
  ? await renderFarmLlmsFullTxt(value, { origin: url.origin, readMarkdown: llmsContext.markdown })
6835
6847
  : value;
6836
- return createFarmMetadataRouteResponse(match.metadata.kind, body, routeModule, { method });
6848
+ return createFarmMetadataRouteResponse(match.metadata.kind, body, routeModule, { method, request });
6837
6849
  } catch (error) {
6838
6850
  console.error("Metadata route render failed:", error);
6839
6851
  return new Response("Internal Server Error", {
@@ -7030,7 +7042,7 @@ function hasLocalRequestRoute(request, routePathname) {
7030
7042
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7031
7043
  return true;
7032
7044
  }
7033
- ${_optionalChain([config, 'access', _119 => _119.docs, 'optionalAccess', _120 => _120.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7045
+ ${_optionalChain([config, 'access', _124 => _124.docs, 'optionalAccess', _125 => _125.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7034
7046
  if (
7035
7047
  isFarmDocsAPIRequest(pathname) ||
7036
7048
  docsPath === "/" ||
@@ -7056,7 +7068,7 @@ function getFarmPluginRequestOptions(request) {
7056
7068
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7057
7069
  };
7058
7070
  }
7059
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7071
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7060
7072
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7061
7073
  pathname,
7062
7074
  method: request.method,
@@ -7146,7 +7158,7 @@ function getApplicableLayouts(pathname) {
7146
7158
  return applicable;
7147
7159
  }
7148
7160
 
7149
- ${_optionalChain([config, 'access', _123 => _123.docs, 'optionalAccess', _124 => _124.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7161
+ ${_optionalChain([config, 'access', _128 => _128.docs, 'optionalAccess', _129 => _129.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7150
7162
  if (request.method === "HEAD") return response;
7151
7163
  if (response.headers.get("x-farm-docs-adapter")) return response;
7152
7164
 
@@ -7253,7 +7265,7 @@ ${_optionalChain([config, 'access', _123 => _123.docs, 'optionalAccess', _124 =>
7253
7265
  }` : ""}
7254
7266
 
7255
7267
  const pprShellCache = getFarmDataCache();
7256
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _125 => _125.experimental, 'optionalAccess', _126 => _126.ppr]) === true)};
7268
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _130 => _130.experimental, 'optionalAccess', _131 => _131.ppr]) === true)};
7257
7269
 
7258
7270
  function resolveRouteRenderingView(route) {
7259
7271
  // The same merge development uses: baked directive config under the
@@ -7376,7 +7388,7 @@ async function handleFarmRequest(request, adapterContext) {
7376
7388
  },
7377
7389
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
7378
7390
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
7379
- ${_optionalChain([config, 'access', _127 => _127.md, 'optionalAccess', _128 => _128.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7391
+ ${_optionalChain([config, 'access', _132 => _132.md, 'optionalAccess', _133 => _133.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7380
7392
  if (matchPageRoute(pathname)) {
7381
7393
  // The Link header advertises the public .md URL, like the head alternate.
7382
7394
  return applyMarkdownNegotiationHeaders(response, {
@@ -7495,7 +7507,7 @@ async function handleFarmRequestInContext(
7495
7507
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
7496
7508
  `}
7497
7509
 
7498
- ${_optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) ? `
7510
+ ${_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) ? `
7499
7511
  // Docs responses are served after app middleware so route guards and
7500
7512
  // middleware headers apply to the docs engine like any other page content.
7501
7513
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -7540,7 +7552,7 @@ async function handleFarmRequestInContext(
7540
7552
  }
7541
7553
  ` : ""}
7542
7554
 
7543
- ${_optionalChain([config, 'access', _131 => _131.md, 'optionalAccess', _132 => _132.enabled]) ? `
7555
+ ${_optionalChain([config, 'access', _136 => _136.md, 'optionalAccess', _137 => _137.enabled]) ? `
7544
7556
  if (farmMarkdownConfig?.enabled) {
7545
7557
  const markdownResponse = await createMarkdownMirrorResponse({
7546
7558
  // The mirror helper only reads metadata and creates its own GET request.
@@ -7634,6 +7646,15 @@ async function handleFarmRequestInContext(
7634
7646
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
7635
7647
  }
7636
7648
  ` : ""}
7649
+ ${_optionalChain([config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.apiCatalog]) ? `
7650
+ // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
7651
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkQJ4D3UKJcjs.FARM_API_CATALOG_PATH)}) {
7652
+ return applyProductionMiddlewareHeaders(
7653
+ createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
7654
+ middlewareHeaders,
7655
+ );
7656
+ }
7657
+ ` : ""}
7637
7658
  ${servesAgentRobotsTxt ? `
7638
7659
  // agent.crawlers with no robots.ts: serve the generated file.
7639
7660
  if (normalizeRuntimePath(routePathname) === "/robots.txt") {
@@ -7643,32 +7664,46 @@ async function handleFarmRequestInContext(
7643
7664
  );
7644
7665
  }
7645
7666
  ` : ""}
7646
- ${_optionalChain([config, 'access', _133 => _133.agent, 'optionalAccess', _134 => _134.llmsTxt, 'optionalAccess', _135 => _135.enabled]) ? `
7667
+ ${_optionalChain([config, 'access', _140 => _140.agent, 'optionalAccess', _141 => _141.llmsTxt, 'optionalAccess', _142 => _142.enabled]) ? `
7647
7668
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
7648
7669
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
7649
7670
  ? "llms"
7650
- : ${_optionalChain([config, 'access', _136 => _136.agent, 'optionalAccess', _137 => _137.llmsTxt, 'optionalAccess', _138 => _138.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7671
+ : ${_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt, 'optionalAccess', _145 => _145.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7651
7672
  if (farmGeneratedLlmsKind) {
7652
7673
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
7653
- const llmsBody = farmGeneratedLlmsKind === "llms-full"
7654
- ? await renderFarmLlmsFullTxt(llmsContext.defaults, {
7655
- origin: new URL(request.url).origin,
7656
- readMarkdown: llmsContext.markdown,
7657
- })
7658
- : llmsContext.defaults;
7659
- return applyProductionMiddlewareHeaders(
7660
- createFarmMetadataRouteResponse(
7661
- farmGeneratedLlmsKind,
7662
- llmsBody,
7663
- { revalidate: farmLlmsTxtConfig.revalidate },
7664
- { method: request.method },
7665
- ),
7666
- middlewareHeaders,
7674
+ const llmsOrigin = new URL(request.url).origin;
7675
+ // A page that times out is left out, the shared render is not reused, and
7676
+ // the partial response is not cacheable.
7677
+ let llmsComplete = true;
7678
+ const renderLlmsFull = (shared) =>
7679
+ renderFarmLlmsFullTxt(llmsContext.defaults, {
7680
+ origin: llmsOrigin,
7681
+ readMarkdown: llmsContext.markdown,
7682
+ onIncomplete: () => {
7683
+ llmsComplete = false;
7684
+ if (shared) shared.incomplete();
7685
+ },
7686
+ });
7687
+ // HEAD reads no pages, so it neither waits for nor fills the shared render.
7688
+ const llmsBody = farmGeneratedLlmsKind !== "llms-full"
7689
+ ? llmsContext.defaults
7690
+ : request.method.toUpperCase() === "HEAD"
7691
+ ? await renderLlmsFull()
7692
+ : await farmLlmsFullRenderer(llmsOrigin, renderLlmsFull, (complete) => {
7693
+ llmsComplete = complete;
7694
+ });
7695
+ const llmsResponse = createFarmMetadataRouteResponse(
7696
+ farmGeneratedLlmsKind,
7697
+ llmsBody,
7698
+ { revalidate: llmsComplete ? farmLlmsTxtConfig.revalidate : 0 },
7699
+ { method: request.method, request },
7667
7700
  );
7701
+ if (!llmsComplete) llmsResponse.headers.set("cache-control", "no-store");
7702
+ return applyProductionMiddlewareHeaders(llmsResponse, middlewareHeaders);
7668
7703
  }
7669
7704
  ` : ""}
7670
7705
 
7671
- ${_optionalChain([config, 'access', _139 => _139.docs, 'optionalAccess', _140 => _140.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7706
+ ${_optionalChain([config, 'access', _146 => _146.docs, 'optionalAccess', _147 => _147.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7672
7707
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
7673
7708
  if (docsAPIResponse) {
7674
7709
  return applyProductionMiddlewareHeaders(docsAPIResponse, middlewareHeaders);
@@ -8103,7 +8138,7 @@ async function handleFarmRequestInContext(
8103
8138
  );
8104
8139
  }
8105
8140
  }
8106
- ${_optionalChain([config, 'access', _141 => _141.md, 'optionalAccess', _142 => _142.enabled]) ? `
8141
+ ${_optionalChain([config, 'access', _148 => _148.md, 'optionalAccess', _149 => _149.enabled]) ? `
8107
8142
  // Advertise the Markdown mirror in the head as well as the Link header,
8108
8143
  // using the public path the .md request will be resolved against.
8109
8144
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8111,7 +8146,7 @@ async function handleFarmRequestInContext(
8111
8146
  getFarmMarkdownAlternatePath(farmMarkdownConfig, pathname),
8112
8147
  );` : ""}
8113
8148
 
8114
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.jsonLd]), () => ( false)))} });
8149
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.jsonLd]), () => ( false)))} });
8115
8150
  const title = renderedMetadata.title;
8116
8151
  const metaTags = renderedMetadata.tags;
8117
8152
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -8726,11 +8761,11 @@ ${generatePreloadResponseRuntimeSource()}
8726
8761
 
8727
8762
  // Export as Web Standard fetch API
8728
8763
  export async function fetch(request, context) {
8729
- ${_optionalChain([config, 'access', _145 => _145.agent, 'optionalAccess', _146 => _146.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8764
+ ${_optionalChain([config, 'access', _152 => _152.agent, 'optionalAccess', _153 => _153.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8730
8765
  basePath: farmLocalAPIBasePath,
8731
8766
  dispatch: async (localRequest) =>
8732
8767
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
8733
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.noindexPreviews]) ? `
8768
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.noindexPreviews]) ? `
8734
8769
  // Keep every response of a preview deployment out of search indexes.
8735
8770
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
8736
8771
  }
@@ -8873,7 +8908,7 @@ function configMiddlewareMayHandlePath(config, pathname) {
8873
8908
  if (!hasFarmMiddlewareConfig(config)) return false;
8874
8909
  const entries = Array.isArray(config) ? config : [config];
8875
8910
  return entries.some((entry) => {
8876
- if (_optionalChain([entry, 'access', _149 => _149.exclude, 'optionalAccess', _150 => _150.some, 'call', _151 => _151((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8911
+ if (_optionalChain([entry, 'access', _156 => _156.exclude, 'optionalAccess', _157 => _157.some, 'call', _158 => _158((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8877
8912
  return false;
8878
8913
  }
8879
8914
  if (!entry.matcher) return true;
@@ -8929,11 +8964,11 @@ function getPhysicalPrerenderBypassReason(options) {
8929
8964
  }
8930
8965
  if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
8931
8966
  if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
8932
- if (_chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8967
+ if (_chunkWFPRVVF2cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8933
8968
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
8934
8969
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
8935
- if (_optionalChain([manifestEntry, 'optionalAccess', _152 => _152.rendering]) === "dynamic") return "dynamic runtime manifest";
8936
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _153 => _153.regions, 'optionalAccess', _154 => _154.length])) || manifestEntry.maxDuration !== void 0)) {
8970
+ if (_optionalChain([manifestEntry, 'optionalAccess', _159 => _159.rendering]) === "dynamic") return "dynamic runtime manifest";
8971
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _160 => _160.regions, 'optionalAccess', _161 => _161.length])) || manifestEntry.maxDuration !== void 0)) {
8937
8972
  return "route runtime controls";
8938
8973
  }
8939
8974
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -8955,7 +8990,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
8955
8990
  const nitroBuilder = nitroBuilderResult.value;
8956
8991
  const isVercel = preset === "vercel" || preset === "vercel-edge";
8957
8992
  const isCloudflareWorker = preset === "cloudflare-module";
8958
- const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8993
+ const outputDir = _chunkWFPRVVF2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8959
8994
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
8960
8995
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
8961
8996
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -9286,20 +9321,20 @@ export default async function farmNitroEventHandler(event) {
9286
9321
  snapshotSSRRebundleOptions(nitroConfig)
9287
9322
  );
9288
9323
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
9289
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _155 => _155.rollupConfig, 'optionalAccess', _156 => _156.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _157 => _157.rollupConfig, 'optionalAccess', _158 => _158.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _159 => _159.output, 'optionalAccess', _160 => _160.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9290
- _optionalChain([nitroConfig, 'access', _161 => _161.handlers, 'optionalAccess', _162 => _162.some, 'call', _163 => _163(
9291
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _164 => _164.handler]) || "") === nitroEntryPath
9324
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _162 => _162.rollupConfig, 'optionalAccess', _163 => _163.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _164 => _164.rollupConfig, 'optionalAccess', _165 => _165.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _166 => _166.output, 'optionalAccess', _167 => _167.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9325
+ _optionalChain([nitroConfig, 'access', _168 => _168.handlers, 'optionalAccess', _169 => _169.some, 'call', _170 => _170(
9326
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _171 => _171.handler]) || "") === nitroEntryPath
9292
9327
  )])
9293
9328
  );
9294
9329
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
9295
9330
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
9296
9331
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
9297
9332
  const shouldMinify = nitroConfig.minify !== false;
9298
- const keepServerNames = !(_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) && _optionalChain([config, 'access', _167 => _167.docs, 'access', _168 => _168.adapter, 'optionalAccess', _169 => _169.server]));
9333
+ const keepServerNames = !(_optionalChain([config, 'access', _172 => _172.docs, 'optionalAccess', _173 => _173.enabled]) && _optionalChain([config, 'access', _174 => _174.docs, 'access', _175 => _175.adapter, 'optionalAccess', _176 => _176.server]));
9299
9334
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9300
9335
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
9301
9336
  if (canReusePrebuiltSSR) {
9302
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _170 => _170.rollupConfig, 'optionalAccess', _171 => _171.plugins]);
9337
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _177 => _177.rollupConfig, 'optionalAccess', _178 => _178.plugins]);
9303
9338
  nitroConfig.rollupConfig = {
9304
9339
  ...nitroConfig.rollupConfig,
9305
9340
  plugins: [
@@ -9310,10 +9345,31 @@ export default async function farmNitroEventHandler(event) {
9310
9345
  }
9311
9346
  nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
9312
9347
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
9348
+ if (_optionalChain([config, 'access', _179 => _179.md, 'optionalAccess', _180 => _180.enabled])) {
9349
+ nitroInstance.hooks.hook("prerender:generate", (route) => {
9350
+ if (!route.contents || !_optionalChain([route, 'access', _181 => _181.contentType, 'optionalAccess', _182 => _182.toLowerCase, 'call', _183 => _183(), 'access', _184 => _184.includes, 'call', _185 => _185("html")])) return;
9351
+ const alternatePath = _chunkQIH2HD6Hcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
9352
+ if (!alternatePath) return;
9353
+ const routeRule = nitroInstance.options.routeRules[route.route] || {};
9354
+ const alternate = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
9355
+ const headers = { ...routeRule.headers };
9356
+ let link;
9357
+ for (const key of Object.keys(headers)) {
9358
+ if (key.toLowerCase() !== "link") continue;
9359
+ link = link ? `${link}, ${headers[key]}` : headers[key];
9360
+ delete headers[key];
9361
+ }
9362
+ headers.Link = !link ? alternate : link.includes(alternate) ? link : `${link}, ${alternate}`;
9363
+ nitroInstance.options.routeRules[route.route] = { ...routeRule, headers };
9364
+ });
9365
+ nitroInstance.hooks.hook("prerender:done", () => {
9366
+ nitroInstance.routing.sync();
9367
+ });
9368
+ }
9313
9369
  if (config.security.csp && config.security.csp.nonce) {
9314
9370
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
9315
- if (!route.contents || !_optionalChain([route, 'access', _172 => _172.contentType, 'optionalAccess', _173 => _173.toLowerCase, 'call', _174 => _174(), 'access', _175 => _175.includes, 'call', _176 => _176("html")])) return;
9316
- const staticCsp = await _chunkISTFC3MZcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
9371
+ if (!route.contents || !_optionalChain([route, 'access', _186 => _186.contentType, 'optionalAccess', _187 => _187.toLowerCase, 'call', _188 => _188(), 'access', _189 => _189.includes, 'call', _190 => _190("html")])) return;
9372
+ const staticCsp = await _chunk2CT6XUNOcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
9317
9373
  if (!staticCsp) return;
9318
9374
  route.contents = staticCsp.html;
9319
9375
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -9383,19 +9439,24 @@ export default async function farmNitroEventHandler(event) {
9383
9439
  }
9384
9440
  if (prerenderRoutes.length > 0) {
9385
9441
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
9386
- const previousPrerender = process.env[_chunkYA6LLTIJcjs.FARM_PRERENDER_ENV];
9387
- process.env[_chunkYA6LLTIJcjs.FARM_PRERENDER_ENV] = "1";
9442
+ const previousPrerender = process.env[_chunkND224OE2cjs.FARM_PRERENDER_ENV];
9443
+ process.env[_chunkND224OE2cjs.FARM_PRERENDER_ENV] = "1";
9388
9444
  try {
9389
9445
  await nitroBuilder.prerender(nitroInstance);
9390
9446
  } finally {
9391
- if (previousPrerender === void 0) delete process.env[_chunkYA6LLTIJcjs.FARM_PRERENDER_ENV];
9392
- else process.env[_chunkYA6LLTIJcjs.FARM_PRERENDER_ENV] = previousPrerender;
9447
+ if (previousPrerender === void 0) delete process.env[_chunkND224OE2cjs.FARM_PRERENDER_ENV];
9448
+ else process.env[_chunkND224OE2cjs.FARM_PRERENDER_ENV] = previousPrerender;
9393
9449
  }
9394
9450
  }
9395
9451
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs, preset) : Promise.resolve(null);
9396
- const [nitroBuildResult, sharpRuntimeStageResult] = await Promise.allSettled([
9452
+ const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
9453
+ ssrBundle,
9454
+ shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null
9455
+ ) : Promise.resolve(null);
9456
+ const [nitroBuildResult, sharpRuntimeStageResult, prebuiltSSRFilesResult] = await Promise.allSettled([
9397
9457
  nitroBuilder.build(nitroInstance),
9398
- sharpRuntimeStagePromise
9458
+ sharpRuntimeStagePromise,
9459
+ prebuiltSSRFilesPromise
9399
9460
  ]);
9400
9461
  await nitroInstance.close();
9401
9462
  if (nitroBuildResult.status === "rejected") {
@@ -9410,6 +9471,9 @@ export default async function farmNitroEventHandler(event) {
9410
9471
  if (sharpRuntimeStageResult.status === "rejected") {
9411
9472
  throw sharpRuntimeStageResult.reason;
9412
9473
  }
9474
+ if (prebuiltSSRFilesResult.status === "rejected") {
9475
+ throw prebuiltSSRFilesResult.reason;
9476
+ }
9413
9477
  const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs, preset) : null)));
9414
9478
  const runtimeCopyPromise = (async () => {
9415
9479
  if (stagedSharpRuntime) {
@@ -9420,10 +9484,9 @@ export default async function farmNitroEventHandler(event) {
9420
9484
  }
9421
9485
  })();
9422
9486
  const copyResults = await Promise.allSettled([
9423
- canReusePrebuiltSSR ? copyPrebuiltSSRBundle(
9424
- ssrBundle,
9487
+ prebuiltSSRFilesResult.value ? writeSSRBundleFiles(
9488
+ prebuiltSSRFilesResult.value,
9425
9489
  _path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
9426
- shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null,
9427
9490
  fs
9428
9491
  ) : Promise.resolve(),
9429
9492
  runtimeCopyPromise
@@ -9467,21 +9530,29 @@ function resolveFarmNitroOutputConfig(preset, outputDir) {
9467
9530
  };
9468
9531
  }
9469
9532
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNitroOutputConfig, "resolveFarmNitroOutputConfig");
9470
- async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs) {
9533
+ function prepareSSRBundleFiles(ssrBundle, minifyOptions) {
9534
+ return Promise.all(
9535
+ Object.entries(ssrBundle).map(async ([fileName, output]) => ({
9536
+ fileName,
9537
+ contents: output.type === "asset" ? output.source : minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code
9538
+ }))
9539
+ );
9540
+ }
9541
+ _chunkS3JO3N4Hcjs.__name.call(void 0, prepareSSRBundleFiles, "prepareSSRBundleFiles");
9542
+ async function writeSSRBundleFiles(files, targetDir, fs) {
9471
9543
  await fs.rm(targetDir, { recursive: true, force: true });
9472
9544
  await Promise.all(
9473
- Object.entries(ssrBundle).map(async ([fileName, output]) => {
9545
+ files.map(async ({ fileName, contents }) => {
9474
9546
  const targetPath = _path2.default.join(targetDir, fileName);
9475
9547
  await fs.mkdir(_path2.default.dirname(targetPath), { recursive: true });
9476
- if (output.type === "asset") {
9477
- await fs.writeFile(targetPath, output.source);
9478
- return;
9479
- }
9480
- const code = minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code;
9481
- await fs.writeFile(targetPath, code);
9548
+ await fs.writeFile(targetPath, contents);
9482
9549
  })
9483
9550
  );
9484
9551
  }
9552
+ _chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRBundleFiles, "writeSSRBundleFiles");
9553
+ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs) {
9554
+ await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs);
9555
+ }
9485
9556
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrebuiltSSRBundle, "copyPrebuiltSSRBundle");
9486
9557
  async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs) {
9487
9558
  const packagePath = _path2.default.join(serverDir, "package.json");
@@ -9505,7 +9576,7 @@ async function moveVercelOutputPath(src, dest, fs) {
9505
9576
  await fs.rename(src, dest);
9506
9577
  return;
9507
9578
  } catch (error) {
9508
- const code = _optionalChain([error, 'optionalAccess', _177 => _177.code]);
9579
+ const code = _optionalChain([error, 'optionalAccess', _191 => _191.code]);
9509
9580
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
9510
9581
  throw error;
9511
9582
  }
@@ -9532,7 +9603,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
9532
9603
  try {
9533
9604
  await moveVercelOutputPath(publicDir, staticDir, fs);
9534
9605
  } catch (error) {
9535
- if (_optionalChain([error, 'optionalAccess', _178 => _178.code]) !== "ENOENT") throw error;
9606
+ if (_optionalChain([error, 'optionalAccess', _192 => _192.code]) !== "ENOENT") throw error;
9536
9607
  }
9537
9608
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs);
9538
9609
  await copyPrismaClientForVercel(root, nitroFuncDir, fs);
@@ -9565,7 +9636,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9565
9636
  const docsContentDir = resolveBuildDocsContentDir(config, root);
9566
9637
  if (!docsContentDir) return;
9567
9638
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
9568
- const lastModifiedManifest = _chunkLYM7HY34cjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9639
+ const lastModifiedManifest = _chunk3WSWXPYMcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9569
9640
  fallback: "now"
9570
9641
  });
9571
9642
  await fs.rm(bundledContentDir, { recursive: true, force: true });
@@ -9575,7 +9646,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9575
9646
  force: true
9576
9647
  });
9577
9648
  await fs.writeFile(
9578
- _path2.default.join(bundledContentDir, _chunkLYM7HY34cjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9649
+ _path2.default.join(bundledContentDir, _chunk3WSWXPYMcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9579
9650
  `${JSON.stringify(lastModifiedManifest, null, 2)}
9580
9651
  `
9581
9652
  );
@@ -9652,7 +9723,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
9652
9723
  try {
9653
9724
  await copyPackage("sharp", sharpRequire);
9654
9725
  if (!copiedPackages.has("sharp")) {
9655
- throw new Error(`Farm image optimization requires sharp. ${_chunkG6GNNB44cjs.SHARP_INSTALL_HINT}`);
9726
+ throw new Error(`Farm image optimization requires sharp. ${_chunk3TQG7CGCcjs.SHARP_INSTALL_HINT}`);
9656
9727
  }
9657
9728
  } catch (error) {
9658
9729
  await fs.rm(stageDir, { recursive: true, force: true });
@@ -9866,7 +9937,7 @@ function createBuildTargetBaseline(config) {
9866
9937
  preset,
9867
9938
  distDir,
9868
9939
  outputDir,
9869
- outputWasDerived: outputDir === _chunkDNLQMFERcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9940
+ outputWasDerived: outputDir === _chunkWFPRVVF2cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9870
9941
  };
9871
9942
  }
9872
9943
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -9876,8 +9947,8 @@ function resolveBuildTargets(config, options, baseline) {
9876
9947
  const distDir = config.distDir || ".farm";
9877
9948
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
9878
9949
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
9879
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkDNLQMFERcjs.getDeployTargetForPreset.call(void 0, preset);
9880
- const outputDir = shouldRefreshDerivedOutput ? _chunkDNLQMFERcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
9950
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkWFPRVVF2cjs.getDeployTargetForPreset.call(void 0, preset);
9951
+ const outputDir = shouldRefreshDerivedOutput ? _chunkWFPRVVF2cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
9881
9952
  return {
9882
9953
  root,
9883
9954
  preset,
@@ -9885,7 +9956,7 @@ function resolveBuildTargets(config, options, baseline) {
9885
9956
  distDir,
9886
9957
  deployTarget,
9887
9958
  outputDir,
9888
- deployOutputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9959
+ deployOutputDir: _chunkWFPRVVF2cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9889
9960
  };
9890
9961
  }
9891
9962
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -9894,7 +9965,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9894
9965
  const targetBaseline = createBuildTargetBaseline(config);
9895
9966
  let targets;
9896
9967
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
9897
- const pluginManager = new (0, _chunkG6GNNB44cjs.PluginManager)({
9968
+ const pluginManager = new (0, _chunk3TQG7CGCcjs.PluginManager)({
9898
9969
  config,
9899
9970
  isDev: false,
9900
9971
  isProd: true
@@ -9923,12 +9994,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9923
9994
  };
9924
9995
  config = {
9925
9996
  ...config,
9926
- images: _chunkG6GNNB44cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
9997
+ images: _chunk3TQG7CGCcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
9927
9998
  root: targets.root,
9928
9999
  preset: targets.preset
9929
10000
  })
9930
10001
  };
9931
- if (_optionalChain([config, 'access', _179 => _179.docs, 'optionalAccess', _180 => _180.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
10002
+ if (_optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
9932
10003
  pluginManager.updateContext({ config });
9933
10004
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
9934
10005
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -9942,8 +10013,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9942
10013
  });
9943
10014
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
9944
10015
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
9945
- if (_optionalChain([productionViteResult, 'optionalAccess', _181 => _181.status]) === "rejected") throw productionViteResult.reason;
9946
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _182 => _182.value]);
10016
+ if (_optionalChain([productionViteResult, 'optionalAccess', _195 => _195.status]) === "rejected") throw productionViteResult.reason;
10017
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _196 => _196.value]);
9947
10018
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
9948
10019
  projectModuleServer = await createProjectModuleServer(
9949
10020
  createViteServer,
@@ -9951,7 +10022,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9951
10022
  root,
9952
10023
  rendererBuild.signal
9953
10024
  );
9954
- const farmApp = _chunkG6GNNB44cjs.createFarmApp.call(void 0, config, projectModuleServer);
10025
+ const farmApp = _chunk3TQG7CGCcjs.createFarmApp.call(void 0, config, projectModuleServer);
9955
10026
  await farmApp.initialize();
9956
10027
  const routeManager = farmApp.getRouteManager();
9957
10028
  const serverRenderer = farmApp.getServerRenderer();
@@ -9961,8 +10032,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9961
10032
  layers: config.layers,
9962
10033
  plugins: config.plugins,
9963
10034
  extraRoutes: [
9964
- ..._optionalChain([config, 'access', _183 => _183.openapi, 'optionalAccess', _184 => _184.enabled]) && config.openapi.route ? [config.openapi.route] : [],
9965
- ..._chunkLYM7HY34cjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10035
+ ..._optionalChain([config, 'access', _197 => _197.openapi, 'optionalAccess', _198 => _198.enabled]) && config.openapi.route ? [config.openapi.route] : [],
10036
+ ..._chunk3WSWXPYMcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
9966
10037
  ],
9967
10038
  suppressLintOnLink: config.suppressLintOnLink,
9968
10039
  componentExtensions: config.renderer.componentExtensions,
@@ -9971,7 +10042,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9971
10042
  const message = error instanceof Error ? error.message : String(error);
9972
10043
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
9973
10044
  });
9974
- const apiRouteManager = new (0, _chunkIMBMOEWTcjs.APIRouteManager)(
10045
+ const apiRouteManager = new (0, _chunkBD2U4ZL6cjs.APIRouteManager)(
9975
10046
  _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config),
9976
10047
  projectModuleServer,
9977
10048
  {
@@ -10046,7 +10117,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10046
10117
  throw error;
10047
10118
  } finally {
10048
10119
  try {
10049
- await _optionalChain([projectModuleServer, 'optionalAccess', _185 => _185.close, 'call', _186 => _186()]);
10120
+ await _optionalChain([projectModuleServer, 'optionalAccess', _199 => _199.close, 'call', _200 => _200()]);
10050
10121
  } finally {
10051
10122
  rendererBuild.abort();
10052
10123
  }
@@ -10058,7 +10129,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10058
10129
  ssr: true,
10059
10130
  buildLifetime
10060
10131
  });
10061
- const viteConfig = _chunkG6GNNB44cjs.mergeFarmViteConfig.call(void 0,
10132
+ const viteConfig = _chunk3TQG7CGCcjs.mergeFarmViteConfig.call(void 0,
10062
10133
  {
10063
10134
  root,
10064
10135
  appType: "custom",
@@ -10070,7 +10141,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10070
10141
  },
10071
10142
  plugins: [
10072
10143
  ...rendererVitePlugins,
10073
- _chunkG6GNNB44cjs.farmFontImportsPlugin.call(void 0, {
10144
+ _chunk3TQG7CGCcjs.farmFontImportsPlugin.call(void 0, {
10074
10145
  root,
10075
10146
  basePath: config.basePath,
10076
10147
  publicDir: config.publicDir
@@ -10082,7 +10153,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10082
10153
  hmr: false
10083
10154
  },
10084
10155
  resolve: {
10085
- alias: _chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10156
+ alias: _chunk3TQG7CGCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10086
10157
  dedupe: [...config.renderer.dedupe || []]
10087
10158
  },
10088
10159
  optimizeDeps: {
@@ -10168,7 +10239,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10168
10239
  define: {
10169
10240
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
10170
10241
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
10171
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _187 => _187.env, 'optionalAccess', _188 => _188.public]) || {})
10242
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _201 => _201.env, 'optionalAccess', _202 => _202.public]) || {})
10172
10243
  },
10173
10244
  plugins: [
10174
10245
  farmI18nClientBridgePlugin(),
@@ -10203,7 +10274,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10203
10274
  if (pluginManager) {
10204
10275
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
10205
10276
  }
10206
- const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10277
+ const outputDir = _chunkWFPRVVF2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10207
10278
  const serverOutputDir = _path2.default.join(outputDir, "server");
10208
10279
  const publicOutputDir = _path2.default.join(outputDir, "public");
10209
10280
  const { mkdir, cp } = await import("fs/promises");
@@ -10274,7 +10345,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10274
10345
  root,
10275
10346
  preset,
10276
10347
  distDir,
10277
- outputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10348
+ outputDir: _chunkWFPRVVF2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10278
10349
  });
10279
10350
  }
10280
10351
  }