@farm.js/core 0.1.74 → 0.1.75

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 (439) hide show
  1. package/dist/{agent-mcp-handler-NRIL4JBC.cjs → agent-mcp-handler-73SGWVZT.cjs} +9 -9
  2. package/dist/{agent-mcp-handler-HX4F4VKN.mjs → agent-mcp-handler-PJKZHYSA.mjs} +8 -8
  3. package/dist/{agent-mcp.d-CX8_oOT_.d.ts → agent-mcp.d-Djvao5eV.d.ts} +24 -2
  4. package/dist/{agent-mcp.d-BEhDfdWc.d.mts → agent-mcp.d-wA13pwmS.d.mts} +24 -2
  5. package/dist/agent-runtime.cjs +7 -7
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +6 -6
  9. package/dist/analyzer-23GCBYFI.cjs +16 -0
  10. package/dist/{analyzer-2K35LIQZ.mjs → analyzer-LJHMFCDW.mjs} +2 -2
  11. package/dist/api/client.cjs +4 -4
  12. package/dist/api/client.mjs +3 -3
  13. package/dist/api/client.native.cjs +6 -6
  14. package/dist/api/client.native.mjs +3 -3
  15. package/dist/api/node.cjs +12 -12
  16. package/dist/api/node.d.mts +3 -3
  17. package/dist/api/node.d.ts +3 -3
  18. package/dist/api/node.mjs +11 -11
  19. package/dist/api/route-manager.cjs +20 -20
  20. package/dist/api/route-manager.d.mts +3 -3
  21. package/dist/api/route-manager.d.ts +3 -3
  22. package/dist/api/route-manager.mjs +19 -19
  23. package/dist/api/runtime.cjs +11 -11
  24. package/dist/api/runtime.d.mts +2 -2
  25. package/dist/api/runtime.d.ts +2 -2
  26. package/dist/api/runtime.mjs +10 -10
  27. package/dist/api.cjs +23 -23
  28. package/dist/api.d.mts +4 -4
  29. package/dist/api.d.ts +4 -4
  30. package/dist/api.mjs +22 -22
  31. package/dist/{app-manifest.d-CVEx1CFB.d.ts → app-manifest.d-BukcP_EV.d.ts} +1 -1
  32. package/dist/{app-manifest.d-BcXt2yCx.d.mts → app-manifest.d-DIuqSi9k.d.mts} +1 -1
  33. package/dist/app-markdown.cjs +7 -7
  34. package/dist/app-markdown.d.mts +2 -2
  35. package/dist/app-markdown.d.ts +2 -2
  36. package/dist/app-markdown.mjs +6 -6
  37. package/dist/{app.d-B6i8CSrx.d.ts → app.d-BQqmM6Gy.d.ts} +29 -4
  38. package/dist/{app.d-DowzSmT5.d.mts → app.d-YVuFb10p.d.mts} +29 -4
  39. package/dist/{base-path.d-BJ3SYpB8.d.mts → base-path.d-m7wvRMnG.d.mts} +15 -1
  40. package/dist/{base-path.d-BJ3SYpB8.d.ts → base-path.d-m7wvRMnG.d.ts} +15 -1
  41. package/dist/cache.cjs +2 -2
  42. package/dist/cache.d.mts +14 -1
  43. package/dist/cache.d.ts +14 -1
  44. package/dist/cache.mjs +1 -1
  45. package/dist/{chunk-JYNNIGQO.cjs → chunk-25JGHAGH.cjs} +11 -1
  46. package/dist/{chunk-GWXZS7K5.mjs → chunk-2LKUR5QJ.mjs} +1 -1
  47. package/dist/{chunk-B3XY6FMC.mjs → chunk-2NQ3S2SJ.mjs} +3 -3
  48. package/dist/chunk-2PJVEL56.cjs +90 -0
  49. package/dist/{chunk-4M5ESTJ2.cjs → chunk-2RSVYJT6.cjs} +19 -3
  50. package/dist/{chunk-PG6ZIHKE.cjs → chunk-2YJ4DHTD.cjs} +2 -2
  51. package/dist/{chunk-MGZVDX4R.mjs → chunk-3AJQFVWW.mjs} +3 -3
  52. package/dist/{chunk-DRHHTHA3.mjs → chunk-3GMD2E4Q.mjs} +3 -3
  53. package/dist/{chunk-S3D6SL2V.cjs → chunk-42EUEYW6.cjs} +17 -12
  54. package/dist/{chunk-D2IAYGYA.mjs → chunk-47R7CX4A.mjs} +6 -6
  55. package/dist/{chunk-YQWRBBAA.mjs → chunk-4PWGLPL6.mjs} +1 -1
  56. package/dist/{chunk-7S7AAK2D.mjs → chunk-4QBFYEDC.mjs} +2 -1
  57. package/dist/{chunk-UHAARKF3.mjs → chunk-4T2RB4JA.mjs} +5 -5
  58. package/dist/{chunk-KMYOKQPP.cjs → chunk-4VLXQ55O.cjs} +27 -22
  59. package/dist/{chunk-V6T3UJAH.cjs → chunk-4ZSZI6XL.cjs} +17 -17
  60. package/dist/{chunk-XGJVRPYL.cjs → chunk-52LTENRE.cjs} +3 -3
  61. package/dist/{chunk-RQ4UZJPR.cjs → chunk-5AMH6AFA.cjs} +5 -3
  62. package/dist/{chunk-AYP2YFVN.mjs → chunk-5KAEGBIL.mjs} +75 -42
  63. package/dist/{chunk-FCBUNILW.mjs → chunk-5O3SK3ZC.mjs} +4 -4
  64. package/dist/{chunk-IJFNXP3D.cjs → chunk-5QZT2EQN.cjs} +2 -2
  65. package/dist/{chunk-X2KNHD4B.mjs → chunk-5WFPZG7K.mjs} +8 -8
  66. package/dist/{chunk-TPDKFRQX.cjs → chunk-62DZHPDK.cjs} +16 -11
  67. package/dist/{chunk-DTBRSRTR.cjs → chunk-63EFR2WF.cjs} +6 -5
  68. package/dist/{chunk-2RCCFB2Y.cjs → chunk-6B44ZU5P.cjs} +11 -11
  69. package/dist/{chunk-ZRCGPSUM.cjs → chunk-6D3CJFNU.cjs} +37 -21
  70. package/dist/{chunk-65OS2TOT.cjs → chunk-6DBBMQWT.cjs} +34 -34
  71. package/dist/{chunk-IP2R2TAE.mjs → chunk-6MATGOEF.mjs} +1 -1
  72. package/dist/{chunk-ACAEFEOH.cjs → chunk-7564NP5Z.cjs} +10 -10
  73. package/dist/{chunk-7H45IJWO.mjs → chunk-7DBJ2SWK.mjs} +1 -1
  74. package/dist/chunk-7E4FDO5X.mjs +265 -0
  75. package/dist/{chunk-FPBOAG6N.cjs → chunk-7EOSFIPN.cjs} +3 -3
  76. package/dist/{chunk-DRBXYJZ6.mjs → chunk-7FQFK3OA.mjs} +2 -2
  77. package/dist/{chunk-TUOO6IK3.mjs → chunk-7H2TXT2K.mjs} +11 -1
  78. package/dist/{chunk-A4PWGL46.mjs → chunk-7KDCVSTR.mjs} +4 -4
  79. package/dist/{chunk-GPICBTDV.cjs → chunk-7Q2YWZF7.cjs} +6 -6
  80. package/dist/{chunk-CFG4QERR.cjs → chunk-7Q7UB4TL.cjs} +2 -2
  81. package/dist/chunk-A3LNXQJJ.cjs +265 -0
  82. package/dist/{chunk-BFOMCSZ2.mjs → chunk-A5F55ZFA.mjs} +184 -27
  83. package/dist/{chunk-S6O2L47H.mjs → chunk-AG27TI6Q.mjs} +67 -5
  84. package/dist/{chunk-DC2AXGNZ.mjs → chunk-AM2M56SL.mjs} +1 -1
  85. package/dist/{chunk-JRHGJVJH.mjs → chunk-B5QRNCIE.mjs} +1 -1
  86. package/dist/{chunk-R6Q6VSGU.mjs → chunk-BGUTIQII.mjs} +1 -1
  87. package/dist/{chunk-3OMLZLDE.cjs → chunk-BNCKXPCU.cjs} +44 -0
  88. package/dist/{chunk-35GBGSQZ.cjs → chunk-BNTRXJL4.cjs} +3 -3
  89. package/dist/{chunk-BPAXGCKX.mjs → chunk-BRNPLD22.mjs} +30 -17
  90. package/dist/{chunk-JZGL2PIH.mjs → chunk-CDT7CGQT.mjs} +2 -2
  91. package/dist/{chunk-BNXV3PRM.mjs → chunk-CF74ABRI.mjs} +10 -10
  92. package/dist/chunk-CIY74JLV.cjs +134 -0
  93. package/dist/{chunk-IZ5WOTQP.mjs → chunk-CLM73YYD.mjs} +2 -2
  94. package/dist/{chunk-FGXSWRWA.mjs → chunk-CSAIIMY3.mjs} +1 -1
  95. package/dist/{chunk-EF5AP4CV.cjs → chunk-CYNQPKA4.cjs} +2 -2
  96. package/dist/{chunk-M53MIIXY.mjs → chunk-CZOXZ6WQ.mjs} +1 -1
  97. package/dist/{chunk-ROPMQNCG.mjs → chunk-DASQJ5UD.mjs} +2 -2
  98. package/dist/{chunk-BWFBTTJ5.cjs → chunk-DD22NQFX.cjs} +2 -2
  99. package/dist/{chunk-AL6E63FZ.mjs → chunk-DUSTJ6A5.mjs} +20 -17
  100. package/dist/{chunk-EWIEJQP6.cjs → chunk-DZ3AZ7UK.cjs} +52 -52
  101. package/dist/{chunk-6YFC3ZFX.mjs → chunk-DZXD6CYJ.mjs} +1 -1
  102. package/dist/{chunk-Q4G52OSW.mjs → chunk-EMTN5ABC.mjs} +1 -1
  103. package/dist/{chunk-GK2GBIXD.mjs → chunk-ERT6HQAI.mjs} +8 -3
  104. package/dist/{chunk-ZLRWO5GK.mjs → chunk-F35C3TJZ.mjs} +1 -1
  105. package/dist/{chunk-F244KE2D.cjs → chunk-F4ID7BGO.cjs} +33 -30
  106. package/dist/{chunk-C7GJDVN4.mjs → chunk-F7MJWW6A.mjs} +1 -1
  107. package/dist/{chunk-WTTJ2YS2.mjs → chunk-FCAYYLAE.mjs} +18 -2
  108. package/dist/{chunk-PWKAX5MS.cjs → chunk-FDZZ6K3N.cjs} +6 -6
  109. package/dist/{chunk-MHLNWRCJ.cjs → chunk-FE6KYDHC.cjs} +3 -3
  110. package/dist/{chunk-PTLXHRJZ.mjs → chunk-FLMALEY2.mjs} +37 -4
  111. package/dist/{chunk-GRHSQYD4.cjs → chunk-G7B6NU4X.cjs} +11 -11
  112. package/dist/{chunk-E4T7WJJN.mjs → chunk-GAAK3HDZ.mjs} +28 -7
  113. package/dist/{chunk-QMNWKQL4.cjs → chunk-GC5ROI3A.cjs} +4 -4
  114. package/dist/{chunk-JXIYH2NO.cjs → chunk-GCJ4GNMC.cjs} +4 -4
  115. package/dist/{chunk-KNEYWPZV.mjs → chunk-GFXKO4UW.mjs} +42 -10
  116. package/dist/{chunk-AU5UPNOD.mjs → chunk-GLF44JKY.mjs} +3 -3
  117. package/dist/{chunk-GUZC226X.mjs → chunk-GLVDXRG2.mjs} +1 -1
  118. package/dist/{chunk-FEQ72ZHD.mjs → chunk-GNY7BO7R.mjs} +6 -6
  119. package/dist/{chunk-OWQV6MLM.cjs → chunk-GYJT2U7J.cjs} +2 -1
  120. package/dist/{chunk-XZPI44Q7.cjs → chunk-H7OFZJCV.cjs} +8 -8
  121. package/dist/{chunk-IG4IQMIW.mjs → chunk-H7QY7ZE4.mjs} +1 -1
  122. package/dist/{chunk-2TZ3F6TN.cjs → chunk-HFJLMALC.cjs} +25 -25
  123. package/dist/{chunk-CROAFCMW.mjs → chunk-HONTCUK6.mjs} +1 -1
  124. package/dist/{chunk-7PJARAQQ.mjs → chunk-HQ2VAJLW.mjs} +1 -1
  125. package/dist/{chunk-LHFGTR7F.mjs → chunk-HT2SZKXG.mjs} +92 -10
  126. package/dist/{chunk-6JEXH7N6.mjs → chunk-HV2WZFUW.mjs} +1 -1
  127. package/dist/{chunk-ENYBDM4U.cjs → chunk-HVJ7IACB.cjs} +15 -7
  128. package/dist/{chunk-WS4SLJW5.mjs → chunk-IDOUCM2X.mjs} +142 -170
  129. package/dist/{chunk-FN5UEC7I.mjs → chunk-IG2JE6WJ.mjs} +1 -1
  130. package/dist/{chunk-MQ4DYVFS.cjs → chunk-IIHZ2BEE.cjs} +3 -3
  131. package/dist/{chunk-56HHUSR5.cjs → chunk-IK33N2AN.cjs} +1281 -685
  132. package/dist/{chunk-RSL3YFJG.cjs → chunk-IVBDRAOR.cjs} +1 -1
  133. package/dist/{chunk-FNWL5DMG.cjs → chunk-IXO6O2EL.cjs} +6 -6
  134. package/dist/{chunk-B5WZP3T3.cjs → chunk-IYFBLWXU.cjs} +41 -23
  135. package/dist/{chunk-R4BWNP73.mjs → chunk-JA6RML7C.mjs} +3 -3
  136. package/dist/{chunk-JSUVQ5HG.cjs → chunk-JHZ6HULQ.cjs} +12 -9
  137. package/dist/{chunk-NXGQIXR7.cjs → chunk-JNZDTE75.cjs} +313 -156
  138. package/dist/{chunk-KWUZJZ23.mjs → chunk-JRBWBMP2.mjs} +4 -3
  139. package/dist/{chunk-YH33PZ3K.mjs → chunk-K6DXKHFE.mjs} +1 -1
  140. package/dist/{chunk-AXVRUDMB.cjs → chunk-K6PGK7DC.cjs} +2 -2
  141. package/dist/{chunk-72NTEYCX.mjs → chunk-KHS3T3E5.mjs} +15 -10
  142. package/dist/{chunk-D4TYE6MY.cjs → chunk-KPYQ32BA.cjs} +2 -2
  143. package/dist/{chunk-J42QN7OC.cjs → chunk-KQS27YN7.cjs} +6 -6
  144. package/dist/{chunk-KUMKBBYP.mjs → chunk-KUXEII7V.mjs} +1 -1
  145. package/dist/{chunk-CA7DNRHO.cjs → chunk-L6E5BSNU.cjs} +3 -3
  146. package/dist/{chunk-47ZDUDN5.cjs → chunk-L7Y65BQU.cjs} +64 -32
  147. package/dist/{chunk-OSKIG4OP.mjs → chunk-LPXJEZJK.mjs} +30 -14
  148. package/dist/{chunk-CF77L6RL.mjs → chunk-LQBV2Y37.mjs} +4 -4
  149. package/dist/{chunk-HK4VJI27.cjs → chunk-LQWIIBI2.cjs} +11 -1
  150. package/dist/{chunk-BIX46FTI.mjs → chunk-MFU7SXAB.mjs} +10 -2
  151. package/dist/{chunk-YTVSWXEZ.cjs → chunk-ML4TOUZP.cjs} +76 -43
  152. package/dist/{chunk-ZD7JUTBY.mjs → chunk-NLATR3T3.mjs} +2 -2
  153. package/dist/{chunk-P3EZKU6L.cjs → chunk-NPGXX7HN.cjs} +37 -37
  154. package/dist/{chunk-3BUJIPKE.cjs → chunk-NSNQLBHR.cjs} +2 -2
  155. package/dist/chunk-NUWUEXUD.mjs +55 -0
  156. package/dist/{chunk-53EHWHT2.cjs → chunk-O4JYMU5N.cjs} +35 -22
  157. package/dist/{chunk-TNYC3TYP.mjs → chunk-O7JEFGUV.mjs} +2 -2
  158. package/dist/{chunk-62ZRA7XU.mjs → chunk-OCLCA3X3.mjs} +1 -1
  159. package/dist/{chunk-JI6N4W2I.mjs → chunk-OFIFRB62.mjs} +813 -217
  160. package/dist/{chunk-CXQZQK6R.mjs → chunk-OVUU2RCQ.mjs} +2 -2
  161. package/dist/{chunk-Q3MVNRAO.cjs → chunk-OZARLCYQ.cjs} +1005 -582
  162. package/dist/{chunk-HBLYSWIJ.cjs → chunk-PBJ7MEOV.cjs} +9 -9
  163. package/dist/{chunk-4AB62NMW.cjs → chunk-PBQGIA27.cjs} +2 -2
  164. package/dist/{chunk-RBRIKT6B.mjs → chunk-PDACTAVX.mjs} +3 -3
  165. package/dist/{chunk-AO5IRA2N.mjs → chunk-PE2LEWXA.mjs} +6 -3
  166. package/dist/{chunk-VZKCGHWC.cjs → chunk-PG7J7XYT.cjs} +6 -6
  167. package/dist/{chunk-MMK4MZUN.mjs → chunk-PKXGFQZS.mjs} +1 -1
  168. package/dist/{chunk-NKETXVKP.mjs → chunk-PL7MCYYD.mjs} +32 -14
  169. package/dist/chunk-PWHF2C6A.mjs +134 -0
  170. package/dist/{chunk-JWHRVBCZ.cjs → chunk-Q2EKSSEG.cjs} +21 -21
  171. package/dist/{chunk-EHJOSIXM.cjs → chunk-QDHR54S6.cjs} +11 -11
  172. package/dist/{chunk-YWDRWG4L.mjs → chunk-QGYHE6VJ.mjs} +872 -449
  173. package/dist/{chunk-ZOYKJBP5.cjs → chunk-QKW6DLDT.cjs} +2 -2
  174. package/dist/{chunk-3ODLJRA6.mjs → chunk-QSLGE2ZC.mjs} +1 -1
  175. package/dist/{chunk-FSODPZRT.cjs → chunk-QUEYL2WM.cjs} +10 -10
  176. package/dist/{chunk-ZDAEHG2O.cjs → chunk-QYOAGT3E.cjs} +3 -3
  177. package/dist/{chunk-VKLV7GF4.mjs → chunk-R5X7FDOG.mjs} +1 -1
  178. package/dist/{chunk-O47W53D3.cjs → chunk-RDADQG5S.cjs} +7 -77
  179. package/dist/chunk-RDSHEHBA.mjs +82 -0
  180. package/dist/{chunk-K3RU5MOR.mjs → chunk-RK4MGL6Q.mjs} +1 -1
  181. package/dist/{chunk-LRB5OVRT.cjs → chunk-RKQOMG2X.cjs} +2 -2
  182. package/dist/chunk-RQRTH57V.cjs +82 -0
  183. package/dist/{chunk-MUITBU5Z.mjs → chunk-S7QEQCVV.mjs} +2 -2
  184. package/dist/{chunk-HKZVC5GP.cjs → chunk-SFSTZ7TB.cjs} +8 -8
  185. package/dist/{chunk-ZZGANFQH.cjs → chunk-SX535SU5.cjs} +12 -12
  186. package/dist/{chunk-NLBK37HI.cjs → chunk-SXXSQVKK.cjs} +4 -4
  187. package/dist/{chunk-ELJQWUAR.mjs → chunk-SYPEMXW2.mjs} +2 -2
  188. package/dist/{chunk-XXKMAHYE.mjs → chunk-TFEODQLG.mjs} +1 -1
  189. package/dist/{chunk-BSJMWCWM.cjs → chunk-TZ2YPXLB.cjs} +7 -7
  190. package/dist/{chunk-OEL5EPOJ.mjs → chunk-UD6KTSJS.mjs} +6 -76
  191. package/dist/{chunk-2EVESLP3.mjs → chunk-UJIBSFUE.mjs} +4 -4
  192. package/dist/chunk-UNOXV37V.cjs +55 -0
  193. package/dist/{chunk-H2ZJ35NW.mjs → chunk-UOE6ZZZP.mjs} +1 -1
  194. package/dist/{chunk-O6K4G7YA.mjs → chunk-URQW27KO.mjs} +10 -5
  195. package/dist/chunk-VDQZV6BX.mjs +17 -0
  196. package/dist/{chunk-2DOI6HLJ.cjs → chunk-VJ6L7TII.cjs} +3 -3
  197. package/dist/{chunk-QL3YZTGZ.cjs → chunk-VJI2LWTL.cjs} +2 -2
  198. package/dist/{chunk-7RKHXF4P.mjs → chunk-WGNGM6MJ.mjs} +2 -2
  199. package/dist/{chunk-77SVUQM5.cjs → chunk-WHCNJVYU.cjs} +10 -10
  200. package/dist/{chunk-DM2YGTRH.cjs → chunk-WJ5CCQBM.cjs} +23 -23
  201. package/dist/chunk-WKVYF2B5.cjs +17 -0
  202. package/dist/{chunk-MKQ27TGW.cjs → chunk-WRWJ7IWT.cjs} +7 -7
  203. package/dist/{chunk-Y4FEQBKY.cjs → chunk-WW62HKA2.cjs} +47 -26
  204. package/dist/{chunk-XVSBALOY.cjs → chunk-X3Y6JWJG.cjs} +3 -3
  205. package/dist/{chunk-O2A6HE76.cjs → chunk-XGDI4OUB.cjs} +103 -21
  206. package/dist/{chunk-LIQJYEQP.cjs → chunk-XRFGOYXG.cjs} +4 -4
  207. package/dist/{chunk-42KMUIWZ.cjs → chunk-XX6ZA2IO.cjs} +3 -3
  208. package/dist/{chunk-6IOZPJ3I.cjs → chunk-Y3DO7BIJ.cjs} +69 -7
  209. package/dist/{chunk-L5JDKFMQ.cjs → chunk-YBXIVQCE.cjs} +4 -4
  210. package/dist/{chunk-JZ43UD6S.mjs → chunk-YCNKS6SD.mjs} +12 -12
  211. package/dist/{chunk-FYV6DTAG.cjs → chunk-YL7BKHYE.cjs} +538 -566
  212. package/dist/{chunk-G7S6XG6X.cjs → chunk-YN7G22MP.cjs} +6 -6
  213. package/dist/{chunk-VKRMO3EZ.cjs → chunk-YRXPDKMM.cjs} +10 -10
  214. package/dist/{chunk-VFPFXMTF.mjs → chunk-YSTKSZD2.mjs} +1 -1
  215. package/dist/{chunk-QDWMCFTH.mjs → chunk-YT2ZMLXK.mjs} +1 -1
  216. package/dist/{chunk-EMRYJG4U.cjs → chunk-YTNE4KGC.cjs} +3 -3
  217. package/dist/{chunk-E7QOEV5Z.cjs → chunk-YUCU6XB4.cjs} +4 -4
  218. package/dist/{chunk-NLRAQXAA.mjs → chunk-YVVY276M.mjs} +1 -1
  219. package/dist/{chunk-MQ5HA7H2.mjs → chunk-Z2FFLTF5.mjs} +3 -3
  220. package/dist/{chunk-JSDV2NUN.mjs → chunk-Z3QXQN4U.mjs} +1 -1
  221. package/dist/{chunk-HRQV5Q3J.mjs → chunk-Z4IRG4RG.mjs} +96 -9
  222. package/dist/{chunk-JOECBGY7.mjs → chunk-ZEWWZJPZ.mjs} +3 -1
  223. package/dist/{chunk-2GQBBOFH.mjs → chunk-ZIAWO6BC.mjs} +11 -1
  224. package/dist/{chunk-WH3PBJS7.cjs → chunk-ZIOFRBIU.cjs} +100 -13
  225. package/dist/{chunk-3OJNNCDL.cjs → chunk-ZNXU4E6A.cjs} +8 -8
  226. package/dist/{chunk-KIRIFO6T.mjs → chunk-ZO6TOLHL.mjs} +44 -0
  227. package/dist/{chunk-737MIVX3.cjs → chunk-ZPCZWEU3.cjs} +24 -24
  228. package/dist/{chunk-NET6PBUH.cjs → chunk-ZV76IQG7.cjs} +2 -2
  229. package/dist/{client-component.d-edV76QvU.d.mts → client-component.d-BeqVuqy2.d.mts} +2 -2
  230. package/dist/{client-component.d-DYOwmq0c.d.ts → client-component.d-CZ1NpHAY.d.ts} +2 -2
  231. package/dist/{client-plugins.d-DwvqqGsU.d.mts → client-plugins.d-ChceYO9t.d.mts} +24 -3
  232. package/dist/{client-plugins.d-BmJYW2FY.d.ts → client-plugins.d-D9kWC0QB.d.ts} +24 -3
  233. package/dist/client-plugins.d.mts +1 -1
  234. package/dist/client-plugins.d.ts +1 -1
  235. package/dist/client.cjs +15 -13
  236. package/dist/client.d.mts +6 -6
  237. package/dist/client.d.ts +6 -6
  238. package/dist/client.mjs +14 -12
  239. package/dist/config.d.mts +1 -1
  240. package/dist/config.d.ts +1 -1
  241. package/dist/cron.cjs +4 -4
  242. package/dist/cron.mjs +3 -3
  243. package/dist/desktop.d.mts +2 -2
  244. package/dist/desktop.d.ts +2 -2
  245. package/dist/{devtools-WPX62NG2.mjs → devtools-B3W3DLPG.mjs} +18 -18
  246. package/dist/{devtools-YMDS7PUA.cjs → devtools-T5I2WHRX.cjs} +20 -20
  247. package/dist/docs.cjs +27 -21
  248. package/dist/docs.d.mts +17 -3
  249. package/dist/docs.d.ts +17 -3
  250. package/dist/docs.mjs +26 -20
  251. package/dist/environment/vite.cjs +6 -6
  252. package/dist/environment/vite.mjs +5 -5
  253. package/dist/headers.cjs +3 -3
  254. package/dist/{headers.d-BIbQyAxJ.d.ts → headers.d-Aux4JVnm.d.ts} +1 -1
  255. package/dist/{headers.d-BtNxFc2s.d.mts → headers.d-BawakaPv.d.mts} +1 -1
  256. package/dist/headers.mjs +2 -2
  257. package/dist/i18n/client.cjs +15 -16
  258. package/dist/i18n/client.mjs +5 -6
  259. package/dist/i18n/index.cjs +4 -4
  260. package/dist/i18n/index.mjs +3 -3
  261. package/dist/i18n/server.cjs +5 -5
  262. package/dist/i18n/server.mjs +4 -4
  263. package/dist/image/server.cjs +5 -4
  264. package/dist/image/server.d.mts +5 -1
  265. package/dist/image/server.d.ts +5 -1
  266. package/dist/image/server.mjs +4 -3
  267. package/dist/image/sharp.cjs +53 -89
  268. package/dist/image/sharp.d.mts +2 -1
  269. package/dist/image/sharp.d.ts +2 -1
  270. package/dist/image/sharp.mjs +50 -86
  271. package/dist/index.cjs +99 -93
  272. package/dist/{index.d-CQdDRXd1.d.mts → index.d-Ccq42CPU.d.mts} +1 -1
  273. package/dist/{index.d-CQ_wUzOV.d.ts → index.d-r1MLpgeE.d.ts} +1 -1
  274. package/dist/index.d.mts +19 -19
  275. package/dist/index.d.ts +19 -19
  276. package/dist/index.mjs +96 -90
  277. package/dist/integrations/orm.d.mts +1 -1
  278. package/dist/integrations/orm.d.ts +1 -1
  279. package/dist/integrations.cjs +7 -7
  280. package/dist/integrations.d.mts +1 -1
  281. package/dist/integrations.d.ts +1 -1
  282. package/dist/integrations.mjs +6 -6
  283. package/dist/internal/app-markdown-runtime.cjs +6 -6
  284. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  285. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  286. package/dist/internal/app-markdown-runtime.mjs +5 -5
  287. package/dist/internal/build-runtime.cjs +68 -66
  288. package/dist/internal/build-runtime.d.mts +3 -3
  289. package/dist/internal/build-runtime.d.ts +3 -3
  290. package/dist/internal/build-runtime.mjs +67 -65
  291. package/dist/internal/cli-runtime.cjs +33 -33
  292. package/dist/internal/cli-runtime.mjs +32 -32
  293. package/dist/internal/client-error-overlay.cjs +4 -4
  294. package/dist/internal/client-error-overlay.mjs +1 -1
  295. package/dist/internal/client-runtime.cjs +23 -2
  296. package/dist/internal/client-runtime.d.mts +29 -8
  297. package/dist/internal/client-runtime.d.ts +29 -8
  298. package/dist/internal/client-runtime.mjs +23 -2
  299. package/dist/internal/compression-runtime.d.mts +1 -1
  300. package/dist/internal/compression-runtime.d.ts +1 -1
  301. package/dist/internal/config-runtime.cjs +20 -20
  302. package/dist/internal/config-runtime.d.mts +3 -3
  303. package/dist/internal/config-runtime.d.ts +3 -3
  304. package/dist/internal/config-runtime.mjs +19 -19
  305. package/dist/internal/form-actions.cjs +6 -6
  306. package/dist/internal/form-actions.mjs +5 -5
  307. package/dist/internal/infra-analytics-runtime.cjs +15 -15
  308. package/dist/internal/infra-analytics-runtime.mjs +13 -13
  309. package/dist/internal/islands-server.cjs +2 -2
  310. package/dist/internal/islands-server.mjs +1 -1
  311. package/dist/internal/metadata-image-runtime.cjs +4 -4
  312. package/dist/internal/metadata-image-runtime.mjs +3 -3
  313. package/dist/internal/native-server-fns.cjs +5 -5
  314. package/dist/internal/native-server-fns.mjs +4 -4
  315. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  316. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  317. package/dist/internal/production-runtime.cjs +63 -40
  318. package/dist/internal/production-runtime.d.mts +80 -13
  319. package/dist/internal/production-runtime.d.ts +80 -13
  320. package/dist/internal/production-runtime.mjs +66 -43
  321. package/dist/internal/react-cache.cjs +3 -3
  322. package/dist/internal/react-cache.mjs +1 -1
  323. package/dist/internal/start-manifest.cjs +54 -0
  324. package/dist/internal/start-manifest.d.mts +43 -0
  325. package/dist/internal/start-manifest.d.ts +43 -0
  326. package/dist/internal/start-manifest.mjs +54 -0
  327. package/dist/internal/vercel-edge-middleware.cjs +8 -8
  328. package/dist/internal/vercel-edge-middleware.mjs +7 -7
  329. package/dist/manager-R7FV4A56.cjs +18 -0
  330. package/dist/{manager-RHB2P35B.mjs → manager-YO2RHDYU.mjs} +5 -5
  331. package/dist/markdown.cjs +5 -5
  332. package/dist/markdown.d.mts +1 -1
  333. package/dist/markdown.d.ts +1 -1
  334. package/dist/markdown.mjs +4 -4
  335. package/dist/middleware.cjs +14 -14
  336. package/dist/middleware.d.mts +1 -1
  337. package/dist/middleware.d.ts +1 -1
  338. package/dist/middleware.mjs +13 -13
  339. package/dist/{mount.d-6bhpBQQB.d.mts → mount.d-BomEt2kV.d.mts} +1 -1
  340. package/dist/{mount.d-C-u7rFkM.d.ts → mount.d-Ca8eb9GB.d.ts} +1 -1
  341. package/dist/{native-server-fn-handler-W4FSD76W.cjs → native-server-fn-handler-IWNKQEXK.cjs} +9 -8
  342. package/dist/{native-server-fn-handler-I66X4E5S.mjs → native-server-fn-handler-LII4MDRR.mjs} +8 -7
  343. package/dist/native-tree-D3PW64ZL.cjs +28 -0
  344. package/dist/{native-tree-3X23BT3N.mjs → native-tree-G6ZWS7IR.mjs} +5 -5
  345. package/dist/{navigation-delegate.d-nx6gtsY4.d.mts → navigation-delegate.d-B1ujRkYo.d.mts} +1 -1
  346. package/dist/{navigation-delegate.d-xsG4T1x-.d.ts → navigation-delegate.d-DJCC2jXF.d.ts} +1 -1
  347. package/dist/navigation.cjs +13 -11
  348. package/dist/navigation.d.mts +4 -4
  349. package/dist/navigation.d.ts +4 -4
  350. package/dist/navigation.mjs +12 -10
  351. package/dist/{nitro-SSFTPZMW.cjs → nitro-HKMVYIXY.cjs} +13 -13
  352. package/dist/{nitro-XTQ2HKDL.mjs → nitro-RHLKLYXH.mjs} +8 -8
  353. package/dist/{plugin-5PIQQVRP.cjs → plugin-5BNPYCER.cjs} +2 -2
  354. package/dist/{plugin-QZT747YW.mjs → plugin-FD4S2QEJ.mjs} +1 -1
  355. package/dist/plugin.cjs +62 -60
  356. package/dist/plugin.d.mts +4 -4
  357. package/dist/plugin.d.ts +4 -4
  358. package/dist/plugin.mjs +61 -59
  359. package/dist/query/client.cjs +20 -9
  360. package/dist/query/client.mjs +16 -5
  361. package/dist/{render-plan.d-gW0fwKz2.d.ts → render-plan.d-BxRbaxYA.d.ts} +1 -1
  362. package/dist/{render-plan.d-B5y3h97B.d.mts → render-plan.d-CFod_Zf-.d.mts} +1 -1
  363. package/dist/renderer/react/server.cjs +9 -1
  364. package/dist/renderer/react/server.d.mts +9 -1
  365. package/dist/renderer/react/server.d.ts +9 -1
  366. package/dist/renderer/react/server.mjs +8 -0
  367. package/dist/renderer-client.cjs +25 -26
  368. package/dist/renderer-client.d.mts +4 -4
  369. package/dist/renderer-client.d.ts +4 -4
  370. package/dist/renderer-client.mjs +15 -16
  371. package/dist/request.cjs +2 -2
  372. package/dist/{request.d-B0ugAadD.d.ts → request.d-DG4TeXMM.d.mts} +7 -2
  373. package/dist/{request.d-DLq33nYo.d.mts → request.d-DRQgaXGG.d.ts} +7 -2
  374. package/dist/request.d.mts +2 -2
  375. package/dist/request.d.ts +2 -2
  376. package/dist/request.mjs +1 -1
  377. package/dist/{route-rendering.d-DSeIV7yV.d.mts → route-rendering.d-BXtZKgqu.d.mts} +1 -1
  378. package/dist/{route-rendering.d-ytaqDQD6.d.ts → route-rendering.d-Db07UNVG.d.ts} +1 -1
  379. package/dist/router.cjs +4 -4
  380. package/dist/{router.d-Chd5cpe3.d.mts → router.d-B61kXqxJ.d.mts} +1 -1
  381. package/dist/{router.d-BaEAEGPg.d.ts → router.d-BC3hyjf0.d.ts} +1 -1
  382. package/dist/router.mjs +3 -3
  383. package/dist/routes.cjs +6 -6
  384. package/dist/routes.d.mts +1 -1
  385. package/dist/routes.d.ts +1 -1
  386. package/dist/routes.mjs +5 -5
  387. package/dist/{rsc-pipeline-DPMYONEV.mjs → rsc-pipeline-LJ7YCGY6.mjs} +22 -22
  388. package/dist/{rsc-pipeline-XIUUMMG5.cjs → rsc-pipeline-VENBFYXW.cjs} +23 -23
  389. package/dist/{runtime-XIUJZTZ3.mjs → runtime-4DWUXZHS.mjs} +27 -27
  390. package/dist/{runtime-WD77S3C5.cjs → runtime-UNDTYGQS.cjs} +38 -38
  391. package/dist/{runtime.d-DpCs0eAO.d.mts → runtime.d-Cl6EBGmC.d.mts} +1 -1
  392. package/dist/{runtime.d-h2USyQsz.d.ts → runtime.d-SC95yDzr.d.ts} +1 -1
  393. package/dist/safe-fetch.cjs +15 -0
  394. package/dist/safe-fetch.d.mts +61 -0
  395. package/dist/safe-fetch.d.ts +61 -0
  396. package/dist/safe-fetch.mjs +15 -0
  397. package/dist/{schema-dev-notice-C2JINRZI.mjs → schema-dev-notice-CA55V57L.mjs} +2 -2
  398. package/dist/{schema-dev-notice-X7GG7QVB.cjs → schema-dev-notice-RWA2UTR6.cjs} +3 -3
  399. package/dist/server-action-security.cjs +5 -5
  400. package/dist/server-action-security.mjs +4 -4
  401. package/dist/server-fn.cjs +8 -7
  402. package/dist/server-fn.mjs +7 -6
  403. package/dist/server-plugins.cjs +7 -7
  404. package/dist/server-plugins.d.mts +3 -3
  405. package/dist/server-plugins.d.ts +3 -3
  406. package/dist/server-plugins.mjs +6 -6
  407. package/dist/server-query.cjs +9 -8
  408. package/dist/server-query.mjs +8 -7
  409. package/dist/server.cjs +101 -94
  410. package/dist/server.d.mts +13 -13
  411. package/dist/server.d.ts +13 -13
  412. package/dist/server.mjs +74 -67
  413. package/dist/{spa-router.d-DCQVtEaE.d.mts → spa-router.d-DrlXgDqY.d.mts} +4 -3
  414. package/dist/{spa-router.d-DpdJHs1q.d.ts → spa-router.d-DwM02Mwd.d.ts} +4 -3
  415. package/dist/testing.cjs +31 -31
  416. package/dist/testing.d.mts +1 -1
  417. package/dist/testing.d.ts +1 -1
  418. package/dist/testing.mjs +23 -23
  419. package/dist/theme/server.cjs +3 -3
  420. package/dist/theme/server.mjs +2 -2
  421. package/dist/{utils.d-DmicwMvS.d.ts → utils.d-C6KXz3uB.d.ts} +1 -1
  422. package/dist/{utils.d-DKDZtAY5.d.mts → utils.d-CHzxAshz.d.mts} +1 -1
  423. package/dist/version.cjs +2 -2
  424. package/dist/version.mjs +1 -1
  425. package/dist/vite.cjs +62 -60
  426. package/dist/vite.d.mts +10 -5
  427. package/dist/vite.d.ts +10 -5
  428. package/dist/vite.mjs +61 -59
  429. package/dist/workflows.cjs +7 -7
  430. package/dist/workflows.mjs +6 -6
  431. package/package.json +18 -1
  432. package/dist/analyzer-6EOYURMV.cjs +0 -16
  433. package/dist/chunk-D4XGKF67.cjs +0 -127
  434. package/dist/chunk-MFQGU5CC.mjs +0 -127
  435. package/dist/chunk-NCIAP562.mjs +0 -27
  436. package/dist/chunk-QQ44FYRO.cjs +0 -27
  437. package/dist/chunk-RI3EVPKD.cjs +0 -57
  438. package/dist/manager-S77ZARTC.cjs +0 -18
  439. package/dist/native-tree-TAPKR7QJ.cjs +0 -28
@@ -15,13 +15,13 @@ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
15
15
 
16
16
 
17
17
 
18
- var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
18
+ var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
19
19
 
20
20
 
21
- var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
21
+ var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
22
22
 
23
23
 
24
- var _chunkRSL3YFJGcjs = require('./chunk-RSL3YFJG.cjs');
24
+ var _chunkIVBDRAORcjs = require('./chunk-IVBDRAOR.cjs');
25
25
 
26
26
  // src/environment-vite.ts
27
27
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -142,6 +142,7 @@ function createFarmSourceLocator(code, getCombinedSourcemap) {
142
142
 
143
143
 
144
144
  var _parseAst = require('rolldown/parseAst');
145
+ var _utils = require('rolldown/utils');
145
146
 
146
147
  // src/utils/source-snapshot.ts
147
148
 
@@ -370,6 +371,10 @@ function resolveFarmReactServerExport(importer, specifier) {
370
371
  cache.set(key, resolved);
371
372
  return resolved;
372
373
  }
374
+ function parseLang(file) {
375
+ const extension = _path2.default.extname(file).slice(1);
376
+ return extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
377
+ }
373
378
  var parsedModules = /* @__PURE__ */ new Map();
374
379
  function readModule(file) {
375
380
  let stat;
@@ -384,9 +389,7 @@ function readModule(file) {
384
389
  let program = null;
385
390
  try {
386
391
  const code = _fs2.default.readFileSync(file, "utf8");
387
- const extension = _path2.default.extname(file).slice(1);
388
- const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
389
- program = _parseAst.parseAst.call(void 0, code, { lang });
392
+ program = _parseAst.parseAst.call(void 0, code, { lang: parseLang(file) });
390
393
  } catch (e5) {
391
394
  program = null;
392
395
  }
@@ -511,8 +514,7 @@ function isFarmPackageClientExport(importer, specifier, name) {
511
514
  );
512
515
  }
513
516
  function parseCode(code, file) {
514
- const extension = _path2.default.extname(file).slice(1);
515
- const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
517
+ const lang = parseLang(file);
516
518
  return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
517
519
  try {
518
520
  return _parseAst.parseAst.call(void 0, code, { lang });
@@ -715,6 +717,66 @@ function staticImportSources(program) {
715
717
  }
716
718
  return sources;
717
719
  }
720
+ var GAP = String.raw`(?:\s|\/\*[\s\S]*?\*\/|\/\/[^\n\r\u2028\u2029]*)*`;
721
+ var EMPTY_EXPORT_LIST = new RegExp(String.raw`\bexport${GAP}\{${GAP}\}`);
722
+ function scanFarmStaticImports(code, lang) {
723
+ let result;
724
+ try {
725
+ result = _utils.parseSync.call(void 0, "file.js", code, { lang, preserveParens: false });
726
+ } catch (e8) {
727
+ return null;
728
+ }
729
+ if (result.errors.length > 0) return null;
730
+ const fromProgram = () => {
731
+ const program = result.program;
732
+ return { sources: staticImportSources(program), client: isClientModule(program) };
733
+ };
734
+ const statements = [];
735
+ for (const entry of result.module.staticImports) {
736
+ if (entry.entries.some((binding) => binding.isType)) return fromProgram();
737
+ statements.push({ start: entry.start, source: entry.moduleRequest.value });
738
+ }
739
+ const imported = new Set(statements.map((statement) => statement.start));
740
+ for (const entry of result.module.staticExports) {
741
+ if (entry.entries.some((binding) => binding.isType)) return fromProgram();
742
+ const request = _optionalChain([entry, 'access', _58 => _58.entries, 'access', _59 => _59[0], 'optionalAccess', _60 => _60.moduleRequest]);
743
+ if (request && !imported.has(entry.start) && request.start >= entry.start && request.end <= entry.end) {
744
+ statements.push({ start: entry.start, source: request.value });
745
+ }
746
+ }
747
+ if (EMPTY_EXPORT_LIST.test(code)) return fromProgram();
748
+ statements.sort((left, right) => left.start - right.start);
749
+ const prologueEnd = _nullishCoalesce(_optionalChain([statements, 'access', _61 => _61[0], 'optionalAccess', _62 => _62.start]), () => ( code.length));
750
+ if (code.slice(0, prologueEnd).includes("use client")) return fromProgram();
751
+ return { sources: statements.map((statement) => statement.source), client: false };
752
+ }
753
+ var scannedModules = /* @__PURE__ */ new Map();
754
+ function readModuleImports(file) {
755
+ let stat;
756
+ try {
757
+ stat = _fs2.default.statSync(file);
758
+ } catch (e9) {
759
+ return null;
760
+ }
761
+ noteFarmSourceRead(file);
762
+ const cached = scannedModules.get(file);
763
+ if (cached && cached.size === stat.size && cached.mtimeMs === stat.mtimeMs) return cached.imports;
764
+ const parsed = parsedModules.get(file);
765
+ let imports;
766
+ if (parsed && parsed.size === stat.size && parsed.mtimeMs === stat.mtimeMs) {
767
+ imports = parsed.program ? { sources: staticImportSources(parsed.program), client: isClientModule(parsed.program) } : null;
768
+ } else {
769
+ let code;
770
+ try {
771
+ code = _fs2.default.readFileSync(file, "utf8");
772
+ } catch (e10) {
773
+ code = void 0;
774
+ }
775
+ imports = code === void 0 ? null : scanFarmStaticImports(code, parseLang(file));
776
+ }
777
+ scannedModules.set(file, { size: stat.size, mtimeMs: stat.mtimeMs, imports });
778
+ return imports;
779
+ }
718
780
  var clientOnlyFreeFiles = /* @__PURE__ */ new Set();
719
781
  function invalidateFarmClientOnlyScan() {
720
782
  clientOnlyFreeFiles.clear();
@@ -726,28 +788,34 @@ function resolveServerEntry(importer, specifier) {
726
788
  }
727
789
  return _nullishCoalesce(resolveFarmReactServerExport(importer, specifier), () => ( resolveFarmPackageDefaultEntry(importer, specifier, DEFAULT_CONDITIONS)));
728
790
  }
729
- function walkToClientOnly(file, seen) {
791
+ function walkToClientOnly(file, seen, resolved) {
730
792
  if (seen.has(file) || clientOnlyFreeFiles.has(file)) return null;
731
793
  seen.add(file);
732
- const program = readModule(file);
733
- if (!program || isClientModule(program)) return null;
734
- for (const source of staticImportSources(program)) {
794
+ const imports = readModuleImports(file);
795
+ if (!imports || imports.client) return null;
796
+ for (const source of imports.sources) {
735
797
  if (source === CLIENT_ONLY_PACKAGE) return [file];
736
- const child = source.startsWith(".") ? resolveRelative(file, source) : resolveServerEntry(file, source);
737
- const chain = child && walkToClientOnly(child, seen);
798
+ const key = `${_path2.default.dirname(file)}\0${source}`;
799
+ let child = resolved.get(key);
800
+ if (child === void 0) {
801
+ child = source.startsWith(".") ? resolveRelative(file, source) : resolveServerEntry(file, source);
802
+ resolved.set(key, child);
803
+ }
804
+ const chain = child && walkToClientOnly(child, seen, resolved);
738
805
  if (chain) return [file, ...chain];
739
806
  }
740
807
  return null;
741
808
  }
742
809
  function findFarmClientOnlyImport(code, file) {
743
810
  if (!code.includes("import") && !code.includes("export")) return null;
744
- const program = parseCode(code, file);
745
- if (!program) return null;
746
- for (const specifier of staticImportSources(program)) {
811
+ const imports = scanFarmStaticImports(code, parseLang(file));
812
+ if (!imports) return null;
813
+ const resolved = /* @__PURE__ */ new Map();
814
+ for (const specifier of imports.sources) {
747
815
  const entry = resolveServerEntry(file, specifier);
748
816
  if (!entry) continue;
749
817
  const seen = /* @__PURE__ */ new Set();
750
- const chain = walkToClientOnly(entry, seen);
818
+ const chain = walkToClientOnly(entry, seen, resolved);
751
819
  if (chain) return { specifier, chain };
752
820
  for (const walked of seen) clientOnlyFreeFiles.add(walked);
753
821
  }
@@ -758,7 +826,7 @@ function farmRelativeImportFiles(code, file) {
758
826
  if (!program) return [];
759
827
  const files = [];
760
828
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
761
- const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _58 => _58.source, 'optionalAccess', _59 => _59.value]);
829
+ const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _63 => _63.source, 'optionalAccess', _64 => _64.value]);
762
830
  if (typeof source !== "string" || !source.startsWith(".")) continue;
763
831
  const resolved = resolveRelative(file, source);
764
832
  if (resolved) files.push(resolved);
@@ -776,7 +844,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
776
844
  if (!program) return false;
777
845
  if (depth > 0 && isClientModule(program)) return true;
778
846
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
779
- const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _60 => _60.source, 'optionalAccess', _61 => _61.value]);
847
+ const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _65 => _65.source, 'optionalAccess', _66 => _66.value]);
780
848
  if (typeof source !== "string" || !source.startsWith(".")) continue;
781
849
  const child = resolveRelative(file, source);
782
850
  if (child && reaches(child, depth + 1)) return true;
@@ -789,18 +857,88 @@ var IMPORT_SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(?\s*)["']([^"'./][^"']*)["']/g
789
857
  var STYLESHEET_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["'][^"']+\.(?:css|scss|sass|less|styl)["']/;
790
858
  var MAX_SCANNED_FILES = 2e3;
791
859
  var packageScans = /* @__PURE__ */ new Map();
860
+ var PACKAGE_SCAN_CACHE_SCHEMA = 1;
861
+ var packageScanStamps = /* @__PURE__ */ new Map();
862
+ var packageScanCache;
863
+ function stampScannedPath(directory, target) {
864
+ try {
865
+ const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
866
+ if (!stat) return void 0;
867
+ return [_path2.default.relative(directory, target), stat.size, stat.mtimeMs, stat.ctimeMs];
868
+ } catch (e11) {
869
+ return void 0;
870
+ }
871
+ }
872
+ function isUnchangedScanStamp(directory, stamp) {
873
+ const current = stampScannedPath(directory, _path2.default.join(directory, stamp[0]));
874
+ return current !== void 0 && current[1] === stamp[1] && current[2] === stamp[2] && current[3] === stamp[3];
875
+ }
876
+ function usePackageScanCacheFile(file) {
877
+ if (_optionalChain([packageScanCache, 'optionalAccess', _67 => _67.file]) === file) return;
878
+ const stored = /* @__PURE__ */ new Map();
879
+ try {
880
+ const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
881
+ if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkIVBDRAORcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
882
+ for (const [directory, scan] of Object.entries(value.scans)) {
883
+ if (isStoredPackageScan(scan)) stored.set(directory, scan);
884
+ }
885
+ }
886
+ } catch (e12) {
887
+ }
888
+ packageScanCache = { file, stored, dirty: false };
889
+ }
890
+ function isStoredPackageScan(value) {
891
+ const scan = value;
892
+ return !!scan && Array.isArray(scan.imports) && scan.imports.every((item) => typeof item === "string") && typeof scan.stylesheets === "boolean" && Array.isArray(scan.paths) && scan.paths.every(
893
+ (stamp) => Array.isArray(stamp) && stamp.length === 4 && typeof stamp[0] === "string" && stamp.slice(1).every((part) => typeof part === "number")
894
+ );
895
+ }
896
+ function persistPackageScanCache() {
897
+ const cache2 = packageScanCache;
898
+ if (!_optionalChain([cache2, 'optionalAccess', _69 => _69.dirty])) return;
899
+ const scans = {};
900
+ for (const [directory, paths] of packageScanStamps) {
901
+ const scan = packageScans.get(directory);
902
+ if (scan)
903
+ scans[directory] = { imports: [...scan.imports], stylesheets: scan.stylesheets, paths };
904
+ }
905
+ const temporary = `${cache2.file}.${process.pid}.${Date.now()}.tmp`;
906
+ try {
907
+ _fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
908
+ _fs2.default.writeFileSync(
909
+ temporary,
910
+ JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkIVBDRAORcjs.FARM_VERSION, scans })
911
+ );
912
+ _fs2.default.renameSync(temporary, cache2.file);
913
+ cache2.dirty = false;
914
+ } catch (e13) {
915
+ try {
916
+ _fs2.default.rmSync(temporary, { force: true });
917
+ } catch (e14) {
918
+ }
919
+ }
920
+ }
792
921
  function scanPackage(directory) {
793
922
  const cached = packageScans.get(directory);
794
923
  if (cached) return cached;
924
+ const stored = _optionalChain([packageScanCache, 'optionalAccess', _70 => _70.stored, 'access', _71 => _71.get, 'call', _72 => _72(directory)]);
925
+ if (stored && stored.paths.every((stamp) => isUnchangedScanStamp(directory, stamp))) {
926
+ const scan2 = { imports: new Set(stored.imports), stylesheets: stored.stylesheets };
927
+ packageScans.set(directory, scan2);
928
+ packageScanStamps.set(directory, stored.paths);
929
+ return scan2;
930
+ }
795
931
  const scan = { imports: /* @__PURE__ */ new Set(), stylesheets: false };
932
+ const stamps = [];
796
933
  const pending = [directory];
797
934
  let scanned = 0;
798
935
  while (pending.length > 0 && scanned < MAX_SCANNED_FILES) {
799
936
  const current = pending.pop();
800
937
  let entries;
938
+ stamps.push(stampScannedPath(directory, current));
801
939
  try {
802
940
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
803
- } catch (e8) {
941
+ } catch (e15) {
804
942
  continue;
805
943
  }
806
944
  for (const entry of entries) {
@@ -809,9 +947,10 @@ function scanPackage(directory) {
809
947
  if (entry.isDirectory()) pending.push(file);
810
948
  else if (/\.(?:[cm]?js|jsx)$/.test(entry.name) && scanned++ < MAX_SCANNED_FILES) {
811
949
  let code;
950
+ stamps.push(stampScannedPath(directory, file));
812
951
  try {
813
952
  code = _fs2.default.readFileSync(file, "utf8");
814
- } catch (e9) {
953
+ } catch (e16) {
815
954
  continue;
816
955
  }
817
956
  for (const match of code.matchAll(IMPORT_SPECIFIER)) scan.imports.add(match[1]);
@@ -820,6 +959,10 @@ function scanPackage(directory) {
820
959
  }
821
960
  }
822
961
  packageScans.set(directory, scan);
962
+ if (stamps.every((stamp) => stamp !== void 0)) {
963
+ packageScanStamps.set(directory, stamps);
964
+ if (packageScanCache) packageScanCache.dirty = true;
965
+ }
823
966
  return scan;
824
967
  }
825
968
  function findFarmServerBundledPackage(importer, specifier) {
@@ -834,7 +977,7 @@ function findFarmServerBundledPackage(importer, specifier) {
834
977
  if (manifest.exports === void 0 && manifest.type !== "module" && typeof manifest.module === "string" && typeof manifest.main === "string" && _path2.default.resolve(directory, manifest.main) !== _path2.default.resolve(directory, manifest.module)) {
835
978
  return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
836
979
  }
837
- } catch (e10) {
980
+ } catch (e17) {
838
981
  return null;
839
982
  }
840
983
  return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
@@ -842,7 +985,7 @@ function findFarmServerBundledPackage(importer, specifier) {
842
985
  function isSelfContainedPackage(manifest, importer) {
843
986
  if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
844
987
  return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
845
- (peer) => _optionalChain([manifest, 'access', _62 => _62.peerDependenciesMeta, 'optionalAccess', _63 => _63[peer], 'optionalAccess', _64 => _64.optional]) === true || findPackageDirectory(importer, peer) !== null
988
+ (peer) => _optionalChain([manifest, 'access', _73 => _73.peerDependenciesMeta, 'optionalAccess', _74 => _74[peer], 'optionalAccess', _75 => _75.optional]) === true || findPackageDirectory(importer, peer) !== null
846
989
  );
847
990
  }
848
991
  function findFarmPackageManifest(importer, specifier) {
@@ -854,11 +997,11 @@ function findFarmPackageManifest(importer, specifier) {
854
997
  try {
855
998
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
856
999
  names = new Set(Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))));
857
- } catch (e11) {
1000
+ } catch (e18) {
858
1001
  return null;
859
1002
  }
860
1003
  const dependencies = [...scanPackage(directory).imports].filter((imported) => {
861
- const name = _optionalChain([packageNameOf, 'call', _65 => _65(imported), 'optionalAccess', _66 => _66.name]);
1004
+ const name = _optionalChain([packageNameOf, 'call', _76 => _76(imported), 'optionalAccess', _77 => _77.name]);
862
1005
  return name !== void 0 && names.has(name);
863
1006
  });
864
1007
  return { name: parsed.name, dependencies: dependencies.sort() };
@@ -891,9 +1034,9 @@ function listFarmModuleExports(entry) {
891
1034
  const name = exportedName(specifier.exported);
892
1035
  if (name) names.add(name);
893
1036
  }
894
- if (_optionalChain([node, 'access', _67 => _67.declaration, 'optionalAccess', _68 => _68.id, 'optionalAccess', _69 => _69.name])) names.add(node.declaration.id.name);
895
- for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _70 => _70.declaration, 'optionalAccess', _71 => _71.declarations]), () => ( []))) {
896
- if (_optionalChain([declarator, 'access', _72 => _72.id, 'optionalAccess', _73 => _73.type]) === "Identifier") names.add(declarator.id.name);
1037
+ if (_optionalChain([node, 'access', _78 => _78.declaration, 'optionalAccess', _79 => _79.id, 'optionalAccess', _80 => _80.name])) names.add(node.declaration.id.name);
1038
+ for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _81 => _81.declaration, 'optionalAccess', _82 => _82.declarations]), () => ( []))) {
1039
+ if (_optionalChain([declarator, 'access', _83 => _83.id, 'optionalAccess', _84 => _84.type]) === "Identifier") names.add(declarator.id.name);
897
1040
  }
898
1041
  } else if (node.type === "ExportDefaultDeclaration") {
899
1042
  esm = true;
@@ -984,8 +1127,8 @@ function resolveProgrammaticClientRoutes(options) {
984
1127
  let untraced = false;
985
1128
  const definedIn = /* @__PURE__ */ new Map();
986
1129
  for (const route of definitions) {
987
- const source = _chunkE7QOEV5Zcjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
988
- const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _74 => _74.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
1130
+ const source = _chunkYUCU6XB4cjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
1131
+ const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _85 => _85.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
989
1132
  for (const caller of callers.flat()) caller.routeSource = true;
990
1133
  definedIn.set(route, callers.flat());
991
1134
  if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
@@ -1082,7 +1225,7 @@ function resolveProgrammaticClientRoutes(options) {
1082
1225
  return { routes, routeSourceFiles };
1083
1226
  }
1084
1227
  function createEvaluatedRouteGraph(server) {
1085
- const evaluated = _optionalChain([server, 'access', _75 => _75.environments, 'optionalAccess', _76 => _76.ssr, 'optionalAccess', _77 => _77.runner, 'optionalAccess', _78 => _78.evaluatedModules]);
1228
+ const evaluated = _optionalChain([server, 'access', _86 => _86.environments, 'optionalAccess', _87 => _87.ssr, 'optionalAccess', _88 => _88.runner, 'optionalAccess', _89 => _89.evaluatedModules]);
1086
1229
  if (!evaluated) return void 0;
1087
1230
  const toGraphModule = (node) => ({
1088
1231
  id: node.id,
@@ -1206,7 +1349,7 @@ function isNodeBuiltinId(id) {
1206
1349
  return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
1207
1350
  }
1208
1351
  function isProgrammaticRouteActionProxy(code) {
1209
- return Boolean(_optionalChain([code, 'optionalAccess', _79 => _79.includes, 'call', _80 => _80("__farmRouteActionTarget: true")]));
1352
+ return Boolean(_optionalChain([code, 'optionalAccess', _90 => _90.includes, 'call', _91 => _91("__farmRouteActionTarget: true")]));
1210
1353
  }
1211
1354
  function collectGraph(graph, routesFile) {
1212
1355
  const modules = /* @__PURE__ */ new Map();
@@ -1300,7 +1443,7 @@ function holdsRouteDefinition(value, definitions) {
1300
1443
  if (descriptor && "value" in descriptor) next(descriptor.value);
1301
1444
  }
1302
1445
  }
1303
- } catch (e12) {
1446
+ } catch (e19) {
1304
1447
  }
1305
1448
  }
1306
1449
  return false;
@@ -1393,7 +1536,7 @@ function readJsonString(text) {
1393
1536
  try {
1394
1537
  const value = JSON.parse(text);
1395
1538
  return typeof value === "string" ? value : void 0;
1396
- } catch (e13) {
1539
+ } catch (e20) {
1397
1540
  return void 0;
1398
1541
  }
1399
1542
  }
@@ -1401,7 +1544,7 @@ function readJsonArray(text) {
1401
1544
  try {
1402
1545
  const value = JSON.parse(text);
1403
1546
  return Array.isArray(value) ? value : void 0;
1404
- } catch (e14) {
1547
+ } catch (e21) {
1405
1548
  return void 0;
1406
1549
  }
1407
1550
  }
@@ -1411,13 +1554,13 @@ function readExports(namespace) {
1411
1554
  let keys;
1412
1555
  try {
1413
1556
  keys = Object.keys(namespace);
1414
- } catch (e15) {
1557
+ } catch (e22) {
1415
1558
  return [];
1416
1559
  }
1417
1560
  for (const key of keys) {
1418
1561
  try {
1419
1562
  entries.push([key, namespace[key]]);
1420
- } catch (e16) {
1563
+ } catch (e23) {
1421
1564
  }
1422
1565
  }
1423
1566
  return entries;
@@ -1450,7 +1593,7 @@ function toModuleFile(file) {
1450
1593
  if (file.startsWith("file://")) {
1451
1594
  try {
1452
1595
  return toPosixPath(_url.fileURLToPath.call(void 0, file));
1453
- } catch (e17) {
1596
+ } catch (e24) {
1454
1597
  return toPosixPath(file);
1455
1598
  }
1456
1599
  }
@@ -1469,7 +1612,7 @@ var _crypto = require('crypto');
1469
1612
 
1470
1613
  var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
1471
1614
  var moduleName = (node) => {
1472
- const name = _optionalChain([node, 'optionalAccess', _81 => _81.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _82 => _82.value]);
1615
+ const name = _optionalChain([node, 'optionalAccess', _92 => _92.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _93 => _93.value]);
1473
1616
  return typeof name === "string" ? name : null;
1474
1617
  };
1475
1618
  function parse(code, file) {
@@ -1480,7 +1623,7 @@ function parse(code, file) {
1480
1623
  function parseAs(code, lang) {
1481
1624
  try {
1482
1625
  return _parseAst.parseAst.call(void 0, code, { lang });
1483
- } catch (e18) {
1626
+ } catch (e25) {
1484
1627
  return null;
1485
1628
  }
1486
1629
  }
@@ -1505,8 +1648,8 @@ function namespaceMembers2(program, local, declaration) {
1505
1648
  if (opaque || node === declaration) return;
1506
1649
  const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
1507
1650
  if (name !== local) return;
1508
- if (_optionalChain([parent, 'optionalAccess', _83 => _83.type]) === "ImportNamespaceSpecifier") return;
1509
- const member = (_optionalChain([parent, 'optionalAccess', _84 => _84.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _85 => _85.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1651
+ if (_optionalChain([parent, 'optionalAccess', _94 => _94.type]) === "ImportNamespaceSpecifier") return;
1652
+ const member = (_optionalChain([parent, 'optionalAccess', _95 => _95.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _96 => _96.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1510
1653
  const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
1511
1654
  if (property) members.add(property);
1512
1655
  else opaque = true;
@@ -1522,7 +1665,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1522
1665
  const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
1523
1666
  if (node.type !== "ImportDeclaration" && !reexport) continue;
1524
1667
  if (node.importKind === "type" || node.exportKind === "type") continue;
1525
- const specifier = _optionalChain([node, 'access', _86 => _86.source, 'optionalAccess', _87 => _87.value]);
1668
+ const specifier = _optionalChain([node, 'access', _97 => _97.source, 'optionalAccess', _98 => _98.value]);
1526
1669
  if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
1527
1670
  continue;
1528
1671
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
@@ -1579,7 +1722,7 @@ function farmPackageClientImportExports(entry) {
1579
1722
  return [
1580
1723
  ...entry.defaultLocal ? ["default"] : [],
1581
1724
  ...entry.named.map((binding) => binding.imported),
1582
- ..._nullishCoalesce(_optionalChain([entry, 'access', _88 => _88.namespace, 'optionalAccess', _89 => _89.members]), () => ( []))
1725
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _99 => _99.namespace, 'optionalAccess', _100 => _100.members]), () => ( []))
1583
1726
  ];
1584
1727
  }
1585
1728
  var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
@@ -1620,7 +1763,7 @@ function packageLookup(directory, packageName) {
1620
1763
  const candidate = _path2.default.join(current, "node_modules", packageName);
1621
1764
  try {
1622
1765
  return { from: current, real: _fs2.default.realpathSync(candidate) };
1623
- } catch (e19) {
1766
+ } catch (e26) {
1624
1767
  }
1625
1768
  }
1626
1769
  if (_path2.default.dirname(current) === current) return null;
@@ -1631,10 +1774,10 @@ function referenceResolveFrom(root, specifier, importer) {
1631
1774
  const own = packageLookup(_path2.default.dirname(importer), packageName);
1632
1775
  if (!own) return null;
1633
1776
  const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
1634
- if (_optionalChain([app, 'optionalAccess', _90 => _90.real]) === own.real) return null;
1777
+ if (_optionalChain([app, 'optionalAccess', _101 => _101.real]) === own.real) return null;
1635
1778
  try {
1636
1779
  return _fs2.default.realpathSync(own.from);
1637
- } catch (e20) {
1780
+ } catch (e27) {
1638
1781
  return own.from;
1639
1782
  }
1640
1783
  }
@@ -1660,7 +1803,7 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
1660
1803
  let current = null;
1661
1804
  try {
1662
1805
  current = _fs2.default.readFileSync(file, "utf8");
1663
- } catch (e21) {
1806
+ } catch (e28) {
1664
1807
  }
1665
1808
  if (current !== source) {
1666
1809
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1672,7 +1815,7 @@ function writeIfChanged(file, source) {
1672
1815
  let current = null;
1673
1816
  try {
1674
1817
  current = _fs2.default.readFileSync(file, "utf8");
1675
- } catch (e22) {
1818
+ } catch (e29) {
1676
1819
  }
1677
1820
  if (current !== source) {
1678
1821
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1684,7 +1827,7 @@ function owningPackage(file) {
1684
1827
  try {
1685
1828
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
1686
1829
  if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
1687
- } catch (e23) {
1830
+ } catch (e30) {
1688
1831
  }
1689
1832
  if (_path2.default.dirname(current) === current) return null;
1690
1833
  }
@@ -1755,7 +1898,7 @@ function rewriteFarmPackageClientImports(options) {
1755
1898
  lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
1756
1899
  fields.push(`${member}: ${local}`);
1757
1900
  }
1758
- if (_optionalChain([entry, 'access', _91 => _91.namespace, 'access', _92 => _92.values, 'optionalAccess', _93 => _93.length])) {
1901
+ if (_optionalChain([entry, 'access', _102 => _102.namespace, 'access', _103 => _103.values, 'optionalAccess', _104 => _104.length])) {
1759
1902
  const local = `__farm_package_values_${next++}__`;
1760
1903
  lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
1761
1904
  for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
@@ -1804,7 +1947,7 @@ function ensureFarmIslandContainerReference(root) {
1804
1947
  let current = null;
1805
1948
  try {
1806
1949
  current = _fs2.default.readFileSync(file, "utf8");
1807
- } catch (e24) {
1950
+ } catch (e31) {
1808
1951
  }
1809
1952
  if (current !== source) {
1810
1953
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1818,7 +1961,7 @@ function parse2(code, file) {
1818
1961
  return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
1819
1962
  try {
1820
1963
  return _parseAst.parseAst.call(void 0, code, { lang });
1821
- } catch (e25) {
1964
+ } catch (e32) {
1822
1965
  return null;
1823
1966
  }
1824
1967
  });
@@ -1852,7 +1995,7 @@ function findFarmIslandContainers(code, file, bindings) {
1852
1995
  const current = node;
1853
1996
  if (typeof current.type !== "string") return;
1854
1997
  if (current.type === "JSXElement") {
1855
- const name = jsxName(_optionalChain([current, 'access', _94 => _94.openingElement, 'optionalAccess', _95 => _95.name]));
1998
+ const name = jsxName(_optionalChain([current, 'access', _105 => _105.openingElement, 'optionalAccess', _106 => _106.name]));
1856
1999
  if (name && names.has(name)) {
1857
2000
  let container;
1858
2001
  for (let depth = open.length - 1; depth >= 0; depth--) {
@@ -1868,9 +2011,9 @@ function findFarmIslandContainers(code, file, bindings) {
1868
2011
  });
1869
2012
  }
1870
2013
  }
1871
- const host = _optionalChain([current, 'access', _96 => _96.openingElement, 'optionalAccess', _97 => _97.name, 'optionalAccess', _98 => _98.type]) === "JSXIdentifier" && (ISLAND_CONTAINER_TAGS.has(name) || FLOW_CONTENT_TAGS.has(name));
2014
+ const host = _optionalChain([current, 'access', _107 => _107.openingElement, 'optionalAccess', _108 => _108.name, 'optionalAccess', _109 => _109.type]) === "JSXIdentifier" && (ISLAND_CONTAINER_TAGS.has(name) || FLOW_CONTENT_TAGS.has(name));
1872
2015
  if (host) open.push(current);
1873
- visit(_optionalChain([current, 'access', _99 => _99.openingElement, 'optionalAccess', _100 => _100.attributes]));
2016
+ visit(_optionalChain([current, 'access', _110 => _110.openingElement, 'optionalAccess', _111 => _111.attributes]));
1874
2017
  visit(current.children);
1875
2018
  if (host) open.pop();
1876
2019
  return;
@@ -1901,7 +2044,7 @@ function wrapFarmIslandContainers(options) {
1901
2044
  const declaration = `import { ${FARM_ISLAND_CONTAINER_EXPORT} as ${CONTAINER_LOCAL} } from ${specifier};
1902
2045
  `;
1903
2046
  let prologueEnd = 0;
1904
- for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call', _101 => _101(options.code, options.file), 'optionalAccess', _102 => _102.body]), () => ( []))) {
2047
+ for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call', _112 => _112(options.code, options.file), 'optionalAccess', _113 => _113.body]), () => ( []))) {
1905
2048
  if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") break;
1906
2049
  prologueEnd = statement.end;
1907
2050
  }
@@ -1957,7 +2100,7 @@ function stampPackagePath(target, kind) {
1957
2100
  const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
1958
2101
  if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
1959
2102
  return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
1960
- } catch (e26) {
2103
+ } catch (e33) {
1961
2104
  return void 0;
1962
2105
  }
1963
2106
  }
@@ -1993,7 +2136,7 @@ var PackageClientBoundaryCache = class {
1993
2136
  else this.dirty = true;
1994
2137
  }
1995
2138
  }
1996
- return _optionalChain([entries, 'optionalAccess', _103 => _103.find, 'call', _104 => _104(
2139
+ return _optionalChain([entries, 'optionalAccess', _114 => _114.find, 'call', _115 => _115(
1997
2140
  (entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
1998
2141
  )]);
1999
2142
  }
@@ -2012,7 +2155,7 @@ var PackageClientBoundaryCache = class {
2012
2155
  await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
2013
2156
  await _fs2.default.promises.writeFile(temporary, contents);
2014
2157
  await _fs2.default.promises.rename(temporary, file);
2015
- } catch (e27) {
2158
+ } catch (e34) {
2016
2159
  await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
2017
2160
  });
2018
2161
  }
@@ -2027,10 +2170,10 @@ var PackageClientBoundaryCache = class {
2027
2170
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
2028
2171
  _fs2.default.writeFileSync(temporary, contents);
2029
2172
  _fs2.default.renameSync(temporary, file);
2030
- } catch (e28) {
2173
+ } catch (e35) {
2031
2174
  try {
2032
2175
  _fs2.default.rmSync(temporary, { force: true });
2033
- } catch (e29) {
2176
+ } catch (e36) {
2034
2177
  }
2035
2178
  }
2036
2179
  }
@@ -2064,7 +2207,7 @@ var PackageClientBoundaryCache = class {
2064
2207
  }
2065
2208
  const contents = JSON.stringify({
2066
2209
  schema: SCHEMA_VERSION,
2067
- farm: _chunkRSL3YFJGcjs.FARM_VERSION,
2210
+ farm: _chunkIVBDRAORcjs.FARM_VERSION,
2068
2211
  paths,
2069
2212
  entries
2070
2213
  });
@@ -2101,10 +2244,10 @@ function readStoredCache(file) {
2101
2244
  let value;
2102
2245
  try {
2103
2246
  value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
2104
- } catch (e30) {
2247
+ } catch (e37) {
2105
2248
  return null;
2106
2249
  }
2107
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkRSL3YFJGcjs.FARM_VERSION) {
2250
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkIVBDRAORcjs.FARM_VERSION) {
2108
2251
  return null;
2109
2252
  }
2110
2253
  const { paths, entries } = value;
@@ -2115,7 +2258,7 @@ function readStoredCache(file) {
2115
2258
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
2116
2259
  if (usable.length > 0) valid[key] = usable;
2117
2260
  }
2118
- return { schema: SCHEMA_VERSION, farm: _chunkRSL3YFJGcjs.FARM_VERSION, paths, entries: valid };
2261
+ return { schema: SCHEMA_VERSION, farm: _chunkIVBDRAORcjs.FARM_VERSION, paths, entries: valid };
2119
2262
  }
2120
2263
  function isRecord(value) {
2121
2264
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -2154,7 +2297,7 @@ async function withPackageClientBoundaryCache(operation) {
2154
2297
  }
2155
2298
  }
2156
2299
  function usePackageClientBoundaryCacheFile(file) {
2157
- _optionalChain([getPackageClientBoundaryCache, 'call', _105 => _105(), 'optionalAccess', _106 => _106.load, 'call', _107 => _107(file)]);
2300
+ _optionalChain([getPackageClientBoundaryCache, 'call', _116 => _116(), 'optionalAccess', _117 => _117.load, 'call', _118 => _118(file)]);
2158
2301
  }
2159
2302
  function resolvePackageClientBoundaryCacheFile(root, distDir) {
2160
2303
  return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
@@ -2171,7 +2314,7 @@ function runWithPackageClientBoundaryCacheFile(file, operation) {
2171
2314
  var latestDevCache;
2172
2315
  function runWithLatestPackageClientBoundaryCache(file, operation) {
2173
2316
  if (getPackageClientBoundaryCache()) return operation();
2174
- if (_optionalChain([latestDevCache, 'optionalAccess', _108 => _108.file]) !== file) {
2317
+ if (_optionalChain([latestDevCache, 'optionalAccess', _119 => _119.file]) !== file) {
2175
2318
  const cache2 = new PackageClientBoundaryCache();
2176
2319
  cache2.load(file);
2177
2320
  latestDevCache = { file, cache: cache2 };
@@ -2205,7 +2348,7 @@ function readSourceFileContents(filePath) {
2205
2348
  return null;
2206
2349
  }
2207
2350
  return _fs2.default.readFileSync(filePath, "utf-8");
2208
- } catch (e31) {
2351
+ } catch (e38) {
2209
2352
  return null;
2210
2353
  }
2211
2354
  }
@@ -2218,7 +2361,7 @@ function resolveModuleSourcePath(modulePath, root) {
2218
2361
  if (modulePath.startsWith("file://")) {
2219
2362
  try {
2220
2363
  candidates.add(_url.fileURLToPath.call(void 0, modulePath));
2221
- } catch (e32) {
2364
+ } catch (e39) {
2222
2365
  }
2223
2366
  }
2224
2367
  if (modulePath.startsWith("/@fs/")) {
@@ -2231,7 +2374,7 @@ function resolveModuleSourcePath(modulePath, root) {
2231
2374
  candidates.add(_path2.default.join(root, normalized));
2232
2375
  candidates.add(_path2.default.resolve(root, normalized));
2233
2376
  }
2234
- if (_optionalChain([withoutQuery, 'optionalAccess', _109 => _109.startsWith, 'call', _110 => _110("/src/")])) {
2377
+ if (_optionalChain([withoutQuery, 'optionalAccess', _120 => _120.startsWith, 'call', _121 => _121("/src/")])) {
2235
2378
  const normalized = withoutQuery.replace(/^\/+/, "");
2236
2379
  candidates.add(_path2.default.join(process.cwd(), normalized));
2237
2380
  candidates.add(_path2.default.resolve(process.cwd(), normalized));
@@ -2310,7 +2453,7 @@ function hasHydrateExport(content) {
2310
2453
  for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
2311
2454
  for (const specifier of match[1].split(",")) {
2312
2455
  const parts = specifier.trim().split(/\s+as\s+/);
2313
- const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _111 => _111.trim, 'call', _112 => _112()]);
2456
+ const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
2314
2457
  if (exportedName2 === "hydrate") {
2315
2458
  return true;
2316
2459
  }
@@ -2505,7 +2648,7 @@ function isIslandExportStart(tokens, index) {
2505
2648
  const token = tokens[index];
2506
2649
  const previous = tokens[index - 1];
2507
2650
  const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
2508
- return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _113 => _113[index + 1], 'optionalAccess', _114 => _114.value]) === "const" && _optionalChain([tokens, 'access', _115 => _115[index + 2], 'optionalAccess', _116 => _116.value]) === "island";
2651
+ return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _124 => _124[index + 1], 'optionalAccess', _125 => _125.value]) === "const" && _optionalChain([tokens, 'access', _126 => _126[index + 2], 'optionalAccess', _127 => _127.value]) === "island";
2509
2652
  }
2510
2653
  function getIslandStrategyExport(content) {
2511
2654
  if (!content) return null;
@@ -2513,15 +2656,15 @@ function getIslandStrategyExport(content) {
2513
2656
  for (let index = 0; index < tokens.length - 2; index++) {
2514
2657
  if (!isIslandExportStart(tokens, index)) continue;
2515
2658
  let valueIndex = index + 3;
2516
- if (_optionalChain([tokens, 'access', _117 => _117[valueIndex], 'optionalAccess', _118 => _118.value]) === ":") {
2659
+ if (_optionalChain([tokens, 'access', _128 => _128[valueIndex], 'optionalAccess', _129 => _129.value]) === ":") {
2517
2660
  while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
2518
2661
  }
2519
- if (_optionalChain([tokens, 'access', _119 => _119[valueIndex], 'optionalAccess', _120 => _120.value]) !== "=") break;
2662
+ if (_optionalChain([tokens, 'access', _130 => _130[valueIndex], 'optionalAccess', _131 => _131.value]) !== "=") break;
2520
2663
  valueIndex++;
2521
2664
  const literal = tokens[valueIndex];
2522
2665
  if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
2523
2666
  let trailingIndex = valueIndex + 1;
2524
- if (_optionalChain([tokens, 'access', _121 => _121[trailingIndex], 'optionalAccess', _122 => _122.value]) === "as" && _optionalChain([tokens, 'access', _123 => _123[trailingIndex + 1], 'optionalAccess', _124 => _124.value]) === "const") {
2667
+ if (_optionalChain([tokens, 'access', _132 => _132[trailingIndex], 'optionalAccess', _133 => _133.value]) === "as" && _optionalChain([tokens, 'access', _134 => _134[trailingIndex + 1], 'optionalAccess', _135 => _135.value]) === "const") {
2525
2668
  trailingIndex += 2;
2526
2669
  }
2527
2670
  const trailing = tokens[trailingIndex];
@@ -2547,13 +2690,13 @@ function hasAsyncDefaultExport(content) {
2547
2690
  for (let index = 0; index < tokens.length - 2; index++) {
2548
2691
  const token = tokens[index];
2549
2692
  if (token.kind !== "identifier" || token.value !== "export") continue;
2550
- if (_optionalChain([tokens, 'access', _125 => _125[index - 1], 'optionalAccess', _126 => _126.value]) === ".") continue;
2551
- if (_optionalChain([tokens, 'access', _127 => _127[index + 1], 'optionalAccess', _128 => _128.value]) !== "default") continue;
2693
+ if (_optionalChain([tokens, 'access', _136 => _136[index - 1], 'optionalAccess', _137 => _137.value]) === ".") continue;
2694
+ if (_optionalChain([tokens, 'access', _138 => _138[index + 1], 'optionalAccess', _139 => _139.value]) !== "default") continue;
2552
2695
  const exported = tokens[index + 2];
2553
2696
  if (exported.kind === "identifier" && exported.value === "async") {
2554
2697
  return true;
2555
2698
  }
2556
- if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _129 => _129[index + 3], 'optionalAccess', _130 => _130.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2699
+ if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _140 => _140[index + 3], 'optionalAccess', _141 => _141.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2557
2700
  return true;
2558
2701
  }
2559
2702
  }
@@ -2561,10 +2704,10 @@ function hasAsyncDefaultExport(content) {
2561
2704
  }
2562
2705
  function isAsyncLocalDeclaration(tokens, name) {
2563
2706
  for (let index = 0; index < tokens.length - 2; index++) {
2564
- if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.value]) === "function" && _optionalChain([tokens, 'access', _133 => _133[index + 2], 'optionalAccess', _134 => _134.value]) === name) {
2707
+ if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _142 => _142[index + 1], 'optionalAccess', _143 => _143.value]) === "function" && _optionalChain([tokens, 'access', _144 => _144[index + 2], 'optionalAccess', _145 => _145.value]) === name) {
2565
2708
  return true;
2566
2709
  }
2567
- if (tokens[index].value === name && _optionalChain([tokens, 'access', _135 => _135[index + 1], 'optionalAccess', _136 => _136.value]) === "=" && _optionalChain([tokens, 'access', _137 => _137[index + 2], 'optionalAccess', _138 => _138.value]) === "async") {
2710
+ if (tokens[index].value === name && _optionalChain([tokens, 'access', _146 => _146[index + 1], 'optionalAccess', _147 => _147.value]) === "=" && _optionalChain([tokens, 'access', _148 => _148[index + 2], 'optionalAccess', _149 => _149.value]) === "async") {
2568
2711
  return true;
2569
2712
  }
2570
2713
  }
@@ -2778,7 +2921,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
2778
2921
  return plan;
2779
2922
  }
2780
2923
  function usesFarmServerTree(plan) {
2781
- return _optionalChain([plan, 'optionalAccess', _139 => _139.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
2924
+ return _optionalChain([plan, 'optionalAccess', _150 => _150.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
2782
2925
  }
2783
2926
  function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
2784
2927
  const plan = {
@@ -2908,7 +3051,7 @@ function clientModulePlanSignature(content) {
2908
3051
  isIsolatableClientBoundarySource(content),
2909
3052
  getImportSpecifiers(content).sort()
2910
3053
  ]);
2911
- } catch (e33) {
3054
+ } catch (e40) {
2912
3055
  return null;
2913
3056
  }
2914
3057
  }
@@ -2933,7 +3076,7 @@ function getStaticImportBindings(content) {
2933
3076
  if (!content) return bindings;
2934
3077
  const tokens = tokenizeModuleSource(content);
2935
3078
  for (let index = 0; index < tokens.length; index++) {
2936
- if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _140 => _140[index - 1], 'optionalAccess', _141 => _141.value]) === ".") continue;
3079
+ if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _151 => _151[index - 1], 'optionalAccess', _152 => _152.value]) === ".") continue;
2937
3080
  const first = tokens[index + 1];
2938
3081
  if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
2939
3082
  continue;
@@ -2941,7 +3084,7 @@ function getStaticImportBindings(content) {
2941
3084
  let fromIndex = -1;
2942
3085
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2943
3086
  if (tokens[cursor].value === ";") break;
2944
- if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _142 => _142[cursor + 1], 'optionalAccess', _143 => _143.kind]) === "string") {
3087
+ if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _153 => _153[cursor + 1], 'optionalAccess', _154 => _154.kind]) === "string") {
2945
3088
  fromIndex = cursor;
2946
3089
  break;
2947
3090
  }
@@ -2950,13 +3093,13 @@ function getStaticImportBindings(content) {
2950
3093
  const specifier = tokens[fromIndex + 1].value;
2951
3094
  const clause = tokens.slice(index + 1, fromIndex);
2952
3095
  const localNames = [];
2953
- if (_optionalChain([clause, 'access', _144 => _144[0], 'optionalAccess', _145 => _145.kind]) === "identifier" && clause[0].value !== "type") {
3096
+ if (_optionalChain([clause, 'access', _155 => _155[0], 'optionalAccess', _156 => _156.kind]) === "identifier" && clause[0].value !== "type") {
2954
3097
  localNames.push(clause[0].value);
2955
3098
  }
2956
3099
  const namespaceAs = clause.findIndex(
2957
- (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _146 => _146[clauseIndex + 1], 'optionalAccess', _147 => _147.value]) === "as"
3100
+ (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _157 => _157[clauseIndex + 1], 'optionalAccess', _158 => _158.value]) === "as"
2958
3101
  );
2959
- if (namespaceAs !== -1 && _optionalChain([clause, 'access', _148 => _148[namespaceAs + 2], 'optionalAccess', _149 => _149.kind]) === "identifier") {
3102
+ if (namespaceAs !== -1 && _optionalChain([clause, 'access', _159 => _159[namespaceAs + 2], 'optionalAccess', _160 => _160.kind]) === "identifier") {
2960
3103
  localNames.push(clause[namespaceAs + 2].value);
2961
3104
  }
2962
3105
  const openingBrace = clause.findIndex((token) => token.value === "{");
@@ -2966,11 +3109,11 @@ function getStaticImportBindings(content) {
2966
3109
  if (openingBrace !== -1 && closingBrace !== -1) {
2967
3110
  let entryStart = openingBrace + 1;
2968
3111
  for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
2969
- if (cursor !== closingBrace && _optionalChain([clause, 'access', _150 => _150[cursor], 'optionalAccess', _151 => _151.value]) !== ",") continue;
3112
+ if (cursor !== closingBrace && _optionalChain([clause, 'access', _161 => _161[cursor], 'optionalAccess', _162 => _162.value]) !== ",") continue;
2970
3113
  const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
2971
3114
  const asIndex = entry.findIndex((token) => token.value === "as");
2972
3115
  const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
2973
- if (_optionalChain([local, 'optionalAccess', _152 => _152.kind]) === "identifier") localNames.push(local.value);
3116
+ if (_optionalChain([local, 'optionalAccess', _163 => _163.kind]) === "identifier") localNames.push(local.value);
2974
3117
  entryStart = cursor + 1;
2975
3118
  }
2976
3119
  }
@@ -3007,14 +3150,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
3007
3150
  const open = [];
3008
3151
  const isSelfClosing = (openingIndex) => {
3009
3152
  for (let index = openingIndex; index < tokens.length; index++) {
3010
- if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _153 => _153[index - 1], 'optionalAccess', _154 => _154.value]) === "/";
3153
+ if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _164 => _164[index - 1], 'optionalAccess', _165 => _165.value]) === "/";
3011
3154
  }
3012
3155
  return false;
3013
3156
  };
3014
3157
  for (let index = 0; index < tokens.length - 1; index++) {
3015
3158
  if (tokens[index].value !== "<") continue;
3016
3159
  if (tokens[index + 1].value === "/") {
3017
- const closing = _optionalChain([tokens, 'access', _155 => _155[index + 2], 'optionalAccess', _156 => _156.value]);
3160
+ const closing = _optionalChain([tokens, 'access', _166 => _166[index + 2], 'optionalAccess', _167 => _167.value]);
3018
3161
  const at = closing ? open.lastIndexOf(closing) : -1;
3019
3162
  if (at !== -1) open.length = at;
3020
3163
  continue;
@@ -3057,7 +3200,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
3057
3200
  }
3058
3201
  function containsClientJsx(tokens, start, end, clientBindings) {
3059
3202
  for (let index = start; index < end; index++) {
3060
- if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.value]))) return true;
3203
+ if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _168 => _168[index + 1], 'optionalAccess', _169 => _169.value]))) return true;
3061
3204
  }
3062
3205
  return false;
3063
3206
  }
@@ -3095,7 +3238,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
3095
3238
  let helperName;
3096
3239
  let bodyStart = -1;
3097
3240
  let bodyEnd = -1;
3098
- if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _159 => _159[index + 1], 'optionalAccess', _160 => _160.kind]) === "identifier") {
3241
+ if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _170 => _170[index + 1], 'optionalAccess', _171 => _171.kind]) === "identifier") {
3099
3242
  helperName = tokens[index + 1].value;
3100
3243
  const parametersStart = tokens.findIndex(
3101
3244
  (token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
@@ -3105,21 +3248,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
3105
3248
  (token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
3106
3249
  );
3107
3250
  if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
3108
- } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _161 => _161[index + 1], 'optionalAccess', _162 => _162.kind]) === "identifier") {
3251
+ } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _172 => _172[index + 1], 'optionalAccess', _173 => _173.kind]) === "identifier") {
3109
3252
  helperName = tokens[index + 1].value;
3110
3253
  let assignmentIndex = -1;
3111
3254
  let arrowIndex = -1;
3112
3255
  for (let cursor = index + 2; cursor < tokens.length; cursor++) {
3113
3256
  if (tokens[cursor].value === ";") break;
3114
3257
  if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
3115
- if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _163 => _163[cursor + 1], 'optionalAccess', _164 => _164.value]) === ">") {
3258
+ if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _174 => _174[cursor + 1], 'optionalAccess', _175 => _175.value]) === ">") {
3116
3259
  arrowIndex = cursor;
3117
3260
  break;
3118
3261
  }
3119
3262
  }
3120
3263
  if (arrowIndex !== -1) {
3121
3264
  bodyStart = arrowIndex + 2;
3122
- bodyEnd = _optionalChain([tokens, 'access', _165 => _165[bodyStart], 'optionalAccess', _166 => _166.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
3265
+ bodyEnd = _optionalChain([tokens, 'access', _176 => _176[bodyStart], 'optionalAccess', _177 => _177.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
3123
3266
  } else if (assignmentIndex !== -1) {
3124
3267
  bodyStart = assignmentIndex + 1;
3125
3268
  bodyEnd = findStatementEnd(tokens, bodyStart);
@@ -3159,14 +3302,14 @@ function passesElementValuedProps(content, localBindings) {
3159
3302
  else if (value === "}") braceDepth--;
3160
3303
  else if (value === "<" && braceDepth > 0) return true;
3161
3304
  else if (value === ">" && braceDepth === 0) {
3162
- selfClosing = _optionalChain([tokens, 'access', _167 => _167[cursor - 1], 'optionalAccess', _168 => _168.value]) === "/";
3305
+ selfClosing = _optionalChain([tokens, 'access', _178 => _178[cursor - 1], 'optionalAccess', _179 => _179.value]) === "/";
3163
3306
  break;
3164
3307
  }
3165
3308
  }
3166
3309
  if (selfClosing || cursor >= tokens.length) continue;
3167
3310
  for (let child = cursor + 1; child < tokens.length; child++) {
3168
3311
  if (tokens[child].value !== "<") continue;
3169
- const closesBoundary = _optionalChain([tokens, 'access', _169 => _169[child + 1], 'optionalAccess', _170 => _170.value]) === "/" && _optionalChain([tokens, 'access', _171 => _171[child + 2], 'optionalAccess', _172 => _172.value]) === name;
3312
+ const closesBoundary = _optionalChain([tokens, 'access', _180 => _180[child + 1], 'optionalAccess', _181 => _181.value]) === "/" && _optionalChain([tokens, 'access', _182 => _182[child + 2], 'optionalAccess', _183 => _183.value]) === name;
3170
3313
  if (!closesBoundary) return true;
3171
3314
  break;
3172
3315
  }
@@ -3188,7 +3331,7 @@ function rendersOnlyLeafElements(content, localBindings) {
3188
3331
  else if (value === "<" && braceDepth > 0) return false;
3189
3332
  else if (value === ">" && braceDepth === 0) break;
3190
3333
  }
3191
- if (cursor >= tokens.length || _optionalChain([tokens, 'access', _173 => _173[cursor - 1], 'optionalAccess', _174 => _174.value]) !== "/") return false;
3334
+ if (cursor >= tokens.length || _optionalChain([tokens, 'access', _184 => _184[cursor - 1], 'optionalAccess', _185 => _185.value]) !== "/") return false;
3192
3335
  }
3193
3336
  return true;
3194
3337
  }
@@ -3200,9 +3343,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
3200
3343
  const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
3201
3344
  for (let index = 0; index < tokens.length; index++) {
3202
3345
  let callStart = -1;
3203
- if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _175 => _175[index + 1], 'optionalAccess', _176 => _176.value]) === "map" || _optionalChain([tokens, 'access', _177 => _177[index + 1], 'optionalAccess', _178 => _178.value]) === "flatMap") && _optionalChain([tokens, 'access', _179 => _179[index + 2], 'optionalAccess', _180 => _180.value]) === "(") {
3346
+ if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _186 => _186[index + 1], 'optionalAccess', _187 => _187.value]) === "map" || _optionalChain([tokens, 'access', _188 => _188[index + 1], 'optionalAccess', _189 => _189.value]) === "flatMap") && _optionalChain([tokens, 'access', _190 => _190[index + 2], 'optionalAccess', _191 => _191.value]) === "(") {
3204
3347
  callStart = index + 2;
3205
- } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _181 => _181[index + 1], 'optionalAccess', _182 => _182.value]) === "." && _optionalChain([tokens, 'access', _183 => _183[index + 2], 'optionalAccess', _184 => _184.value]) === "from" && _optionalChain([tokens, 'access', _185 => _185[index + 3], 'optionalAccess', _186 => _186.value]) === "(") {
3348
+ } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _192 => _192[index + 1], 'optionalAccess', _193 => _193.value]) === "." && _optionalChain([tokens, 'access', _194 => _194[index + 2], 'optionalAccess', _195 => _195.value]) === "from" && _optionalChain([tokens, 'access', _196 => _196[index + 3], 'optionalAccess', _197 => _197.value]) === "(") {
3206
3349
  callStart = index + 3;
3207
3350
  }
3208
3351
  if (callStart !== -1) {
@@ -3211,10 +3354,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
3211
3354
  index = callEnd;
3212
3355
  continue;
3213
3356
  }
3214
- if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _187 => _187[index + 1], 'optionalAccess', _188 => _188.value]) === "(") {
3357
+ if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _198 => _198[index + 1], 'optionalAccess', _199 => _199.value]) === "(") {
3215
3358
  const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
3216
3359
  const bodyStart = conditionEnd + 1;
3217
- const bodyEnd = _optionalChain([tokens, 'access', _189 => _189[bodyStart], 'optionalAccess', _190 => _190.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
3360
+ const bodyEnd = _optionalChain([tokens, 'access', _200 => _200[bodyStart], 'optionalAccess', _201 => _201.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
3218
3361
  if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
3219
3362
  }
3220
3363
  }
@@ -3326,7 +3469,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
3326
3469
  const localBindings = _nullishCoalesce(importedBindings.get(specifier), () => ( []));
3327
3470
  const staticUses = countStaticJsxUses(content, localBindings);
3328
3471
  if (staticUses > 0) {
3329
- const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _191 => _191(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _192 => _192.length]), () => ( 0))) > 0;
3472
+ const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _202 => _202(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _203 => _203.length]), () => ( 0))) > 0;
3330
3473
  if (grows) visit(ensureFarmIslandContainerReference(projectRoot));
3331
3474
  const container = grows ? void 0 : findParserSensitiveJsxContainer(content, localBindings);
3332
3475
  if (container) {
@@ -3422,7 +3565,7 @@ function farmWorkspaceServerEntry(entry) {
3422
3565
  function realpathOrSelf(file) {
3423
3566
  try {
3424
3567
  return _fs2.default.realpathSync(file);
3425
- } catch (e34) {
3568
+ } catch (e41) {
3426
3569
  return file;
3427
3570
  }
3428
3571
  }
@@ -3452,7 +3595,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
3452
3595
  }
3453
3596
  function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3454
3597
  if (!resolvedPath || visited.has(resolvedPath)) {
3455
- if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _193 => _193.stop, 'call', _194 => _194(resolvedPath)]);
3598
+ if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _204 => _204.stop, 'call', _205 => _205(resolvedPath)]);
3456
3599
  return {
3457
3600
  isClientComponent: false,
3458
3601
  shouldHydrate: false,
@@ -3460,7 +3603,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3460
3603
  };
3461
3604
  }
3462
3605
  visited.add(resolvedPath);
3463
- _optionalChain([trace2, 'optionalAccess', _195 => _195.visit, 'call', _196 => _196(resolvedPath)]);
3606
+ _optionalChain([trace2, 'optionalAccess', _206 => _206.visit, 'call', _207 => _207(resolvedPath)]);
3464
3607
  const content = readIfExists(resolvedPath);
3465
3608
  const parsed = parseClientModuleMetadata(content, false);
3466
3609
  let importsClientBoundary = false;
@@ -3518,7 +3661,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3518
3661
  braceDepth = Math.max(0, braceDepth - 1);
3519
3662
  continue;
3520
3663
  }
3521
- if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _197 => _197[index - 1], 'optionalAccess', _198 => _198.value]) !== "." && _optionalChain([tokens, 'access', _199 => _199[index + 1], 'optionalAccess', _200 => _200.value]) === "(" && _optionalChain([tokens, 'access', _201 => _201[index + 2], 'optionalAccess', _202 => _202.kind]) === "string") {
3664
+ if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _208 => _208[index - 1], 'optionalAccess', _209 => _209.value]) !== "." && _optionalChain([tokens, 'access', _210 => _210[index + 1], 'optionalAccess', _211 => _211.value]) === "(" && _optionalChain([tokens, 'access', _212 => _212[index + 2], 'optionalAccess', _213 => _213.kind]) === "string") {
3522
3665
  matches.add(tokens[index + 2].value);
3523
3666
  continue;
3524
3667
  }
@@ -3528,7 +3671,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3528
3671
  }
3529
3672
  if (reexportsOnly && keyword.value !== "export") continue;
3530
3673
  const previous = tokens[index - 1];
3531
- if (_optionalChain([previous, 'optionalAccess', _203 => _203.value]) === ".") continue;
3674
+ if (_optionalChain([previous, 'optionalAccess', _214 => _214.value]) === ".") continue;
3532
3675
  const first = tokens[index + 1];
3533
3676
  if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
3534
3677
  continue;
@@ -3544,7 +3687,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3544
3687
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
3545
3688
  const token = tokens[cursor];
3546
3689
  if (token.value === ";") break;
3547
- if (token.value === "from" && _optionalChain([tokens, 'access', _204 => _204[cursor + 1], 'optionalAccess', _205 => _205.kind]) === "string") {
3690
+ if (token.value === "from" && _optionalChain([tokens, 'access', _215 => _215[cursor + 1], 'optionalAccess', _216 => _216.kind]) === "string") {
3548
3691
  fromIndex = cursor;
3549
3692
  break;
3550
3693
  }
@@ -3562,14 +3705,14 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3562
3705
  return Array.from(matches);
3563
3706
  }
3564
3707
  function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
3565
- if (_optionalChain([tokens, 'access', _206 => _206[startIndex], 'optionalAccess', _207 => _207.value]) !== "{") return false;
3708
+ if (_optionalChain([tokens, 'access', _217 => _217[startIndex], 'optionalAccess', _218 => _218.value]) !== "{") return false;
3566
3709
  const closingBraceIndex = tokens.findIndex(
3567
3710
  (token, index) => index > startIndex && index < endIndex && token.value === "}"
3568
3711
  );
3569
3712
  if (closingBraceIndex === -1) return false;
3570
3713
  let entryStartsAt = startIndex + 1;
3571
3714
  for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
3572
- if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _208 => _208[index], 'optionalAccess', _209 => _209.value]) !== ",") continue;
3715
+ if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _219 => _219[index], 'optionalAccess', _220 => _220.value]) !== ",") continue;
3573
3716
  const entry = tokens.slice(entryStartsAt, index);
3574
3717
  if (entry.length > 0 && entry[0].value !== "type") return false;
3575
3718
  entryStartsAt = index + 1;
@@ -3609,7 +3752,7 @@ function warnUnresolvedAliasImport(importerPath, specifier, root) {
3609
3752
  if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
3610
3753
  warnedUnresolvedAliasImports.add(specifier);
3611
3754
  const importer = root ? _path2.default.relative(root, importerPath) : importerPath;
3612
- _chunkQMNWKQL4cjs.logger.warn(
3755
+ _chunkGC5ROI3Acjs.logger.warn(
3613
3756
  `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".`
3614
3757
  );
3615
3758
  }
@@ -3643,14 +3786,14 @@ function getProjectImportAliases(projectRoot) {
3643
3786
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
3644
3787
  try {
3645
3788
  return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
3646
- } catch (e35) {
3789
+ } catch (e42) {
3647
3790
  return "-";
3648
3791
  }
3649
3792
  }).join(":");
3650
3793
  const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3651
3794
  const cacheStamp = `${stamp}:${sourceDir}`;
3652
3795
  const cached = projectImportAliasCache.get(projectRoot);
3653
- if (_optionalChain([cached, 'optionalAccess', _210 => _210.stamp]) === cacheStamp) return cached.aliases;
3796
+ if (_optionalChain([cached, 'optionalAccess', _221 => _221.stamp]) === cacheStamp) return cached.aliases;
3654
3797
  const aliases = [
3655
3798
  ...readTsconfigPathAliases(projectRoot),
3656
3799
  ...readPackageImportAliases(projectRoot)
@@ -3671,7 +3814,7 @@ function readTsconfigPathAliases(projectRoot) {
3671
3814
  const configPath = _path2.default.join(projectRoot, name);
3672
3815
  if (!_fs2.default.existsSync(configPath)) continue;
3673
3816
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
3674
- if (!_optionalChain([resolved, 'optionalAccess', _211 => _211.paths])) return [];
3817
+ if (!_optionalChain([resolved, 'optionalAccess', _222 => _222.paths])) return [];
3675
3818
  const base2 = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
3676
3819
  return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
3677
3820
  if (!Array.isArray(targets)) return [];
@@ -3706,18 +3849,18 @@ function readTsconfigPaths(configPath, visited) {
3706
3849
  inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
3707
3850
  }
3708
3851
  const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
3709
- const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _212 => _212.baseUrl]);
3852
+ const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _223 => _223.baseUrl]);
3710
3853
  if (options.paths && typeof options.paths === "object") {
3711
3854
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
3712
3855
  }
3713
3856
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
3714
3857
  }
3715
3858
  function readPackageImportAliases(projectRoot) {
3716
- const imports = _optionalChain([readPackageJson, 'call', _213 => _213(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _214 => _214.imports]);
3859
+ const imports = _optionalChain([readPackageJson, 'call', _224 => _224(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _225 => _225.imports]);
3717
3860
  if (!imports || typeof imports !== "object") return [];
3718
3861
  return Object.entries(imports).flatMap(([pattern, value]) => {
3719
3862
  const target = resolveConditionalExportTarget(value);
3720
- if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _215 => _215.startsWith, 'call', _216 => _216("./")])) return [];
3863
+ if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _226 => _226.startsWith, 'call', _227 => _227("./")])) return [];
3721
3864
  const wildcardIndex = pattern.indexOf("*");
3722
3865
  return [
3723
3866
  {
@@ -3733,7 +3876,7 @@ function readJsonWithComments(filePath) {
3733
3876
  let source;
3734
3877
  try {
3735
3878
  source = _fs2.default.readFileSync(filePath, "utf8");
3736
- } catch (e36) {
3879
+ } catch (e43) {
3737
3880
  return null;
3738
3881
  }
3739
3882
  let output = "";
@@ -3761,7 +3904,7 @@ function readJsonWithComments(filePath) {
3761
3904
  }
3762
3905
  try {
3763
3906
  return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
3764
- } catch (e37) {
3907
+ } catch (e44) {
3765
3908
  return null;
3766
3909
  }
3767
3910
  }
@@ -3783,15 +3926,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
3783
3926
  const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
3784
3927
  const packageJson = readPackageJson(packageJsonPath);
3785
3928
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
3786
- const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _217 => _217.exports]), exportKey);
3929
+ const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _228 => _228.exports]), exportKey);
3787
3930
  const candidates = /* @__PURE__ */ new Set();
3788
- if (_optionalChain([exportTarget, 'optionalAccess', _218 => _218.startsWith, 'call', _219 => _219("./")])) {
3931
+ if (_optionalChain([exportTarget, 'optionalAccess', _229 => _229.startsWith, 'call', _230 => _230("./")])) {
3789
3932
  candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
3790
3933
  }
3791
3934
  if (packageSubpath) {
3792
3935
  candidates.add(_path2.default.join(packageDirectory, packageSubpath));
3793
3936
  } else {
3794
- for (const entry of [_optionalChain([packageJson, 'optionalAccess', _220 => _220.browser]), _optionalChain([packageJson, 'optionalAccess', _221 => _221.module]), _optionalChain([packageJson, 'optionalAccess', _222 => _222.main])]) {
3937
+ for (const entry of [_optionalChain([packageJson, 'optionalAccess', _231 => _231.browser]), _optionalChain([packageJson, 'optionalAccess', _232 => _232.module]), _optionalChain([packageJson, 'optionalAccess', _233 => _233.main])]) {
3795
3938
  if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
3796
3939
  }
3797
3940
  candidates.add(_path2.default.join(packageDirectory, "index"));
@@ -3827,7 +3970,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
3827
3970
  function readPackageJson(packageJsonPath) {
3828
3971
  try {
3829
3972
  return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
3830
- } catch (e38) {
3973
+ } catch (e45) {
3831
3974
  return null;
3832
3975
  }
3833
3976
  }
@@ -3856,7 +3999,7 @@ function resolvePackageExport(exportsField, exportKey) {
3856
3999
  if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
3857
4000
  const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
3858
4001
  const target = resolveConditionalExportTarget(value);
3859
- return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _223 => _223.replace, 'call', _224 => _224("*", wildcard)]), () => ( null));
4002
+ return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _234 => _234.replace, 'call', _235 => _235("*", wildcard)]), () => ( null));
3860
4003
  }
3861
4004
  return null;
3862
4005
  }
@@ -3882,15 +4025,25 @@ function resolveConditionalExportTarget(value) {
3882
4025
  }
3883
4026
  function resolveSourceCandidate(candidates) {
3884
4027
  for (const candidate of candidates) {
3885
- const paths = [candidate];
3886
- for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
3887
- paths.push(`${candidate}${extension}`, _path2.default.join(candidate, `index${extension}`));
3888
- }
3889
- for (const sourcePath of paths) {
3890
- try {
3891
- if (_fs2.default.statSync(sourcePath).isFile()) return sourcePath;
3892
- } catch (e39) {
3893
- }
4028
+ const resolved = memoizeInFarmSourceSnapshot(
4029
+ "source-candidate",
4030
+ farmSourceSnapshotPathKey(candidate),
4031
+ () => resolveSourceCandidatePath(candidate),
4032
+ (result) => result !== null
4033
+ );
4034
+ if (resolved) return resolved;
4035
+ }
4036
+ return null;
4037
+ }
4038
+ function resolveSourceCandidatePath(candidate) {
4039
+ const paths = [candidate];
4040
+ for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
4041
+ paths.push(`${candidate}${extension}`, _path2.default.join(candidate, `index${extension}`));
4042
+ }
4043
+ for (const sourcePath of paths) {
4044
+ try {
4045
+ if (_optionalChain([_fs2.default, 'access', _236 => _236.statSync, 'call', _237 => _237(sourcePath, { throwIfNoEntry: false }), 'optionalAccess', _238 => _238.isFile, 'call', _239 => _239()])) return sourcePath;
4046
+ } catch (e46) {
3894
4047
  }
3895
4048
  }
3896
4049
  return null;
@@ -3932,7 +4085,7 @@ function scanFarmPackageImports(directory, root) {
3932
4085
  let entries;
3933
4086
  try {
3934
4087
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3935
- } catch (e40) {
4088
+ } catch (e47) {
3936
4089
  return;
3937
4090
  }
3938
4091
  for (const entry of entries) {
@@ -3965,7 +4118,7 @@ function collectFarmServerBundledPackageInfo(directory) {
3965
4118
  let entries;
3966
4119
  try {
3967
4120
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3968
- } catch (e41) {
4121
+ } catch (e48) {
3969
4122
  return;
3970
4123
  }
3971
4124
  for (const entry of entries) {
@@ -4004,7 +4157,7 @@ function getFarmClientReachableModules(directory, root) {
4004
4157
  let entries;
4005
4158
  try {
4006
4159
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
4007
- } catch (e42) {
4160
+ } catch (e49) {
4008
4161
  return;
4009
4162
  }
4010
4163
  for (const entry of entries) {
@@ -4107,13 +4260,13 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4107
4260
  let projectRoot = process.cwd();
4108
4261
  let sources;
4109
4262
  const routeSourceFiles = () => {
4110
- const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _225 => _225.getProgrammaticClientRoutes, 'call', _226 => _226()]);
4111
- if (_optionalChain([sources, 'optionalAccess', _227 => _227.for]) !== clientRoutes || !sources) {
4263
+ const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _240 => _240.getProgrammaticClientRoutes, 'call', _241 => _241()]);
4264
+ if (_optionalChain([sources, 'optionalAccess', _242 => _242.for]) !== clientRoutes || !sources) {
4112
4265
  sources = {
4113
4266
  for: clientRoutes,
4114
4267
  files: /* @__PURE__ */ new Set([
4115
4268
  ...routesFiles,
4116
- ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _228 => _228.routeSourceFiles]), () => ( []))].map(resolvedFile)
4269
+ ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _243 => _243.routeSourceFiles]), () => ( []))].map(resolvedFile)
4117
4270
  ])
4118
4271
  };
4119
4272
  }
@@ -4134,11 +4287,11 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4134
4287
  configResolved(config) {
4135
4288
  isBuild = config.command === "build";
4136
4289
  projectRoot = config.root;
4137
- farmApi = _optionalChain([config, 'access', _229 => _229.plugins, 'access', _230 => _230.find, 'call', _231 => _231((plugin) => plugin.name === "farm"), 'optionalAccess', _232 => _232.api]);
4290
+ farmApi = _optionalChain([config, 'access', _244 => _244.plugins, 'access', _245 => _245.find, 'call', _246 => _246((plugin) => plugin.name === "farm"), 'optionalAccess', _247 => _247.api]);
4138
4291
  sources = void 0;
4139
4292
  routesFiles = new Set(
4140
4293
  _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
4141
- (source) => _chunkE7QOEV5Zcjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
4294
+ (source) => _chunkYUCU6XB4cjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
4142
4295
  (name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
4143
4296
  )
4144
4297
  )
@@ -4147,14 +4300,14 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4147
4300
  transform(code, id, transformOptions) {
4148
4301
  const environment = resolveBuildEnvironment(
4149
4302
  this,
4150
- _optionalChain([transformOptions, 'optionalAccess', _233 => _233.ssr])
4303
+ _optionalChain([transformOptions, 'optionalAccess', _248 => _248.ssr])
4151
4304
  );
4152
4305
  const parse3 = (source) => this.parse(source);
4153
4306
  const result = transformEnvironmentFunctions({ code, id, environment, parse: parse3 });
4154
- if (environment === "client" && !isBuild && !_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4307
+ if (environment === "client" && !isBuild && !_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4155
4308
  this.error(routeSourceError(moduleFile(id)));
4156
4309
  }
4157
- if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _234 => _234.experimental, 'optionalAccess', _235 => _235.serverComponents])) === "islands" && isApplicationScript(id)) {
4310
+ if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _249 => _249.experimental, 'optionalAccess', _250 => _250.serverComponents])) === "islands" && isApplicationScript(id)) {
4158
4311
  const file = id.split("?", 1)[0];
4159
4312
  const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
4160
4313
  const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
@@ -4186,9 +4339,9 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4186
4339
  if (resolveBuildEnvironment(context, false) !== "client") return;
4187
4340
  const forbidden = routeSourceFiles();
4188
4341
  for (const id of this.getModuleIds()) {
4189
- if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4342
+ if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4190
4343
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
4191
- return _optionalChain([this, 'access', _236 => _236.getModuleInfo, 'call', _237 => _237(moduleId), 'optionalAccess', _238 => _238.importedIds]);
4344
+ return _optionalChain([this, 'access', _251 => _251.getModuleInfo, 'call', _252 => _252(moduleId), 'optionalAccess', _253 => _253.importedIds]);
4192
4345
  });
4193
4346
  if (chain) {
4194
4347
  this.error(
@@ -4206,8 +4359,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4206
4359
  }
4207
4360
  if (!forbidden.has(moduleFile(id))) continue;
4208
4361
  const info = this.getModuleInfo(id);
4209
- if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _239 => _239.code]))) continue;
4210
- this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _240 => _240.importers, 'access', _241 => _241.map, 'call', _242 => _242(moduleFile)])));
4362
+ if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _254 => _254.code]))) continue;
4363
+ this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _255 => _255.importers, 'access', _256 => _256.map, 'call', _257 => _257(moduleFile)])));
4211
4364
  }
4212
4365
  }
4213
4366
  };
@@ -4221,13 +4374,13 @@ function moduleFile(id) {
4221
4374
  function resolvedFile(filePath) {
4222
4375
  try {
4223
4376
  return moduleFile(_fs.realpathSync.call(void 0, filePath));
4224
- } catch (e43) {
4377
+ } catch (e50) {
4225
4378
  return moduleFile(filePath);
4226
4379
  }
4227
4380
  }
4228
4381
  function resolveBuildEnvironment(context, ssr) {
4229
- if (_optionalChain([context, 'access', _243 => _243.environment, 'optionalAccess', _244 => _244.name]) === "client") return "client";
4230
- if (_optionalChain([context, 'access', _245 => _245.environment, 'optionalAccess', _246 => _246.name]) === "rsc" || _optionalChain([context, 'access', _247 => _247.environment, 'optionalAccess', _248 => _248.name]) === "ssr") {
4382
+ if (_optionalChain([context, 'access', _258 => _258.environment, 'optionalAccess', _259 => _259.name]) === "client") return "client";
4383
+ if (_optionalChain([context, 'access', _260 => _260.environment, 'optionalAccess', _261 => _261.name]) === "rsc" || _optionalChain([context, 'access', _262 => _262.environment, 'optionalAccess', _263 => _263.name]) === "ssr") {
4231
4384
  return "server";
4232
4385
  }
4233
4386
  return ssr ? "server" : "client";
@@ -4547,4 +4700,8 @@ function transformError(id, message) {
4547
4700
 
4548
4701
 
4549
4702
 
4550
- exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.getFarmSourceStamp = getFarmSourceStamp; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.withFarmSourceSnapshotOf = withFarmSourceSnapshotOf; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlanKey = getClientModuleHydrationPlanKey; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.createFarmDiagnostic = createFarmDiagnostic; exports.formatFarmDiagnostic = formatFarmDiagnostic; exports.createFarmSourceLocator = createFarmSourceLocator; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
4703
+
4704
+
4705
+
4706
+
4707
+ exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.getFarmSourceStamp = getFarmSourceStamp; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.withFarmSourceSnapshotOf = withFarmSourceSnapshotOf; exports.memoizeInFarmSourceSnapshot = memoizeInFarmSourceSnapshot; exports.noteFarmSourceRead = noteFarmSourceRead; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.usePackageScanCacheFile = usePackageScanCacheFile; exports.persistPackageScanCache = persistPackageScanCache; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlanKey = getClientModuleHydrationPlanKey; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.createFarmDiagnostic = createFarmDiagnostic; exports.formatFarmDiagnostic = formatFarmDiagnostic; exports.createFarmSourceLocator = createFarmSourceLocator; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;