@farm.js/core 0.1.21 → 0.1.23

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 (156) 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-DAyPE-gr.d.ts → app-BV-7wV5q.d.ts} +10 -3
  12. package/dist/{app-D_6nTit-.d.mts → app-BZDWwwFa.d.mts} +10 -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-RWXZKZXB.cjs → chunk-4DKZ6JR3.cjs} +302 -339
  19. package/dist/{chunk-PUCUVI7K.mjs → chunk-72VJRKJD.mjs} +1 -1
  20. package/dist/{chunk-5L6NBNHI.mjs → chunk-7LU4IOXQ.mjs} +156 -193
  21. package/dist/{chunk-RMIJFZU3.mjs → chunk-BDJNP7AQ.mjs} +10 -14
  22. package/dist/{chunk-OLYK7EAK.mjs → chunk-DAATZTKJ.mjs} +14 -0
  23. package/dist/{chunk-YP5JZ4LF.cjs → chunk-DNLQMFER.cjs} +15 -19
  24. package/dist/{chunk-XFFQSD2F.cjs → chunk-DW34V5SM.cjs} +7 -7
  25. package/dist/{chunk-PKO4FCTL.mjs → chunk-EHUZ2MKO.mjs} +1 -1
  26. package/dist/{chunk-3NM6SRI6.mjs → chunk-F3VB7ONA.mjs} +10 -8
  27. package/dist/{chunk-L7ARWZYT.cjs → chunk-III667SJ.cjs} +496 -303
  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-ZE6ONQ5R.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-TFAXUHWX.cjs → chunk-PSV6XKPO.cjs} +15 -1
  38. package/dist/{chunk-BHJUZ64B.cjs → chunk-QTBEAKCJ.cjs} +7 -7
  39. package/dist/{chunk-J6JRB2ER.mjs → chunk-S67OYZU7.mjs} +1 -1
  40. package/dist/chunk-SFGWNC43.mjs +97 -0
  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-53G3OLTA.mjs → chunk-VPY755R2.mjs} +256 -63
  45. package/dist/{chunk-NRS46D4L.mjs → chunk-VVJCWBIE.mjs} +3 -3
  46. package/dist/{chunk-Q2TUENW2.cjs → chunk-VXCA7RZP.cjs} +1 -1
  47. package/dist/{chunk-CQHFU55R.mjs → chunk-WNUBR4CA.mjs} +5 -1
  48. package/dist/{chunk-CIAGU2X4.cjs → chunk-XSIRSMAS.cjs} +10 -8
  49. package/dist/{chunk-W7MZXRXM.mjs → chunk-YGMK6ESJ.mjs} +20 -30
  50. package/dist/chunk-YOZYCI6Z.mjs +73 -0
  51. package/dist/{chunk-HLCDYJY7.mjs → chunk-YQVSHTMR.mjs} +20 -1
  52. package/dist/{chunk-F5D4XEAS.mjs → chunk-ZZSRYEYU.mjs} +7 -8
  53. package/dist/{client-plugins-CWrhb1ir.d.mts → client-plugins-B_XzCegf.d.mts} +11 -9
  54. package/dist/{client-plugins-DPf0qZey.d.ts → client-plugins-CKsXQfXY.d.ts} +11 -9
  55. package/dist/client-plugins.d.mts +3 -2
  56. package/dist/client-plugins.d.ts +3 -2
  57. package/dist/client.d.mts +7 -6
  58. package/dist/client.d.ts +7 -6
  59. package/dist/config.d.mts +3 -2
  60. package/dist/config.d.ts +3 -2
  61. package/dist/{devtools-MTB5SA2B.mjs → devtools-OY4SNU3P.mjs} +5 -4
  62. package/dist/{devtools-R6MDDAZK.cjs → devtools-UHRSZ7VA.cjs} +6 -5
  63. package/dist/docs.cjs +10 -7
  64. package/dist/docs.mjs +9 -6
  65. package/dist/index.cjs +24 -21
  66. package/dist/index.d.mts +14 -13
  67. package/dist/index.d.ts +14 -13
  68. package/dist/index.mjs +19 -16
  69. package/dist/instrumentation.cjs +3 -2
  70. package/dist/instrumentation.mjs +2 -1
  71. package/dist/integrations.d.mts +3 -2
  72. package/dist/integrations.d.ts +3 -2
  73. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  74. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  75. package/dist/internal/build-runtime.cjs +18 -15
  76. package/dist/internal/build-runtime.d.mts +5 -4
  77. package/dist/internal/build-runtime.d.ts +5 -4
  78. package/dist/internal/build-runtime.mjs +17 -14
  79. package/dist/internal/cli-runtime.cjs +11 -8
  80. package/dist/internal/cli-runtime.mjs +10 -7
  81. package/dist/internal/client-error-overlay.cjs +4 -4
  82. package/dist/internal/client-error-overlay.mjs +1 -1
  83. package/dist/internal/compression-runtime.d.mts +3 -2
  84. package/dist/internal/compression-runtime.d.ts +3 -2
  85. package/dist/internal/config-runtime.cjs +6 -5
  86. package/dist/internal/config-runtime.d.mts +4 -3
  87. package/dist/internal/config-runtime.d.ts +4 -3
  88. package/dist/internal/config-runtime.mjs +5 -4
  89. package/dist/internal/metadata-image-runtime.cjs +3 -2
  90. package/dist/internal/metadata-image-runtime.mjs +2 -1
  91. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  92. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  93. package/dist/internal/production-runtime.d.mts +9 -8
  94. package/dist/internal/production-runtime.d.ts +9 -8
  95. package/dist/layers-4PNE2HOY.cjs +18 -0
  96. package/dist/{layers-CJKSJGLN.mjs → layers-BRQF5ETU.mjs} +2 -1
  97. package/dist/{manager-NPG43N46.mjs → manager-RT733VRK.mjs} +2 -2
  98. package/dist/{manager-G4B2IPYE.cjs → manager-XZ5TX7AO.cjs} +3 -3
  99. package/dist/{metadata-CO9fRyyJ.d.mts → metadata-B08w4EYV.d.mts} +1 -1
  100. package/dist/{metadata-zY9wltwH.d.ts → metadata-IQEblkZp.d.ts} +1 -1
  101. package/dist/middleware.d.mts +5 -4
  102. package/dist/middleware.d.ts +5 -4
  103. package/dist/navigation.d.mts +6 -5
  104. package/dist/navigation.d.ts +6 -5
  105. package/dist/{nitro-TSGDUJMN.cjs → nitro-KQDU7CFE.cjs} +2 -2
  106. package/dist/{nitro-4LFVTT24.mjs → nitro-ZKLGOTVY.mjs} +1 -1
  107. package/dist/node-module-bundle-L5L7JCZ4.mjs +11 -0
  108. package/dist/node-module-bundle-VAFZOXMJ.cjs +11 -0
  109. package/dist/plugin.cjs +12 -10
  110. package/dist/plugin.d.mts +3 -2
  111. package/dist/plugin.d.ts +3 -2
  112. package/dist/plugin.mjs +11 -9
  113. package/dist/{production-runtime-CywsHwnG.d.mts → production-runtime-C3bGFEaM.d.mts} +1 -1
  114. package/dist/{production-runtime-lkfwujwK.d.ts → production-runtime-DRSOkc-d.d.ts} +1 -1
  115. package/dist/{render-plan-LVy6sGQe.d.mts → render-plan-B6CKNl4e.d.mts} +1 -1
  116. package/dist/{render-plan-DHF0GeWo.d.ts → render-plan-CCFuMLNS.d.ts} +1 -1
  117. package/dist/renderer-client.d.mts +5 -4
  118. package/dist/renderer-client.d.ts +5 -4
  119. package/dist/renderer.cjs +4 -2
  120. package/dist/renderer.d.mts +9 -1
  121. package/dist/renderer.d.ts +9 -1
  122. package/dist/renderer.mjs +3 -1
  123. package/dist/{request-6AkmhEYE.d.mts → request-DgD1XsTx.d.mts} +1 -1
  124. package/dist/{request-BYxlRqA9.d.ts → request-Dn6VURbE.d.ts} +1 -1
  125. package/dist/request.d.mts +4 -3
  126. package/dist/request.d.ts +4 -3
  127. package/dist/{route-rendering-Dd8Jmml7.d.mts → route-rendering-76A5I_kE.d.mts} +1 -1
  128. package/dist/{route-rendering-CWaKiUbS.d.ts → route-rendering-LAmQEdyG.d.ts} +1 -1
  129. package/dist/{router-B2m4fvve.d.ts → router-BSOOGya2.d.ts} +1 -1
  130. package/dist/{router-xwEE112q.d.mts → router-CnrRSa9d.d.mts} +1 -1
  131. package/dist/routes.d.mts +3 -2
  132. package/dist/routes.d.ts +3 -2
  133. package/dist/server-plugins.d.mts +4 -3
  134. package/dist/server-plugins.d.ts +4 -3
  135. package/dist/server.cjs +43 -36
  136. package/dist/server.d.mts +9 -8
  137. package/dist/server.d.ts +9 -8
  138. package/dist/server.mjs +27 -20
  139. package/dist/{spa-router-Y8rrXTVK.d.ts → spa-router-BMrSsG5b.d.ts} +2 -2
  140. package/dist/{spa-router-DVEHQnWo.d.mts → spa-router-DnYhWCvI.d.mts} +2 -2
  141. package/dist/testing.cjs +2 -1
  142. package/dist/testing.d.mts +3 -2
  143. package/dist/testing.d.ts +3 -2
  144. package/dist/testing.mjs +2 -1
  145. package/dist/{utils-DSPx34-A.d.mts → utils-ABkktwku.d.mts} +1 -1
  146. package/dist/{utils-Dvuny_08.d.ts → utils-C3GguS-Q.d.ts} +1 -1
  147. package/dist/version.cjs +2 -2
  148. package/dist/version.mjs +1 -1
  149. package/dist/vite.cjs +12 -10
  150. package/dist/vite.d.mts +3 -2
  151. package/dist/vite.d.ts +3 -2
  152. package/dist/vite.mjs +11 -9
  153. package/dist/workflows.cjs +2 -2
  154. package/dist/workflows.mjs +1 -1
  155. package/package.json +27 -13
  156. package/dist/layers-E4WPJNY5.cjs +0 -17
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkXFFQSD2Fcjs = require('./chunk-XFFQSD2F.cjs');
9
+ var _chunkDW34V5SMcjs = require('./chunk-DW34V5SM.cjs');
10
10
 
11
11
 
12
12
 
@@ -30,7 +30,7 @@ var _chunkOYDRPBBVcjs = require('./chunk-OYDRPBBV.cjs');
30
30
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
31
31
 
32
32
 
33
- var _chunkTKNSDBBNcjs = require('./chunk-TKNSDBBN.cjs');
33
+ var _chunkK3F2E6GScjs = require('./chunk-K3F2E6GS.cjs');
34
34
 
35
35
 
36
36
  var _chunkFXUUWYAXcjs = require('./chunk-FXUUWYAX.cjs');
@@ -74,7 +74,7 @@ var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkY4YMF2NQcjs = require('./chunk-Y4YMF2NQ.cjs');
77
+ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
78
78
 
79
79
 
80
80
 
@@ -87,7 +87,8 @@ var _chunkY4YMF2NQcjs = require('./chunk-Y4YMF2NQ.cjs');
87
87
 
88
88
 
89
89
 
90
- var _chunkTFAXUHWXcjs = require('./chunk-TFAXUHWX.cjs');
90
+
91
+ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
91
92
 
92
93
 
93
94
 
@@ -143,7 +144,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
143
144
  var _chunkBBVSJVBZcjs = require('./chunk-BBVSJVBZ.cjs');
144
145
 
145
146
 
146
- var _chunkK6FNHVDRcjs = require('./chunk-K6FNHVDR.cjs');
147
+ var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
147
148
 
148
149
 
149
150
  var _chunk4ZFL5GFNcjs = require('./chunk-4ZFL5GFN.cjs');
@@ -181,7 +182,7 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
181
182
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
182
183
 
183
184
 
184
- var _chunkB3WK4DTXcjs = require('./chunk-B3WK4DTX.cjs');
185
+ var _chunkIMBMOEWTcjs = require('./chunk-IMBMOEWT.cjs');
185
186
 
186
187
 
187
188
 
@@ -194,6 +195,12 @@ var _chunkN4RLRSWWcjs = require('./chunk-N4RLRSWW.cjs');
194
195
  var _chunkUJ2C4ICScjs = require('./chunk-UJ2C4ICS.cjs');
195
196
 
196
197
 
198
+
199
+
200
+
201
+ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
202
+
203
+
197
204
  var _chunk4PNUXIVUcjs = require('./chunk-4PNUXIVU.cjs');
198
205
 
199
206
 
@@ -264,7 +271,7 @@ var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
264
271
  var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
265
272
 
266
273
 
267
- var _chunkQ2TUENW2cjs = require('./chunk-Q2TUENW2.cjs');
274
+ var _chunkVXCA7RZPcjs = require('./chunk-VXCA7RZP.cjs');
268
275
 
269
276
 
270
277
 
@@ -347,7 +354,7 @@ var _chunkNO3WWW3Ncjs = require('./chunk-NO3WWW3N.cjs');
347
354
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
348
355
 
349
356
  // src/routing/route-manager.ts
350
- var _path = require('path'); var path9 = _interopRequireWildcard(_path); var path4 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path); var path16 = _interopRequireWildcard(_path); var path13 = _interopRequireWildcard(_path);
357
+ var _path = require('path'); var path9 = _interopRequireWildcard(_path); var path4 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path); var path17 = _interopRequireWildcard(_path); var path14 = _interopRequireWildcard(_path);
351
358
 
352
359
  // src/utils/client-component.ts
353
360
  var _fs = require('fs'); var fs5 = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs); var fs9 = _interopRequireWildcard(_fs); var fs8 = _interopRequireWildcard(_fs);
@@ -400,7 +407,7 @@ function resolveModuleSourcePath(modulePath, root) {
400
407
  }
401
408
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveModuleSourcePath, "resolveModuleSourcePath");
402
409
  function getFarmClientHydrationPlanOptions(renderer, hasUnsupportedIntegrationProvider) {
403
- return { asyncOwnerIslands: _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
410
+ return { asyncOwnerIslands: _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
404
411
  }
405
412
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientHydrationPlanOptions, "getFarmClientHydrationPlanOptions");
406
413
  function describeSuppressedAsyncHydration(subject, reason) {
@@ -1439,9 +1446,22 @@ function resolveImportedModule(importerPath, specifier, root) {
1439
1446
  }
1440
1447
  const aliased = resolveProjectAliasSourcePath(specifier, root);
1441
1448
  if (aliased) return { path: aliased, local: true };
1442
- return { path: resolvePackageModuleSourcePath(importerPath, specifier, root), local: false };
1449
+ const packagePath = resolvePackageModuleSourcePath(importerPath, specifier, root);
1450
+ if (!packagePath) warnUnresolvedAliasImport(importerPath, specifier, root);
1451
+ return { path: packagePath, local: false };
1443
1452
  }
1444
1453
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveImportedModule, "resolveImportedModule");
1454
+ var warnedUnresolvedAliasImports = /* @__PURE__ */ new Set();
1455
+ var ALIAS_IMPORT = /^(?:@\/|~\/|#)/;
1456
+ function warnUnresolvedAliasImport(importerPath, specifier, root) {
1457
+ if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
1458
+ warnedUnresolvedAliasImports.add(specifier);
1459
+ const importer = root ? path9.default.relative(root, importerPath) : importerPath;
1460
+ _chunk5QIKR7RRcjs.logger.warn(
1461
+ `Could not resolve "${specifier}" (imported by ${importer}) while checking which pages need client JavaScript. If it holds client components, they will not hydrate. Map the alias in tsconfig.json "paths" or package.json "imports".`
1462
+ );
1463
+ }
1464
+ _chunkS3JO3N4Hcjs.__name.call(void 0, warnUnresolvedAliasImport, "warnUnresolvedAliasImport");
1445
1465
  var projectImportAliasCache = /* @__PURE__ */ new Map();
1446
1466
  var PROJECT_ALIAS_FILES = ["tsconfig.json", "jsconfig.json", "package.json"];
1447
1467
  function resolveProjectAliasSourcePath(specifier, root) {
@@ -1913,7 +1933,7 @@ var _RouteManager = class _RouteManager {
1913
1933
  this.redirects.clear();
1914
1934
  this.programmaticPages.clear();
1915
1935
  this.programmaticLayouts.clear();
1916
- for (const source of _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, this.config)) {
1936
+ for (const source of _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, this.config)) {
1917
1937
  await this.discoverFileRoutes(source);
1918
1938
  await this.discoverProgrammaticRoutes(source);
1919
1939
  }
@@ -2471,7 +2491,7 @@ var _RouteManager = class _RouteManager {
2471
2491
  }
2472
2492
  async discoverFileRoutes(source) {
2473
2493
  const appDir = _chunk5QIKR7RRcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
2474
- const componentExtensions = _chunkTFAXUHWXcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
2494
+ const componentExtensions = _chunkPSV6XKPOcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
2475
2495
  (extension) => extension.slice(1)
2476
2496
  );
2477
2497
  const componentGlob = componentExtensions.join(",");
@@ -2489,7 +2509,7 @@ var _RouteManager = class _RouteManager {
2489
2509
  appDir
2490
2510
  );
2491
2511
  const canonicalPageGroups = /* @__PURE__ */ new Map();
2492
- for (const file of pageFiles.filter((candidate) => _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
2512
+ for (const file of pageFiles.filter((candidate) => _chunkDW34V5SMcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
2493
2513
  const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
2494
2514
  const pattern = this.createRoutePattern(route);
2495
2515
  const group = canonicalPageGroups.get(pattern);
@@ -2562,7 +2582,7 @@ var _RouteManager = class _RouteManager {
2562
2582
  }
2563
2583
  }
2564
2584
  for (const file of [...pageFiles, ...slotDefaultFiles]) {
2565
- const slot = _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, file);
2585
+ const slot = _chunkDW34V5SMcjs.parseRouteSlotFile.call(void 0, file);
2566
2586
  if (!slot) continue;
2567
2587
  const modulePath = path9.default.join(appDir, file);
2568
2588
  const pattern = this.createRoutePattern(slot.route);
@@ -2584,7 +2604,7 @@ var _RouteManager = class _RouteManager {
2584
2604
  ownerPattern,
2585
2605
  interception: slot.interception,
2586
2606
  fallback: slot.fallback,
2587
- containerId: _chunkXFFQSD2Fcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
2607
+ containerId: _chunkDW34V5SMcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
2588
2608
  });
2589
2609
  }
2590
2610
  for (const file of metadataImageFiles) {
@@ -2822,7 +2842,7 @@ var _RouteManager = class _RouteManager {
2822
2842
  pattern: entry.pattern
2823
2843
  }));
2824
2844
  const i18n = this.getI18nConfig();
2825
- const result = await _chunkXFFQSD2Fcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2845
+ const result = await _chunkDW34V5SMcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2826
2846
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
2827
2847
  });
2828
2848
  if (!i18n) {
@@ -2867,7 +2887,7 @@ var _RouteManager = class _RouteManager {
2867
2887
  async isRouteSSG(modulePath) {
2868
2888
  try {
2869
2889
  const mod = await this.loadRouteModule(modulePath);
2870
- const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2890
+ const rendering = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2871
2891
  return rendering.ssg;
2872
2892
  } catch (e10) {
2873
2893
  return false;
@@ -2879,7 +2899,7 @@ var _RouteManager = class _RouteManager {
2879
2899
  async hasRouteISR(modulePath) {
2880
2900
  try {
2881
2901
  const mod = await this.loadRouteModule(modulePath);
2882
- const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2902
+ const rendering = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2883
2903
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
2884
2904
  } catch (e11) {
2885
2905
  return false;
@@ -2891,7 +2911,7 @@ var _RouteManager = class _RouteManager {
2891
2911
  async getRouteRevalidateInterval(modulePath) {
2892
2912
  try {
2893
2913
  const mod = await this.loadRouteModule(modulePath);
2894
- const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2914
+ const rendering = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2895
2915
  return rendering.revalidate;
2896
2916
  } catch (e12) {
2897
2917
  return void 0;
@@ -3130,7 +3150,7 @@ var _stream = require('stream');
3130
3150
 
3131
3151
 
3132
3152
  function resolveFarmNotFoundComponentPath(config, appDirs) {
3133
- const extensions = _chunkTFAXUHWXcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
3153
+ const extensions = _chunkPSV6XKPOcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
3134
3154
  const configuredPath = _optionalChain([config, 'access', _137 => _137.notFound, 'optionalAccess', _138 => _138.component, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()]);
3135
3155
  if (configuredPath) {
3136
3156
  const componentPath = path9.default.isAbsolute(configuredPath) ? path9.default.normalize(configuredPath) : path9.default.resolve(config.root, configuredPath);
@@ -4808,10 +4828,10 @@ var _ServerRenderer = class _ServerRenderer {
4808
4828
  async initialize() {
4809
4829
  if (this.rendererRuntime) return;
4810
4830
  if (_optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.notFound, 'optionalAccess', _150 => _150.component, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
4811
- resolveFarmNotFoundComponentPath(this.config, _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config));
4831
+ resolveFarmNotFoundComponentPath(this.config, _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config));
4812
4832
  }
4813
- const loaded = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4814
- _chunkTFAXUHWXcjs.resolveFarmRendererModule.call(void 0,
4833
+ const loaded = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4834
+ _chunkPSV6XKPOcjs.resolveFarmRendererModule.call(void 0,
4815
4835
  this.config.root || process.cwd(),
4816
4836
  this.config.renderer.server
4817
4837
  )
@@ -4825,7 +4845,7 @@ var _ServerRenderer = class _ServerRenderer {
4825
4845
  );
4826
4846
  }
4827
4847
  }
4828
- _chunkTFAXUHWXcjs.assertFarmRendererStreamingRuntime.call(void 0,
4848
+ _chunkPSV6XKPOcjs.assertFarmRendererStreamingRuntime.call(void 0,
4829
4849
  this.config.renderer.name,
4830
4850
  this.config.renderer,
4831
4851
  runtime,
@@ -4833,6 +4853,29 @@ var _ServerRenderer = class _ServerRenderer {
4833
4853
  );
4834
4854
  this.rendererRuntime = runtime;
4835
4855
  _optionalChain([this, 'access', _153 => _153.routeManager, 'access', _154 => _154.setRendererRuntime, 'optionalCall', _155 => _155(this.rendererRuntime)]);
4856
+ await this.applyRendererAppSetup();
4857
+ }
4858
+ /**
4859
+ * Pass the app's renderer setup module (`renderer.appSetup`) to the renderer. In development
4860
+ * the module runner returns the cached module until the file changes, so an edit is
4861
+ * re-applied on the next request without restarting.
4862
+ */
4863
+ async applyRendererAppSetup() {
4864
+ const appSetupPath = _chunkPSV6XKPOcjs.resolveFarmRendererAppSetup.call(void 0,
4865
+ this.config.root || process.cwd(),
4866
+ this.config.renderer
4867
+ );
4868
+ if (!appSetupPath) return;
4869
+ const configureApp = this.rendererRuntime.configureApp;
4870
+ if (typeof configureApp !== "function") {
4871
+ throw new Error(
4872
+ `Renderer \`${this.config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`
4873
+ );
4874
+ }
4875
+ const setupModule = this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
4876
+ if (setupModule === this.appliedAppSetupModule) return;
4877
+ this.appliedAppSetupModule = setupModule;
4878
+ configureApp(setupModule.default);
4836
4879
  }
4837
4880
  createPageBoundary(pageElement, options) {
4838
4881
  return this.rendererRuntime.createElement(
@@ -4897,7 +4940,7 @@ var _ServerRenderer = class _ServerRenderer {
4897
4940
  return this.rendererRuntime.wrapClientGraph(element);
4898
4941
  }
4899
4942
  async renderElementToCompleteHTML(element) {
4900
- const streaming = _chunkTFAXUHWXcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
4943
+ const streaming = _chunkPSV6XKPOcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
4901
4944
  const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
4902
4945
  if (renderToPipeableStream) {
4903
4946
  return await new Promise((resolve5, reject) => {
@@ -4927,7 +4970,7 @@ var _ServerRenderer = class _ServerRenderer {
4927
4970
  }
4928
4971
  if (streaming.web && this.rendererRuntime.renderToReadableStream) {
4929
4972
  const stream = await this.rendererRuntime.renderToReadableStream(element);
4930
- return await _chunkTFAXUHWXcjs.readFarmRendererWebStream.call(void 0, stream);
4973
+ return await _chunkPSV6XKPOcjs.readFarmRendererWebStream.call(void 0, stream);
4931
4974
  }
4932
4975
  return await this.rendererRuntime.renderToString(element);
4933
4976
  }
@@ -4949,6 +4992,7 @@ var _ServerRenderer = class _ServerRenderer {
4949
4992
  */
4950
4993
  async renderNavigationFragment(input) {
4951
4994
  await this.initialize();
4995
+ if (this.viteServer) await this.applyRendererAppSetup();
4952
4996
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
4953
4997
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
4954
4998
  let element = this.rendererRuntime.createElement(input.PageComponent, input.pageProps);
@@ -5043,7 +5087,7 @@ var _ServerRenderer = class _ServerRenderer {
5043
5087
  * Check if a path should be served from SSG cache
5044
5088
  */
5045
5089
  async shouldServeSSG(pathname) {
5046
- const ssgPage = _chunkXFFQSD2Fcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5090
+ const ssgPage = _chunkDW34V5SMcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5047
5091
  if (!ssgPage) return null;
5048
5092
  const cached = await this.getCachedSSGPage(pathname);
5049
5093
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -5274,6 +5318,7 @@ var _ServerRenderer = class _ServerRenderer {
5274
5318
  }
5275
5319
  async renderPage(req, res) {
5276
5320
  await this.initialize();
5321
+ if (this.viteServer) await this.applyRendererAppSetup();
5277
5322
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
5278
5323
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
5279
5324
  const cspNonce = _chunkISTFC3MZcjs.createFarmCspNonce.call(void 0, this.security);
@@ -5458,7 +5503,7 @@ var _ServerRenderer = class _ServerRenderer {
5458
5503
  throw error;
5459
5504
  }
5460
5505
  }
5461
- const renderingConfig = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5506
+ const renderingConfig = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5462
5507
  routeModule,
5463
5508
  route.modulePath,
5464
5509
  { experimentalPPR: _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.ppr]) === true }
@@ -5903,13 +5948,13 @@ var _ServerRenderer = class _ServerRenderer {
5903
5948
  for (let i = providers.length - 1; i >= 0; i--) {
5904
5949
  const provider = providers[i];
5905
5950
  if (provider.component || provider.type === "clerk") {
5906
- const rendererCapabilities = _chunkTFAXUHWXcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
5951
+ const rendererCapabilities = _chunkPSV6XKPOcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
5907
5952
  if (!rendererCapabilities.functionComponents) {
5908
5953
  throw new Error(
5909
5954
  `Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _191 => _191.config, 'access', _192 => _192.renderer, 'optionalAccess', _193 => _193.name]), () => ( "the configured renderer"))}\` cannot.`
5910
5955
  );
5911
5956
  }
5912
- if (provider.type === "clerk" && !_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer)) {
5957
+ if (provider.type === "clerk" && !_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, this.config.renderer)) {
5913
5958
  throw new Error(
5914
5959
  `Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
5915
5960
  );
@@ -5945,7 +5990,7 @@ var _ServerRenderer = class _ServerRenderer {
5945
5990
  }
5946
5991
  if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
5947
5992
  _nullishCoalesce(providerSourceModule, () => ( "")),
5948
- _chunkTFAXUHWXcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.renderer, 'optionalAccess', _196 => _196.componentExtensions]))
5993
+ _chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.renderer, 'optionalAccess', _196 => _196.componentExtensions]))
5949
5994
  )) {
5950
5995
  ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
5951
5996
  }
@@ -6258,7 +6303,7 @@ var _ServerRenderer = class _ServerRenderer {
6258
6303
  }
6259
6304
  async writeMetadataImageResponse(req, res, value, imageModule) {
6260
6305
  const ifNoneMatch = req.headers["if-none-match"];
6261
- const response = await _chunkTKNSDBBNcjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
6306
+ const response = await _chunkK3F2E6GScjs.createFarmMetadataImageResponse.call(void 0, value, imageModule, {
6262
6307
  method: req.method,
6263
6308
  ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch
6264
6309
  });
@@ -6936,7 +6981,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6936
6981
  async loadNotFoundModule() {
6937
6982
  const notFoundPath = resolveFarmNotFoundComponentPath(
6938
6983
  this.config,
6939
- _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config)
6984
+ _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config)
6940
6985
  );
6941
6986
  if (!notFoundPath) return null;
6942
6987
  return await this.routeManager.loadRouteModule(notFoundPath);
@@ -7000,7 +7045,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
7000
7045
  return;
7001
7046
  }
7002
7047
  const appDir = path9.join(this.config.root, this.config.srcDir, "app");
7003
- const notFoundExtensions = _chunkTFAXUHWXcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
7048
+ const notFoundExtensions = _chunkPSV6XKPOcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
7004
7049
  let layoutModule = null;
7005
7050
  try {
7006
7051
  for (const ext of notFoundExtensions) {
@@ -7012,7 +7057,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
7012
7057
  }
7013
7058
  const notFoundPath = resolveFarmNotFoundComponentPath(
7014
7059
  this.config,
7015
- _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config)
7060
+ _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config)
7016
7061
  );
7017
7062
  if (notFoundPath) {
7018
7063
  const notFoundModule = await this.loadNotFoundModule();
@@ -7069,7 +7114,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
7069
7114
  stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
7070
7115
  sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
7071
7116
  development: isDev,
7072
- farmVersion: _chunkQ2TUENW2cjs.FARM_VERSION,
7117
+ farmVersion: _chunkVXCA7RZPcjs.FARM_VERSION,
7073
7118
  nodeVersion: process.version,
7074
7119
  mode: isDev ? "development" : "production"
7075
7120
  });
@@ -7262,7 +7307,7 @@ var _FarmApp = class _FarmApp {
7262
7307
  outDir: config.outDir || "dist",
7263
7308
  basePath,
7264
7309
  trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
7265
- renderer: _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, config.renderer),
7310
+ renderer: _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, config.renderer),
7266
7311
  preset: _nullishCoalesce(config.preset, () => ( "node-server")),
7267
7312
  deploy: config.deploy || {},
7268
7313
  storage: config.storage || {},
@@ -7273,7 +7318,7 @@ var _FarmApp = class _FarmApp {
7273
7318
  plugins: config.plugins || [],
7274
7319
  migrations: config.migrations || { commands: [] },
7275
7320
  cron: _chunk6EXBPJ24cjs.resolveCronConfig.call(void 0, config.cron),
7276
- workflows: _chunkK6FNHVDRcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7321
+ workflows: _chunkMPEYMSCFcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7277
7322
  api: normalizeFarmAppAPIConfig(config.api),
7278
7323
  middleware: config.middleware || {},
7279
7324
  routeRules: _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, config.routeRules),
@@ -7321,12 +7366,12 @@ var _FarmApp = class _FarmApp {
7321
7366
  };
7322
7367
  }
7323
7368
  async verifyAppStructure() {
7324
- const appDirs = _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config);
7369
+ const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, this.config);
7325
7370
  const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk5QIKR7RRcjs.fileExists.call(void 0, appDir)))).some(
7326
7371
  Boolean
7327
7372
  );
7328
7373
  if (!hasAppDirectory) {
7329
- const routeFiles = _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7374
+ const routeFiles = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7330
7375
  (source) => _chunkN4RLRSWWcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7331
7376
  );
7332
7377
  if (routeFiles.length > 0) {
@@ -7337,7 +7382,7 @@ var _FarmApp = class _FarmApp {
7337
7382
  `App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
7338
7383
  );
7339
7384
  }
7340
- const componentExtensions = _chunkTFAXUHWXcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
7385
+ const componentExtensions = _chunkPSV6XKPOcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
7341
7386
  const rootLayoutPaths = appDirs.flatMap(
7342
7387
  (appDir) => componentExtensions.map((extension) => path9.default.join(appDir, `layout${extension}`))
7343
7388
  );
@@ -7377,6 +7422,121 @@ function createFarmApp(config, viteServer) {
7377
7422
  }
7378
7423
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmApp, "createFarmApp");
7379
7424
 
7425
+ // src/build/tailwind.ts
7426
+
7427
+
7428
+ // src/build/vite-plugin-compat.ts
7429
+ function adaptTailwindVitePlugin(pluginOption, builder) {
7430
+ if (builder !== "rolldown") return pluginOption;
7431
+ return adaptPluginOption(pluginOption);
7432
+ }
7433
+ _chunkS3JO3N4Hcjs.__name.call(void 0, adaptTailwindVitePlugin, "adaptTailwindVitePlugin");
7434
+ function adaptPluginOption(pluginOption) {
7435
+ if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
7436
+ if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
7437
+ const plugin = pluginOption;
7438
+ if (!_optionalChain([plugin, 'access', _293 => _293.name, 'optionalAccess', _294 => _294.startsWith, 'call', _295 => _295("@tailwindcss/vite:generate:")])) return pluginOption;
7439
+ if (isVitePluginHook(plugin.transform)) {
7440
+ return {
7441
+ ...plugin,
7442
+ transform: withVite5TransformContext(plugin.transform)
7443
+ };
7444
+ }
7445
+ if (plugin.transform && typeof plugin.transform === "object" && "handler" in plugin.transform && isVitePluginHook(plugin.transform.handler)) {
7446
+ return {
7447
+ ...plugin,
7448
+ transform: {
7449
+ ...plugin.transform,
7450
+ handler: withVite5TransformContext(plugin.transform.handler)
7451
+ }
7452
+ };
7453
+ }
7454
+ return pluginOption;
7455
+ }
7456
+ _chunkS3JO3N4Hcjs.__name.call(void 0, adaptPluginOption, "adaptPluginOption");
7457
+ function isVitePluginHook(value) {
7458
+ return typeof value === "function";
7459
+ }
7460
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isVitePluginHook, "isVitePluginHook");
7461
+ function withVite5TransformContext(handler) {
7462
+ return function(...args) {
7463
+ const context = new Proxy(this, {
7464
+ get(target, property, receiver) {
7465
+ if (property === "environment") return void 0;
7466
+ return Reflect.get(target, property, receiver);
7467
+ }
7468
+ });
7469
+ return handler.apply(context, args);
7470
+ };
7471
+ }
7472
+ _chunkS3JO3N4Hcjs.__name.call(void 0, withVite5TransformContext, "withVite5TransformContext");
7473
+
7474
+ // src/build/tailwind.ts
7475
+ var TAILWIND_CSS_IMPORT = /@import\s+["']tailwindcss["']/;
7476
+ var TAILWIND_VITE_INSTALL_HINT = _chunkLYLEZIG3cjs.formatOptionalPeerInstallHint.call(void 0,
7477
+ "@tailwindcss/vite",
7478
+ "enable built-in Tailwind CSS support",
7479
+ { dev: true }
7480
+ );
7481
+ var warnedMissingTailwind = false;
7482
+ async function loadTailwindVitePlugin(options = {}, importTailwind = () => import("@tailwindcss/vite")) {
7483
+ try {
7484
+ const tailwindVite = (await importTailwind()).default;
7485
+ const plugin = options.builder ? adaptTailwindVitePlugin(tailwindVite(), options.builder) : tailwindVite();
7486
+ if (options.announce) _chunk5QIKR7RRcjs.logger.info("\u{1F4E6} Enabled built-in Tailwind support (@tailwindcss/vite)");
7487
+ return plugin;
7488
+ } catch (error) {
7489
+ if (_chunkLYLEZIG3cjs.isMissingPackageError.call(void 0, error, "@tailwindcss/vite")) return createMissingTailwindPlugin();
7490
+ _chunk5QIKR7RRcjs.logger.warn(
7491
+ `Tailwind plugin auto-enable failed${options.label ? ` ${options.label}` : ""}; continuing without it: ${error.message}`
7492
+ );
7493
+ return void 0;
7494
+ }
7495
+ }
7496
+ _chunkS3JO3N4Hcjs.__name.call(void 0, loadTailwindVitePlugin, "loadTailwindVitePlugin");
7497
+ function createMissingTailwindPlugin() {
7498
+ let root = process.cwd();
7499
+ return {
7500
+ name: "farm:tailwind-missing",
7501
+ enforce: "pre",
7502
+ configResolved(config) {
7503
+ root = config.root;
7504
+ },
7505
+ transform(code, id) {
7506
+ if (warnedMissingTailwind || !/\.css(?:\?.*)?$/.test(id) || !TAILWIND_CSS_IMPORT.test(code)) {
7507
+ return null;
7508
+ }
7509
+ warnedMissingTailwind = true;
7510
+ const file = path9.default.relative(root, id.split("?", 1)[0]).replace(/\\/g, "/");
7511
+ _chunk5QIKR7RRcjs.logger.warn(
7512
+ `${file} imports Tailwind CSS, but @tailwindcss/vite is not installed; continuing without Tailwind. ${TAILWIND_VITE_INSTALL_HINT}`
7513
+ );
7514
+ return null;
7515
+ }
7516
+ };
7517
+ }
7518
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createMissingTailwindPlugin, "createMissingTailwindPlugin");
7519
+
7520
+ // src/image-runtime.ts
7521
+ var SHARP_INSTALL_HINT = _chunkLYLEZIG3cjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
7522
+ var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
7523
+ function resolveFarmImageProviderForRuntime(images, options) {
7524
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _296 => _296.provider]), () => ( "auto"));
7525
+ if (provider === "none") return images;
7526
+ const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
7527
+ if (!usesSharp || _chunkLYLEZIG3cjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
7528
+ if (provider === "node") {
7529
+ throw new Error(
7530
+ `images.provider "node" optimizes images with sharp, which is not installed. ${SHARP_INSTALL_HINT}`
7531
+ );
7532
+ }
7533
+ _chunk5QIKR7RRcjs.logger.info(
7534
+ `Image optimization is off because sharp is not installed; images use their original URLs. ${SHARP_INSTALL_HINT}, or set images.provider to "none".`
7535
+ );
7536
+ return Object.freeze({ ...images, provider: "none" });
7537
+ }
7538
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmImageProviderForRuntime, "resolveFarmImageProviderForRuntime");
7539
+
7380
7540
  // src/schema-step-types.ts
7381
7541
  function validateSchemaSteps(owner, schema, steps) {
7382
7542
  if (steps === void 0) return;
@@ -7386,7 +7546,7 @@ function validateSchemaSteps(owner, schema, steps) {
7386
7546
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
7387
7547
  const ids = /* @__PURE__ */ new Set();
7388
7548
  for (const step of steps) {
7389
- const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _293 => _293.id])}"`;
7549
+ const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _297 => _297.id])}"`;
7390
7550
  if (!step || typeof step.id !== "string" || step.id.trim() === "") {
7391
7551
  throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
7392
7552
  }
@@ -7463,8 +7623,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, validateSchemaSteps, "validateSchemaSteps"
7463
7623
  var _FarmPluginOptionsError = class _FarmPluginOptionsError extends TypeError {
7464
7624
  constructor(issues) {
7465
7625
  const lines = issues.map((issue) => {
7466
- const path17 = formatIssuePath(issue.path);
7467
- return ` - ${path17 ? `${path17}: ` : ""}${issue.message}`;
7626
+ const path18 = formatIssuePath(issue.path);
7627
+ return ` - ${path18 ? `${path18}: ` : ""}${issue.message}`;
7468
7628
  });
7469
7629
  super(`Invalid plugin options:
7470
7630
  ${lines.join("\n")}`);
@@ -7474,9 +7634,9 @@ ${lines.join("\n")}`);
7474
7634
  };
7475
7635
  _chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
7476
7636
  var FarmPluginOptionsError = _FarmPluginOptionsError;
7477
- function formatIssuePath(path17) {
7478
- if (!_optionalChain([path17, 'optionalAccess', _294 => _294.length])) return "";
7479
- return path17.map((segment) => {
7637
+ function formatIssuePath(path18) {
7638
+ if (!_optionalChain([path18, 'optionalAccess', _298 => _298.length])) return "";
7639
+ return path18.map((segment) => {
7480
7640
  const key = typeof segment === "object" && segment !== null ? segment.key : segment;
7481
7641
  return typeof key === "symbol" ? key.toString() : String(key);
7482
7642
  }).join(".");
@@ -7489,11 +7649,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
7489
7649
  function isPluginOptionsSchema(value) {
7490
7650
  if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
7491
7651
  const standard = value["~standard"];
7492
- return typeof _optionalChain([standard, 'optionalAccess', _295 => _295.validate]) === "function";
7652
+ return typeof _optionalChain([standard, 'optionalAccess', _299 => _299.validate]) === "function";
7493
7653
  }
7494
7654
  _chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
7495
7655
  function parsePluginOptions(schema, options) {
7496
- const standard = _optionalChain([schema, 'optionalAccess', _296 => _296["~standard"]]);
7656
+ const standard = _optionalChain([schema, 'optionalAccess', _300 => _300["~standard"]]);
7497
7657
  if (!standard || typeof standard.validate !== "function") {
7498
7658
  throw new TypeError(
7499
7659
  "A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
@@ -7553,9 +7713,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
7553
7713
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
7554
7714
  function farmPluginMayAffectRuntimePath(plugin, pathname) {
7555
7715
  const runtime = plugin.runtime;
7556
- const endpoints = _optionalChain([runtime, 'optionalAccess', _297 => _297.endpoints]);
7716
+ const endpoints = _optionalChain([runtime, 'optionalAccess', _301 => _301.endpoints]);
7557
7717
  const hasUnscopedRequestHooks = Boolean(
7558
- plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _298 => _298.context]) || _optionalChain([runtime, 'optionalAccess', _299 => _299.before]) || _optionalChain([runtime, 'optionalAccess', _300 => _300.after]) || _optionalChain([runtime, 'optionalAccess', _301 => _301.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7718
+ plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _302 => _302.context]) || _optionalChain([runtime, 'optionalAccess', _303 => _303.before]) || _optionalChain([runtime, 'optionalAccess', _304 => _304.after]) || _optionalChain([runtime, 'optionalAccess', _305 => _305.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7559
7719
  );
7560
7720
  if (hasUnscopedRequestHooks) return true;
7561
7721
  if (Array.isArray(endpoints) && endpoints.length > 0) {
@@ -7567,7 +7727,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
7567
7727
  ) === normalizedPathname
7568
7728
  );
7569
7729
  }
7570
- return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _302 => _302.start]) || _optionalChain([runtime, 'optionalAccess', _303 => _303.close]));
7730
+ return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _306 => _306.start]) || _optionalChain([runtime, 'optionalAccess', _307 => _307.close]));
7571
7731
  }
7572
7732
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
7573
7733
 
@@ -7701,7 +7861,7 @@ var _PluginManager = class _PluginManager {
7701
7861
  const endpoints = [];
7702
7862
  const owners = /* @__PURE__ */ new Map();
7703
7863
  for (const plugin of this.getSortedPlugins()) {
7704
- const configured = _optionalChain([plugin, 'access', _304 => _304.runtime, 'optionalAccess', _305 => _305.endpoints]);
7864
+ const configured = _optionalChain([plugin, 'access', _308 => _308.runtime, 'optionalAccess', _309 => _309.endpoints]);
7705
7865
  if (configured === void 0) continue;
7706
7866
  if (!Array.isArray(configured)) {
7707
7867
  throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
@@ -7712,23 +7872,23 @@ var _PluginManager = class _PluginManager {
7712
7872
  `Farm plugin "${plugin.name}" runtime.endpoints must contain endpoint objects`
7713
7873
  );
7714
7874
  }
7715
- const path17 = normalizeFarmPluginRuntimeEndpointPath(
7875
+ const path18 = normalizeFarmPluginRuntimeEndpointPath(
7716
7876
  endpoint.path,
7717
7877
  `Farm plugin "${plugin.name}" runtime endpoint`
7718
7878
  );
7719
7879
  if (typeof endpoint.handler !== "function") {
7720
7880
  throw new TypeError(
7721
- `Farm plugin "${plugin.name}" runtime endpoint ${path17} requires a handler`
7881
+ `Farm plugin "${plugin.name}" runtime endpoint ${path18} requires a handler`
7722
7882
  );
7723
7883
  }
7724
- const owner = owners.get(path17);
7884
+ const owner = owners.get(path18);
7725
7885
  if (owner) {
7726
7886
  throw new Error(
7727
- `Farm plugin runtime endpoint ${path17} from "${plugin.name}" conflicts with "${owner}"`
7887
+ `Farm plugin runtime endpoint ${path18} from "${plugin.name}" conflicts with "${owner}"`
7728
7888
  );
7729
7889
  }
7730
- owners.set(path17, plugin.name);
7731
- endpoints.push({ plugin, endpoint, path: path17 });
7890
+ owners.set(path18, plugin.name);
7891
+ endpoints.push({ plugin, endpoint, path: path18 });
7732
7892
  }
7733
7893
  }
7734
7894
  this.runtimeEndpoints = endpoints;
@@ -7772,7 +7932,7 @@ var _PluginManager = class _PluginManager {
7772
7932
  const values = {};
7773
7933
  const owners = /* @__PURE__ */ new Map();
7774
7934
  for (const plugin of this.getSortedPlugins()) {
7775
- const createContext = _optionalChain([plugin, 'access', _306 => _306.runtime, 'optionalAccess', _307 => _307.context]);
7935
+ const createContext = _optionalChain([plugin, 'access', _310 => _310.runtime, 'optionalAccess', _311 => _311.context]);
7776
7936
  if (!createContext) continue;
7777
7937
  const result = await createContext(
7778
7938
  this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
@@ -7798,7 +7958,7 @@ var _PluginManager = class _PluginManager {
7798
7958
  }
7799
7959
  async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
7800
7960
  for (const plugin of this.getSortedPlugins()) {
7801
- const onError = _optionalChain([plugin, 'access', _308 => _308.runtime, 'optionalAccess', _309 => _309.error]);
7961
+ const onError = _optionalChain([plugin, 'access', _312 => _312.runtime, 'optionalAccess', _313 => _313.error]);
7802
7962
  if (!onError) continue;
7803
7963
  try {
7804
7964
  await onError({
@@ -7842,19 +8002,19 @@ var _PluginManager = class _PluginManager {
7842
8002
  case "config":
7843
8003
  if (plugin.configure) {
7844
8004
  hooks.push(
7845
- (config, context) => _optionalChain([plugin, 'access', _310 => _310.configure, 'optionalCall', _311 => _311(config, context)])
8005
+ (config, context) => _optionalChain([plugin, 'access', _314 => _314.configure, 'optionalCall', _315 => _315(config, context)])
7846
8006
  );
7847
8007
  }
7848
8008
  break;
7849
8009
  case "ready":
7850
- if (_optionalChain([plugin, 'access', _312 => _312.runtime, 'optionalAccess', _313 => _313.start])) {
7851
- hooks.push((context) => _optionalChain([plugin, 'access', _314 => _314.runtime, 'optionalAccess', _315 => _315.start, 'optionalCall', _316 => _316(withState(context))]));
8010
+ if (_optionalChain([plugin, 'access', _316 => _316.runtime, 'optionalAccess', _317 => _317.start])) {
8011
+ hooks.push((context) => _optionalChain([plugin, 'access', _318 => _318.runtime, 'optionalAccess', _319 => _319.start, 'optionalCall', _320 => _320(withState(context))]));
7852
8012
  }
7853
8013
  break;
7854
8014
  case "shutdown":
7855
- if (_optionalChain([plugin, 'access', _317 => _317.runtime, 'optionalAccess', _318 => _318.close])) {
8015
+ if (_optionalChain([plugin, 'access', _321 => _321.runtime, 'optionalAccess', _322 => _322.close])) {
7856
8016
  hooks.push(
7857
- (payload, context) => _optionalChain([plugin, 'access', _319 => _319.runtime, 'optionalAccess', _320 => _320.close, 'optionalCall', _321 => _321({
8017
+ (payload, context) => _optionalChain([plugin, 'access', _323 => _323.runtime, 'optionalAccess', _324 => _324.close, 'optionalCall', _325 => _325({
7858
8018
  ...withState(context),
7859
8019
  reason: payload.reason
7860
8020
  })])
@@ -7862,93 +8022,93 @@ var _PluginManager = class _PluginManager {
7862
8022
  }
7863
8023
  break;
7864
8024
  case "routeDiscovered":
7865
- if (_optionalChain([plugin, 'access', _322 => _322.router, 'optionalAccess', _323 => _323.discovered])) {
8025
+ if (_optionalChain([plugin, 'access', _326 => _326.router, 'optionalAccess', _327 => _327.discovered])) {
7866
8026
  hooks.push(
7867
- (route, context) => _optionalChain([plugin, 'access', _324 => _324.router, 'optionalAccess', _325 => _325.discovered, 'optionalCall', _326 => _326(route, withState(context))])
8027
+ (route, context) => _optionalChain([plugin, 'access', _328 => _328.router, 'optionalAccess', _329 => _329.discovered, 'optionalCall', _330 => _330(route, withState(context))])
7868
8028
  );
7869
8029
  }
7870
8030
  break;
7871
8031
  case "middlewareDiscovered":
7872
- if (_optionalChain([plugin, 'access', _327 => _327.router, 'optionalAccess', _328 => _328.discovered])) {
8032
+ if (_optionalChain([plugin, 'access', _331 => _331.router, 'optionalAccess', _332 => _332.discovered])) {
7873
8033
  hooks.push(
7874
- (route, context) => _optionalChain([plugin, 'access', _329 => _329.router, 'optionalAccess', _330 => _330.discovered, 'optionalCall', _331 => _331({ kind: "middleware", ...route }, withState(context))])
8034
+ (route, context) => _optionalChain([plugin, 'access', _333 => _333.router, 'optionalAccess', _334 => _334.discovered, 'optionalCall', _335 => _335({ kind: "middleware", ...route }, withState(context))])
7875
8035
  );
7876
8036
  }
7877
8037
  break;
7878
8038
  case "apiRouteDiscovered":
7879
- if (_optionalChain([plugin, 'access', _332 => _332.router, 'optionalAccess', _333 => _333.discovered])) {
8039
+ if (_optionalChain([plugin, 'access', _336 => _336.router, 'optionalAccess', _337 => _337.discovered])) {
7880
8040
  hooks.push(
7881
- (route, context) => _optionalChain([plugin, 'access', _334 => _334.router, 'optionalAccess', _335 => _335.discovered, 'optionalCall', _336 => _336({ kind: "api", ...route }, withState(context))])
8041
+ (route, context) => _optionalChain([plugin, 'access', _338 => _338.router, 'optionalAccess', _339 => _339.discovered, 'optionalCall', _340 => _340({ kind: "api", ...route }, withState(context))])
7882
8042
  );
7883
8043
  }
7884
8044
  break;
7885
8045
  case "routesGenerated":
7886
- if (_optionalChain([plugin, 'access', _337 => _337.router, 'optionalAccess', _338 => _338.generated])) {
8046
+ if (_optionalChain([plugin, 'access', _341 => _341.router, 'optionalAccess', _342 => _342.generated])) {
7887
8047
  hooks.push(
7888
- (routes, context) => _optionalChain([plugin, 'access', _339 => _339.router, 'optionalAccess', _340 => _340.generated, 'optionalCall', _341 => _341(routes, withState(context))])
8048
+ (routes, context) => _optionalChain([plugin, 'access', _343 => _343.router, 'optionalAccess', _344 => _344.generated, 'optionalCall', _345 => _345(routes, withState(context))])
7889
8049
  );
7890
8050
  }
7891
8051
  break;
7892
8052
  case "beforeRouteMatch":
7893
- if (_optionalChain([plugin, 'access', _342 => _342.router, 'optionalAccess', _343 => _343.before])) {
8053
+ if (_optionalChain([plugin, 'access', _346 => _346.router, 'optionalAccess', _347 => _347.before])) {
7894
8054
  hooks.push(
7895
- (route, context) => _optionalChain([plugin, 'access', _344 => _344.router, 'optionalAccess', _345 => _345.before, 'optionalCall', _346 => _346(route, withState(context))])
8055
+ (route, context) => _optionalChain([plugin, 'access', _348 => _348.router, 'optionalAccess', _349 => _349.before, 'optionalCall', _350 => _350(route, withState(context))])
7896
8056
  );
7897
8057
  }
7898
8058
  break;
7899
8059
  case "afterRouteMatch":
7900
- if (_optionalChain([plugin, 'access', _347 => _347.router, 'optionalAccess', _348 => _348.after])) {
8060
+ if (_optionalChain([plugin, 'access', _351 => _351.router, 'optionalAccess', _352 => _352.after])) {
7901
8061
  hooks.push(
7902
- (result, context) => _optionalChain([plugin, 'access', _349 => _349.router, 'optionalAccess', _350 => _350.after, 'optionalCall', _351 => _351(result, withState(context))])
8062
+ (result, context) => _optionalChain([plugin, 'access', _353 => _353.router, 'optionalAccess', _354 => _354.after, 'optionalCall', _355 => _355(result, withState(context))])
7903
8063
  );
7904
8064
  }
7905
8065
  break;
7906
8066
  case "beforeRender":
7907
- if (_optionalChain([plugin, 'access', _352 => _352.render, 'optionalAccess', _353 => _353.before])) {
8067
+ if (_optionalChain([plugin, 'access', _356 => _356.render, 'optionalAccess', _357 => _357.before])) {
7908
8068
  hooks.push(
7909
- (render, context) => _optionalChain([plugin, 'access', _354 => _354.render, 'optionalAccess', _355 => _355.before, 'optionalCall', _356 => _356(render, withState(context))])
8069
+ (render, context) => _optionalChain([plugin, 'access', _358 => _358.render, 'optionalAccess', _359 => _359.before, 'optionalCall', _360 => _360(render, withState(context))])
7910
8070
  );
7911
8071
  }
7912
8072
  break;
7913
8073
  case "afterRender":
7914
- if (_optionalChain([plugin, 'access', _357 => _357.render, 'optionalAccess', _358 => _358.html])) {
8074
+ if (_optionalChain([plugin, 'access', _361 => _361.render, 'optionalAccess', _362 => _362.html])) {
7915
8075
  hooks.push(
7916
- (html, render, context) => _optionalChain([plugin, 'access', _359 => _359.render, 'optionalAccess', _360 => _360.html, 'optionalCall', _361 => _361(html, render, withState(context))])
8076
+ (html, render, context) => _optionalChain([plugin, 'access', _363 => _363.render, 'optionalAccess', _364 => _364.html, 'optionalCall', _365 => _365(html, render, withState(context))])
7917
8077
  );
7918
8078
  }
7919
8079
  break;
7920
8080
  case "beforeBundle":
7921
- if (_optionalChain([plugin, 'access', _362 => _362.build, 'optionalAccess', _363 => _363.before])) {
8081
+ if (_optionalChain([plugin, 'access', _366 => _366.build, 'optionalAccess', _367 => _367.before])) {
7922
8082
  hooks.push(
7923
- (bundle, context) => _optionalChain([plugin, 'access', _364 => _364.build, 'optionalAccess', _365 => _365.before, 'optionalCall', _366 => _366(bundle, withState(context))])
8083
+ (bundle, context) => _optionalChain([plugin, 'access', _368 => _368.build, 'optionalAccess', _369 => _369.before, 'optionalCall', _370 => _370(bundle, withState(context))])
7924
8084
  );
7925
8085
  }
7926
8086
  break;
7927
8087
  case "beforeNitroBuild":
7928
- if (_optionalChain([plugin, 'access', _367 => _367.build, 'optionalAccess', _368 => _368.configure])) {
8088
+ if (_optionalChain([plugin, 'access', _371 => _371.build, 'optionalAccess', _372 => _372.configure])) {
7929
8089
  hooks.push(
7930
- (buildConfig, context) => _optionalChain([plugin, 'access', _369 => _369.build, 'optionalAccess', _370 => _370.configure, 'optionalCall', _371 => _371(buildConfig, withState(context))])
8090
+ (buildConfig, context) => _optionalChain([plugin, 'access', _373 => _373.build, 'optionalAccess', _374 => _374.configure, 'optionalCall', _375 => _375(buildConfig, withState(context))])
7931
8091
  );
7932
8092
  }
7933
8093
  break;
7934
8094
  case "afterBundle":
7935
- if (_optionalChain([plugin, 'access', _372 => _372.build, 'optionalAccess', _373 => _373.after])) {
8095
+ if (_optionalChain([plugin, 'access', _376 => _376.build, 'optionalAccess', _377 => _377.after])) {
7936
8096
  hooks.push(
7937
- (result, context) => _optionalChain([plugin, 'access', _374 => _374.build, 'optionalAccess', _375 => _375.after, 'optionalCall', _376 => _376(result, withState(context))])
8097
+ (result, context) => _optionalChain([plugin, 'access', _378 => _378.build, 'optionalAccess', _379 => _379.after, 'optionalCall', _380 => _380(result, withState(context))])
7938
8098
  );
7939
8099
  }
7940
8100
  break;
7941
8101
  case "devServerCreated":
7942
- if (_optionalChain([plugin, 'access', _377 => _377.dev, 'optionalAccess', _378 => _378.server])) {
8102
+ if (_optionalChain([plugin, 'access', _381 => _381.dev, 'optionalAccess', _382 => _382.server])) {
7943
8103
  hooks.push(
7944
- (server, context) => _optionalChain([plugin, 'access', _379 => _379.dev, 'optionalAccess', _380 => _380.server, 'optionalCall', _381 => _381(server, withState(context))])
8104
+ (server, context) => _optionalChain([plugin, 'access', _383 => _383.dev, 'optionalAccess', _384 => _384.server, 'optionalCall', _385 => _385(server, withState(context))])
7945
8105
  );
7946
8106
  }
7947
8107
  break;
7948
8108
  case "hmrUpdate":
7949
- if (_optionalChain([plugin, 'access', _382 => _382.dev, 'optionalAccess', _383 => _383.update])) {
8109
+ if (_optionalChain([plugin, 'access', _386 => _386.dev, 'optionalAccess', _387 => _387.update])) {
7950
8110
  hooks.push(
7951
- (update, context) => _optionalChain([plugin, 'access', _384 => _384.dev, 'optionalAccess', _385 => _385.update, 'optionalCall', _386 => _386(update, withState(context))])
8111
+ (update, context) => _optionalChain([plugin, 'access', _388 => _388.dev, 'optionalAccess', _389 => _389.update, 'optionalCall', _390 => _390(update, withState(context))])
7952
8112
  );
7953
8113
  }
7954
8114
  break;
@@ -7994,7 +8154,7 @@ var _PluginManager = class _PluginManager {
7994
8154
  hasRuntimeHook(hookName) {
7995
8155
  const cached = this.runtimeHookPresence.get(hookName);
7996
8156
  if (cached !== void 0) return cached;
7997
- const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _387 => _387.runtime, 'optionalAccess', _388 => _388[hookName]]) === "function");
8157
+ const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _391 => _391.runtime, 'optionalAccess', _392 => _392[hookName]]) === "function");
7998
8158
  this.runtimeHookPresence.set(hookName, present);
7999
8159
  return present;
8000
8160
  }
@@ -8073,7 +8233,7 @@ var _PluginManager = class _PluginManager {
8073
8233
  async beginRuntimeRequest(request2, options = {}) {
8074
8234
  await this.startRuntime();
8075
8235
  const startedAt = Date.now();
8076
- const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _389 => _389.waitUntil, 'optionalCall', _390 => _390(Promise.resolve(promise))]) : (promise) => {
8236
+ const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _393 => _393.waitUntil, 'optionalCall', _394 => _394(Promise.resolve(promise))]) : (promise) => {
8077
8237
  void Promise.resolve(promise).catch(() => {
8078
8238
  });
8079
8239
  };
@@ -8106,7 +8266,7 @@ var _PluginManager = class _PluginManager {
8106
8266
  );
8107
8267
  let response;
8108
8268
  for (const plugin of this.getSortedPlugins()) {
8109
- const before = _optionalChain([plugin, 'access', _391 => _391.runtime, 'optionalAccess', _392 => _392.before]);
8269
+ const before = _optionalChain([plugin, 'access', _395 => _395.runtime, 'optionalAccess', _396 => _396.before]);
8110
8270
  if (!before) continue;
8111
8271
  const result = await before({
8112
8272
  ...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
@@ -8152,7 +8312,7 @@ var _PluginManager = class _PluginManager {
8152
8312
  let response = initialResponse;
8153
8313
  try {
8154
8314
  for (const plugin of this.getSortedPlugins()) {
8155
- const after = _optionalChain([plugin, 'access', _393 => _393.runtime, 'optionalAccess', _394 => _394.after]);
8315
+ const after = _optionalChain([plugin, 'access', _397 => _397.runtime, 'optionalAccess', _398 => _398.after]);
8156
8316
  if (!after) continue;
8157
8317
  const result = await after({
8158
8318
  ...this.createRuntimeBaseEvent(
@@ -8241,7 +8401,7 @@ var _PluginManager = class _PluginManager {
8241
8401
  /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
8242
8402
  async runHookParallelFiltered(hookName, include, ...args) {
8243
8403
  if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
8244
- await this.closeRuntime(_optionalChain([args, 'access', _395 => _395[0], 'optionalAccess', _396 => _396.reason]));
8404
+ await this.closeRuntime(_optionalChain([args, 'access', _399 => _399[0], 'optionalAccess', _400 => _400.reason]));
8245
8405
  return false;
8246
8406
  }
8247
8407
  const plugins = this.getSortedPlugins().filter(include);
@@ -8327,7 +8487,7 @@ function createPluginFactory(definition) {
8327
8487
  configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
8328
8488
  } : {},
8329
8489
  setup(context) {
8330
- const state = _optionalChain([setup, 'optionalCall', _397 => _397({ ...context, options })]);
8490
+ const state = _optionalChain([setup, 'optionalCall', _401 => _401({ ...context, options })]);
8331
8491
  return state instanceof Promise ? state.then(resolveState) : resolveState(state);
8332
8492
  }
8333
8493
  });
@@ -8368,10 +8528,10 @@ function declarePluginSchema(plugin) {
8368
8528
  models: Object.keys(models).filter((key) => !models[key].external),
8369
8529
  ...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunkQBPXNZGVcjs.pluginShortName) } : {},
8370
8530
  ...plugin.version ? { version: plugin.version } : {},
8371
- ..._optionalChain([plugin, 'access', _398 => _398.migrations, 'optionalAccess', _399 => _399.length]) ? { migrations: plugin.migrations } : {},
8372
- dialect: _optionalChain([database, 'optionalAccess', _400 => _400.dialect]),
8531
+ ..._optionalChain([plugin, 'access', _402 => _402.migrations, 'optionalAccess', _403 => _403.length]) ? { migrations: plugin.migrations } : {},
8532
+ dialect: _optionalChain([database, 'optionalAccess', _404 => _404.dialect]),
8373
8533
  resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
8374
- if (_optionalChain([database, 'optionalAccess', _401 => _401.client]) !== void 0 && database.client !== null) {
8534
+ if (_optionalChain([database, 'optionalAccess', _405 => _405.client]) !== void 0 && database.client !== null) {
8375
8535
  const client2 = typeof database.client === "function" ? await database.client() : database.client;
8376
8536
  if (client2 === void 0 || client2 === null) {
8377
8537
  throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
@@ -8425,7 +8585,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
8425
8585
  }
8426
8586
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
8427
8587
  function resolveFarmClientPlugins(plugins, _root) {
8428
- if (!_optionalChain([plugins, 'optionalAccess', _402 => _402.length])) return [];
8588
+ if (!_optionalChain([plugins, 'optionalAccess', _406 => _406.length])) return [];
8429
8589
  return plugins.flatMap((plugin) => {
8430
8590
  if (!plugin.client) return [];
8431
8591
  assertClientLifecycle(plugin.client, plugin.name);
@@ -8505,7 +8665,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
8505
8665
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
8506
8666
  }
8507
8667
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
8508
- if (!_optionalChain([descriptor, 'optionalAccess', _403 => _403.enumerable])) {
8668
+ if (!_optionalChain([descriptor, 'optionalAccess', _407 => _407.enumerable])) {
8509
8669
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
8510
8670
  }
8511
8671
  if (!("value" in descriptor)) {
@@ -8629,7 +8789,7 @@ function assertPublicData(value, pluginName) {
8629
8789
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
8630
8790
  }
8631
8791
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
8632
- if (!_optionalChain([descriptor, 'optionalAccess', _404 => _404.enumerable])) {
8792
+ if (!_optionalChain([descriptor, 'optionalAccess', _408 => _408.enumerable])) {
8633
8793
  throwPublicDataError(
8634
8794
  pluginName,
8635
8795
  [...pathSegments, key],
@@ -8675,8 +8835,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
8675
8835
 
8676
8836
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
8677
8837
  function resolveFarmClientCacheAdapterEntry(root, cache) {
8678
- const client = _optionalChain([cache, 'optionalAccess', _405 => _405.client]);
8679
- const adapter = _optionalChain([client, 'optionalAccess', _406 => _406.adapter]);
8838
+ const client = _optionalChain([cache, 'optionalAccess', _409 => _409.client]);
8839
+ const adapter = _optionalChain([client, 'optionalAccess', _410 => _410.adapter]);
8680
8840
  if (adapter === void 0) return void 0;
8681
8841
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
8682
8842
  throw new Error(
@@ -8691,8 +8851,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache) {
8691
8851
  );
8692
8852
  }
8693
8853
  const options = {};
8694
- if (_optionalChain([client, 'optionalAccess', _407 => _407.version]) !== void 0) options.version = client.version;
8695
- if (_optionalChain([client, 'optionalAccess', _408 => _408.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8854
+ if (_optionalChain([client, 'optionalAccess', _411 => _411.version]) !== void 0) options.version = client.version;
8855
+ if (_optionalChain([client, 'optionalAccess', _412 => _412.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8696
8856
  return { importPath: found.replace(/\\/g, "/"), options };
8697
8857
  }
8698
8858
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
@@ -8794,7 +8954,7 @@ function createFarmLayoutElement(Component, pattern, children, params) {
8794
8954
  function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
8795
8955
  if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
8796
8956
  const matchesAppRoute = Boolean(
8797
- _optionalChain([routeManager, 'optionalAccess', _409 => _409.matchRoute, 'call', _410 => _410(pathname), 'optionalAccess', _411 => _411.route]) || _optionalChain([routeManager, 'optionalAccess', _412 => _412.matchMetadataRoute, 'call', _413 => _413(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _414 => _414.matchMetadataImage, 'call', _415 => _415(pathname)]) || generatedPaths.includes(pathname)
8957
+ _optionalChain([routeManager, 'optionalAccess', _413 => _413.matchRoute, 'call', _414 => _414(pathname), 'optionalAccess', _415 => _415.route]) || _optionalChain([routeManager, 'optionalAccess', _416 => _416.matchMetadataRoute, 'call', _417 => _417(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _418 => _418.matchMetadataImage, 'call', _419 => _419(pathname)]) || generatedPaths.includes(pathname)
8798
8958
  );
8799
8959
  return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
8800
8960
  }
@@ -8823,7 +8983,7 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
8823
8983
  ]);
8824
8984
  function farmAppOwnsDocsEnginePath(pathname, options) {
8825
8985
  if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
8826
- return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _416 => _416.routeManager, 'optionalAccess', _417 => _417.matchMetadataRoute, 'call', _418 => _418(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
8986
+ return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _420 => _420.routeManager, 'optionalAccess', _421 => _421.matchMetadataRoute, 'call', _422 => _422(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
8827
8987
  }
8828
8988
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
8829
8989
  function devServableFileExists(pathname, baseDirs) {
@@ -8837,9 +8997,9 @@ function devServableFileExists(pathname, baseDirs) {
8837
8997
  if (!relativePathname) return false;
8838
8998
  for (const baseDir of baseDirs) {
8839
8999
  if (typeof baseDir !== "string" || baseDir.length === 0) continue;
8840
- const resolvedBase = path13.resolve(baseDir);
8841
- const candidate = path13.resolve(resolvedBase, relativePathname);
8842
- if (!candidate.startsWith(resolvedBase + path13.sep)) continue;
9000
+ const resolvedBase = path14.resolve(baseDir);
9001
+ const candidate = path14.resolve(resolvedBase, relativePathname);
9002
+ if (!candidate.startsWith(resolvedBase + path14.sep)) continue;
8843
9003
  try {
8844
9004
  if (fs8.existsSync(candidate) && fs8.statSync(candidate).isFile()) {
8845
9005
  return true;
@@ -8930,14 +9090,14 @@ function analyzeClientBoundary(program, publicKeys) {
8930
9090
  _chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
8931
9091
  function readNodeBuiltinSource(node) {
8932
9092
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
8933
- const value = _optionalChain([node, 'access', _419 => _419.source, 'optionalAccess', _420 => _420.value]);
9093
+ const value = _optionalChain([node, 'access', _423 => _423.source, 'optionalAccess', _424 => _424.value]);
8934
9094
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
8935
9095
  }
8936
9096
  if (node.type === "CallExpression") {
8937
9097
  const callee = node.callee;
8938
- if (_optionalChain([callee, 'optionalAccess', _421 => _421.type]) === "Identifier" && callee.name === "require") {
8939
- const arg = _optionalChain([node, 'access', _422 => _422.arguments, 'optionalAccess', _423 => _423[0]]);
8940
- const value = _optionalChain([arg, 'optionalAccess', _424 => _424.type]) === "Literal" ? arg.value : void 0;
9098
+ if (_optionalChain([callee, 'optionalAccess', _425 => _425.type]) === "Identifier" && callee.name === "require") {
9099
+ const arg = _optionalChain([node, 'access', _426 => _426.arguments, 'optionalAccess', _427 => _427[0]]);
9100
+ const value = _optionalChain([arg, 'optionalAccess', _428 => _428.type]) === "Literal" ? arg.value : void 0;
8941
9101
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
8942
9102
  }
8943
9103
  }
@@ -8947,7 +9107,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
8947
9107
  function readProcessEnvKey(node) {
8948
9108
  if (node.type !== "MemberExpression") return void 0;
8949
9109
  const object = node.object;
8950
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _425 => _425.object, 'optionalAccess', _426 => _426.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _427 => _427.property, 'optionalAccess', _428 => _428.name]) !== "env") {
9110
+ if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _429 => _429.object, 'optionalAccess', _430 => _430.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _431 => _431.property, 'optionalAccess', _432 => _432.name]) !== "env") {
8951
9111
  return void 0;
8952
9112
  }
8953
9113
  const property = node.property;
@@ -9012,7 +9172,7 @@ function farmImageImportsPlugin() {
9012
9172
  async transform(code, id) {
9013
9173
  const filePath = id.split("?", 1)[0];
9014
9174
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
9015
- const defaultExport = _optionalChain([code, 'access', _429 => _429.match, 'call', _430 => _430(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _431 => _431[1]]);
9175
+ const defaultExport = _optionalChain([code, 'access', _433 => _433.match, 'call', _434 => _434(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _435 => _435[1]]);
9016
9176
  if (!defaultExport) return null;
9017
9177
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
9018
9178
  }
@@ -9073,7 +9233,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9073
9233
  ];
9074
9234
  function getFarmClientOptimizeDepsInclude(renderer) {
9075
9235
  return Array.from(
9076
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _432 => _432.optimizeDeps]) || []])
9236
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _436 => _436.optimizeDeps]) || []])
9077
9237
  );
9078
9238
  }
9079
9239
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
@@ -9098,7 +9258,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9098
9258
  // Farm's HTML boots through a virtual module and imports route UI lazily.
9099
9259
  // Explicit entries let Vite finish that crawl before a navigation can
9100
9260
  // rotate the optimizer hash underneath a hydrated React runtime.
9101
- ..._optionalChain([entries, 'optionalAccess', _433 => _433.length]) ? { entries: [...entries] } : {}
9261
+ ..._optionalChain([entries, 'optionalAccess', _437 => _437.length]) ? { entries: [...entries] } : {}
9102
9262
  };
9103
9263
  }
9104
9264
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
@@ -9128,8 +9288,8 @@ function mergeAlias(farmValue, userValue) {
9128
9288
  }
9129
9289
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
9130
9290
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9131
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _434 => _434.optimizeDeps, 'optionalAccess', _435 => _435.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _436 => _436.optimizeDeps, 'optionalAccess', _437 => _437.noDiscovery])));
9132
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _438 => _438.optimizeDeps, 'optionalAccess', _439 => _439.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _440 => _440.optimizeDeps, 'optionalAccess', _441 => _441.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _442 => _442.optimizeDeps, 'optionalAccess', _443 => _443.holdUntilCrawlEnd]))));
9291
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _438 => _438.optimizeDeps, 'optionalAccess', _439 => _439.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _440 => _440.optimizeDeps, 'optionalAccess', _441 => _441.noDiscovery])));
9292
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _442 => _442.optimizeDeps, 'optionalAccess', _443 => _443.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _444 => _444.optimizeDeps, 'optionalAccess', _445 => _445.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _446 => _446.optimizeDeps, 'optionalAccess', _447 => _447.holdUntilCrawlEnd]))));
9133
9293
  return {
9134
9294
  ...farmConfig,
9135
9295
  ...userConfig,
@@ -9141,9 +9301,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9141
9301
  resolve: {
9142
9302
  ...farmConfig.resolve,
9143
9303
  ...userConfig.resolve,
9144
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _444 => _444.resolve, 'optionalAccess', _445 => _445.alias]), _optionalChain([userConfig, 'access', _446 => _446.resolve, 'optionalAccess', _447 => _447.alias])),
9304
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _448 => _448.resolve, 'optionalAccess', _449 => _449.alias]), _optionalChain([userConfig, 'access', _450 => _450.resolve, 'optionalAccess', _451 => _451.alias])),
9145
9305
  dedupe: Array.from(
9146
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _448 => _448.resolve, 'optionalAccess', _449 => _449.dedupe]) || [], ..._optionalChain([userConfig, 'access', _450 => _450.resolve, 'optionalAccess', _451 => _451.dedupe]) || []])
9306
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _452 => _452.resolve, 'optionalAccess', _453 => _453.dedupe]) || [], ..._optionalChain([userConfig, 'access', _454 => _454.resolve, 'optionalAccess', _455 => _455.dedupe]) || []])
9147
9307
  )
9148
9308
  },
9149
9309
  optimizeDeps: {
@@ -9153,21 +9313,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9153
9313
  holdUntilCrawlEnd,
9154
9314
  include: Array.from(
9155
9315
  /* @__PURE__ */ new Set([
9156
- ..._optionalChain([farmConfig, 'access', _452 => _452.optimizeDeps, 'optionalAccess', _453 => _453.include]) || [],
9157
- ..._optionalChain([userConfig, 'access', _454 => _454.optimizeDeps, 'optionalAccess', _455 => _455.include]) || []
9316
+ ..._optionalChain([farmConfig, 'access', _456 => _456.optimizeDeps, 'optionalAccess', _457 => _457.include]) || [],
9317
+ ..._optionalChain([userConfig, 'access', _458 => _458.optimizeDeps, 'optionalAccess', _459 => _459.include]) || []
9158
9318
  ])
9159
9319
  ),
9160
9320
  exclude: Array.from(
9161
9321
  /* @__PURE__ */ new Set([
9162
- ..._optionalChain([farmConfig, 'access', _456 => _456.optimizeDeps, 'optionalAccess', _457 => _457.exclude]) || [],
9163
- ..._optionalChain([userConfig, 'access', _458 => _458.optimizeDeps, 'optionalAccess', _459 => _459.exclude]) || []
9322
+ ..._optionalChain([farmConfig, 'access', _460 => _460.optimizeDeps, 'optionalAccess', _461 => _461.exclude]) || [],
9323
+ ..._optionalChain([userConfig, 'access', _462 => _462.optimizeDeps, 'optionalAccess', _463 => _463.exclude]) || []
9164
9324
  ])
9165
9325
  )
9166
9326
  },
9167
9327
  ssr: {
9168
9328
  ...farmConfig.ssr,
9169
9329
  ...userConfig.ssr,
9170
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _460 => _460.ssr, 'optionalAccess', _461 => _461.noExternal]), _optionalChain([userConfig, 'access', _462 => _462.ssr, 'optionalAccess', _463 => _463.noExternal]))
9330
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _464 => _464.ssr, 'optionalAccess', _465 => _465.noExternal]), _optionalChain([userConfig, 'access', _466 => _466.ssr, 'optionalAccess', _467 => _467.noExternal]))
9171
9331
  }
9172
9332
  };
9173
9333
  }
@@ -9221,7 +9381,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9221
9381
  ...farmConfig.build,
9222
9382
  rollupOptions: {
9223
9383
  ...userBundlerOptions,
9224
- ..._optionalChain([farmConfig, 'access', _464 => _464.build, 'optionalAccess', _465 => _465.rollupOptions])
9384
+ ..._optionalChain([farmConfig, 'access', _468 => _468.build, 'optionalAccess', _469 => _469.rollupOptions])
9225
9385
  }
9226
9386
  },
9227
9387
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -9229,7 +9389,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9229
9389
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
9230
9390
  ssr: {
9231
9391
  ...merged.ssr,
9232
- external: mergeExternal(_optionalChain([farmConfig, 'access', _466 => _466.ssr, 'optionalAccess', _467 => _467.external]), _optionalChain([userConfig, 'access', _468 => _468.ssr, 'optionalAccess', _469 => _469.external]))
9392
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _470 => _470.ssr, 'optionalAccess', _471 => _471.external]), _optionalChain([userConfig, 'access', _472 => _472.ssr, 'optionalAccess', _473 => _473.external]))
9233
9393
  }
9234
9394
  };
9235
9395
  }
@@ -9300,14 +9460,15 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunk5QIKR7RRcjs.logge
9300
9460
  _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportOpenAPIDevGenerationResult");
9301
9461
 
9302
9462
  // src/vite.ts
9463
+ var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
9303
9464
  function farmLlmsTxtGeneratedPaths(config) {
9304
- const llms = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _470 => _470.agent, 'optionalAccess', _471 => _471.llmsTxt]));
9465
+ const llms = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _474 => _474.agent, 'optionalAccess', _475 => _475.llmsTxt]));
9305
9466
  if (!llms.enabled) return [];
9306
9467
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
9307
9468
  }
9308
9469
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
9309
9470
  function farmAgentGeneratedPaths(config) {
9310
- const crawlers = _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _472 => _472.agent, 'optionalAccess', _473 => _473.crawlers]));
9471
+ const crawlers = _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _476 => _476.agent, 'optionalAccess', _477 => _477.crawlers]));
9311
9472
  return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
9312
9473
  }
9313
9474
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
@@ -9345,7 +9506,7 @@ function loadFarmDocsSearchDevRuntime() {
9345
9506
  }
9346
9507
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDocsSearchDevRuntime, "loadFarmDocsSearchDevRuntime");
9347
9508
  function loadFarmOpenAPIDevRuntime() {
9348
- return import("./manager-G4B2IPYE.cjs");
9509
+ return import("./manager-XZ5TX7AO.cjs");
9349
9510
  }
9350
9511
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmOpenAPIDevRuntime, "loadFarmOpenAPIDevRuntime");
9351
9512
  function loadFarmWorkflowsDevRuntime() {
@@ -9353,7 +9514,7 @@ function loadFarmWorkflowsDevRuntime() {
9353
9514
  }
9354
9515
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
9355
9516
  function loadFarmDevtoolsSnapshotRuntime() {
9356
- return import("./devtools-R6MDDAZK.cjs");
9517
+ return import("./devtools-UHRSZ7VA.cjs");
9357
9518
  }
9358
9519
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
9359
9520
  function loadFarmDevtoolsUIRuntime() {
@@ -9369,7 +9530,7 @@ function farmI18nClientBridgePlugin() {
9369
9530
  name: "farm:i18n-client-bridge",
9370
9531
  enforce: "pre",
9371
9532
  resolveId(id, _importer, options) {
9372
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _474 => _474.ssr])) {
9533
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _478 => _478.ssr])) {
9373
9534
  return FARM_I18N_CLIENT_BRIDGE_ID;
9374
9535
  }
9375
9536
  return null;
@@ -9383,14 +9544,29 @@ function farmI18nClientBridgePlugin() {
9383
9544
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmI18nClientBridgePlugin, "farmI18nClientBridgePlugin");
9384
9545
  var FARM_SERVER_ONLY_ENTRIES = /* @__PURE__ */ new Set(["@farm.js/core/og"]);
9385
9546
  function farmServerOnlyEntriesPlugin() {
9547
+ let root = process.cwd();
9548
+ let vercelOgInstalled = false;
9386
9549
  return {
9387
9550
  name: "farm:server-only-entries",
9388
9551
  enforce: "pre",
9552
+ configResolved(config) {
9553
+ root = config.root;
9554
+ },
9389
9555
  resolveId(id, importer, options) {
9390
- if (_optionalChain([options, 'optionalAccess', _475 => _475.ssr]) || !FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
9391
- this.error(
9392
- `${id} is server-only and cannot be imported into client code${importer ? ` (imported by ${importer})` : ""}. Use it from an API route or another server module.`
9393
- );
9556
+ if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
9557
+ const importedBy = importer ? ` (imported by ${importer})` : "";
9558
+ if (!_optionalChain([options, 'optionalAccess', _479 => _479.ssr])) {
9559
+ this.error(
9560
+ `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
9561
+ );
9562
+ }
9563
+ vercelOgInstalled || (vercelOgInstalled = _chunkLYLEZIG3cjs.isOptionalPeerInstalled.call(void 0, root, "@vercel/og"));
9564
+ if (!vercelOgInstalled) {
9565
+ this.error(
9566
+ `${id} needs @vercel/og, which is not installed${importedBy}. ${_chunkLYLEZIG3cjs.VERCEL_OG_INSTALL_HINT}`
9567
+ );
9568
+ }
9569
+ return null;
9394
9570
  }
9395
9571
  };
9396
9572
  }
@@ -9429,7 +9605,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
9429
9605
  }
9430
9606
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
9431
9607
  function getPublicEnvDefine(config) {
9432
- const publicEnv = _optionalChain([config, 'access', _476 => _476.env, 'optionalAccess', _477 => _477.public]);
9608
+ const publicEnv = _optionalChain([config, 'access', _480 => _480.env, 'optionalAccess', _481 => _481.public]);
9433
9609
  if (!isResolvedEnvScope(publicEnv)) {
9434
9610
  return {};
9435
9611
  }
@@ -9470,7 +9646,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
9470
9646
  return;
9471
9647
  }
9472
9648
  if (res.headersSent) {
9473
- _optionalChain([res, 'access', _478 => _478.destroy, 'optionalCall', _479 => _479(error instanceof Error ? error : new Error(String(error)))]);
9649
+ _optionalChain([res, 'access', _482 => _482.destroy, 'optionalCall', _483 => _483(error instanceof Error ? error : new Error(String(error)))]);
9474
9650
  return;
9475
9651
  }
9476
9652
  res.statusCode = 500;
@@ -9569,7 +9745,7 @@ function interceptFarmDevPageResponse(options) {
9569
9745
  const originalWrite = res.write.bind(res);
9570
9746
  const originalEnd = res.end.bind(res);
9571
9747
  const originalWriteHead = res.writeHead.bind(res);
9572
- const originalFlushHeaders = _optionalChain([res, 'access', _480 => _480.flushHeaders, 'optionalAccess', _481 => _481.bind, 'call', _482 => _482(res)]);
9748
+ const originalFlushHeaders = _optionalChain([res, 'access', _484 => _484.flushHeaders, 'optionalAccess', _485 => _485.bind, 'call', _486 => _486(res)]);
9573
9749
  let afterResponseCalled = false;
9574
9750
  let interceptedEnd = false;
9575
9751
  const htmlChunks = [];
@@ -9609,7 +9785,7 @@ function interceptFarmDevPageResponse(options) {
9609
9785
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
9610
9786
  if (shouldBufferResponse) {
9611
9787
  const callback = args.find((arg) => typeof arg === "function");
9612
- _optionalChain([callback, 'optionalCall', _483 => _483()]);
9788
+ _optionalChain([callback, 'optionalCall', _487 => _487()]);
9613
9789
  return true;
9614
9790
  }
9615
9791
  const writeResult = originalWrite(chunk, ...args);
@@ -9724,14 +9900,14 @@ function getEnvDefines(config, configEnv) {
9724
9900
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
9725
9901
  )
9726
9902
  };
9727
- if (_optionalChain([configEnv, 'optionalAccess', _484 => _484.isSsrBuild])) {
9903
+ if (_optionalChain([configEnv, 'optionalAccess', _488 => _488.isSsrBuild])) {
9728
9904
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
9729
9905
  }
9730
9906
  return defines;
9731
9907
  }
9732
9908
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
9733
9909
  function getFarmAPIBaseURLDefine(config) {
9734
- const baseURL = _optionalChain([config, 'access', _485 => _485.api, 'optionalAccess', _486 => _486.baseURL]);
9910
+ const baseURL = _optionalChain([config, 'access', _489 => _489.api, 'optionalAccess', _490 => _490.baseURL]);
9735
9911
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
9736
9912
  }
9737
9913
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -9761,7 +9937,7 @@ function fileContainsProgrammaticPageRoute(file) {
9761
9937
  _chunkS3JO3N4Hcjs.__name.call(void 0, fileContainsProgrammaticPageRoute, "fileContainsProgrammaticPageRoute");
9762
9938
  function rewriteEarlySsrRelativeImports(options) {
9763
9939
  const cleanId = options.id.split("?", 1)[0];
9764
- if (!path16.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
9940
+ if (!path17.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
9765
9941
  return null;
9766
9942
  }
9767
9943
  const replacements = [];
@@ -9781,7 +9957,7 @@ function rewriteEarlySsrRelativeImports(options) {
9781
9957
  const suffixIndex = source.value.search(/[?#]/);
9782
9958
  const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
9783
9959
  const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
9784
- const resolvedPath = path16.resolve(path16.dirname(cleanId), sourcePath);
9960
+ const resolvedPath = path17.resolve(path17.dirname(cleanId), sourcePath);
9785
9961
  replacements.push({
9786
9962
  start: source.start,
9787
9963
  end: source.end,
@@ -9821,9 +9997,9 @@ function transformIsolatedClientBoundaryModule(options) {
9821
9997
  transformedExports++;
9822
9998
  }, "addWrapper");
9823
9999
  for (const node of body) {
9824
- if (_optionalChain([node, 'optionalAccess', _487 => _487.type]) === "ExportDefaultDeclaration" && node.declaration) {
10000
+ if (_optionalChain([node, 'optionalAccess', _491 => _491.type]) === "ExportDefaultDeclaration" && node.declaration) {
9825
10001
  const declaration2 = node.declaration;
9826
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _488 => _488.id, 'optionalAccess', _489 => _489.name])) {
10002
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _492 => _492.id, 'optionalAccess', _493 => _493.name])) {
9827
10003
  replacements.push({
9828
10004
  start: node.start,
9829
10005
  end: node.end,
@@ -9841,14 +10017,14 @@ function transformIsolatedClientBoundaryModule(options) {
9841
10017
  }
9842
10018
  continue;
9843
10019
  }
9844
- if (_optionalChain([node, 'optionalAccess', _490 => _490.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10020
+ if (_optionalChain([node, 'optionalAccess', _494 => _494.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
9845
10021
  const declaration = node.declaration;
9846
10022
  const declaredNames = [];
9847
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _491 => _491.id, 'optionalAccess', _492 => _492.name])) {
10023
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _495 => _495.id, 'optionalAccess', _496 => _496.name])) {
9848
10024
  declaredNames.push(declaration.id.name);
9849
10025
  } else if (declaration.type === "VariableDeclaration") {
9850
10026
  for (const declarator of declaration.declarations || []) {
9851
- if (_optionalChain([declarator, 'access', _493 => _493.id, 'optionalAccess', _494 => _494.type]) === "Identifier") declaredNames.push(declarator.id.name);
10027
+ if (_optionalChain([declarator, 'access', _497 => _497.id, 'optionalAccess', _498 => _498.type]) === "Identifier") declaredNames.push(declarator.id.name);
9852
10028
  }
9853
10029
  }
9854
10030
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -9912,7 +10088,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
9912
10088
  } catch (e27) {
9913
10089
  return;
9914
10090
  }
9915
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _495 => _495.env, 'optionalAccess', _496 => _496.public]), () => ( {}))));
10091
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _499 => _499.env, 'optionalAccess', _500 => _500.public]), () => ( {}))));
9916
10092
  const findings = analyzeClientBoundary(program, publicKeys);
9917
10093
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
9918
10094
  return;
@@ -9922,7 +10098,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
9922
10098
  }
9923
10099
  _chunkS3JO3N4Hcjs.__name.call(void 0, warnClientBoundaryOnce, "warnClientBoundaryOnce");
9924
10100
  function shouldEmitFarmClientRootHmr(renderer) {
9925
- return _chunkTFAXUHWXcjs.getFarmRendererCapabilities.call(void 0, _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
10101
+ return _chunkPSV6XKPOcjs.getFarmRendererCapabilities.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
9926
10102
  }
9927
10103
  _chunkS3JO3N4Hcjs.__name.call(void 0, shouldEmitFarmClientRootHmr, "shouldEmitFarmClientRootHmr");
9928
10104
  function hasViteAlias(alias, find) {
@@ -9941,6 +10117,7 @@ function farmPlugin(options = {}, initialPluginManager) {
9941
10117
  publicDir: options.publicDir
9942
10118
  });
9943
10119
  let farmApp;
10120
+ let serverFnTransformActive = false;
9944
10121
  let server;
9945
10122
  let apiRouteManager;
9946
10123
  let openAPIManager = null;
@@ -9962,8 +10139,8 @@ function farmPlugin(options = {}, initialPluginManager) {
9962
10139
  name: "farm",
9963
10140
  config(userConfig, configEnv) {
9964
10141
  isBuild = configEnv.command === "build";
9965
- const layerAliases = _chunkY4YMF2NQcjs.getFarmLayerAliases.call(void 0, options.layers);
9966
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _497 => _497.resolve, 'optionalAccess', _498 => _498.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10142
+ const layerAliases = _chunkVPTDD5XFcjs.getFarmLayerAliases.call(void 0, options.layers);
10143
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _501 => _501.resolve, 'optionalAccess', _502 => _502.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
9967
10144
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
9968
10145
  return {
9969
10146
  // Honor Farm's publicDir so the dev server serves the same static
@@ -9979,7 +10156,7 @@ function farmPlugin(options = {}, initialPluginManager) {
9979
10156
  ...layerRoots.length ? {
9980
10157
  server: {
9981
10158
  fs: {
9982
- allow: [path16.resolve(options.root || process.cwd()), ...layerRoots]
10159
+ allow: [path17.resolve(options.root || process.cwd()), ...layerRoots]
9983
10160
  }
9984
10161
  }
9985
10162
  } : {}
@@ -9989,6 +10166,14 @@ function farmPlugin(options = {}, initialPluginManager) {
9989
10166
  if (typeof fontImports.configResolved === "function") {
9990
10167
  await fontImports.configResolved.call(this, config);
9991
10168
  }
10169
+ serverFnTransformActive = config.plugins.some(
10170
+ (plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
10171
+ );
10172
+ if (_optionalChain([options, 'access', _503 => _503.experimental, 'optionalAccess', _504 => _504.serverActions]) === true && !serverFnTransformActive) {
10173
+ _chunk5QIKR7RRcjs.logger.warn(
10174
+ "experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
10175
+ );
10176
+ }
9992
10177
  },
9993
10178
  async configureServer(viteServer) {
9994
10179
  if (typeof fontImports.configureServer === "function") {
@@ -10012,7 +10197,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10012
10197
  );
10013
10198
  await farmApp.initialize();
10014
10199
  const farmConfig = farmApp.getConfig();
10015
- if (_optionalChain([farmConfig, 'access', _499 => _499.agent, 'optionalAccess', _500 => _500.noindexPreviews])) {
10200
+ if (_optionalChain([farmConfig, 'access', _505 => _505.agent, 'optionalAccess', _506 => _506.noindexPreviews])) {
10016
10201
  server.middlewares.use((_req, res, next) => {
10017
10202
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
10018
10203
  res.setHeader("X-Robots-Tag", _chunkISTFC3MZcjs.FARM_PREVIEW_ROBOTS_TAG);
@@ -10022,6 +10207,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10022
10207
  }
10023
10208
  const apiServerBasePath = _chunkWPYFSQKKcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
10024
10209
  const serverConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, farmConfig.server);
10210
+ globalThis.__FARM_IMAGE_CONFIG__ = _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, farmConfig.images);
10025
10211
  let imageHandler = null;
10026
10212
  if (farmConfig.images.provider !== "none") {
10027
10213
  const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
@@ -10031,7 +10217,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10031
10217
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
10032
10218
  // Vite owns this address. Unlike request.url, it cannot be replaced by
10033
10219
  // a caller-controlled Host header.
10034
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _501 => _501.resolvedUrls, 'optionalAccess', _502 => _502.local, 'access', _503 => _503[0]]), "trustedLocalOrigin"),
10220
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _507 => _507.resolvedUrls, 'optionalAccess', _508 => _508.local, 'access', _509 => _509[0]]), "trustedLocalOrigin"),
10035
10221
  onError(error) {
10036
10222
  _chunk5QIKR7RRcjs.logger.error(
10037
10223
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -10039,8 +10225,8 @@ function farmPlugin(options = {}, initialPluginManager) {
10039
10225
  }
10040
10226
  });
10041
10227
  }
10042
- const sourceRoots = _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, farmConfig);
10043
- server.watcher.add(sourceRoots.map((source) => path16.join(source.root, source.srcDir)));
10228
+ const sourceRoots = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, farmConfig);
10229
+ server.watcher.add(sourceRoots.map((source) => path17.join(source.root, source.srcDir)));
10044
10230
  if (farmConfig.i18n.enabled) {
10045
10231
  server.watcher.add(
10046
10232
  farmConfig.i18n.locales.map(
@@ -10051,15 +10237,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10051
10237
  const workflowConfig = farmConfig.workflows;
10052
10238
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
10053
10239
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
10054
- ..._optionalChain([options, 'access', _504 => _504.openapi, 'optionalAccess', _505 => _505.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10055
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _506 => _506.getFarmDocsRouteTypeEntries, 'call', _507 => _507(farmConfig.docs)]), () => ( []))
10240
+ ..._optionalChain([options, 'access', _510 => _510.openapi, 'optionalAccess', _511 => _511.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10241
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _512 => _512.getFarmDocsRouteTypeEntries, 'call', _513 => _513(farmConfig.docs)]), () => ( []))
10056
10242
  ], "getExtraRouteTypes");
10057
10243
  const appDirSlugs = sourceRoots.map(
10058
- (source) => path16.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
10244
+ (source) => path17.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
10059
10245
  );
10060
10246
  const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
10061
10247
  try {
10062
- const result = await _chunkXFFQSD2Fcjs.generateFarmTypeArtifacts.call(void 0, {
10248
+ const result = await _chunkDW34V5SMcjs.generateFarmTypeArtifacts.call(void 0, {
10063
10249
  root: farmConfig.root,
10064
10250
  srcDir: farmConfig.srcDir,
10065
10251
  layers: farmConfig.layers,
@@ -10096,13 +10282,13 @@ function farmPlugin(options = {}, initialPluginManager) {
10096
10282
  }, "generateTypeArtifacts");
10097
10283
  await generateTypeArtifacts("startup");
10098
10284
  const srcDirSlugs = sourceRoots.map(
10099
- (source) => path16.join(source.root, source.srcDir).replace(/\\/g, "/")
10285
+ (source) => path17.join(source.root, source.srcDir).replace(/\\/g, "/")
10100
10286
  );
10101
10287
  const layerConfigFiles = new Set(
10102
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _508 => _508.configFile, 'optionalAccess', _509 => _509.replace, 'call', _510 => _510(/\\/g, "/")])).filter((file) => Boolean(file))
10288
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _514 => _514.configFile, 'optionalAccess', _515 => _515.replace, 'call', _516 => _516(/\\/g, "/")])).filter((file) => Boolean(file))
10103
10289
  );
10104
10290
  const routeModuleExtensions = /* @__PURE__ */ new Set([
10105
- ..._chunkTFAXUHWXcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
10291
+ ..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
10106
10292
  ".md",
10107
10293
  ".mdx"
10108
10294
  ]);
@@ -10178,7 +10364,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10178
10364
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
10179
10365
  }
10180
10366
  if (isI18nCatalogFile(file)) {
10181
- _optionalChain([farmApp, 'optionalAccess', _511 => _511.getI18nRuntime, 'call', _512 => _512(), 'access', _513 => _513.reload, 'call', _514 => _514(), 'access', _515 => _515.then, 'call', _516 => _516(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _517 => _517.catch, 'call', _518 => _518((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
10367
+ _optionalChain([farmApp, 'optionalAccess', _517 => _517.getI18nRuntime, 'call', _518 => _518(), 'access', _519 => _519.reload, 'call', _520 => _520(), 'access', _521 => _521.then, 'call', _522 => _522(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _523 => _523.catch, 'call', _524 => _524((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
10182
10368
  }
10183
10369
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
10184
10370
  if (isRouteRefreshEvent) {
@@ -10191,15 +10377,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10191
10377
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
10192
10378
  pendingRouteRefreshIncludesMiddleware = false;
10193
10379
  Promise.all([
10194
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _519 => _519(`${ev} ${file}`)]),
10195
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _520 => _520.reload, 'call', _521 => _521()]) : void 0
10380
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _525 => _525(`${ev} ${file}`)]),
10381
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _526 => _526.reload, 'call', _527 => _527()]) : void 0
10196
10382
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
10197
10383
  }, 50);
10198
10384
  }
10199
10385
  }
10200
10386
  });
10201
10387
  });
10202
- const appDirs = _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, farmConfig);
10388
+ const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, farmConfig);
10203
10389
  const routeManager = farmApp.getRouteManager();
10204
10390
  const discoveredRoutes = [];
10205
10391
  for (const [pattern, entry] of routeManager.getRoutes()) {
@@ -10226,7 +10412,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10226
10412
  layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
10227
10413
  });
10228
10414
  }
10229
- apiRouteManager = new (0, _chunkB3WK4DTXcjs.APIRouteManager)(appDirs, server, {
10415
+ apiRouteManager = new (0, _chunkIMBMOEWTcjs.APIRouteManager)(appDirs, server, {
10230
10416
  plugins: farmConfig.plugins,
10231
10417
  i18n: farmApp.getI18nRuntime(),
10232
10418
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -10235,7 +10421,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10235
10421
  await apiRouteManager.discoverRoutes();
10236
10422
  let discoveredWorkflows = [];
10237
10423
  const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
10238
- (dir) => fs9.existsSync(path16.isAbsolute(dir) ? dir : path16.join(farmConfig.root, dir))
10424
+ (dir) => fs9.existsSync(path17.isAbsolute(dir) ? dir : path17.join(farmConfig.root, dir))
10239
10425
  );
10240
10426
  if (hasWorkflowDirectory) {
10241
10427
  const { createFarmWorkflowRequestHandler, discoverFarmWorkflows } = await loadFarmWorkflowsDevRuntime();
@@ -10281,11 +10467,11 @@ function farmPlugin(options = {}, initialPluginManager) {
10281
10467
  });
10282
10468
  }
10283
10469
  }
10284
- if (_optionalChain([options, 'access', _522 => _522.openapi, 'optionalAccess', _523 => _523.enabled])) {
10470
+ if (_optionalChain([options, 'access', _528 => _528.openapi, 'optionalAccess', _529 => _529.enabled])) {
10285
10471
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
10286
10472
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
10287
10473
  mode: "development",
10288
- apiBaseURL: typeof _optionalChain([options, 'access', _524 => _524.api, 'optionalAccess', _525 => _525.baseURL]) === "string" ? options.api.baseURL : void 0
10474
+ apiBaseURL: typeof _optionalChain([options, 'access', _530 => _530.api, 'optionalAccess', _531 => _531.baseURL]) === "string" ? options.api.baseURL : void 0
10289
10475
  });
10290
10476
  const spec = await openAPIManager.generateSpec();
10291
10477
  reportOpenAPIDevGenerationResult(spec);
@@ -10324,13 +10510,13 @@ function farmPlugin(options = {}, initialPluginManager) {
10324
10510
  ),
10325
10511
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
10326
10512
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
10327
- if (specifier === _optionalChain([farmConfig, 'access', _526 => _526.docs, 'access', _527 => _527.adapter, 'optionalAccess', _528 => _528.server]) && _optionalChain([resolved, 'optionalAccess', _529 => _529.id])) {
10513
+ if (specifier === _optionalChain([farmConfig, 'access', _532 => _532.docs, 'access', _533 => _533.adapter, 'optionalAccess', _534 => _534.server]) && _optionalChain([resolved, 'optionalAccess', _535 => _535.id])) {
10328
10514
  return import(
10329
10515
  /* @vite-ignore */
10330
10516
  _url.pathToFileURL.call(void 0, resolved.id).href
10331
10517
  );
10332
10518
  }
10333
- return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _530 => _530.id]), () => ( specifier)));
10519
+ return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _536 => _536.id]), () => ( specifier)));
10334
10520
  }, "loadModule")
10335
10521
  }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
10336
10522
  root: farmConfig.root,
@@ -10345,7 +10531,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10345
10531
  )
10346
10532
  }) : null;
10347
10533
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
10348
- if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _531 => _531.headers, 'access', _532 => _532.get, 'call', _533 => _533("content-type"), 'optionalAccess', _534 => _534.toLowerCase, 'call', _535 => _535(), 'access', _536 => _536.includes, 'call', _537 => _537("text/html")])) {
10534
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _537 => _537.headers, 'access', _538 => _538.get, 'call', _539 => _539("content-type"), 'optionalAccess', _540 => _540.toLowerCase, 'call', _541 => _541(), 'access', _542 => _542.includes, 'call', _543 => _543("text/html")])) {
10349
10535
  return response;
10350
10536
  }
10351
10537
  const pathname = new URL(request2.url).pathname;
@@ -10366,9 +10552,9 @@ function farmPlugin(options = {}, initialPluginManager) {
10366
10552
  headers: response.headers
10367
10553
  });
10368
10554
  }
10369
- const docsRenderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _538 => _538.getConfig, 'call', _539 => _539()]), () => ( options))).renderer);
10555
+ const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _544 => _544.getConfig, 'call', _545 => _545()]), () => ( options))).renderer);
10370
10556
  const [rendererRuntime, layoutModules] = await Promise.all([
10371
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
10557
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
10372
10558
  Promise.all(
10373
10559
  layoutEntries.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
10374
10560
  )
@@ -10395,7 +10581,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10395
10581
  ])
10396
10582
  );
10397
10583
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
10398
- const pageModulePath = _optionalChain([matchedRoute, 'access', _540 => _540.route, 'optionalAccess', _541 => _541.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
10584
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _546 => _546.route, 'optionalAccess', _547 => _547.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
10399
10585
  const bootstrapScript = `<script>
10400
10586
  window.__FARM_PROPS__ = ${inlineValue({ params })};
10401
10587
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -10489,7 +10675,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10489
10675
  }, "dispatch")
10490
10676
  },
10491
10677
  (request2) => {
10492
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _542 => _542.getConfig, 'call', _543 => _543()]), () => ( options));
10678
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _548 => _548.getConfig, 'call', _549 => _549()]), () => ( options));
10493
10679
  const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
10494
10680
  return _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, request2, {
10495
10681
  trustProxy: currentServerConfig.trustProxy
@@ -10500,7 +10686,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10500
10686
  withAPIRequestTracing(async (req, res, next) => {
10501
10687
  const requestUrl = req.url || "/";
10502
10688
  const requestMethod = req.method || "GET";
10503
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _544 => _544.getConfig, 'call', _545 => _545()]), () => ( options));
10689
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _550 => _550.getConfig, 'call', _551 => _551()]), () => ( options));
10504
10690
  const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
10505
10691
  const parsedRequestUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
10506
10692
  trustProxy: currentServerConfig.trustProxy
@@ -10590,7 +10776,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10590
10776
  return;
10591
10777
  }
10592
10778
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
10593
- if (!_optionalChain([middlewareManager, 'optionalAccess', _546 => _546.hasMiddleware, 'call', _547 => _547()])) return false;
10779
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _552 => _552.hasMiddleware, 'call', _553 => _553()])) return false;
10594
10780
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
10595
10781
  return runFarmMiddlewareWithNavigation(
10596
10782
  farmApp.getServerRenderer(),
@@ -10601,7 +10787,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10601
10787
  );
10602
10788
  }, "runAppMiddlewareForContentRoute");
10603
10789
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
10604
- if (openAPIManager && _optionalChain([options, 'access', _548 => _548.openapi, 'optionalAccess', _549 => _549.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
10790
+ if (openAPIManager && _optionalChain([options, 'access', _554 => _554.openapi, 'optionalAccess', _555 => _555.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
10605
10791
  if (await runAppMiddlewareForContentRoute()) return;
10606
10792
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
10607
10793
  res.statusCode = 405;
@@ -10618,7 +10804,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10618
10804
  res.end(requestMethod === "HEAD" ? void 0 : body);
10619
10805
  return;
10620
10806
  }
10621
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _550 => _550.openapi, 'optionalAccess', _551 => _551.route])) {
10807
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _556 => _556.openapi, 'optionalAccess', _557 => _557.route])) {
10622
10808
  if (await runAppMiddlewareForContentRoute()) return;
10623
10809
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
10624
10810
  return docsHandler(req, res);
@@ -10658,7 +10844,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10658
10844
  config: farmApp.getConfig().mdx,
10659
10845
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
10660
10846
  const match = farmApp.getRouteManager().matchRoute(pathname2);
10661
- const sourcePath = _optionalChain([match, 'access', _552 => _552.route, 'optionalAccess', _553 => _553.markdownSourcePath]) || (match.route && _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
10847
+ const sourcePath = _optionalChain([match, 'access', _558 => _558.route, 'optionalAccess', _559 => _559.markdownSourcePath]) || (match.route && _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
10662
10848
  if (!sourcePath) {
10663
10849
  return null;
10664
10850
  }
@@ -10766,7 +10952,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10766
10952
  "beforeRequest",
10767
10953
  (plugin) => {
10768
10954
  const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
10769
- return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _554 => _554.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
10955
+ return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _560 => _560.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
10770
10956
  },
10771
10957
  req,
10772
10958
  res
@@ -10896,7 +11082,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10896
11082
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
10897
11083
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
10898
11084
  if (apiHandler && hasExplicitAPIRoute) {
10899
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _555 => _555.route, 'access', _556 => _556.path]) || _optionalChain([apiRouteManager, 'access', _557 => _557.matchRoute, 'call', _558 => _558(pathname2), 'optionalAccess', _559 => _559.route, 'access', _560 => _560.path]) || urlPath2;
11085
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _561 => _561.route, 'access', _562 => _562.path]) || _optionalChain([apiRouteManager, 'access', _563 => _563.matchRoute, 'call', _564 => _564(pathname2), 'optionalAccess', _565 => _565.route, 'access', _566 => _566.path]) || urlPath2;
10900
11086
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
10901
11087
  type: "route.matched",
10902
11088
  pathname: pathname2,
@@ -10986,7 +11172,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10986
11172
  return;
10987
11173
  }
10988
11174
  }
10989
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _561 => _561.isFarmDocsAPIRequest, 'call', _562 => _562(pathname2)])) {
11175
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _567 => _567.isFarmDocsAPIRequest, 'call', _568 => _568(pathname2)])) {
10990
11176
  try {
10991
11177
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
10992
11178
  const headers = new Headers();
@@ -11059,18 +11245,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11059
11245
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
11060
11246
  return;
11061
11247
  }
11062
- if (_optionalChain([req, 'access', _563 => _563.url, 'optionalAccess', _564 => _564.startsWith, 'call', _565 => _565("/@")]) || _optionalChain([req, 'access', _566 => _566.url, 'optionalAccess', _567 => _567.startsWith, 'call', _568 => _568("/node_modules")])) {
11248
+ if (_optionalChain([req, 'access', _569 => _569.url, 'optionalAccess', _570 => _570.startsWith, 'call', _571 => _571("/@")]) || _optionalChain([req, 'access', _572 => _572.url, 'optionalAccess', _573 => _573.startsWith, 'call', _574 => _574("/node_modules")])) {
11063
11249
  return next();
11064
11250
  }
11065
11251
  if (shouldBypassFarmRouterForDottedPath(
11066
11252
  requestPathname,
11067
- _optionalChain([farmApp, 'optionalAccess', _569 => _569.getRouteManager, 'call', _570 => _570()]),
11253
+ _optionalChain([farmApp, 'optionalAccess', _575 => _575.getRouteManager, 'call', _576 => _576()]),
11068
11254
  [server.config.publicDir, server.config.root],
11069
11255
  farmAgentGeneratedPaths(farmConfig)
11070
11256
  )) {
11071
11257
  return next();
11072
11258
  }
11073
- if (_optionalChain([req, 'access', _571 => _571.url, 'optionalAccess', _572 => _572.startsWith, 'call', _573 => _573("/__farm/page-data")])) {
11259
+ if (_optionalChain([req, 'access', _577 => _577.url, 'optionalAccess', _578 => _578.startsWith, 'call', _579 => _579("/__farm/page-data")])) {
11074
11260
  const urlObj = parsedRequestUrl;
11075
11261
  const targetPath = urlObj.searchParams.get("path") || "/";
11076
11262
  try {
@@ -11098,7 +11284,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11098
11284
  });
11099
11285
  let middlewareMap = /* @__PURE__ */ new Map();
11100
11286
  let middlewareContext = /* @__PURE__ */ new Map();
11101
- if (_optionalChain([middlewareManager, 'optionalAccess', _574 => _574.hasMiddleware, 'call', _575 => _575()])) {
11287
+ if (_optionalChain([middlewareManager, 'optionalAccess', _580 => _580.hasMiddleware, 'call', _581 => _581()])) {
11102
11288
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
11103
11289
  const handled = await runFarmMiddlewareWithNavigation(
11104
11290
  farmApp.getServerRenderer(),
@@ -11126,10 +11312,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11126
11312
  if (pm) {
11127
11313
  await pm.runHookParallel("afterRouteMatch", {
11128
11314
  pathname: targetPath,
11129
- matched: !!_optionalChain([match, 'optionalAccess', _576 => _576.route]),
11130
- routePattern: _optionalChain([match, 'optionalAccess', _577 => _577.route, 'optionalAccess', _578 => _578.pattern]) || null,
11131
- params: _optionalChain([match, 'optionalAccess', _579 => _579.params]) || {},
11132
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _580 => _580.layouts]) || []).map((l) => l.pattern)
11315
+ matched: !!_optionalChain([match, 'optionalAccess', _582 => _582.route]),
11316
+ routePattern: _optionalChain([match, 'optionalAccess', _583 => _583.route, 'optionalAccess', _584 => _584.pattern]) || null,
11317
+ params: _optionalChain([match, 'optionalAccess', _585 => _585.params]) || {},
11318
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _586 => _586.layouts]) || []).map((l) => l.pattern)
11133
11319
  });
11134
11320
  }
11135
11321
  if (!match) {
@@ -11266,7 +11452,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11266
11452
  pageShouldHydrate: shouldHydrate,
11267
11453
  layoutShouldHydrate: shouldHydrateLayout,
11268
11454
  islandStrategy: hydrationIslandStrategy,
11269
- rendering: _chunkXFFQSD2Fcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
11455
+ rendering: _chunkDW34V5SMcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
11270
11456
  });
11271
11457
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
11272
11458
  const layoutStartIndex = getSharedLayoutPrefixLength(
@@ -11280,7 +11466,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11280
11466
  middlewareContext,
11281
11467
  () => renderer.renderNavigationFragment({
11282
11468
  PageComponent: routeModule.default,
11283
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _581 => _581.default]),
11469
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _587 => _587.default]),
11284
11470
  pageProps: routeProps,
11285
11471
  params,
11286
11472
  layouts: layouts.map((layout, index) => ({
@@ -11386,14 +11572,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11386
11572
  trustProxy: currentServerConfig.trustProxy
11387
11573
  }).pathname;
11388
11574
  const routeManager2 = farmApp.getRouteManager();
11389
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _582 => _582.hasHook, 'call', _583 => _583("beforeRouteMatch")]), () => ( false));
11390
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _584 => _584.hasHook, 'call', _585 => _585("afterRouteMatch")]), () => ( false));
11391
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _586 => _586.hasHook, 'call', _587 => _587("beforeRequest")]), () => ( false));
11392
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _588 => _588.hasHook, 'call', _589 => _589("beforeRender")]), () => ( false));
11393
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("afterResponse")]), () => ( false));
11394
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("afterRender")]), () => ( false)));
11395
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasRuntimeRequestHooks, 'call', _597 => _597()]), () => ( false));
11396
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasRuntimeHook, 'call', _599 => _599("after")]), () => ( false));
11575
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _588 => _588.hasHook, 'call', _589 => _589("beforeRouteMatch")]), () => ( false));
11576
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("afterRouteMatch")]), () => ( false));
11577
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("beforeRequest")]), () => ( false));
11578
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("beforeRender")]), () => ( false));
11579
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasHook, 'call', _597 => _597("afterResponse")]), () => ( false));
11580
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasHook, 'call', _599 => _599("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _600 => _600.hasHook, 'call', _601 => _601("afterRender")]), () => ( false)));
11581
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _602 => _602.hasRuntimeRequestHooks, 'call', _603 => _603()]), () => ( false));
11582
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _604 => _604.hasRuntimeHook, 'call', _605 => _605("after")]), () => ( false));
11397
11583
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
11398
11584
  let runtimeSession;
11399
11585
  if (pm && hasRuntimeRequestHooks) {
@@ -11404,8 +11590,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11404
11590
  kind: "page",
11405
11591
  route: {
11406
11592
  pathname: requestedPathname,
11407
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _600 => _600.route, 'optionalAccess', _601 => _601.pattern]) || null,
11408
- params: _optionalChain([requestedMatch, 'optionalAccess', _602 => _602.params]) || {}
11593
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _606 => _606.route, 'optionalAccess', _607 => _607.pattern]) || null,
11594
+ params: _optionalChain([requestedMatch, 'optionalAccess', _608 => _608.params]) || {}
11409
11595
  }
11410
11596
  }
11411
11597
  );
@@ -11438,17 +11624,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11438
11624
  if (pm && hasAfterRouteMatchHook) {
11439
11625
  await pm.runHookParallel("afterRouteMatch", {
11440
11626
  pathname,
11441
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _603 => _603.route]),
11442
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _604 => _604.route, 'optionalAccess', _605 => _605.pattern]) || null,
11443
- params: _optionalChain([routeMatch, 'optionalAccess', _606 => _606.params]) || {},
11444
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _607 => _607.layouts]) || []).map((l) => l.pattern)
11627
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _609 => _609.route]),
11628
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _610 => _610.route, 'optionalAccess', _611 => _611.pattern]) || null,
11629
+ params: _optionalChain([routeMatch, 'optionalAccess', _612 => _612.params]) || {},
11630
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _613 => _613.layouts]) || []).map((l) => l.pattern)
11445
11631
  });
11446
11632
  }
11447
11633
  const renderPayload = {
11448
11634
  pathname,
11449
11635
  method,
11450
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _608 => _608.route, 'optionalAccess', _609 => _609.pattern]) || null,
11451
- params: _optionalChain([routeMatch, 'optionalAccess', _610 => _610.params]) || {}
11636
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _614 => _614.route, 'optionalAccess', _615 => _615.pattern]) || null,
11637
+ params: _optionalChain([routeMatch, 'optionalAccess', _616 => _616.params]) || {}
11452
11638
  };
11453
11639
  const shouldInterceptResponse = Boolean(
11454
11640
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -11470,7 +11656,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11470
11656
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
11471
11657
  }) : void 0;
11472
11658
  try {
11473
- if (_optionalChain([middlewareManager, 'optionalAccess', _611 => _611.hasMiddleware, 'call', _612 => _612()])) {
11659
+ if (_optionalChain([middlewareManager, 'optionalAccess', _617 => _617.hasMiddleware, 'call', _618 => _618()])) {
11474
11660
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
11475
11661
  const handled = await runFarmMiddlewareWithNavigation(
11476
11662
  farmApp.getServerRenderer(),
@@ -11480,7 +11666,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11480
11666
  () => middlewareManager.execute(req, res)
11481
11667
  );
11482
11668
  if (handled) {
11483
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _613 => _613.isEnded, 'call', _614 => _614()])) {
11669
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _619 => _619.isEnded, 'call', _620 => _620()])) {
11484
11670
  const duration = Date.now() - startTime;
11485
11671
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
11486
11672
  }
@@ -11492,7 +11678,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11492
11678
  req.url || "/",
11493
11679
  `http://${req.headers.host || "localhost:3000"}`
11494
11680
  ).pathname;
11495
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _615 => _615.matchRoute, 'call', _616 => _616(currentPathname), 'optionalAccess', _617 => _617.route]));
11681
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _621 => _621.matchRoute, 'call', _622 => _622(currentPathname), 'optionalAccess', _623 => _623.route]));
11496
11682
  await pm.runHookParallelFiltered(
11497
11683
  "beforeRequest",
11498
11684
  (plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
@@ -11500,8 +11686,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11500
11686
  res
11501
11687
  );
11502
11688
  }
11503
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _618 => _618.isEnded, 'call', _619 => _619()])) {
11504
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _620 => _620.isEnded, 'call', _621 => _621()])) {
11689
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _624 => _624.isEnded, 'call', _625 => _625()])) {
11690
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _626 => _626.isEnded, 'call', _627 => _627()])) {
11505
11691
  const duration = Date.now() - startTime;
11506
11692
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
11507
11693
  }
@@ -11559,36 +11745,36 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11559
11745
  if (imageModule) return imageModule;
11560
11746
  }
11561
11747
  if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
11562
- const renderer = _optionalChain([farmApp, 'optionalAccess', _622 => _622.getConfig, 'call', _623 => _623(), 'access', _624 => _624.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11563
- return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _625 => _625.config, 'access', _626 => _626.root]) || options.root, renderer);
11748
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _628 => _628.getConfig, 'call', _629 => _629(), 'access', _630 => _630.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
11749
+ return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _631 => _631.config, 'access', _632 => _632.root]) || options.root, renderer);
11564
11750
  }
11565
11751
  if (isFarmClientVirtualId(id)) {
11566
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _627 => _627.getConfig, 'call', _628 => _628()]);
11567
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _629 => _629.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11568
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _630 => _630.integrations]) || options.integrations;
11569
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _631 => _631.root]) || _optionalChain([server, 'optionalAccess', _632 => _632.config, 'access', _633 => _633.root]) || process.cwd();
11570
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _634 => _634.docs]);
11752
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _633 => _633.getConfig, 'call', _634 => _634()]);
11753
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _635 => _635.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
11754
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _636 => _636.integrations]) || options.integrations;
11755
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.root]) || _optionalChain([server, 'optionalAccess', _638 => _638.config, 'access', _639 => _639.root]) || process.cwd();
11756
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _640 => _640.docs]);
11571
11757
  const adapterOwnsDocsRuntime = Boolean(
11572
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _635 => _635.adapter, 'optionalAccess', _636 => _636.server]) && docs.adapter.react
11758
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _641 => _641.adapter, 'optionalAccess', _642 => _642.server]) && docs.adapter.react
11573
11759
  );
11574
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
11760
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _643 => _643.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
11575
11761
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
11576
- _optionalChain([docs, 'optionalAccess', _638 => _638.enabled]) ? loadFarmDocsDevRuntime() : null,
11577
- _optionalChain([docs, 'optionalAccess', _639 => _639.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
11762
+ _optionalChain([docs, 'optionalAccess', _644 => _644.enabled]) ? loadFarmDocsDevRuntime() : null,
11763
+ _optionalChain([docs, 'optionalAccess', _645 => _645.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
11578
11764
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
11579
11765
  ]);
11580
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _640 => _640.isFarmDocsSearchEnabled, 'call', _641 => _641(docs)]), () => ( false));
11766
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _646 => _646.isFarmDocsSearchEnabled, 'call', _647 => _647(docs)]), () => ( false));
11581
11767
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
11582
11768
  docsSearchEnabled,
11583
11769
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
11584
11770
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
11585
11771
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
11586
11772
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunkQBPXNZGVcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
11587
- const integrationProviders = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
11773
+ const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
11588
11774
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
11589
- _optionalChain([resolvedConfig, 'optionalAccess', _642 => _642.experimental, 'optionalAccess', _643 => _643.isolatedClientHydration]),
11775
+ _optionalChain([resolvedConfig, 'optionalAccess', _648 => _648.experimental, 'optionalAccess', _649 => _649.isolatedClientHydration]),
11590
11776
  {
11591
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _644 => _644.experimental, 'optionalAccess', _645 => _645.serverComponents]) === true,
11777
+ serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.experimental, 'optionalAccess', _651 => _651.serverComponents]) === true,
11592
11778
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
11593
11779
  }
11594
11780
  );
@@ -11596,31 +11782,31 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11596
11782
  integrationProviders,
11597
11783
  [
11598
11784
  ..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
11599
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _646 => _646.getFarmDocsDocumentNavigationMatchers, 'call', _647 => _647(docs)]), () => ( []))
11785
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _652 => _652.getFarmDocsDocumentNavigationMatchers, 'call', _653 => _653(docs)]), () => ( []))
11600
11786
  ],
11601
11787
  generatedDocsSearchRuntime,
11602
11788
  `${generatedDevtoolsClientRuntime}
11603
11789
  ${generatedDevIndicatorsClientRuntime}`,
11604
- _optionalChain([resolvedConfig, 'optionalAccess', _648 => _648.plugins]) || [],
11790
+ _optionalChain([resolvedConfig, 'optionalAccess', _654 => _654.plugins]) || [],
11605
11791
  root,
11606
- _optionalChain([resolvedConfig, 'optionalAccess', _649 => _649.srcDir]) || options.srcDir || "src",
11607
- _optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.publicRuntimeConfig]) || options.publicRuntimeConfig,
11608
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _651 => _651.adapter, 'optionalAccess', _652 => _652.react]) : void 0,
11792
+ _optionalChain([resolvedConfig, 'optionalAccess', _655 => _655.srcDir]) || options.srcDir || "src",
11793
+ _optionalChain([resolvedConfig, 'optionalAccess', _656 => _656.publicRuntimeConfig]) || options.publicRuntimeConfig,
11794
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _657 => _657.adapter, 'optionalAccess', _658 => _658.react]) : void 0,
11609
11795
  renderer,
11610
- isolatedHydrationMode === "enabled" || _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _653 => _653.getRouteManager, 'call', _654 => _654(), 'access', _655 => _655.getIsolatedClientBoundaryModules, 'call', _656 => _656(root)])))), 'optionalAccess', _657 => _657.size]) > 0,
11611
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.trailingSlash]), () => ( false)),
11612
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _659 => _659.basePath]), () => ( "/")),
11796
+ isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _659 => _659.getRouteManager, 'call', _660 => _660(), 'access', _661 => _661.getIsolatedClientBoundaryModules, 'call', _662 => _662(root)])))), 'optionalAccess', _663 => _663.size]) > 0,
11797
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _664 => _664.trailingSlash]), () => ( false)),
11798
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _665 => _665.basePath]), () => ( "/")),
11613
11799
  generateClientCachePersistenceCode(
11614
- resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _660 => _660.cache]))
11800
+ resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _666 => _666.cache]))
11615
11801
  ),
11616
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
11802
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
11617
11803
  );
11618
11804
  }
11619
11805
  if (id === "/@farm/server") {
11620
11806
  return generateServerCode();
11621
11807
  }
11622
11808
  if (id === "/@farm/manifest") {
11623
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _661 => _661.getRouteManager, 'call', _662 => _662()]);
11809
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _667 => _667.getRouteManager, 'call', _668 => _668()]);
11624
11810
  if (!routeManager) {
11625
11811
  return `
11626
11812
  export const getManifest = () => ({
@@ -11635,7 +11821,7 @@ export const getManifest = () => ({
11635
11821
  const manifest = routeManager.generateClientManifest(server.config.root);
11636
11822
  const globalStylesheetHref = resolveDevGlobalStylesheetHref(
11637
11823
  server.config.root,
11638
- _optionalChain([farmApp, 'optionalAccess', _663 => _663.getConfig, 'call', _664 => _664(), 'access', _665 => _665.srcDir])
11824
+ _optionalChain([farmApp, 'optionalAccess', _669 => _669.getConfig, 'call', _670 => _670(), 'access', _671 => _671.srcDir])
11639
11825
  );
11640
11826
  const fullManifest = {
11641
11827
  clientEntry: "/@farm/client.js",
@@ -11686,17 +11872,17 @@ export const manifest = getManifest();
11686
11872
  }
11687
11873
  },
11688
11874
  async transform(code, id, transformOptions) {
11689
- if (!_optionalChain([transformOptions, 'optionalAccess', _666 => _666.ssr])) {
11690
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _667 => _667.getConfig, 'call', _668 => _668()]), () => ( options));
11691
- if (_optionalChain([currentConfig, 'access', _669 => _669.experimental, 'optionalAccess', _670 => _670.serverActions]) !== true) {
11875
+ if (!_optionalChain([transformOptions, 'optionalAccess', _672 => _672.ssr])) {
11876
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _673 => _673.getConfig, 'call', _674 => _674()]), () => ( options));
11877
+ if (_optionalChain([currentConfig, 'access', _675 => _675.experimental, 'optionalAccess', _676 => _676.serverActions]) !== true || !serverFnTransformActive) {
11692
11878
  const violation = findClientServerFnViolation(code, id);
11693
11879
  if (violation) {
11694
11880
  this.error(formatServerFnBoundaryError(violation, id));
11695
11881
  }
11696
11882
  }
11697
11883
  }
11698
- if (!_optionalChain([transformOptions, 'optionalAccess', _671 => _671.ssr]) && shouldInspectClientBoundary(id, code)) {
11699
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _672 => _672.getConfig, 'call', _673 => _673()]), () => ( options)));
11884
+ if (!_optionalChain([transformOptions, 'optionalAccess', _677 => _677.ssr]) && shouldInspectClientBoundary(id, code)) {
11885
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _678 => _678.getConfig, 'call', _679 => _679()]), () => ( options)));
11700
11886
  }
11701
11887
  if (typeof imageImports.transform === "function") {
11702
11888
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -11711,13 +11897,13 @@ export const manifest = getManifest();
11711
11897
  id,
11712
11898
  transformOptions
11713
11899
  );
11714
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _674 => _674.code, 'optionalAccess', _675 => _675.toString, 'call', _676 => _676()]);
11900
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _680 => _680.code, 'optionalAccess', _681 => _681.toString, 'call', _682 => _682()]);
11715
11901
  if (fontCode) {
11716
11902
  transformedCode = fontCode;
11717
11903
  transformed = true;
11718
11904
  }
11719
11905
  }
11720
- if (_optionalChain([transformOptions, 'optionalAccess', _677 => _677.ssr]) && server) {
11906
+ if (_optionalChain([transformOptions, 'optionalAccess', _683 => _683.ssr]) && server) {
11721
11907
  const rewrittenImports = rewriteEarlySsrRelativeImports({
11722
11908
  code: transformedCode,
11723
11909
  id,
@@ -11737,13 +11923,13 @@ export const manifest = getManifest();
11737
11923
  }
11738
11924
  transformedCode = stripUseClientDirective(transformedCode);
11739
11925
  transformed = true;
11740
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _678 => _678.getConfig, 'call', _679 => _679()]), () => ( options));
11926
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _684 => _684.getConfig, 'call', _685 => _685()]), () => ( options));
11741
11927
  let isolatedModuleReference = null;
11742
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _680 => _680.config, 'access', _681 => _681.root]) || process.cwd();
11928
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _686 => _686.config, 'access', _687 => _687.root]) || process.cwd();
11743
11929
  const cleanId = id.split("?", 1)[0];
11744
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _682 => _682.getRouteManager, 'call', _683 => _683(), 'access', _684 => _684.getIsolatedClientBoundaryModules, 'call', _685 => _685(root)])));
11745
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _686 => _686.has, 'call', _687 => _687(path16.resolve(cleanId))]) === true;
11746
- if (_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
11930
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _688 => _688.getRouteManager, 'call', _689 => _689(), 'access', _690 => _690.getIsolatedClientBoundaryModules, 'call', _691 => _691(root)])));
11931
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _692 => _692.has, 'call', _693 => _693(path17.resolve(cleanId))]) === true;
11932
+ if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
11747
11933
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
11748
11934
  const transformedBoundary = transformIsolatedClientBoundaryModule({
11749
11935
  code: transformedCode,
@@ -11779,7 +11965,7 @@ export const manifest = getManifest();
11779
11965
  );
11780
11966
  return;
11781
11967
  }` : "";
11782
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _688 => _688.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
11968
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _694 => _694.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
11783
11969
  if (import.meta.hot) {
11784
11970
  import.meta.hot.accept((newModule) => {
11785
11971
  ${isolatedHmrUpdate}
@@ -11833,14 +12019,14 @@ if (import.meta.hot) {
11833
12019
  }
11834
12020
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
11835
12021
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
11836
- const outDir = path16.join(_optionalChain([server, 'optionalAccess', _689 => _689.config, 'access', _690 => _690.root]) || process.cwd(), options.outDir || "dist");
11837
- const clientDir = path16.join(outDir, "client");
12022
+ const outDir = path17.join(_optionalChain([server, 'optionalAccess', _695 => _695.config, 'access', _696 => _696.root]) || process.cwd(), options.outDir || "dist");
12023
+ const clientDir = path17.join(outDir, "client");
11838
12024
  for (const page of ssgPages) {
11839
12025
  try {
11840
12026
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
11841
12027
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
11842
12028
  const mod = await routeManager.loadRouteModule(page.filePath);
11843
- if (!_optionalChain([mod, 'optionalAccess', _691 => _691.default])) return;
12029
+ if (!_optionalChain([mod, 'optionalAccess', _697 => _697.default])) return;
11844
12030
  const { layouts } = routeManager.matchRoute(page.urlPath);
11845
12031
  const layoutModules = await Promise.all(
11846
12032
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -11872,7 +12058,7 @@ if (import.meta.hot) {
11872
12058
  const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
11873
12059
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
11874
12060
  const fullHtml = `<!DOCTYPE html>
11875
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _692 => _692.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12061
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _698 => _698.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
11876
12062
  <head>
11877
12063
  <meta charset="utf-8">
11878
12064
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -11886,8 +12072,8 @@ if (import.meta.hot) {
11886
12072
  <script type="module" src="/assets/client.js"></script>
11887
12073
  </body>
11888
12074
  </html>`;
11889
- const outputPath = page.urlPath === "/" ? path16.join(clientDir, "index.html") : path16.join(clientDir, page.urlPath + ".html");
11890
- fs9.mkdirSync(path16.dirname(outputPath), { recursive: true });
12075
+ const outputPath = page.urlPath === "/" ? path17.join(clientDir, "index.html") : path17.join(clientDir, page.urlPath + ".html");
12076
+ fs9.mkdirSync(path17.dirname(outputPath), { recursive: true });
11891
12077
  fs9.writeFileSync(outputPath, fullHtml);
11892
12078
  const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
11893
12079
  _chunk5QIKR7RRcjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
@@ -11896,7 +12082,7 @@ if (import.meta.hot) {
11896
12082
  _chunk5QIKR7RRcjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
11897
12083
  }
11898
12084
  }
11899
- const manifestPath = path16.join(outDir, "__ssg_manifest.json");
12085
+ const manifestPath = path17.join(outDir, "__ssg_manifest.json");
11900
12086
  fs9.writeFileSync(
11901
12087
  manifestPath,
11902
12088
  JSON.stringify(
@@ -11930,23 +12116,23 @@ if (import.meta.hot) {
11930
12116
  });
11931
12117
  }
11932
12118
  }
11933
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _693 => _693.getConfig, 'call', _694 => _694()]);
12119
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _699 => _699.getConfig, 'call', _700 => _700()]);
11934
12120
  const normalizedFile = file.replace(/\\/g, "/");
11935
- if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
12121
+ if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
11936
12122
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
11937
12123
  )) {
11938
12124
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
11939
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _695 => _695(`updated ${file}`)]);
12125
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _701 => _701(`updated ${file}`)]);
11940
12126
  server2.ws.send({ type: "full-reload", path: "*" });
11941
12127
  return [];
11942
12128
  }
11943
- const currentSrcRoot = currentFarmConfig ? _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path16.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
12129
+ const currentSrcRoot = currentFarmConfig ? _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path17.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
11944
12130
  if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunk6V4TDWECcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
11945
- logUpdate("PAGE", `updated ${path16.basename(file)}`);
12131
+ logUpdate("PAGE", `updated ${path17.basename(file)}`);
11946
12132
  for (const mod of modules) {
11947
12133
  server2.moduleGraph.invalidateModule(mod);
11948
12134
  }
11949
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _696 => _696(`updated ${file}`)]);
12135
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _702 => _702(`updated ${file}`)]);
11950
12136
  server2.ws.send({
11951
12137
  type: "full-reload",
11952
12138
  path: "*"
@@ -11959,17 +12145,17 @@ if (import.meta.hot) {
11959
12145
  for (const mod of modules) {
11960
12146
  server2.moduleGraph.invalidateModule(mod);
11961
12147
  }
11962
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _697 => _697(`updated ${file}`)]);
12148
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _703 => _703(`updated ${file}`)]);
11963
12149
  server2.ws.send({
11964
12150
  type: "full-reload",
11965
12151
  path: "*"
11966
12152
  });
11967
12153
  return [];
11968
12154
  }
11969
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _698 => _698.experimental, 'optionalAccess', _699 => _699.isolatedClientHydration]);
11970
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _700 => _700.getRouteManager, 'call', _701 => _701()]);
12155
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _704 => _704.experimental, 'optionalAccess', _705 => _705.isolatedClientHydration]);
12156
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _706 => _706.getRouteManager, 'call', _707 => _707()]);
11971
12157
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
11972
- const tracksAsyncOwnerIslands = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _702 => _702.renderer])) && planRouteManager !== void 0;
12158
+ const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _708 => _708.renderer])) && planRouteManager !== void 0;
11973
12159
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
11974
12160
  const routeManager = planRouteManager;
11975
12161
  if (routeManager) {
@@ -12029,7 +12215,7 @@ if (import.meta.hot) {
12029
12215
  }
12030
12216
  return [];
12031
12217
  }
12032
- _optionalChain([farmApp, 'optionalAccess', _703 => _703.getRouteManager, 'call', _704 => _704(), 'access', _705 => _705.invalidateClientManifest, 'call', _706 => _706()]);
12218
+ _optionalChain([farmApp, 'optionalAccess', _709 => _709.getRouteManager, 'call', _710 => _710(), 'access', _711 => _711.invalidateClientManifest, 'call', _712 => _712()]);
12033
12219
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
12034
12220
  if (manifestModule) {
12035
12221
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -12073,10 +12259,10 @@ function createPageDataMiddlewareRequest(req, target) {
12073
12259
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPageDataMiddlewareRequest, "createPageDataMiddlewareRequest");
12074
12260
  function resolveDevelopmentRoot(farmRoot, viteRoot) {
12075
12261
  if (!farmRoot) return viteRoot;
12076
- if (path16.resolve(farmRoot) === path16.resolve(viteRoot)) return farmRoot;
12262
+ if (path17.resolve(farmRoot) === path17.resolve(viteRoot)) return farmRoot;
12077
12263
  try {
12078
12264
  if (fs9.realpathSync(farmRoot) === fs9.realpathSync(viteRoot)) {
12079
- return path16.resolve(viteRoot);
12265
+ return path17.resolve(viteRoot);
12080
12266
  }
12081
12267
  } catch (e30) {
12082
12268
  }
@@ -12088,7 +12274,7 @@ function isFarmClientVirtualId(id) {
12088
12274
  return pathname === "/@farm/client" || pathname === "/@farm/client.js";
12089
12275
  }
12090
12276
  _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmClientVirtualId, "isFarmClientVirtualId");
12091
- function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER) {
12277
+ function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER) {
12092
12278
  const parsed = _chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
12093
12279
  if (!parsed) {
12094
12280
  return "";
@@ -12398,12 +12584,12 @@ async function parseRouteModuleProps2(routeModule, input) {
12398
12584
  }
12399
12585
  const schemas = routeModule.__farmRouteSchemas;
12400
12586
  const params = parseRouteModuleSchema2(
12401
- _optionalChain([schemas, 'optionalAccess', _707 => _707.params]),
12587
+ _optionalChain([schemas, 'optionalAccess', _713 => _713.params]),
12402
12588
  input.props.params,
12403
12589
  "params",
12404
12590
  input.routePath
12405
12591
  );
12406
- const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _708 => _708.search]), input.search, "search", input.routePath);
12592
+ const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _714 => _714.search]), input.search, "search", input.routePath);
12407
12593
  return {
12408
12594
  ...input.props,
12409
12595
  params,
@@ -12424,7 +12610,7 @@ function parseRouteModuleSchema2(schema, value, label, routePath) {
12424
12610
  }
12425
12611
  }
12426
12612
  _chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteModuleSchema2, "parseRouteModuleSchema");
12427
- function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
12613
+ function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
12428
12614
  const providerClientCode = generateFarmIntegrationProviderClientCode(
12429
12615
  integrationProviders,
12430
12616
  root,
@@ -12436,8 +12622,11 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
12436
12622
  srcDir,
12437
12623
  publicRuntimeConfig
12438
12624
  );
12439
- const rendererClientImports = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
12440
- import { hydrateRoot, createRoot } from 'react-dom/client'` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
12625
+ const appSetupPath = _chunkPSV6XKPOcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
12626
+ const rendererClientImports = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
12627
+ import { hydrateRoot, createRoot } from 'react-dom/client'` : appSetupPath ? `import React, { hydrateRoot, createRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)}
12628
+ import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, appSetupPath, root))}
12629
+ __farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
12441
12630
  const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'` : "";
12442
12631
  const docsAdapterImportBlock = _chunk75WGQVQAcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
12443
12632
  docsAdapterReact,
@@ -13285,7 +13474,7 @@ async function buildWrappedHydrationElement(PageComponent, pageProps, layouts =
13285
13474
  }
13286
13475
 
13287
13476
  function hydrateFarmRoute(container, route) {
13288
- ${_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
13477
+ ${_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
13289
13478
  }
13290
13479
 
13291
13480
  function renderFarmRoute(root, route) {
@@ -13994,10 +14183,10 @@ function generateClientManifest(bundle) {
13994
14183
  }
13995
14184
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientManifest");
13996
14185
  async function defineConfig(config = {}) {
13997
- const tailwindcss = (await import("@tailwindcss/vite")).default;
13998
- const appRoot = path16.resolve(config.root || process.cwd());
13999
- if (_optionalChain([config, 'access', _709 => _709.extends, 'optionalAccess', _710 => _710.length])) {
14000
- const { config: layeredConfig } = await import("./layers-E4WPJNY5.cjs").then(
14186
+ const tailwindVitePlugin = await loadTailwindVitePlugin();
14187
+ const appRoot = path17.resolve(config.root || process.cwd());
14188
+ if (_optionalChain([config, 'access', _715 => _715.extends, 'optionalAccess', _716 => _716.length])) {
14189
+ const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
14001
14190
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
14002
14191
  root: appRoot,
14003
14192
  mode: process.env.NODE_ENV === "production" ? "production" : "development"
@@ -14005,8 +14194,9 @@ async function defineConfig(config = {}) {
14005
14194
  );
14006
14195
  config = layeredConfig;
14007
14196
  }
14008
- config.renderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, config.renderer);
14009
- const rendererVitePlugins = await _chunkTFAXUHWXcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
14197
+ config.renderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, config.renderer);
14198
+ config.images = resolveFarmImageProviderForRuntime(config.images, { root: appRoot, dev: true });
14199
+ const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
14010
14200
  ssr: true
14011
14201
  });
14012
14202
  const nodeBuiltinStubs = {
@@ -14096,13 +14286,13 @@ async function defineConfig(config = {}) {
14096
14286
  if (!serverStarted) {
14097
14287
  serverStarted = true;
14098
14288
  const elapsed = Date.now() - startTime;
14099
- const address = _optionalChain([server, 'access', _711 => _711.httpServer, 'optionalAccess', _712 => _712.address, 'call', _713 => _713()]);
14289
+ const address = _optionalChain([server, 'access', _717 => _717.httpServer, 'optionalAccess', _718 => _718.address, 'call', _719 => _719()]);
14100
14290
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
14101
14291
  const hostConfig = server.config.server.host;
14102
14292
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
14103
14293
  console.log("");
14104
14294
  console.log(
14105
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkQ2TUENW2cjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
14295
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkVXCA7RZPcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
14106
14296
  );
14107
14297
  console.log("");
14108
14298
  console.log(
@@ -14135,7 +14325,7 @@ async function defineConfig(config = {}) {
14135
14325
  return {
14136
14326
  plugins: [
14137
14327
  createFarmThemeCssPlugin(config.theme, config.basePath),
14138
- tailwindcss(),
14328
+ tailwindVitePlugin,
14139
14329
  ...rendererVitePlugins,
14140
14330
  viteBrowserExternalPlugin,
14141
14331
  farmI18nClientBridgePlugin(),
@@ -14150,7 +14340,7 @@ async function defineConfig(config = {}) {
14150
14340
  ...createFarmClientOptimizeDepsConfig(
14151
14341
  createFarmClientOptimizeDepsEntries(
14152
14342
  appRoot,
14153
- _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
14343
+ _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
14154
14344
  ),
14155
14345
  config.renderer
14156
14346
  ),
@@ -14190,7 +14380,7 @@ async function defineConfig(config = {}) {
14190
14380
  dedupe: [...config.renderer.dedupe || []],
14191
14381
  // Stub out problematic server-only modules during dev mode
14192
14382
  alias: {
14193
- ..._chunkY4YMF2NQcjs.getFarmLayerAliases.call(void 0, config.layers),
14383
+ ..._chunkVPTDD5XFcjs.getFarmLayerAliases.call(void 0, config.layers),
14194
14384
  ...createFarmSourceAlias(appRoot, config.srcDir),
14195
14385
  // Nitro internals that should not be resolved in browser
14196
14386
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
@@ -14253,4 +14443,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
14253
14443
 
14254
14444
 
14255
14445
 
14256
- exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;
14446
+
14447
+
14448
+
14449
+ exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.loadTailwindVitePlugin = loadTailwindVitePlugin; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;