@farm.js/core 0.1.22 → 0.1.24

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 (150) hide show
  1. package/dist/agent-runtime.d.mts +3 -2
  2. package/dist/agent-runtime.d.ts +3 -2
  3. package/dist/api/route-manager.cjs +3 -2
  4. package/dist/api/route-manager.d.mts +3 -2
  5. package/dist/api/route-manager.d.ts +3 -2
  6. package/dist/api/route-manager.mjs +2 -1
  7. package/dist/api.cjs +4 -3
  8. package/dist/api.d.mts +4 -3
  9. package/dist/api.d.ts +4 -3
  10. package/dist/api.mjs +3 -2
  11. package/dist/{app-B7qKw8Ny.d.ts → app-BV-7wV5q.d.ts} +3 -3
  12. package/dist/{app-0e-oTC_R.d.mts → app-BZDWwwFa.d.mts} +3 -3
  13. package/dist/app-markdown.d.mts +4 -3
  14. package/dist/app-markdown.d.ts +4 -3
  15. package/dist/chunk-2VQKKQ6D.mjs +51 -0
  16. package/dist/{chunk-EGJDUF4Q.mjs → chunk-3ATMYLLJ.mjs} +6 -12
  17. package/dist/{chunk-HSDL2AUR.mjs → chunk-47H7VENP.mjs} +20 -32
  18. package/dist/{chunk-AAWTJW2G.mjs → chunk-6YSEHN46.mjs} +58 -27
  19. package/dist/{chunk-PUCUVI7K.mjs → chunk-72VJRKJD.mjs} +1 -1
  20. package/dist/{chunk-PC33YKTC.mjs → chunk-ARHWIOUZ.mjs} +128 -130
  21. package/dist/{chunk-2HCEC2YO.cjs → chunk-BD7FZ63M.cjs} +1 -1
  22. package/dist/{chunk-SPSQFO3Z.mjs → chunk-BDJNP7AQ.mjs} +9 -13
  23. package/dist/{chunk-X2ZUD4GI.mjs → chunk-BNSD3VDY.mjs} +1 -1
  24. package/dist/{chunk-GXXONIAR.cjs → chunk-DNLQMFER.cjs} +12 -16
  25. package/dist/{chunk-SO7CRMP6.cjs → chunk-DW34V5SM.cjs} +5 -5
  26. package/dist/{chunk-3NM6SRI6.mjs → chunk-F3VB7ONA.mjs} +10 -8
  27. package/dist/{chunk-P5HSJCXI.cjs → chunk-G6GNNB44.cjs} +291 -260
  28. package/dist/chunk-IK6LVLKC.cjs +51 -0
  29. package/dist/{chunk-B3WK4DTX.cjs → chunk-IMBMOEWT.cjs} +5 -1
  30. package/dist/{chunk-IILNZK5G.mjs → chunk-JHWOVJ3M.mjs} +46 -62
  31. package/dist/{chunk-TKNSDBBN.cjs → chunk-K3F2E6GS.cjs} +20 -1
  32. package/dist/{chunk-RTHIVJ2G.cjs → chunk-KCMTCM6I.cjs} +7 -8
  33. package/dist/{chunk-Q3PX2TGL.cjs → chunk-LQIRVSBY.cjs} +30 -40
  34. package/dist/chunk-LYLEZIG3.cjs +73 -0
  35. package/dist/{chunk-NBAHDVOJ.cjs → chunk-LYM7HY34.cjs} +20 -32
  36. package/dist/{chunk-K6FNHVDR.cjs → chunk-MPEYMSCF.cjs} +6 -12
  37. package/dist/{chunk-BHJUZ64B.cjs → chunk-QTBEAKCJ.cjs} +7 -7
  38. package/dist/{chunk-J6JRB2ER.mjs → chunk-S67OYZU7.mjs} +1 -1
  39. package/dist/chunk-SFGWNC43.mjs +97 -0
  40. package/dist/{chunk-EXUMQVY3.cjs → chunk-SIQMTHCZ.cjs} +258 -260
  41. package/dist/{chunk-AYJR42WX.cjs → chunk-UFDV5N3C.cjs} +2 -2
  42. package/dist/chunk-UYIHRDE4.cjs +97 -0
  43. package/dist/{chunk-Y4YMF2NQ.cjs → chunk-VPTDD5XF.cjs} +46 -62
  44. package/dist/{chunk-GKT4ONKN.mjs → chunk-VVJCWBIE.mjs} +2 -2
  45. package/dist/{chunk-CQHFU55R.mjs → chunk-WNUBR4CA.mjs} +5 -1
  46. package/dist/{chunk-CIAGU2X4.cjs → chunk-XSIRSMAS.cjs} +10 -8
  47. package/dist/{chunk-ONMW3EVV.mjs → chunk-YGMK6ESJ.mjs} +20 -30
  48. package/dist/chunk-YOZYCI6Z.mjs +73 -0
  49. package/dist/{chunk-HLCDYJY7.mjs → chunk-YQVSHTMR.mjs} +20 -1
  50. package/dist/{chunk-F5D4XEAS.mjs → chunk-ZZSRYEYU.mjs} +7 -8
  51. package/dist/{client-plugins-CWrhb1ir.d.mts → client-plugins-B_XzCegf.d.mts} +11 -9
  52. package/dist/{client-plugins-DPf0qZey.d.ts → client-plugins-CKsXQfXY.d.ts} +11 -9
  53. package/dist/client-plugins.d.mts +3 -2
  54. package/dist/client-plugins.d.ts +3 -2
  55. package/dist/client.d.mts +7 -6
  56. package/dist/client.d.ts +7 -6
  57. package/dist/config.d.mts +3 -2
  58. package/dist/config.d.ts +3 -2
  59. package/dist/{devtools-EZ5ORGAK.mjs → devtools-OY4SNU3P.mjs} +4 -3
  60. package/dist/{devtools-6DQHO7EK.cjs → devtools-UHRSZ7VA.cjs} +5 -4
  61. package/dist/docs.cjs +9 -6
  62. package/dist/docs.mjs +8 -5
  63. package/dist/index.cjs +23 -20
  64. package/dist/index.d.mts +14 -13
  65. package/dist/index.d.ts +14 -13
  66. package/dist/index.mjs +18 -15
  67. package/dist/instrumentation.cjs +3 -2
  68. package/dist/instrumentation.mjs +2 -1
  69. package/dist/integrations.d.mts +3 -2
  70. package/dist/integrations.d.ts +3 -2
  71. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  72. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  73. package/dist/internal/build-runtime.cjs +17 -14
  74. package/dist/internal/build-runtime.d.mts +5 -4
  75. package/dist/internal/build-runtime.d.ts +5 -4
  76. package/dist/internal/build-runtime.mjs +16 -13
  77. package/dist/internal/cli-runtime.cjs +10 -7
  78. package/dist/internal/cli-runtime.mjs +9 -6
  79. package/dist/internal/client-error-overlay.cjs +4 -4
  80. package/dist/internal/client-error-overlay.mjs +1 -1
  81. package/dist/internal/compression-runtime.d.mts +3 -2
  82. package/dist/internal/compression-runtime.d.ts +3 -2
  83. package/dist/internal/config-runtime.cjs +5 -4
  84. package/dist/internal/config-runtime.d.mts +4 -3
  85. package/dist/internal/config-runtime.d.ts +4 -3
  86. package/dist/internal/config-runtime.mjs +4 -3
  87. package/dist/internal/metadata-image-runtime.cjs +3 -2
  88. package/dist/internal/metadata-image-runtime.mjs +2 -1
  89. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  90. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  91. package/dist/internal/production-runtime.d.mts +9 -8
  92. package/dist/internal/production-runtime.d.ts +9 -8
  93. package/dist/layers-4PNE2HOY.cjs +18 -0
  94. package/dist/{layers-CJKSJGLN.mjs → layers-BRQF5ETU.mjs} +2 -1
  95. package/dist/{manager-NPG43N46.mjs → manager-RT733VRK.mjs} +2 -2
  96. package/dist/{manager-G4B2IPYE.cjs → manager-XZ5TX7AO.cjs} +3 -3
  97. package/dist/{metadata-CO9fRyyJ.d.mts → metadata-B08w4EYV.d.mts} +1 -1
  98. package/dist/{metadata-zY9wltwH.d.ts → metadata-IQEblkZp.d.ts} +1 -1
  99. package/dist/middleware.d.mts +5 -4
  100. package/dist/middleware.d.ts +5 -4
  101. package/dist/navigation.d.mts +6 -5
  102. package/dist/navigation.d.ts +6 -5
  103. package/dist/{nitro-TSGDUJMN.cjs → nitro-KQDU7CFE.cjs} +2 -2
  104. package/dist/{nitro-4LFVTT24.mjs → nitro-ZKLGOTVY.mjs} +1 -1
  105. package/dist/node-module-bundle-L5L7JCZ4.mjs +11 -0
  106. package/dist/node-module-bundle-VAFZOXMJ.cjs +11 -0
  107. package/dist/plugin.cjs +11 -9
  108. package/dist/plugin.d.mts +3 -2
  109. package/dist/plugin.d.ts +3 -2
  110. package/dist/plugin.mjs +10 -8
  111. package/dist/{production-runtime-CywsHwnG.d.mts → production-runtime-C3bGFEaM.d.mts} +1 -1
  112. package/dist/{production-runtime-lkfwujwK.d.ts → production-runtime-DRSOkc-d.d.ts} +1 -1
  113. package/dist/{render-plan-LVy6sGQe.d.mts → render-plan-B6CKNl4e.d.mts} +1 -1
  114. package/dist/{render-plan-DHF0GeWo.d.ts → render-plan-CCFuMLNS.d.ts} +1 -1
  115. package/dist/renderer-client.d.mts +5 -4
  116. package/dist/renderer-client.d.ts +5 -4
  117. package/dist/{request-6AkmhEYE.d.mts → request-DgD1XsTx.d.mts} +1 -1
  118. package/dist/{request-BYxlRqA9.d.ts → request-Dn6VURbE.d.ts} +1 -1
  119. package/dist/request.d.mts +4 -3
  120. package/dist/request.d.ts +4 -3
  121. package/dist/{route-rendering-Dd8Jmml7.d.mts → route-rendering-76A5I_kE.d.mts} +1 -1
  122. package/dist/{route-rendering-CWaKiUbS.d.ts → route-rendering-LAmQEdyG.d.ts} +1 -1
  123. package/dist/{router-B2m4fvve.d.ts → router-BSOOGya2.d.ts} +1 -1
  124. package/dist/{router-xwEE112q.d.mts → router-CnrRSa9d.d.mts} +1 -1
  125. package/dist/routes.d.mts +3 -2
  126. package/dist/routes.d.ts +3 -2
  127. package/dist/server-plugins.d.mts +4 -3
  128. package/dist/server-plugins.d.ts +4 -3
  129. package/dist/server.cjs +39 -26
  130. package/dist/server.d.mts +9 -8
  131. package/dist/server.d.ts +9 -8
  132. package/dist/server.mjs +24 -11
  133. package/dist/{spa-router-Y8rrXTVK.d.ts → spa-router-BMrSsG5b.d.ts} +2 -2
  134. package/dist/{spa-router-DVEHQnWo.d.mts → spa-router-DnYhWCvI.d.mts} +2 -2
  135. package/dist/testing.cjs +2 -1
  136. package/dist/testing.d.mts +3 -2
  137. package/dist/testing.d.ts +3 -2
  138. package/dist/testing.mjs +2 -1
  139. package/dist/{utils-DSPx34-A.d.mts → utils-ABkktwku.d.mts} +1 -1
  140. package/dist/{utils-Dvuny_08.d.ts → utils-C3GguS-Q.d.ts} +1 -1
  141. package/dist/version.cjs +2 -2
  142. package/dist/version.mjs +1 -1
  143. package/dist/vite.cjs +11 -9
  144. package/dist/vite.d.mts +3 -2
  145. package/dist/vite.d.ts +3 -2
  146. package/dist/vite.mjs +10 -8
  147. package/dist/workflows.cjs +2 -2
  148. package/dist/workflows.mjs +1 -1
  149. package/package.json +21 -11
  150. package/dist/layers-E4WPJNY5.cjs +0 -17
@@ -7,7 +7,7 @@ var _chunkMT763TDWcjs = require('./chunk-MT763TDW.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkQ3PX2TGLcjs = require('./chunk-Q3PX2TGL.cjs');
10
+ var _chunkLQIRVSBYcjs = require('./chunk-LQIRVSBY.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,7 +17,7 @@ var _chunkQ3PX2TGLcjs = require('./chunk-Q3PX2TGL.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunkNBAHDVOJcjs = require('./chunk-NBAHDVOJ.cjs');
20
+ var _chunkLYM7HY34cjs = require('./chunk-LYM7HY34.cjs');
21
21
 
22
22
 
23
23
 
@@ -28,13 +28,16 @@ var _chunkMWWVKDW3cjs = require('./chunk-MWWVKDW3.cjs');
28
28
  var _chunkYA6LLTIJcjs = require('./chunk-YA6LLTIJ.cjs');
29
29
 
30
30
 
31
+ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
31
32
 
32
33
 
33
34
 
34
- var _chunkGXXONIARcjs = require('./chunk-GXXONIAR.cjs');
35
35
 
36
36
 
37
- var _chunkRTHIVJ2Gcjs = require('./chunk-RTHIVJ2G.cjs');
37
+ var _chunkDNLQMFERcjs = require('./chunk-DNLQMFER.cjs');
38
+
39
+
40
+ var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
38
41
 
39
42
 
40
43
  var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
@@ -64,13 +67,15 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
64
67
 
65
68
 
66
69
 
67
- var _chunkP5HSJCXIcjs = require('./chunk-P5HSJCXI.cjs');
70
+
71
+
72
+ var _chunkG6GNNB44cjs = require('./chunk-G6GNNB44.cjs');
68
73
 
69
74
 
70
75
 
71
76
 
72
77
 
73
- var _chunkSO7CRMP6cjs = require('./chunk-SO7CRMP6.cjs');
78
+ var _chunkDW34V5SMcjs = require('./chunk-DW34V5SM.cjs');
74
79
 
75
80
 
76
81
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -90,7 +95,7 @@ var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
90
95
  var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
91
96
 
92
97
 
93
- var _chunkY4YMF2NQcjs = require('./chunk-Y4YMF2NQ.cjs');
98
+ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
94
99
 
95
100
 
96
101
 
@@ -122,7 +127,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
122
127
 
123
128
 
124
129
 
125
- var _chunkK6FNHVDRcjs = require('./chunk-K6FNHVDR.cjs');
130
+ var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
126
131
 
127
132
 
128
133
 
@@ -132,12 +137,15 @@ var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
132
137
  var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
133
138
 
134
139
 
135
- var _chunkB3WK4DTXcjs = require('./chunk-B3WK4DTX.cjs');
140
+ var _chunkIMBMOEWTcjs = require('./chunk-IMBMOEWT.cjs');
136
141
 
137
142
 
138
143
  var _chunkIQXFRNY2cjs = require('./chunk-IQXFRNY2.cjs');
139
144
 
140
145
 
146
+ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
147
+
148
+
141
149
 
142
150
  var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
143
151
 
@@ -263,7 +271,7 @@ function getDocsTitle(docs) {
263
271
  }
264
272
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
265
273
  function loadPages(contentDir, docs) {
266
- return _chunkNBAHDVOJcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkNBAHDVOJcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
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));
267
275
  }
268
276
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
269
277
  function findSocialImagePath(html) {
@@ -284,14 +292,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
284
292
  }
285
293
  _chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
286
294
  async function compileFarmDocsManifest(docs, options) {
287
- const contentDir = _chunkNBAHDVOJcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
295
+ const contentDir = _chunkLYM7HY34cjs.resolveFarmDocsContentDir.call(void 0, docs, options);
288
296
  const pages = loadPages(contentDir, docs);
289
297
  const absolutePaths = [
290
298
  _path2.default.resolve(options.root),
291
299
  _path2.default.resolve(contentDir),
292
300
  docs.configPath || ""
293
301
  ];
294
- const handler = _chunkNBAHDVOJcjs.createFarmDocsHandler.call(void 0, docs, {
302
+ const handler = _chunkLYM7HY34cjs.createFarmDocsHandler.call(void 0, docs, {
295
303
  root: options.root,
296
304
  srcDir: options.srcDir,
297
305
  clientEntry: options.clientEntry,
@@ -299,7 +307,7 @@ async function compileFarmDocsManifest(docs, options) {
299
307
  fontStylesheetHref: options.fontStylesheetHref,
300
308
  globalStylesheetHref: options.globalStylesheetHref
301
309
  });
302
- const apiHandler = _chunkQ3PX2TGLcjs.createFarmDocsAPIHandler.call(void 0, {
310
+ const apiHandler = _chunkLQIRVSBYcjs.createFarmDocsAPIHandler.call(void 0, {
303
311
  rootDir: options.root,
304
312
  srcDir: options.srcDir,
305
313
  docs
@@ -391,7 +399,7 @@ async function compileFarmDocsManifest(docs, options) {
391
399
  post: await compileResponse(postResponse, absolutePaths),
392
400
  search: {
393
401
  pages: pages.map((page) => ({
394
- ..._chunkNBAHDVOJcjs.toFarmDocsMarkdownPage.call(void 0, page),
402
+ ..._chunkLYM7HY34cjs.toFarmDocsMarkdownPage.call(void 0, page),
395
403
  sourcePath: `farm-docs:${page.slug || "index"}`
396
404
  })),
397
405
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -411,7 +419,7 @@ async function createFarmRouteRuntimeManifest(options) {
411
419
  const routes = [];
412
420
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
413
421
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
414
- const rendering = await _chunkSO7CRMP6cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
422
+ const rendering = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
415
423
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
416
424
  routes.push({
417
425
  kind: "page",
@@ -1074,6 +1082,9 @@ var NITRO_EXTERNAL_MODULES = /* @__PURE__ */ new Set([
1074
1082
  "fsevents",
1075
1083
  "esbuild",
1076
1084
  "lightningcss",
1085
+ "rolldown",
1086
+ "rolldown/experimental",
1087
+ "rolldown/utils",
1077
1088
  "rollup",
1078
1089
  "vite",
1079
1090
  "nitro",
@@ -1314,75 +1325,76 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
1314
1325
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
1315
1326
  }
1316
1327
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmRuntimeConfigModule, "hasFarmRuntimeConfigModule");
1317
- function createEsbuildTransformOptions(configuredEsbuildOptions, minify, defaultTarget) {
1318
- const {
1319
- include: _include,
1320
- exclude: _exclude,
1321
- sourceMap: _sourceMap,
1322
- loaders: _loaders,
1323
- ...configuredTransformOptions
1324
- } = configuredEsbuildOptions;
1325
- const configuredTarget = Array.isArray(configuredTransformOptions.target) ? configuredTransformOptions.target.filter(
1326
- (target) => typeof target === "string"
1327
- ) : configuredTransformOptions.target;
1328
- const transformTarget = Array.isArray(configuredTarget) && configuredTarget.length === 0 ? defaultTarget : _nullishCoalesce(configuredTarget, () => ( defaultTarget));
1329
- const transformSupported = configuredTransformOptions.supported ? Object.fromEntries(
1330
- Object.entries(configuredTransformOptions.supported).filter(
1331
- (entry) => typeof entry[1] === "boolean"
1332
- )
1333
- ) : void 0;
1334
- return {
1335
- ...configuredTransformOptions,
1336
- format: "esm",
1337
- target: transformTarget,
1338
- loader: "js",
1339
- sourcemap: false,
1340
- minify,
1341
- keepNames: _nullishCoalesce(configuredTransformOptions.keepNames, () => ( true)),
1342
- legalComments: _nullishCoalesce(configuredTransformOptions.legalComments, () => ( "none")),
1343
- supported: transformSupported
1344
- };
1328
+ async function minifyFarmServerChunk(code, fileName, options) {
1329
+ const rolldownUtils = await import("rolldown/utils");
1330
+ const keepNames = { function: options.keepNames, class: options.keepNames };
1331
+ const result = await rolldownUtils.minify(fileName, code, {
1332
+ module: true,
1333
+ compress: { target: options.target, keepNames },
1334
+ mangle: { keepNames },
1335
+ codegen: { legalComments: "none", asciiOnly: true },
1336
+ sourcemap: false
1337
+ });
1338
+ if (result.errors.length > 0) {
1339
+ throw new Error(`Failed to minify ${fileName}: ${result.errors[0].message}`);
1340
+ }
1341
+ return restoreLiteralModuleSpecifiers(result.code, fileName, rolldownUtils);
1342
+ }
1343
+ _chunkS3JO3N4Hcjs.__name.call(void 0, minifyFarmServerChunk, "minifyFarmServerChunk");
1344
+ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor }) {
1345
+ if (!code.includes("import(`") && !code.includes("require(`")) return code;
1346
+ const parsed = parseSync(fileName, code, { lang: "js", sourceType: "module" });
1347
+ if (parsed.errors.length > 0) {
1348
+ throw new Error(`Failed to minify ${fileName}: ${parsed.errors[0].message}`);
1349
+ }
1350
+ const replacements = [];
1351
+ const restore = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (node) => {
1352
+ if (_optionalChain([node, 'optionalAccess', _17 => _17.type]) !== "TemplateLiteral") return;
1353
+ const template = node;
1354
+ const value = _optionalChain([template, 'access', _18 => _18.quasis, 'access', _19 => _19[0], 'optionalAccess', _20 => _20.value, 'access', _21 => _21.cooked]);
1355
+ if (template.expressions.length > 0 || typeof value !== "string") return;
1356
+ const text = JSON.stringify(value).replace(
1357
+ /[\u007f-￿]/g,
1358
+ (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`
1359
+ );
1360
+ replacements.push({ start: template.start, end: template.end, text });
1361
+ }, "restore");
1362
+ new Visitor({
1363
+ ImportExpression(node) {
1364
+ restore(node.source);
1365
+ },
1366
+ CallExpression(node) {
1367
+ if (node.callee.type === "Identifier" && node.callee.name === "require" && node.arguments.length === 1) {
1368
+ restore(node.arguments[0]);
1369
+ }
1370
+ }
1371
+ }).visit(parsed.program);
1372
+ let restored = "";
1373
+ let offset = 0;
1374
+ for (const { start, end, text } of replacements.sort((a, b) => a.start - b.start)) {
1375
+ restored += code.slice(offset, start) + text;
1376
+ offset = end;
1377
+ }
1378
+ return restored + code.slice(offset);
1345
1379
  }
1346
- _chunkS3JO3N4Hcjs.__name.call(void 0, createEsbuildTransformOptions, "createEsbuildTransformOptions");
1347
- function createEsbuildChunkMinifyPlugin(configuredEsbuildOptions) {
1348
- const configuredTransformOptions = createEsbuildTransformOptions(
1349
- configuredEsbuildOptions,
1350
- true,
1351
- "esnext"
1352
- );
1353
- const transformOptions = {
1354
- format: "esm",
1355
- target: configuredTransformOptions.target,
1356
- loader: "js",
1357
- sourcemap: false,
1358
- minify: true,
1359
- keepNames: configuredTransformOptions.keepNames,
1360
- legalComments: configuredTransformOptions.legalComments,
1361
- charset: configuredTransformOptions.charset
1362
- };
1380
+ _chunkS3JO3N4Hcjs.__name.call(void 0, restoreLiteralModuleSpecifiers, "restoreLiteralModuleSpecifiers");
1381
+ function createServerChunkMinifyPlugin(options) {
1363
1382
  return {
1364
- name: "farm-esbuild-minify",
1383
+ name: "farm-server-chunk-minify",
1365
1384
  async renderChunk(code, chunk) {
1366
- const { transform } = await import("esbuild");
1367
- const result = await transform(code, {
1368
- ...transformOptions,
1369
- sourcefile: chunk.fileName
1370
- });
1371
- if (!result.code) return null;
1372
- return {
1373
- code: result.code,
1374
- map: result.map || null
1375
- };
1385
+ const minified = await minifyFarmServerChunk(code, chunk.fileName, options);
1386
+ if (!minified) return null;
1387
+ return { code: minified, map: null };
1376
1388
  }
1377
1389
  };
1378
1390
  }
1379
- _chunkS3JO3N4Hcjs.__name.call(void 0, createEsbuildChunkMinifyPlugin, "createEsbuildChunkMinifyPlugin");
1391
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createServerChunkMinifyPlugin, "createServerChunkMinifyPlugin");
1380
1392
  function trimSlashes(value) {
1381
1393
  return value.replace(/^\/+|\/+$/g, "");
1382
1394
  }
1383
1395
  _chunkS3JO3N4Hcjs.__name.call(void 0, trimSlashes, "trimSlashes");
1384
1396
  function resolveBuildDocsContentDir(config, root) {
1385
- if (!_optionalChain([config, 'access', _17 => _17.docs, 'optionalAccess', _18 => _18.enabled])) return null;
1397
+ if (!_optionalChain([config, 'access', _22 => _22.docs, 'optionalAccess', _23 => _23.enabled])) return null;
1386
1398
  const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
1387
1399
  if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
1388
1400
  const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
@@ -1467,7 +1479,7 @@ function hasFarmPluginRoutes(config) {
1467
1479
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1468
1480
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1469
1481
  return (config.plugins || []).some(
1470
- (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkP5HSJCXIcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1482
+ (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkG6GNNB44cjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1471
1483
  );
1472
1484
  }
1473
1485
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
@@ -1515,7 +1527,7 @@ async function discoverMiddlewareRoutes(appDir) {
1515
1527
  }
1516
1528
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1517
1529
  function assertFarmDocsRuntimeSupported(config, preset) {
1518
- if (!_optionalChain([config, 'access', _19 => _19.docs, 'optionalAccess', _20 => _20.enabled]) || !_optionalChain([config, 'access', _21 => _21.docs, 'access', _22 => _22.adapter, 'optionalAccess', _23 => _23.server]) || _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1530
+ if (!_optionalChain([config, 'access', _24 => _24.docs, 'optionalAccess', _25 => _25.enabled]) || !_optionalChain([config, 'access', _26 => _26.docs, 'access', _27 => _27.adapter, 'optionalAccess', _28 => _28.server]) || _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1519
1531
  return;
1520
1532
  }
1521
1533
  throw new Error(
@@ -1529,7 +1541,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1529
1541
  assertFarmDocsRuntimeSupported(config, preset);
1530
1542
  const srcDir = config.srcDir || "src";
1531
1543
  const distDir = config.distDir || ".farm";
1532
- const deployOutputDir = _chunkGXXONIARcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1544
+ const deployOutputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1533
1545
  const lifecyclePluginManager = options.pluginManager;
1534
1546
  const productionViteResultPromise = Promise.allSettled([
1535
1547
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1729,7 +1741,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1729
1741
  _chunk5QIKR7RRcjs.logger.error(`\u274C Build failed: ${error}`);
1730
1742
  throw error;
1731
1743
  } finally {
1732
- _optionalChain([rendererBuild, 'optionalAccess', _24 => _24.abort, 'call', _25 => _25()]);
1744
+ _optionalChain([rendererBuild, 'optionalAccess', _29 => _29.abort, 'call', _30 => _30()]);
1733
1745
  }
1734
1746
  }
1735
1747
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildUniversal, "buildUniversal");
@@ -1777,7 +1789,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1777
1789
  }
1778
1790
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1779
1791
  await fs.writeFile(fontCssPath, normalizedFontCss);
1780
- await fs.writeFile(clientCssPath, _chunkP5HSJCXIcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1792
+ await fs.writeFile(clientCssPath, _chunkG6GNNB44cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1781
1793
  }
1782
1794
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1783
1795
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1827,7 +1839,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1827
1839
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1828
1840
  let plan = cache.get(key);
1829
1841
  if (!plan) {
1830
- plan = _chunkP5HSJCXIcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1842
+ plan = _chunkG6GNNB44cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1831
1843
  cache.set(key, plan);
1832
1844
  }
1833
1845
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -1851,19 +1863,19 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1851
1863
  const unsupportedIntegrationProvider = integrationProviders.find(
1852
1864
  (provider) => provider.supportsIsolatedHydration !== true
1853
1865
  );
1854
- if (_optionalChain([config, 'access', _26 => _26.experimental, 'optionalAccess', _27 => _27.isolatedClientHydration]) === "enabled" && _optionalChain([config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.serverComponents]) !== true && unsupportedIntegrationProvider) {
1866
+ if (_optionalChain([config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.isolatedClientHydration]) === "enabled" && _optionalChain([config, 'access', _33 => _33.experimental, 'optionalAccess', _34 => _34.serverComponents]) !== true && unsupportedIntegrationProvider) {
1855
1867
  _chunk5QIKR7RRcjs.logger.warn(
1856
1868
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1857
1869
  );
1858
1870
  }
1859
- const isolatedMode = _chunkP5HSJCXIcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1860
- _optionalChain([config, 'access', _30 => _30.experimental, 'optionalAccess', _31 => _31.isolatedClientHydration]),
1871
+ const isolatedMode = _chunkG6GNNB44cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1872
+ _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
1861
1873
  {
1862
- serverComponents: _optionalChain([config, 'access', _32 => _32.experimental, 'optionalAccess', _33 => _33.serverComponents]) === true,
1874
+ serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
1863
1875
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1864
1876
  }
1865
1877
  );
1866
- const planOptions = _chunkP5HSJCXIcjs.getFarmClientHydrationPlanOptions.call(void 0,
1878
+ const planOptions = _chunkG6GNNB44cjs.getFarmClientHydrationPlanOptions.call(void 0,
1867
1879
  config.renderer,
1868
1880
  Boolean(unsupportedIntegrationProvider)
1869
1881
  );
@@ -1912,15 +1924,15 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1912
1924
  });
1913
1925
  const layoutAppliesToRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (layoutPattern, routePattern) => layoutPattern === "/" || routePattern === layoutPattern || routePattern.startsWith(`${layoutPattern}/`), "layoutAppliesToRoute");
1914
1926
  const adapterOwnsDocsRuntime = Boolean(
1915
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _34 => _34.docs, 'optionalAccess', _35 => _35.enabled]) && _optionalChain([config, 'access', _36 => _36.docs, 'access', _37 => _37.adapter, 'optionalAccess', _38 => _38.server]) && config.docs.adapter.react
1927
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _39 => _39.docs, 'optionalAccess', _40 => _40.enabled]) && _optionalChain([config, 'access', _41 => _41.docs, 'access', _42 => _42.adapter, 'optionalAccess', _43 => _43.server]) && config.docs.adapter.react
1916
1928
  );
1917
- const adapterDocsEntry = _optionalChain([config, 'access', _39 => _39.docs, 'optionalAccess', _40 => _40.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
1929
+ const adapterDocsEntry = _optionalChain([config, 'access', _44 => _44.docs, 'optionalAccess', _45 => _45.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
1918
1930
  const isAdapterDocsRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (routePattern) => Boolean(
1919
1931
  adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
1920
1932
  ), "isAdapterDocsRoute");
1921
- const syntheticDocsEntry = _optionalChain([config, 'access', _41 => _41.docs, 'optionalAccess', _42 => _42.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1933
+ const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1922
1934
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
1923
- const markdownPagePlan = _chunkP5HSJCXIcjs.createMarkdownPageHydrationPlanner.call(void 0,
1935
+ const markdownPagePlan = _chunkG6GNNB44cjs.createMarkdownPageHydrationPlanner.call(void 0,
1924
1936
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
1925
1937
  root,
1926
1938
  isolatedMode,
@@ -1936,7 +1948,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1936
1948
  planOptions
1937
1949
  )
1938
1950
  }));
1939
- _chunkP5HSJCXIcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1951
+ _chunkG6GNNB44cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1940
1952
  clientLayouts.map((layout) => ({
1941
1953
  pattern: layout.pattern,
1942
1954
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -1968,7 +1980,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1968
1980
  for (const layout of clientLayouts) {
1969
1981
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, route.pattern)) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
1970
1982
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
1971
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkP5HSJCXIcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
1983
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkG6GNNB44cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
1972
1984
  }
1973
1985
  }
1974
1986
  if (isolatedMode === "analyze") {
@@ -1992,7 +2004,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1992
2004
  );
1993
2005
  if (metadata.suppressedAsyncHydration) {
1994
2006
  _chunk5QIKR7RRcjs.logger.warn(
1995
- `\u26A0\uFE0F ${_chunkP5HSJCXIcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2007
+ `\u26A0\uFE0F ${_chunkG6GNNB44cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
1996
2008
  );
1997
2009
  }
1998
2010
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2051,7 +2063,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2051
2063
  }
2052
2064
  const clientRouteSlots = routeSlots.filter((slot) => {
2053
2065
  try {
2054
- return _chunkP5HSJCXIcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2066
+ return _chunkG6GNNB44cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2055
2067
  } catch (error) {
2056
2068
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2057
2069
  return false;
@@ -2072,8 +2084,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2072
2084
  srcDir,
2073
2085
  adapterOwnsDocsRuntime ? false : _chunkMWWVKDW3cjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2074
2086
  adapterOwnsDocsRuntime ? void 0 : _chunkMWWVKDW3cjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2075
- _optionalChain([config, 'access', _43 => _43.docs, 'optionalAccess', _44 => _44.enabled]) ? config.docs.entry : void 0,
2076
- adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _45 => _45.docs, 'access', _46 => _46.adapter, 'optionalAccess', _47 => _47.react]) : void 0,
2087
+ _optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled]) ? config.docs.entry : void 0,
2088
+ adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _50 => _50.docs, 'access', _51 => _51.adapter, 'optionalAccess', _52 => _52.react]) : void 0,
2077
2089
  config.i18n,
2078
2090
  config.plugins,
2079
2091
  config.renderer,
@@ -2081,7 +2093,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2081
2093
  config.trailingSlash,
2082
2094
  _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations),
2083
2095
  config.basePath,
2084
- _chunkP5HSJCXIcjs.generateClientCachePersistenceCode.call(void 0, _chunkP5HSJCXIcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2096
+ _chunkG6GNNB44cjs.generateClientCachePersistenceCode.call(void 0, _chunkG6GNNB44cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2085
2097
  adapterOwnsDocsRuntime ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2086
2098
  );
2087
2099
  await fs.writeFile(clientEntryPath, clientHydrationCode);
@@ -2098,7 +2110,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2098
2110
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2099
2111
  await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2100
2112
  postcssSearchPath = clientEntryDir;
2101
- tailwindVitePlugin = await _chunkP5HSJCXIcjs.loadTailwindVitePlugin.call(void 0, {
2113
+ tailwindVitePlugin = await _chunkG6GNNB44cjs.loadTailwindVitePlugin.call(void 0, {
2102
2114
  builder: productionVite.builder,
2103
2115
  announce: true
2104
2116
  });
@@ -2131,7 +2143,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2131
2143
  hashCharacters: "hex",
2132
2144
  // Use predictable name for CSS so we can reference it in SSR HTML
2133
2145
  assetFileNames: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (assetInfo) => {
2134
- if (_optionalChain([assetInfo, 'access', _48 => _48.name, 'optionalAccess', _49 => _49.endsWith, 'call', _50 => _50(".css")])) {
2146
+ if (_optionalChain([assetInfo, 'access', _53 => _53.name, 'optionalAccess', _54 => _54.endsWith, 'call', _55 => _55(".css")])) {
2135
2147
  return "farm-client.css";
2136
2148
  }
2137
2149
  return "assets/[name]-h[hash][extname]";
@@ -2167,7 +2179,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2167
2179
  }
2168
2180
  },
2169
2181
  plugins: [
2170
- _chunkP5HSJCXIcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2182
+ _chunkG6GNNB44cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2171
2183
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
2172
2184
  ...rendererVitePlugins,
2173
2185
  ...config.vite.plugins || [],
@@ -2189,7 +2201,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2189
2201
  if (id.includes("/api/") && id.includes("/route")) {
2190
2202
  return { id: "\0empty-api-route", external: false };
2191
2203
  }
2192
- if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node") || id === "nitro" || id === "vite" || id === "esbuild" || id === "rollup" || id.startsWith("nitro/") || id.includes("node-pre-gyp") || id.includes("nf3")) {
2204
+ if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node") || id === "nitro" || id === "vite" || id === "esbuild" || id === "rolldown" || id.startsWith("rolldown/") || id === "rollup" || id.startsWith("nitro/") || id.includes("node-pre-gyp") || id.includes("nf3")) {
2193
2205
  return { id: "\0empty-module", external: false };
2194
2206
  }
2195
2207
  return null;
@@ -2228,7 +2240,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2228
2240
  } : void 0,
2229
2241
  // Ensure React is bundled for client
2230
2242
  resolve: {
2231
- alias: _chunkP5HSJCXIcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2243
+ alias: _chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2232
2244
  dedupe: [...config.renderer.dedupe || []]
2233
2245
  },
2234
2246
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2241,7 +2253,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2241
2253
  ]
2242
2254
  }
2243
2255
  };
2244
- await viteBuild(_chunkP5HSJCXIcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2256
+ await viteBuild(_chunkG6GNNB44cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2245
2257
  await mergeBuiltFontCss(outputDir);
2246
2258
  await validateClientBuildOutput(root, srcDir, outputDir);
2247
2259
  } finally {
@@ -3000,7 +3012,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3000
3012
  direction: {}
3001
3013
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3002
3014
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3003
- const clientPluginEntry = _chunkP5HSJCXIcjs.generateFarmClientPluginEntryCode.call(void 0,
3015
+ const clientPluginEntry = _chunkG6GNNB44cjs.generateFarmClientPluginEntryCode.call(void 0,
3004
3016
  plugins,
3005
3017
  root,
3006
3018
  srcDir,
@@ -3011,7 +3023,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3011
3023
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3012
3024
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3013
3025
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3014
- const providerClientCode = _chunkP5HSJCXIcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3026
+ const providerClientCode = _chunkG6GNNB44cjs.generateFarmIntegrationProviderClientCode.call(void 0,
3015
3027
  integrationProviders,
3016
3028
  root,
3017
3029
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3496,7 +3508,7 @@ function hasHydratableLayout(pathname) {
3496
3508
  });
3497
3509
  }
3498
3510
 
3499
- ${_chunkP5HSJCXIcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3511
+ ${_chunkG6GNNB44cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3500
3512
  // Wrap a page element with applicable layouts
3501
3513
  function wrapWithLayouts(pageElement, pathname, params) {
3502
3514
  const layouts = getApplicableLayouts(pathname);
@@ -4389,7 +4401,7 @@ void hydrate();
4389
4401
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientHydrationEntry, "generateClientHydrationEntry");
4390
4402
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
4391
4403
  const viteBuild = productionVite.build;
4392
- const { farmPlugin } = await import("./vite.cjs");
4404
+ const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
4393
4405
  const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
4394
4406
  const fs = await import("fs/promises");
4395
4407
  const pluginManager = new PluginManager2({
@@ -4411,7 +4423,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4411
4423
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4412
4424
  "module.exports = { plugins: [] };\n"
4413
4425
  );
4414
- tailwindVitePlugin = await _chunkP5HSJCXIcjs.loadTailwindVitePlugin.call(void 0, {
4426
+ tailwindVitePlugin = await _chunkG6GNNB44cjs.loadTailwindVitePlugin.call(void 0, {
4415
4427
  builder: productionVite.builder,
4416
4428
  label: "for SSR"
4417
4429
  });
@@ -4445,6 +4457,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4445
4457
  modulePath: entry.modulePath
4446
4458
  });
4447
4459
  }
4460
+ assertMetadataImageRuntimeInstalled(root, metadataImageRoutes);
4448
4461
  const applicationMetadataRoutes = Array.from(
4449
4462
  routeManager.getMetadataRoutes().values(),
4450
4463
  (entry) => ({
@@ -4485,10 +4498,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4485
4498
  })
4486
4499
  );
4487
4500
  const i18nCatalogs = config.i18n.enabled ? (await _chunkIQXFRNY2cjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
4488
- const appDirs = _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config);
4501
+ const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config);
4489
4502
  let openAPIReference = null;
4490
4503
  if (config.openapi.enabled && config.openapi.route) {
4491
- const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-G4B2IPYE.cjs");
4504
+ const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-XZ5TX7AO.cjs");
4492
4505
  const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
4493
4506
  mode: "production",
4494
4507
  apiBaseURL: config.api.baseURL
@@ -4505,8 +4518,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4505
4518
  };
4506
4519
  }
4507
4520
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4508
- const instrumentationPath = _chunkRTHIVJ2Gcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4509
- const notFoundPath = _chunkP5HSJCXIcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4521
+ const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4522
+ const notFoundPath = _chunkG6GNNB44cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4510
4523
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4511
4524
  layoutRoutes.sort((a, b) => {
4512
4525
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4527,9 +4540,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4527
4540
  (provider) => provider.component || provider.type === "clerk"
4528
4541
  );
4529
4542
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4530
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _51 => _51.mdx, 'optionalAccess', _52 => _52.components]));
4543
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
4531
4544
  const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
4532
- const hasRouteContextConfig = _chunkGXXONIARcjs.hasCustomFarmRouteContext.call(void 0, config);
4545
+ const hasRouteContextConfig = _chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config);
4533
4546
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4534
4547
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4535
4548
  const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
@@ -4538,7 +4551,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4538
4551
  const hasConfiguredRuntimePlugins = Boolean(
4539
4552
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4540
4553
  );
4541
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _53 => _53.docs, 'optionalAccess', _54 => _54.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _55 => _55.docs, 'access', _56 => _56.adapter, 'optionalAccess', _57 => _57.server]) ? await _chunkQ3PX2TGLcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
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, {
4542
4555
  root,
4543
4556
  srcDir: config.srcDir,
4544
4557
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4635,7 +4648,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4635
4648
  // Adapters can render provider scripts by serializing function source.
4636
4649
  // keepNames injects helper calls into those functions; after Nitro
4637
4650
  // minifies the server chunk the helper is no longer in script scope.
4638
- keepNames: !(_optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server])),
4651
+ keepNames: !(_optionalChain([config, 'access', _63 => _63.docs, 'optionalAccess', _64 => _64.enabled]) && _optionalChain([config, 'access', _65 => _65.docs, 'access', _66 => _66.adapter, 'optionalAccess', _67 => _67.server])),
4639
4652
  jsxDev: false
4640
4653
  },
4641
4654
  // SSR configuration to externalize problematic modules
@@ -4649,6 +4662,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4649
4662
  ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4650
4663
  "esbuild",
4651
4664
  "lightningcss",
4665
+ "rolldown",
4666
+ "rolldown/experimental",
4667
+ "rolldown/utils",
4652
4668
  "rollup",
4653
4669
  "@rollup/rollup-darwin-arm64",
4654
4670
  "@rollup/rollup-darwin-x64",
@@ -4682,10 +4698,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4682
4698
  define: {
4683
4699
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
4684
4700
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
4685
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _63 => _63.env, 'optionalAccess', _64 => _64.public]) || {})
4701
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
4686
4702
  },
4687
4703
  plugins: [
4688
- _chunkP5HSJCXIcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4704
+ _chunkG6GNNB44cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4689
4705
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4690
4706
  ...rendererVitePlugins,
4691
4707
  ...config.vite.plugins || [],
@@ -4704,6 +4720,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4704
4720
  };
4705
4721
  }
4706
4722
  },
4723
+ farmServerOnlyEntriesPlugin(),
4707
4724
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
4708
4725
  _chunk22GUSVNJcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
4709
4726
  {
@@ -4744,7 +4761,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4744
4761
  resolve: {
4745
4762
  alias: [
4746
4763
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4747
- ...Object.entries(_chunkP5HSJCXIcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4764
+ ...Object.entries(_chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4748
4765
  ([find, replacement]) => ({ find, replacement })
4749
4766
  )
4750
4767
  ],
@@ -4752,7 +4769,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4752
4769
  dedupe: [...config.renderer.dedupe || []]
4753
4770
  }
4754
4771
  };
4755
- await viteBuild(_chunkP5HSJCXIcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4772
+ await viteBuild(_chunkG6GNNB44cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4756
4773
  } finally {
4757
4774
  if (postcssConfigDir) {
4758
4775
  try {
@@ -4769,15 +4786,15 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4769
4786
  }
4770
4787
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSRInMemory, "buildSSRInMemory");
4771
4788
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
4772
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _65 => _65.llmsTxt]);
4789
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _70 => _70.llmsTxt]);
4773
4790
  const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
4774
4791
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
4775
4792
  ), "ownedByFile");
4776
4793
  return [
4777
- ..._optionalChain([llmsTxt, 'optionalAccess', _66 => _66.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
4778
- ..._optionalChain([llmsTxt, 'optionalAccess', _67 => _67.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
4794
+ ..._optionalChain([llmsTxt, 'optionalAccess', _71 => _71.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
4795
+ ..._optionalChain([llmsTxt, 'optionalAccess', _72 => _72.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
4779
4796
  ...ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
4780
- ..._optionalChain([agent, 'optionalAccess', _68 => _68.crawlers, 'optionalAccess', _69 => _69.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
4797
+ ..._optionalChain([agent, 'optionalAccess', _73 => _73.crawlers, 'optionalAccess', _74 => _74.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
4781
4798
  ];
4782
4799
  }
4783
4800
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
@@ -4819,7 +4836,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
4819
4836
  }
4820
4837
  _chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
4821
4838
  function generateNativeAuthIntegrationSource(auth) {
4822
- if (_optionalChain([auth, 'optionalAccess', _70 => _70.enabled]) !== true) {
4839
+ if (_optionalChain([auth, 'optionalAccess', _75 => _75.enabled]) !== true) {
4823
4840
  return { importSource: "", registerSource: "" };
4824
4841
  }
4825
4842
  return {
@@ -4834,7 +4851,7 @@ function generateNativeAuthIntegrationSource(auth) {
4834
4851
  }
4835
4852
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateNativeAuthIntegrationSource, "generateNativeAuthIntegrationSource");
4836
4853
  function generateNativeMCPPluginSource(mcp) {
4837
- if (_optionalChain([mcp, 'optionalAccess', _71 => _71.enabled]) !== true) {
4854
+ if (_optionalChain([mcp, 'optionalAccess', _76 => _76.enabled]) !== true) {
4838
4855
  return { importSource: "", registerSource: "", pluginSource: "" };
4839
4856
  }
4840
4857
  return {
@@ -4963,8 +4980,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSo
4963
4980
  function parseRouteRenderingDirectiveFromDisk(modulePath) {
4964
4981
  try {
4965
4982
  const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
4966
- const directive = _chunkSO7CRMP6cjs.parseRouteRenderingDirective.call(void 0, source);
4967
- if (_chunkSO7CRMP6cjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
4983
+ const directive = _chunkDW34V5SMcjs.parseRouteRenderingDirective.call(void 0, source);
4984
+ if (_chunkDW34V5SMcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
4968
4985
  return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
4969
4986
  } catch (e22) {
4970
4987
  return void 0;
@@ -5087,14 +5104,14 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
5087
5104
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
5088
5105
  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) {
5089
5106
  const hasCompressionRuntime = config.compress && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5090
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _72 => _72.agent, 'optionalAccess', _73 => _73.crawlers, 'optionalAccess', _74 => _74.enabled])) && !applicationMetadataRoutes.some(
5107
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _77 => _77.agent, 'optionalAccess', _78 => _78.crawlers, 'optionalAccess', _79 => _79.enabled])) && !applicationMetadataRoutes.some(
5091
5108
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5092
5109
  );
5093
5110
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5094
5111
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5095
5112
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5096
5113
  const adapterOwnsDocsRuntime = Boolean(
5097
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _75 => _75.docs, 'optionalAccess', _76 => _76.enabled]) && _optionalChain([config, 'access', _77 => _77.docs, 'access', _78 => _78.adapter, 'optionalAccess', _79 => _79.server]) && config.docs.adapter.react
5114
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _80 => _80.docs, 'optionalAccess', _81 => _81.enabled]) && _optionalChain([config, 'access', _82 => _82.docs, 'access', _83 => _83.adapter, 'optionalAccess', _84 => _84.server]) && config.docs.adapter.react
5098
5115
  );
5099
5116
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5100
5117
  const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
@@ -5119,7 +5136,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5119
5136
  (image) => image.sourceType === "module"
5120
5137
  );
5121
5138
  const hasMiddlewareRuntime = middlewareRoutes.length > 0 || hasFarmMiddlewareConfig(config.middleware);
5122
- const farmDocsFontAssets = _optionalChain([config, 'access', _80 => _80.docs, 'optionalAccess', _81 => _81.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5139
+ const farmDocsFontAssets = _optionalChain([config, 'access', _85 => _85.docs, 'optionalAccess', _86 => _86.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5123
5140
  const integrationProviders = _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations);
5124
5141
  const renderedIntegrationProviders = integrationProviders.filter(
5125
5142
  (provider) => provider.component || provider.type === "clerk"
@@ -5129,16 +5146,16 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5129
5146
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5130
5147
  );
5131
5148
  }
5132
- const providerServerModules = _chunkP5HSJCXIcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5149
+ const providerServerModules = _chunkG6GNNB44cjs.generateFarmIntegrationProviderServerModules.call(void 0,
5133
5150
  renderedIntegrationProviders,
5134
5151
  config.root,
5135
5152
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5136
5153
  );
5137
5154
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5138
5155
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5139
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _82 => _82.providers]);
5156
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _87 => _87.providers]);
5140
5157
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5141
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _83 => _83.component]) === "function")) {
5158
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _88 => _88.component]) === "function")) {
5142
5159
  throw new Error(
5143
5160
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5144
5161
  );
@@ -5149,14 +5166,14 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5149
5166
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5150
5167
  (provider) => provider.supportsIsolatedHydration !== true
5151
5168
  );
5152
- const isolatedHydrationMode = _chunkP5HSJCXIcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5153
- _optionalChain([config, 'access', _84 => _84.experimental, 'optionalAccess', _85 => _85.isolatedClientHydration]),
5169
+ const isolatedHydrationMode = _chunkG6GNNB44cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5170
+ _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.isolatedClientHydration]),
5154
5171
  {
5155
- serverComponents: _optionalChain([config, 'access', _86 => _86.experimental, 'optionalAccess', _87 => _87.serverComponents]) === true,
5172
+ serverComponents: _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents]) === true,
5156
5173
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5157
5174
  }
5158
5175
  );
5159
- const hydrationPlanOptions = _chunkP5HSJCXIcjs.getFarmClientHydrationPlanOptions.call(void 0,
5176
+ const hydrationPlanOptions = _chunkG6GNNB44cjs.getFarmClientHydrationPlanOptions.call(void 0,
5160
5177
  config.renderer,
5161
5178
  Boolean(unsupportedIntegrationProvider)
5162
5179
  );
@@ -5171,7 +5188,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5171
5188
  hydrationPlanOptions
5172
5189
  )
5173
5190
  }));
5174
- const markdownPagePlan = _chunkP5HSJCXIcjs.createMarkdownPageHydrationPlanner.call(void 0,
5191
+ const markdownPagePlan = _chunkG6GNNB44cjs.createMarkdownPageHydrationPlanner.call(void 0,
5175
5192
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5176
5193
  config.root,
5177
5194
  isolatedHydrationMode,
@@ -5189,7 +5206,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5189
5206
  )
5190
5207
  ])
5191
5208
  );
5192
- _chunkP5HSJCXIcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5209
+ _chunkG6GNNB44cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5193
5210
  layoutHydrationPlans.map((layout) => ({
5194
5211
  pattern: layout.pattern,
5195
5212
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5217,7 +5234,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5217
5234
  apiRegistrations.push(`
5218
5235
  {
5219
5236
  path: ${JSON.stringify(route.path)},
5220
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _88 => _88.pluginMethods, 'optionalAccess', _89 => _89.includes, 'call', _90 => _90(method)])))},
5237
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _93 => _93.pluginMethods, 'optionalAccess', _94 => _94.includes, 'call', _95 => _95(method)])))},
5221
5238
  endpoints: ${varName},
5222
5239
  }`);
5223
5240
  });
@@ -5448,25 +5465,25 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5448
5465
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
5449
5466
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
5450
5467
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
5451
- const docsHandlerImport = _optionalChain([config, 'access', _91 => _91.docs, 'optionalAccess', _92 => _92.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5468
+ const docsHandlerImport = _optionalChain([config, 'access', _96 => _96.docs, 'optionalAccess', _97 => _97.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5452
5469
  const isFarmDocsAPIRequest = (requestOrPathname) => {
5453
5470
  const pathname = typeof requestOrPathname === "string"
5454
5471
  ? requestOrPathname
5455
5472
  : new URL(requestOrPathname.url).pathname;
5456
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _93 => _93.apiPath]) || "/api/docs")};
5473
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _98 => _98.apiPath]) || "/api/docs")};
5457
5474
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
5458
5475
  };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
5459
5476
  import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
5460
5477
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
5461
5478
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
5462
- const docsFontImport = _optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5463
- const docsRuntimeImport = _optionalChain([config, 'access', _96 => _96.docs, 'optionalAccess', _97 => _97.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5479
+ const docsFontImport = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5480
+ const docsRuntimeImport = _optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5464
5481
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5465
5482
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5466
- const markdownHandlerImport = _optionalChain([config, 'access', _98 => _98.md, 'optionalAccess', _99 => _99.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5483
+ const markdownHandlerImport = _optionalChain([config, 'access', _103 => _103.md, 'optionalAccess', _104 => _104.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5467
5484
  const appMarkdownImport = hasMarkdownPages ? `import { createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;";
5468
5485
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
5469
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _100 => _100.mdx, 'optionalAccess', _101 => _101.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5486
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _105 => _105.mdx, 'optionalAccess', _106 => _106.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5470
5487
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
5471
5488
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
5472
5489
  const layerConfigImports = layerConfigPaths.map(
@@ -5670,7 +5687,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5670
5687
 
5671
5688
  function FarmDefault404Page() {
5672
5689
  return React.createElement(React.Fragment, null,
5673
- React.createElement("style", null, ${JSON.stringify(_chunkP5HSJCXIcjs.DEFAULT_NOT_FOUND_STYLES)}),
5690
+ React.createElement("style", null, ${JSON.stringify(_chunkG6GNNB44cjs.DEFAULT_NOT_FOUND_STYLES)}),
5674
5691
  React.createElement("main", {
5675
5692
  className: "farm-default-not-found",
5676
5693
  "aria-labelledby": "farm-default-not-found-title",
@@ -5798,14 +5815,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
5798
5815
  onError(error) { console.error("[Farm Image]", error); },
5799
5816
  })`};
5800
5817
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
5801
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _102 => _102.agent, 'optionalAccess', _103 => _103.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
5818
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _107 => _107.agent, 'optionalAccess', _108 => _108.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
5802
5819
  ${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
5803
5820
  const farmMdxConfig = ${JSON.stringify({
5804
5821
  ...config.mdx,
5805
- components: typeof _optionalChain([config, 'access', _104 => _104.mdx, 'optionalAccess', _105 => _105.components]) === "string" ? config.mdx.components : void 0
5822
+ components: typeof _optionalChain([config, 'access', _109 => _109.mdx, 'optionalAccess', _110 => _110.components]) === "string" ? config.mdx.components : void 0
5806
5823
  })};
5807
5824
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
5808
- ${_optionalChain([config, 'access', _106 => _106.agent, 'optionalAccess', _107 => _107.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5825
+ ${_optionalChain([config, 'access', _111 => _111.agent, 'optionalAccess', _112 => _112.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5809
5826
  // environment this was built in, since Netlify exposes its deploy context only
5810
5827
  // to the build.
5811
5828
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -5853,7 +5870,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
5853
5870
  });
5854
5871
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
5855
5872
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
5856
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) && !hasPrecompiledDocs ? `(() => {
5873
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !hasPrecompiledDocs ? `(() => {
5857
5874
  try {
5858
5875
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
5859
5876
  const candidates = [
@@ -5874,7 +5891,7 @@ globalThis.__FARM_DOCS_RUNTIME_CONFIG__ = {
5874
5891
  docs: farmDocsResolvedConfig,
5875
5892
  };
5876
5893
  const farmDocsPrecompiledRuntime = ${hasPrecompiledDocs ? `createFarmDocsPrecompiledRuntime(${JSON.stringify(farmDocsPrecompiledManifest)})` : "null"};
5877
- const farmDocsHandler = ${_optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5894
+ const farmDocsHandler = ${_optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5878
5895
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
5879
5896
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
5880
5897
  docsPath: farmDocsResolvedConfig.entry,
@@ -5902,7 +5919,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _110 => _110.docs, '
5902
5919
  fontStylesheetHref: "/farm-fonts.css",
5903
5920
  globalStylesheetHref: "/assets/globals.css",
5904
5921
  })` : "null"};
5905
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _112 => _112.docs, 'optionalAccess', _113 => _113.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "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"};
5906
5923
 
5907
5924
  // API routes bundled at build time
5908
5925
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
@@ -7013,7 +7030,7 @@ function hasLocalRequestRoute(request, routePathname) {
7013
7030
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7014
7031
  return true;
7015
7032
  }
7016
- ${_optionalChain([config, 'access', _114 => _114.docs, 'optionalAccess', _115 => _115.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7033
+ ${_optionalChain([config, 'access', _119 => _119.docs, 'optionalAccess', _120 => _120.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7017
7034
  if (
7018
7035
  isFarmDocsAPIRequest(pathname) ||
7019
7036
  docsPath === "/" ||
@@ -7039,7 +7056,7 @@ function getFarmPluginRequestOptions(request) {
7039
7056
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7040
7057
  };
7041
7058
  }
7042
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7059
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7043
7060
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7044
7061
  pathname,
7045
7062
  method: request.method,
@@ -7129,7 +7146,7 @@ function getApplicableLayouts(pathname) {
7129
7146
  return applicable;
7130
7147
  }
7131
7148
 
7132
- ${_optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 => _119.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7149
+ ${_optionalChain([config, 'access', _123 => _123.docs, 'optionalAccess', _124 => _124.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7133
7150
  if (request.method === "HEAD") return response;
7134
7151
  if (response.headers.get("x-farm-docs-adapter")) return response;
7135
7152
 
@@ -7236,7 +7253,7 @@ ${_optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 =>
7236
7253
  }` : ""}
7237
7254
 
7238
7255
  const pprShellCache = getFarmDataCache();
7239
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _120 => _120.experimental, 'optionalAccess', _121 => _121.ppr]) === true)};
7256
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _125 => _125.experimental, 'optionalAccess', _126 => _126.ppr]) === true)};
7240
7257
 
7241
7258
  function resolveRouteRenderingView(route) {
7242
7259
  // The same merge development uses: baked directive config under the
@@ -7359,7 +7376,7 @@ async function handleFarmRequest(request, adapterContext) {
7359
7376
  },
7360
7377
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
7361
7378
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
7362
- ${_optionalChain([config, 'access', _122 => _122.md, 'optionalAccess', _123 => _123.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7379
+ ${_optionalChain([config, 'access', _127 => _127.md, 'optionalAccess', _128 => _128.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7363
7380
  if (matchPageRoute(pathname)) {
7364
7381
  // The Link header advertises the public .md URL, like the head alternate.
7365
7382
  return applyMarkdownNegotiationHeaders(response, {
@@ -7478,7 +7495,7 @@ async function handleFarmRequestInContext(
7478
7495
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
7479
7496
  `}
7480
7497
 
7481
- ${_optionalChain([config, 'access', _124 => _124.docs, 'optionalAccess', _125 => _125.enabled]) ? `
7498
+ ${_optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) ? `
7482
7499
  // Docs responses are served after app middleware so route guards and
7483
7500
  // middleware headers apply to the docs engine like any other page content.
7484
7501
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -7523,7 +7540,7 @@ async function handleFarmRequestInContext(
7523
7540
  }
7524
7541
  ` : ""}
7525
7542
 
7526
- ${_optionalChain([config, 'access', _126 => _126.md, 'optionalAccess', _127 => _127.enabled]) ? `
7543
+ ${_optionalChain([config, 'access', _131 => _131.md, 'optionalAccess', _132 => _132.enabled]) ? `
7527
7544
  if (farmMarkdownConfig?.enabled) {
7528
7545
  const markdownResponse = await createMarkdownMirrorResponse({
7529
7546
  // The mirror helper only reads metadata and creates its own GET request.
@@ -7626,11 +7643,11 @@ async function handleFarmRequestInContext(
7626
7643
  );
7627
7644
  }
7628
7645
  ` : ""}
7629
- ${_optionalChain([config, 'access', _128 => _128.agent, 'optionalAccess', _129 => _129.llmsTxt, 'optionalAccess', _130 => _130.enabled]) ? `
7646
+ ${_optionalChain([config, 'access', _133 => _133.agent, 'optionalAccess', _134 => _134.llmsTxt, 'optionalAccess', _135 => _135.enabled]) ? `
7630
7647
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
7631
7648
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
7632
7649
  ? "llms"
7633
- : ${_optionalChain([config, 'access', _131 => _131.agent, 'optionalAccess', _132 => _132.llmsTxt, 'optionalAccess', _133 => _133.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7650
+ : ${_optionalChain([config, 'access', _136 => _136.agent, 'optionalAccess', _137 => _137.llmsTxt, 'optionalAccess', _138 => _138.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7634
7651
  if (farmGeneratedLlmsKind) {
7635
7652
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
7636
7653
  const llmsBody = farmGeneratedLlmsKind === "llms-full"
@@ -7651,7 +7668,7 @@ async function handleFarmRequestInContext(
7651
7668
  }
7652
7669
  ` : ""}
7653
7670
 
7654
- ${_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7671
+ ${_optionalChain([config, 'access', _139 => _139.docs, 'optionalAccess', _140 => _140.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7655
7672
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
7656
7673
  if (docsAPIResponse) {
7657
7674
  return applyProductionMiddlewareHeaders(docsAPIResponse, middlewareHeaders);
@@ -8086,7 +8103,7 @@ async function handleFarmRequestInContext(
8086
8103
  );
8087
8104
  }
8088
8105
  }
8089
- ${_optionalChain([config, 'access', _136 => _136.md, 'optionalAccess', _137 => _137.enabled]) ? `
8106
+ ${_optionalChain([config, 'access', _141 => _141.md, 'optionalAccess', _142 => _142.enabled]) ? `
8090
8107
  // Advertise the Markdown mirror in the head as well as the Link header,
8091
8108
  // using the public path the .md request will be resolved against.
8092
8109
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8094,7 +8111,7 @@ async function handleFarmRequestInContext(
8094
8111
  getFarmMarkdownAlternatePath(farmMarkdownConfig, pathname),
8095
8112
  );` : ""}
8096
8113
 
8097
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.jsonLd]), () => ( false)))} });
8114
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.jsonLd]), () => ( false)))} });
8098
8115
  const title = renderedMetadata.title;
8099
8116
  const metaTags = renderedMetadata.tags;
8100
8117
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -8709,11 +8726,11 @@ ${generatePreloadResponseRuntimeSource()}
8709
8726
 
8710
8727
  // Export as Web Standard fetch API
8711
8728
  export async function fetch(request, context) {
8712
- ${_optionalChain([config, 'access', _140 => _140.agent, 'optionalAccess', _141 => _141.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8729
+ ${_optionalChain([config, 'access', _145 => _145.agent, 'optionalAccess', _146 => _146.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8713
8730
  basePath: farmLocalAPIBasePath,
8714
8731
  dispatch: async (localRequest) =>
8715
8732
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
8716
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _142 => _142.agent, 'optionalAccess', _143 => _143.noindexPreviews]) ? `
8733
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.noindexPreviews]) ? `
8717
8734
  // Keep every response of a preview deployment out of search indexes.
8718
8735
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
8719
8736
  }
@@ -8856,7 +8873,7 @@ function configMiddlewareMayHandlePath(config, pathname) {
8856
8873
  if (!hasFarmMiddlewareConfig(config)) return false;
8857
8874
  const entries = Array.isArray(config) ? config : [config];
8858
8875
  return entries.some((entry) => {
8859
- if (_optionalChain([entry, 'access', _144 => _144.exclude, 'optionalAccess', _145 => _145.some, 'call', _146 => _146((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8876
+ if (_optionalChain([entry, 'access', _149 => _149.exclude, 'optionalAccess', _150 => _150.some, 'call', _151 => _151((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8860
8877
  return false;
8861
8878
  }
8862
8879
  if (!entry.matcher) return true;
@@ -8912,11 +8929,11 @@ function getPhysicalPrerenderBypassReason(options) {
8912
8929
  }
8913
8930
  if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
8914
8931
  if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
8915
- if (_chunkGXXONIARcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8932
+ if (_chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8916
8933
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
8917
8934
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
8918
- if (_optionalChain([manifestEntry, 'optionalAccess', _147 => _147.rendering]) === "dynamic") return "dynamic runtime manifest";
8919
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _148 => _148.regions, 'optionalAccess', _149 => _149.length])) || manifestEntry.maxDuration !== void 0)) {
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)) {
8920
8937
  return "route runtime controls";
8921
8938
  }
8922
8939
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -8938,7 +8955,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
8938
8955
  const nitroBuilder = nitroBuilderResult.value;
8939
8956
  const isVercel = preset === "vercel" || preset === "vercel-edge";
8940
8957
  const isCloudflareWorker = preset === "cloudflare-module";
8941
- const outputDir = _chunkGXXONIARcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8958
+ const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8942
8959
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
8943
8960
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
8944
8961
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -8960,9 +8977,9 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
8960
8977
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
8961
8978
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
8962
8979
  const ssgCollectionPromise = routeManager.collectSSGPages();
8963
- const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config));
8980
+ const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config));
8964
8981
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
8965
- const farmWorkflows = await _chunkK6FNHVDRcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
8982
+ const farmWorkflows = await _chunkMPEYMSCFcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
8966
8983
  const farmCron = await _chunk6EXBPJ24cjs.prepareFarmCronForNitro.call(void 0, config);
8967
8984
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
8968
8985
  ssgCollectionPromise,
@@ -9269,25 +9286,18 @@ export default async function farmNitroEventHandler(event) {
9269
9286
  snapshotSSRRebundleOptions(nitroConfig)
9270
9287
  );
9271
9288
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
9272
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _150 => _150.rollupConfig, 'optionalAccess', _151 => _151.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _152 => _152.rollupConfig, 'optionalAccess', _153 => _153.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _154 => _154.output, 'optionalAccess', _155 => _155.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9273
- _optionalChain([nitroConfig, 'access', _156 => _156.handlers, 'optionalAccess', _157 => _157.some, 'call', _158 => _158(
9274
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _159 => _159.handler]) || "") === nitroEntryPath
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
9275
9292
  )])
9276
9293
  );
9277
9294
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
9278
9295
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
9279
9296
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
9280
9297
  const shouldMinify = nitroConfig.minify !== false;
9281
- const configuredEsbuildOptions = {};
9282
- const resolvedEsbuildOptions = {
9283
- // Function-name helpers are unsafe for provider scripts that serialize a
9284
- // function with toString(); the helper is outside the emitted script scope.
9285
- keepNames: !(_optionalChain([config, 'access', _160 => _160.docs, 'optionalAccess', _161 => _161.enabled]) && _optionalChain([config, 'access', _162 => _162.docs, 'access', _163 => _163.adapter, 'optionalAccess', _164 => _164.server])),
9286
- legalComments: "none"
9287
- };
9288
- const prebuiltSSREsbuildOptions = _optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) && _optionalChain([config, 'access', _167 => _167.docs, 'access', _168 => _168.adapter, 'optionalAccess', _169 => _169.server]) ? resolvedEsbuildOptions : configuredEsbuildOptions;
9289
- const useFarmEsbuildMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9290
- const esbuildChunkMinifier = useFarmEsbuildMinifier ? createEsbuildChunkMinifyPlugin(resolvedEsbuildOptions) : null;
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]));
9299
+ const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9300
+ const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
9291
9301
  if (canReusePrebuiltSSR) {
9292
9302
  const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _170 => _170.rollupConfig, 'optionalAccess', _171 => _171.plugins]);
9293
9303
  nitroConfig.rollupConfig = {
@@ -9298,7 +9308,7 @@ export default async function farmNitroEventHandler(event) {
9298
9308
  ]
9299
9309
  };
9300
9310
  }
9301
- nitroConfig.minify = useFarmEsbuildMinifier ? false : shouldMinify;
9311
+ nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
9302
9312
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
9303
9313
  if (config.security.csp && config.security.csp.nonce) {
9304
9314
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
@@ -9348,26 +9358,25 @@ export default async function farmNitroEventHandler(event) {
9348
9358
  await copyPrebuiltSSRBundle(
9349
9359
  ssrBundle,
9350
9360
  _path2.default.join(prerenderServerDir, FARM_SSR_OUTPUT_DIR),
9351
- {},
9352
- false,
9361
+ null,
9353
9362
  fs
9354
9363
  );
9355
9364
  await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs);
9356
9365
  });
9357
9366
  });
9358
9367
  }
9359
- if (esbuildChunkMinifier || useRolldownBuilder) {
9368
+ if (serverChunkMinifier || useRolldownBuilder) {
9360
9369
  nitroInstance.hooks.hook("rollup:before", (_nitro, rollupConfig) => {
9361
9370
  if (useRolldownBuilder) {
9362
9371
  const rolldownConfig = rollupConfig;
9363
9372
  delete rolldownConfig.inject;
9364
9373
  delete rolldownConfig.jsx;
9365
9374
  }
9366
- if (esbuildChunkMinifier) {
9375
+ if (serverChunkMinifier) {
9367
9376
  const configuredPlugins = rollupConfig.plugins;
9368
9377
  rollupConfig.plugins = [
9369
9378
  ...Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [],
9370
- esbuildChunkMinifier
9379
+ serverChunkMinifier
9371
9380
  ];
9372
9381
  }
9373
9382
  });
@@ -9414,8 +9423,7 @@ export default async function farmNitroEventHandler(event) {
9414
9423
  canReusePrebuiltSSR ? copyPrebuiltSSRBundle(
9415
9424
  ssrBundle,
9416
9425
  _path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
9417
- prebuiltSSREsbuildOptions,
9418
- shouldMinify,
9426
+ shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null,
9419
9427
  fs
9420
9428
  ) : Promise.resolve(),
9421
9429
  runtimeCopyPromise
@@ -9459,23 +9467,7 @@ function resolveFarmNitroOutputConfig(preset, outputDir) {
9459
9467
  };
9460
9468
  }
9461
9469
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNitroOutputConfig, "resolveFarmNitroOutputConfig");
9462
- async function copyPrebuiltSSRBundle(ssrBundle, targetDir, configuredEsbuildOptions, minify, fs) {
9463
- const {
9464
- include: _include,
9465
- exclude: _exclude,
9466
- sourceMap: _sourceMap,
9467
- loaders: _loaders,
9468
- ...configuredTransformOptions
9469
- } = configuredEsbuildOptions;
9470
- const hasConfiguredTransforms = Object.keys(configuredTransformOptions).some(
9471
- (option) => option !== "minify"
9472
- );
9473
- const transformOptions = createEsbuildTransformOptions(
9474
- configuredEsbuildOptions,
9475
- minify,
9476
- "node18"
9477
- );
9478
- const transform = minify || hasConfiguredTransforms ? (await import("esbuild")).transform : null;
9470
+ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs) {
9479
9471
  await fs.rm(targetDir, { recursive: true, force: true });
9480
9472
  await Promise.all(
9481
9473
  Object.entries(ssrBundle).map(async ([fileName, output]) => {
@@ -9485,14 +9477,7 @@ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, configuredEsbuildOpti
9485
9477
  await fs.writeFile(targetPath, output.source);
9486
9478
  return;
9487
9479
  }
9488
- let code = output.code;
9489
- if (transform) {
9490
- const result = await transform(code, {
9491
- ...transformOptions,
9492
- sourcefile: fileName
9493
- });
9494
- code = result.code;
9495
- }
9480
+ const code = minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code;
9496
9481
  await fs.writeFile(targetPath, code);
9497
9482
  })
9498
9483
  );
@@ -9564,7 +9549,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
9564
9549
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
9565
9550
  runtimeRoutes
9566
9551
  });
9567
- const vercelConfigWithWorkflowCrons = _chunkK6FNHVDRcjs.applyFarmWorkflowVercelCrons.call(void 0,
9552
+ const vercelConfigWithWorkflowCrons = _chunkMPEYMSCFcjs.applyFarmWorkflowVercelCrons.call(void 0,
9568
9553
  vercelConfig,
9569
9554
  farmWorkflows.workflows
9570
9555
  );
@@ -9580,7 +9565,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9580
9565
  const docsContentDir = resolveBuildDocsContentDir(config, root);
9581
9566
  if (!docsContentDir) return;
9582
9567
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
9583
- const lastModifiedManifest = _chunkNBAHDVOJcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9568
+ const lastModifiedManifest = _chunkLYM7HY34cjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9584
9569
  fallback: "now"
9585
9570
  });
9586
9571
  await fs.rm(bundledContentDir, { recursive: true, force: true });
@@ -9590,7 +9575,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9590
9575
  force: true
9591
9576
  });
9592
9577
  await fs.writeFile(
9593
- _path2.default.join(bundledContentDir, _chunkNBAHDVOJcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9578
+ _path2.default.join(bundledContentDir, _chunkLYM7HY34cjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9594
9579
  `${JSON.stringify(lastModifiedManifest, null, 2)}
9595
9580
  `
9596
9581
  );
@@ -9667,9 +9652,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
9667
9652
  try {
9668
9653
  await copyPackage("sharp", sharpRequire);
9669
9654
  if (!copiedPackages.has("sharp")) {
9670
- throw new Error(
9671
- "Farm image optimization requires sharp. Reinstall dependencies without omitting optional packages."
9672
- );
9655
+ throw new Error(`Farm image optimization requires sharp. ${_chunkG6GNNB44cjs.SHARP_INSTALL_HINT}`);
9673
9656
  }
9674
9657
  } catch (error) {
9675
9658
  await fs.rm(stageDir, { recursive: true, force: true });
@@ -9741,22 +9724,29 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs) {
9741
9724
  );
9742
9725
  }
9743
9726
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeStagedDirectory, "mergeStagedDirectory");
9744
- async function copyMetadataImageRuntime(root, nitroFuncDir, fs) {
9727
+ function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
9728
+ const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
9729
+ if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
9730
+ const file = generated.modulePath ? _chunk5QIKR7RRcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
9731
+ throw new Error(
9732
+ `${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkLYLEZIG3cjs.VERCEL_OG_INSTALL_HINT}`
9733
+ );
9734
+ }
9735
+ _chunkS3JO3N4Hcjs.__name.call(void 0, assertMetadataImageRuntimeInstalled, "assertMetadataImageRuntimeInstalled");
9736
+ function resolveMetadataImageRuntimePackageJson(root) {
9745
9737
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
9746
- let runtimeRequire = projectRequire;
9747
- let packageJsonPath = resolvePackageJson(runtimeRequire, "@vercel/og");
9748
- if (!packageJsonPath) {
9749
- try {
9750
- runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
9751
- packageJsonPath = resolvePackageJson(runtimeRequire, "@vercel/og");
9752
- } catch (e24) {
9753
- }
9754
- }
9755
- if (!packageJsonPath) {
9756
- throw new Error(
9757
- "Generated metadata images require @vercel/og. Reinstall @farm.js/core with production dependencies."
9758
- );
9738
+ const packageJsonPath = resolvePackageJson(projectRequire, "@vercel/og");
9739
+ if (packageJsonPath) return packageJsonPath;
9740
+ try {
9741
+ return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
9742
+ } catch (e24) {
9743
+ return null;
9759
9744
  }
9745
+ }
9746
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveMetadataImageRuntimePackageJson, "resolveMetadataImageRuntimePackageJson");
9747
+ async function copyMetadataImageRuntime(root, nitroFuncDir, fs) {
9748
+ const packageJsonPath = resolveMetadataImageRuntimePackageJson(root);
9749
+ if (!packageJsonPath) return;
9760
9750
  const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
9761
9751
  const packageDir = _path2.default.dirname(packageJsonPath);
9762
9752
  const targetDir = _path2.default.join(nitroFuncDir, "node_modules", "@vercel", "og");
@@ -9876,7 +9866,7 @@ function createBuildTargetBaseline(config) {
9876
9866
  preset,
9877
9867
  distDir,
9878
9868
  outputDir,
9879
- outputWasDerived: outputDir === _chunkGXXONIARcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9869
+ outputWasDerived: outputDir === _chunkDNLQMFERcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9880
9870
  };
9881
9871
  }
9882
9872
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -9886,8 +9876,8 @@ function resolveBuildTargets(config, options, baseline) {
9886
9876
  const distDir = config.distDir || ".farm";
9887
9877
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
9888
9878
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
9889
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkGXXONIARcjs.getDeployTargetForPreset.call(void 0, preset);
9890
- const outputDir = shouldRefreshDerivedOutput ? _chunkGXXONIARcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
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;
9891
9881
  return {
9892
9882
  root,
9893
9883
  preset,
@@ -9895,7 +9885,7 @@ function resolveBuildTargets(config, options, baseline) {
9895
9885
  distDir,
9896
9886
  deployTarget,
9897
9887
  outputDir,
9898
- deployOutputDir: _chunkGXXONIARcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9888
+ deployOutputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9899
9889
  };
9900
9890
  }
9901
9891
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -9904,7 +9894,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9904
9894
  const targetBaseline = createBuildTargetBaseline(config);
9905
9895
  let targets;
9906
9896
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
9907
- const pluginManager = new (0, _chunkP5HSJCXIcjs.PluginManager)({
9897
+ const pluginManager = new (0, _chunkG6GNNB44cjs.PluginManager)({
9908
9898
  config,
9909
9899
  isDev: false,
9910
9900
  isProd: true
@@ -9931,6 +9921,14 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9931
9921
  outputDir: targets.outputDir
9932
9922
  }
9933
9923
  };
9924
+ config = {
9925
+ ...config,
9926
+ images: _chunkG6GNNB44cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
9927
+ root: targets.root,
9928
+ preset: targets.preset
9929
+ })
9930
+ };
9931
+ if (_optionalChain([config, 'access', _179 => _179.docs, 'optionalAccess', _180 => _180.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
9934
9932
  pluginManager.updateContext({ config });
9935
9933
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
9936
9934
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -9944,8 +9942,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9944
9942
  });
9945
9943
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
9946
9944
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
9947
- if (_optionalChain([productionViteResult, 'optionalAccess', _179 => _179.status]) === "rejected") throw productionViteResult.reason;
9948
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _180 => _180.value]);
9945
+ if (_optionalChain([productionViteResult, 'optionalAccess', _181 => _181.status]) === "rejected") throw productionViteResult.reason;
9946
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _182 => _182.value]);
9949
9947
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
9950
9948
  projectModuleServer = await createProjectModuleServer(
9951
9949
  createViteServer,
@@ -9953,18 +9951,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9953
9951
  root,
9954
9952
  rendererBuild.signal
9955
9953
  );
9956
- const farmApp = _chunkP5HSJCXIcjs.createFarmApp.call(void 0, config, projectModuleServer);
9954
+ const farmApp = _chunkG6GNNB44cjs.createFarmApp.call(void 0, config, projectModuleServer);
9957
9955
  await farmApp.initialize();
9958
9956
  const routeManager = farmApp.getRouteManager();
9959
9957
  const serverRenderer = farmApp.getServerRenderer();
9960
- const typeArtifacts = _chunkSO7CRMP6cjs.generateFarmTypeArtifacts.call(void 0, {
9958
+ const typeArtifacts = _chunkDW34V5SMcjs.generateFarmTypeArtifacts.call(void 0, {
9961
9959
  root,
9962
9960
  srcDir,
9963
9961
  layers: config.layers,
9964
9962
  plugins: config.plugins,
9965
9963
  extraRoutes: [
9966
- ..._optionalChain([config, 'access', _181 => _181.openapi, 'optionalAccess', _182 => _182.enabled]) && config.openapi.route ? [config.openapi.route] : [],
9967
- ..._chunkNBAHDVOJcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
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)
9968
9966
  ],
9969
9967
  suppressLintOnLink: config.suppressLintOnLink,
9970
9968
  componentExtensions: config.renderer.componentExtensions,
@@ -9973,8 +9971,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9973
9971
  const message = error instanceof Error ? error.message : String(error);
9974
9972
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
9975
9973
  });
9976
- const apiRouteManager = new (0, _chunkB3WK4DTXcjs.APIRouteManager)(
9977
- _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config),
9974
+ const apiRouteManager = new (0, _chunkIMBMOEWTcjs.APIRouteManager)(
9975
+ _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config),
9978
9976
  projectModuleServer,
9979
9977
  {
9980
9978
  throwOnLoadError: true,
@@ -10048,7 +10046,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10048
10046
  throw error;
10049
10047
  } finally {
10050
10048
  try {
10051
- await _optionalChain([projectModuleServer, 'optionalAccess', _183 => _183.close, 'call', _184 => _184()]);
10049
+ await _optionalChain([projectModuleServer, 'optionalAccess', _185 => _185.close, 'call', _186 => _186()]);
10052
10050
  } finally {
10053
10051
  rendererBuild.abort();
10054
10052
  }
@@ -10060,7 +10058,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10060
10058
  ssr: true,
10061
10059
  buildLifetime
10062
10060
  });
10063
- const viteConfig = _chunkP5HSJCXIcjs.mergeFarmViteConfig.call(void 0,
10061
+ const viteConfig = _chunkG6GNNB44cjs.mergeFarmViteConfig.call(void 0,
10064
10062
  {
10065
10063
  root,
10066
10064
  appType: "custom",
@@ -10072,7 +10070,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10072
10070
  },
10073
10071
  plugins: [
10074
10072
  ...rendererVitePlugins,
10075
- _chunkP5HSJCXIcjs.farmFontImportsPlugin.call(void 0, {
10073
+ _chunkG6GNNB44cjs.farmFontImportsPlugin.call(void 0, {
10076
10074
  root,
10077
10075
  basePath: config.basePath,
10078
10076
  publicDir: config.publicDir
@@ -10084,7 +10082,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10084
10082
  hmr: false
10085
10083
  },
10086
10084
  resolve: {
10087
- alias: _chunkP5HSJCXIcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10085
+ alias: _chunkG6GNNB44cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10088
10086
  dedupe: [...config.renderer.dedupe || []]
10089
10087
  },
10090
10088
  optimizeDeps: {
@@ -10170,7 +10168,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10170
10168
  define: {
10171
10169
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
10172
10170
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
10173
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _185 => _185.env, 'optionalAccess', _186 => _186.public]) || {})
10171
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _187 => _187.env, 'optionalAccess', _188 => _188.public]) || {})
10174
10172
  },
10175
10173
  plugins: [
10176
10174
  farmI18nClientBridgePlugin(),
@@ -10192,7 +10190,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
10192
10190
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveLegacyPageEntry, "resolveLegacyPageEntry");
10193
10191
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
10194
10192
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
10195
- import("./nitro-TSGDUJMN.cjs"),
10193
+ import("./nitro-KQDU7CFE.cjs"),
10196
10194
  import("nitro/builder")
10197
10195
  ]);
10198
10196
  let nitroConfig = await createNitroConfig(
@@ -10205,7 +10203,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10205
10203
  if (pluginManager) {
10206
10204
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
10207
10205
  }
10208
- const outputDir = _chunkGXXONIARcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10206
+ const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10209
10207
  const serverOutputDir = _path2.default.join(outputDir, "server");
10210
10208
  const publicOutputDir = _path2.default.join(outputDir, "public");
10211
10209
  const { mkdir, cp } = await import("fs/promises");
@@ -10276,7 +10274,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10276
10274
  root,
10277
10275
  preset,
10278
10276
  distDir,
10279
- outputDir: _chunkGXXONIARcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10277
+ outputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10280
10278
  });
10281
10279
  }
10282
10280
  }