@farm.js/core 0.1.67 → 0.1.68

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 (281) hide show
  1. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  6. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.d.mts +8 -6
  14. package/dist/api.d.ts +8 -6
  15. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  16. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  17. package/dist/app-markdown.cjs +3 -3
  18. package/dist/app-markdown.d.mts +10 -10
  19. package/dist/app-markdown.d.ts +10 -10
  20. package/dist/app-markdown.mjs +2 -2
  21. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BVOpL_f2.d.ts} +6 -6
  22. package/dist/{app.d-uBBUxwyV.d.mts → app.d-BhiDXex_.d.mts} +6 -6
  23. package/dist/{chunk-23PVOIPT.cjs → chunk-225APHKC.cjs} +3 -3
  24. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  25. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  26. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  27. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  28. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  29. package/dist/{chunk-WGHY3OL5.mjs → chunk-4UAQB5LB.mjs} +232 -49
  30. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  31. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  32. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  33. package/dist/{chunk-PL6RTBDE.cjs → chunk-5JKDFRTK.cjs} +2 -2
  34. package/dist/{chunk-CO3YMZFD.mjs → chunk-6OFOIMNS.mjs} +1 -1
  35. package/dist/{chunk-556H7JCE.cjs → chunk-7LK5CTUM.cjs} +14 -14
  36. package/dist/{chunk-E6CD45JK.mjs → chunk-A3T445WK.mjs} +19 -5
  37. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  38. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  39. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  40. package/dist/{chunk-XNZWMXCF.mjs → chunk-DIXFKAPM.mjs} +183 -76
  41. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  42. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  43. package/dist/{chunk-N5DQMOAG.cjs → chunk-F36LS2C7.cjs} +273 -90
  44. package/dist/{chunk-H37MDCPR.mjs → chunk-F6CMGWAL.mjs} +1 -1
  45. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  46. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  47. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  48. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  49. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  50. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  51. package/dist/chunk-HHLEYA4B.cjs +17 -0
  52. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  53. package/dist/chunk-ICFPTHXM.mjs +97 -0
  54. package/dist/{chunk-6V5YWI4W.cjs → chunk-IGDYL2IA.cjs} +2 -2
  55. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  56. package/dist/{chunk-JVM3DKZE.mjs → chunk-KDO6T6OB.mjs} +1 -1
  57. package/dist/{chunk-QITSS4TD.cjs → chunk-KWCZKJYU.cjs} +352 -245
  58. package/dist/{chunk-DCXSIEFE.cjs → chunk-LDEXTX4I.cjs} +51 -37
  59. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  60. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  61. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  62. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  63. package/dist/{chunk-HP2DQGQH.mjs → chunk-MNJDNTGO.mjs} +1 -1
  64. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  65. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  66. package/dist/{chunk-4DRINDGN.cjs → chunk-MZ4CRSY7.cjs} +254 -125
  67. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  68. package/dist/{chunk-WDD5CTZW.mjs → chunk-NT4W4H52.mjs} +6 -6
  69. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  70. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  71. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  72. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  73. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  74. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  75. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  76. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  77. package/dist/{chunk-HM7AGSKU.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  78. package/dist/{chunk-V5MQMQ2P.mjs → chunk-T5XFZQCL.mjs} +1 -1
  79. package/dist/{chunk-Q5UX55YA.cjs → chunk-TNK2TVRS.cjs} +831 -470
  80. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  81. package/dist/{chunk-V5RTHYJB.cjs → chunk-URN7VFO7.cjs} +91 -22
  82. package/dist/{chunk-HRPTMX5C.mjs → chunk-VFNAK6A5.mjs} +2 -2
  83. package/dist/{chunk-VK54PDQ6.mjs → chunk-VRGY3X2I.mjs} +86 -17
  84. package/dist/chunk-W44X6IC2.cjs +97 -0
  85. package/dist/{chunk-GTV2ABO7.mjs → chunk-WPB67LE5.mjs} +162 -33
  86. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  87. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  88. package/dist/{chunk-LPIZMU7D.cjs → chunk-YTNBCXCW.cjs} +4 -4
  89. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-Z3PW3DIR.cjs} +3 -3
  91. package/dist/{chunk-UHNSY2PQ.mjs → chunk-Z6SOXHAD.mjs} +772 -411
  92. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  93. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  94. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  95. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-CE1lVK2R.d.mts} +23 -234
  96. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-CNDqcAuf.d.ts} +23 -234
  97. package/dist/client-plugins.d.mts +5 -3
  98. package/dist/client-plugins.d.ts +5 -3
  99. package/dist/client.cjs +6 -6
  100. package/dist/client.d.mts +10 -8
  101. package/dist/client.d.ts +10 -8
  102. package/dist/client.mjs +5 -5
  103. package/dist/config.d.mts +5 -3
  104. package/dist/config.d.ts +5 -3
  105. package/dist/deployment.cjs +4 -2
  106. package/dist/deployment.d.mts +15 -1
  107. package/dist/deployment.d.ts +15 -1
  108. package/dist/deployment.mjs +3 -1
  109. package/dist/desktop.d.mts +6 -4
  110. package/dist/desktop.d.ts +6 -4
  111. package/dist/{devtools-UFQYT3VA.mjs → devtools-2A2GPC7B.mjs} +6 -6
  112. package/dist/{devtools-RZVT4JVN.cjs → devtools-R27T3BRY.cjs} +7 -7
  113. package/dist/docs.cjs +9 -9
  114. package/dist/docs.d.mts +6 -4
  115. package/dist/docs.d.ts +6 -4
  116. package/dist/docs.mjs +8 -8
  117. package/dist/environment/vite.cjs +5 -5
  118. package/dist/environment/vite.d.mts +1 -1
  119. package/dist/environment/vite.d.ts +1 -1
  120. package/dist/environment/vite.mjs +4 -4
  121. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  122. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  123. package/dist/index.cjs +41 -36
  124. package/dist/{index.d-Bdm6866n.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  125. package/dist/{index.d-Dey5T14f.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  126. package/dist/index.d.mts +25 -22
  127. package/dist/index.d.ts +25 -22
  128. package/dist/index.mjs +43 -38
  129. package/dist/instrumentation.cjs +3 -3
  130. package/dist/instrumentation.mjs +2 -2
  131. package/dist/integrations/orm.d.mts +5 -3
  132. package/dist/integrations/orm.d.ts +5 -3
  133. package/dist/integrations.d.mts +5 -3
  134. package/dist/integrations.d.ts +5 -3
  135. package/dist/internal/app-markdown-runtime.cjs +2 -2
  136. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  137. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  138. package/dist/internal/app-markdown-runtime.mjs +1 -1
  139. package/dist/internal/build-runtime.cjs +33 -30
  140. package/dist/internal/build-runtime.d.mts +7 -5
  141. package/dist/internal/build-runtime.d.ts +7 -5
  142. package/dist/internal/build-runtime.mjs +32 -29
  143. package/dist/internal/cli-runtime.cjs +10 -10
  144. package/dist/internal/cli-runtime.mjs +9 -9
  145. package/dist/internal/client-error-overlay.cjs +4 -4
  146. package/dist/internal/client-error-overlay.mjs +1 -1
  147. package/dist/internal/client-runtime.cjs +31 -36
  148. package/dist/internal/client-runtime.d.mts +8 -6
  149. package/dist/internal/client-runtime.d.ts +8 -6
  150. package/dist/internal/client-runtime.mjs +22 -27
  151. package/dist/internal/compression-runtime.d.mts +5 -3
  152. package/dist/internal/compression-runtime.d.ts +5 -3
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +9 -7
  155. package/dist/internal/config-runtime.d.ts +9 -7
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +7 -2
  158. package/dist/internal/form-actions.d.mts +10 -3
  159. package/dist/internal/form-actions.d.ts +10 -3
  160. package/dist/internal/form-actions.mjs +8 -3
  161. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  162. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  163. package/dist/internal/islands-boot.cjs +6 -1
  164. package/dist/internal/islands-boot.mjs +6 -1
  165. package/dist/internal/native-server-fns.cjs +4 -4
  166. package/dist/internal/native-server-fns.mjs +3 -3
  167. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  168. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  169. package/dist/internal/production-node-env.cjs +4 -2
  170. package/dist/internal/production-node-env.d.mts +22 -1
  171. package/dist/internal/production-node-env.d.ts +22 -1
  172. package/dist/internal/production-node-env.mjs +3 -1
  173. package/dist/internal/production-runtime.cjs +13 -9
  174. package/dist/internal/production-runtime.d.mts +21 -16
  175. package/dist/internal/production-runtime.d.ts +21 -16
  176. package/dist/internal/production-runtime.mjs +13 -9
  177. package/dist/internal/server-tree.cjs +2 -2
  178. package/dist/internal/server-tree.d.mts +0 -5
  179. package/dist/internal/server-tree.d.ts +0 -5
  180. package/dist/internal/server-tree.mjs +1 -1
  181. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  182. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  183. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  184. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  185. package/dist/layers-7P4RLKVX.cjs +20 -0
  186. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  187. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  188. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  189. package/dist/markdown.d.mts +5 -3
  190. package/dist/markdown.d.ts +5 -3
  191. package/dist/middleware.cjs +4 -4
  192. package/dist/middleware.d.mts +8 -5
  193. package/dist/middleware.d.ts +8 -5
  194. package/dist/middleware.mjs +6 -6
  195. package/dist/mobile.d.mts +4 -4
  196. package/dist/mobile.d.ts +4 -4
  197. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-Bki4pOaJ.d.mts} +1 -1
  198. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-DjR5aerM.d.ts} +1 -1
  199. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  201. package/dist/navigation.cjs +5 -5
  202. package/dist/navigation.d.mts +8 -6
  203. package/dist/navigation.d.ts +8 -6
  204. package/dist/navigation.mjs +4 -4
  205. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  206. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  207. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  208. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  209. package/dist/plugin.cjs +20 -20
  210. package/dist/plugin.d.mts +7 -5
  211. package/dist/plugin.d.ts +7 -5
  212. package/dist/plugin.mjs +19 -19
  213. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  214. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  215. package/dist/query/client.cjs +6 -6
  216. package/dist/query/client.mjs +2 -2
  217. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  218. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  219. package/dist/renderer/react/server.cjs +2 -2
  220. package/dist/renderer/react/server.mjs +1 -1
  221. package/dist/renderer-client.cjs +5 -5
  222. package/dist/renderer-client.d.mts +8 -6
  223. package/dist/renderer-client.d.ts +8 -6
  224. package/dist/renderer-client.mjs +2 -2
  225. package/dist/renderer.d.mts +5 -0
  226. package/dist/renderer.d.ts +5 -0
  227. package/dist/{request.d-KG-4d2eG.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  228. package/dist/{request.d-B928QjWy.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  229. package/dist/request.d.mts +6 -4
  230. package/dist/request.d.ts +6 -4
  231. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  232. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  233. package/dist/{router.d-DYnRHQwz.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  234. package/dist/{router.d-B8PkJSGp.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  235. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  236. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  237. package/dist/routes.d.mts +5 -3
  238. package/dist/routes.d.ts +5 -3
  239. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-3T7V6OUT.cjs} +10 -9
  240. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-GA4AQWZI.mjs} +9 -8
  241. package/dist/{runtime-X52Q7JFR.cjs → runtime-REUTNTI5.cjs} +20 -20
  242. package/dist/{runtime-U7O3HZOZ.mjs → runtime-ZYCKKY7L.mjs} +12 -12
  243. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DLRO-ExG.d.mts} +1 -1
  244. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-H7k9hOQE.d.ts} +1 -1
  245. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  246. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  247. package/dist/server-plugins.d.mts +6 -4
  248. package/dist/server-plugins.d.ts +6 -4
  249. package/dist/server.cjs +46 -44
  250. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  251. package/dist/server.d-DgC8xew5.d.mts +57 -0
  252. package/dist/server.d.mts +13 -11
  253. package/dist/server.d.ts +13 -11
  254. package/dist/server.mjs +28 -26
  255. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-Dr7oanhl.d.ts} +2 -2
  256. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-g4CzhEH1.d.mts} +2 -2
  257. package/dist/testing.d.mts +5 -3
  258. package/dist/testing.d.ts +5 -3
  259. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  260. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  261. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  262. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  263. package/dist/version.cjs +2 -2
  264. package/dist/version.mjs +1 -1
  265. package/dist/vite.cjs +20 -20
  266. package/dist/vite.d.mts +10 -8
  267. package/dist/vite.d.ts +10 -8
  268. package/dist/vite.mjs +19 -19
  269. package/dist/workflows.cjs +2 -2
  270. package/dist/workflows.d.mts +121 -1
  271. package/dist/workflows.d.ts +121 -1
  272. package/dist/workflows.mjs +1 -1
  273. package/package.json +7 -2
  274. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  275. package/dist/chunk-CLFEQGET.cjs +0 -60
  276. package/dist/chunk-MK5E44WP.mjs +0 -60
  277. package/dist/layers-DMRXRL7F.cjs +0 -18
  278. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  279. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  280. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  281. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -244,6 +244,9 @@ function isFarmDocsSocialImageEnabled(page, docs) {
244
244
  }
245
245
  return !isFalse(page.frontmatter.socialImage);
246
246
  }
247
+ function farmDocsPageUsesRequestOrigin(page, docs) {
248
+ return isFarmDocsSocialImageEnabled(page, docs) && !getSocialImageConfig(docs)?.baseUrl;
249
+ }
247
250
  function getFarmDocsCustomSocialImage(page) {
248
251
  const value = page.frontmatter.socialImage || page.frontmatter.openGraphImage || page.frontmatter.ogImage;
249
252
  return value && !isFalse(value) && isExternalOrRootPath(value) ? value : void 0;
@@ -922,6 +925,19 @@ function discoverFarmDocsPages(contentDir, docs) {
922
925
  visit(contentDir);
923
926
  return pages.sort((a, b) => a.href.localeCompare(b.href));
924
927
  }
928
+ function listFarmDocsBuiltInPrerenderPages(docs, options) {
929
+ const pages = [];
930
+ const originDependent = [];
931
+ for (const root of getFarmDocsRoots(docs)) {
932
+ const contentDir = resolveFarmDocsContentDir(root, options);
933
+ for (const page of discoverFarmDocsPages(contentDir, root)) {
934
+ const loaded = loadFarmDocsPage(contentDir, root, page.slug);
935
+ if (!loaded) continue;
936
+ (farmDocsPageUsesRequestOrigin(loaded, root) ? originDependent : pages).push(loaded.href);
937
+ }
938
+ }
939
+ return { pages: [...new Set(pages)], originDependent: [...new Set(originDependent)] };
940
+ }
925
941
  function toFarmDocsMarkdownPage(page, basePath = "") {
926
942
  const lastModified = page.lastModified || page.frontmatter.lastModified || page.frontmatter.lastmod;
927
943
  return {
@@ -2090,6 +2106,7 @@ export {
2090
2106
  loadFarmDocsPage,
2091
2107
  getFarmDocsMarkdownPath,
2092
2108
  discoverFarmDocsPages,
2109
+ listFarmDocsBuiltInPrerenderPages,
2093
2110
  toFarmDocsMarkdownPage,
2094
2111
  getFarmDocsSiteUrl,
2095
2112
  getFarmDocsPublicEntry,
@@ -15,14 +15,14 @@ var _chunkWBTHHTBOcjs = require('./chunk-WBTHHTBO.cjs');
15
15
  var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
16
16
 
17
17
 
18
- var _chunkHM7AGSKUcjs = require('./chunk-HM7AGSKU.cjs');
18
+ var _chunkSQ6IWJ3Hcjs = require('./chunk-SQ6IWJ3H.cjs');
19
19
 
20
20
  // src/mobile/analyzer.ts
21
21
  var _crypto = require('crypto');
22
22
  var _fs = require('fs');
23
23
  var _promises = require('fs/promises');
24
24
  var _path = require('path'); var path = _interopRequireWildcard(_path);
25
- var ANALYZER_VERSION = `7:${_chunkHM7AGSKUcjs.FARM_VERSION}`;
25
+ var ANALYZER_VERSION = `7:${_chunkSQ6IWJ3Hcjs.FARM_VERSION}`;
26
26
  var INTRINSIC_KINDS = {};
27
27
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
28
28
  INTRINSIC_KINDS[tag] = "View";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-423SSBYQ.mjs";
16
16
  import {
17
17
  FARM_VERSION
18
- } from "./chunk-H37MDCPR.mjs";
18
+ } from "./chunk-F6CMGWAL.mjs";
19
19
 
20
20
  // src/mobile/analyzer.ts
21
21
  import { createHash } from "crypto";
@@ -7,7 +7,7 @@ var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunk22IWL4YDcjs = require('./chunk-22IWL4YD.cjs');
10
+ var _chunkOCNV4CI2cjs = require('./chunk-OCNV4CI2.cjs');
11
11
 
12
12
 
13
13
  var _chunkLSHX2H5Gcjs = require('./chunk-LSHX2H5G.cjs');
@@ -38,7 +38,7 @@ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
38
38
 
39
39
 
40
40
 
41
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
41
+ var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
42
42
 
43
43
 
44
44
 
@@ -67,10 +67,10 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
67
67
  var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
68
68
 
69
69
 
70
- var _chunkDQJ2CIH7cjs = require('./chunk-DQJ2CIH7.cjs');
70
+ var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
71
71
 
72
72
 
73
- var _chunkKCY52OUQcjs = require('./chunk-KCY52OUQ.cjs');
73
+ var _chunkFSODPZRTcjs = require('./chunk-FSODPZRT.cjs');
74
74
 
75
75
 
76
76
  var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
@@ -94,7 +94,7 @@ var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
94
94
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
95
95
 
96
96
 
97
- var _chunkF43OG25Pcjs = require('./chunk-F43OG25P.cjs');
97
+ var _chunkI7J5RLGOcjs = require('./chunk-I7J5RLGO.cjs');
98
98
 
99
99
 
100
100
  var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
@@ -798,7 +798,7 @@ async function loadDocsConfig(rootDir, configPath) {
798
798
  configCacheDir,
799
799
  `docs-config-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`
800
800
  );
801
- await _chunkDQJ2CIH7cjs.bundleNodeModule.call(void 0, {
801
+ await _chunkASYOWPSRcjs.bundleNodeModule.call(void 0, {
802
802
  root,
803
803
  entry: resolvedPath,
804
804
  outfile: modulePath,
@@ -1044,7 +1044,7 @@ function validateConfigRouteSources(routes, field) {
1044
1044
  async function resolveConfig(userConfig, mode) {
1045
1045
  _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _43 => _43.experimental, 'optionalAccess', _44 => _44.serverComponents]));
1046
1046
  const projectRoot = userConfig.root || process.cwd();
1047
- const layerResolution = await _chunk5Y2P454Ocjs.resolveFarmLayers.call(void 0, userConfig, {
1047
+ const layerResolution = await _chunkMTBDJ326cjs.resolveFarmLayers.call(void 0, userConfig, {
1048
1048
  root: projectRoot,
1049
1049
  mode
1050
1050
  });
@@ -1072,9 +1072,9 @@ async function resolveConfig(userConfig, mode) {
1072
1072
  validateConfigRouteSources(rewrites, "rewrites");
1073
1073
  const headers = typeof userConfig.headers === "function" ? await userConfig.headers() : userConfig.headers || [];
1074
1074
  validateConfigRouteSources(headers, "headers");
1075
- const routeRules = _chunk22IWL4YDcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
1076
- const routeRuleRedirects = _chunk22IWL4YDcjs.routeRulesToRedirects.call(void 0, routeRules);
1077
- const routeRuleHeaders = _chunk22IWL4YDcjs.routeRulesToHeaders.call(void 0, routeRules);
1075
+ const routeRules = _chunkOCNV4CI2cjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
1076
+ const routeRuleRedirects = _chunkOCNV4CI2cjs.routeRulesToRedirects.call(void 0, routeRules);
1077
+ const routeRuleHeaders = _chunkOCNV4CI2cjs.routeRulesToHeaders.call(void 0, routeRules);
1078
1078
  const security = _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
1079
1079
  const securityHeader = _chunk6JHZPB52cjs.getFarmSecurityHeader.call(void 0, security);
1080
1080
  if (_chunk6JHZPB52cjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
@@ -1114,7 +1114,7 @@ async function resolveConfig(userConfig, mode) {
1114
1114
  }
1115
1115
  const integrations = nativeAuthIntegration ? { ...userConfig.integrations, auth: nativeAuthIntegration } : userConfig.integrations || {};
1116
1116
  const generateBuildId = userConfig.generateBuildId || (() => `build-${Date.now()}`);
1117
- const deploymentId = _chunkF43OG25Pcjs.normalizeFarmDeploymentId.call(void 0,
1117
+ const deploymentId = _chunkI7J5RLGOcjs.normalizeFarmDeploymentId.call(void 0,
1118
1118
  userConfig.deploymentId || process.env.FARM_DEPLOYMENT_ID || process.env.VERCEL_GIT_COMMIT_SHA || process.env.CF_PAGES_COMMIT_SHA || (mode === "production" ? await generateBuildId() : "development")
1119
1119
  );
1120
1120
  const basePath = _chunkD22BUQKWcjs.normalizeFarmConfigBasePath.call(void 0, userConfig.basePath);
@@ -1155,7 +1155,7 @@ async function resolveConfig(userConfig, mode) {
1155
1155
  mdx,
1156
1156
  migrations: resolveMigrationsConfig(userConfig.migrations),
1157
1157
  cron,
1158
- workflows: _chunkKCY52OUQcjs.resolveWorkflowsConfig.call(void 0, userConfig.workflows),
1158
+ workflows: _chunkFSODPZRTcjs.resolveWorkflowsConfig.call(void 0, userConfig.workflows),
1159
1159
  api,
1160
1160
  observability: _nullishCoalesce(userConfig.observability, () => ( false)),
1161
1161
  telemetry: userConfig.telemetry !== false,
@@ -1226,7 +1226,7 @@ async function resolveConfig(userConfig, mode) {
1226
1226
  };
1227
1227
  _chunkLSHX2H5Gcjs.assertPluginDependencies.call(void 0, resolved.plugins, resolved.integrations);
1228
1228
  if (nativeServerFnPlugin) {
1229
- nativeServerFnAppDirs = (await import("./layers-DMRXRL7F.cjs")).getFarmAppDirectories(resolved);
1229
+ nativeServerFnAppDirs = (await import("./layers-7P4RLKVX.cjs")).getFarmAppDirectories(resolved);
1230
1230
  }
1231
1231
  return resolved;
1232
1232
  }
@@ -1282,7 +1282,7 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
1282
1282
  if (!existsSync(normalizedPath)) {
1283
1283
  continue;
1284
1284
  }
1285
- const loadedConfig = await _chunk5Y2P454Ocjs.loadFarmConfigFile.call(void 0, normalizedPath, { root });
1285
+ const loadedConfig = await _chunkMTBDJ326cjs.loadFarmConfigFile.call(void 0, normalizedPath, { root });
1286
1286
  return loadedConfig.root === void 0 ? { ...loadedConfig, root } : loadedConfig;
1287
1287
  } catch (error) {
1288
1288
  const configError = new Error(
@@ -10,14 +10,14 @@ import {
10
10
  resolveFarmDocsContentDir,
11
11
  toFarmDocsMarkdownPage,
12
12
  toFarmDocsPublicSitemapConfig
13
- } from "./chunk-AQDLVHNF.mjs";
13
+ } from "./chunk-5FBZJJGA.mjs";
14
14
  import {
15
15
  docsEngine,
16
16
  loadFarmDocsEngine
17
17
  } from "./chunk-VE3FWJBO.mjs";
18
18
  import {
19
19
  resolveDocsConfig
20
- } from "./chunk-WDD5CTZW.mjs";
20
+ } from "./chunk-NT4W4H52.mjs";
21
21
  import {
22
22
  getFarmDocsAdapterConfigModule,
23
23
  isSecretDocsConfigKey
@@ -37,12 +37,24 @@ import { pathToFileURL } from "url";
37
37
  function hasFarmDocsRuntimeAdapter(docs) {
38
38
  return Boolean(docs?.enabled && docs.adapter?.server && docs.adapter.react);
39
39
  }
40
- function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
40
+ function farmDocsAdapterServesGuardedPages(docs) {
41
+ return Boolean(
42
+ hasFarmDocsRuntimeAdapter(docs) && docs.adapter.capabilities?.includes("guarded-pages")
43
+ );
44
+ }
45
+ function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded, runtime = "node") {
41
46
  if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
47
+ const servesGuardedPages = farmDocsAdapterServesGuardedPages(docs);
48
+ if (servesGuardedPages && runtime !== "edge") return;
42
49
  const guarded = getFarmDocsRoots(docs).flatMap((root) => discoverFarmDocsPages(resolveFarmDocsContentDir(root, options), root)).filter((page) => isPathGuarded(page.href) || isPathGuarded(getFarmDocsMarkdownPath(page.href))).map((page) => page.href);
43
50
  if (guarded.length === 0) return;
51
+ if (servesGuardedPages) {
52
+ throw new Error(
53
+ `Docs pages behind a path guard (${guarded.join(", ")}) would be public on an edge target: the docs adapter ${JSON.stringify(docs.adapter.id)} serves a build-time snapshot of their content in llms-full.txt, search, Markdown, and MCP, where no guard runs. Deploy to a Node or serverless target, or move those pages out of the docs content directory.`
54
+ );
55
+ }
44
56
  throw new Error(
45
- `Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
57
+ `Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Upgrade the adapter to a release that keeps guarded pages off those surfaces (@farming-labs/farmjs declares it as the \`guarded-pages\` capability), move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
46
58
  );
47
59
  }
48
60
  async function loadFarmDocsConfigModule(docs, loadModule) {
@@ -167,7 +179,8 @@ async function createFarmDocsAdapterHandler(docs, options) {
167
179
  stylesheets: getFarmDocsAdapterStylesheets(options),
168
180
  resolveLayoutFonts: options.resolveLayoutFonts,
169
181
  loadReactModule: () => options.loadModule(docs.adapter.react),
170
- ...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {}
182
+ ...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {},
183
+ ...options.isPathGuarded && farmDocsAdapterServesGuardedPages(docs) ? { isPathGuarded: options.isPathGuarded } : {}
171
184
  };
172
185
  if (multiRoot) {
173
186
  return serverModule.createFarmDocsMultiRuntimeHandler(
@@ -704,6 +717,7 @@ function createFarmDocsAPIHandler(options = {}, cloudIntegration) {
704
717
 
705
718
  export {
706
719
  hasFarmDocsRuntimeAdapter,
720
+ farmDocsAdapterServesGuardedPages,
707
721
  assertFarmDocsAdapterServesNoGuardedPages,
708
722
  getFarmDocsConfigModuleRoot,
709
723
  compileFarmDocsAdapterEdgeManifest,
@@ -84,4 +84,5 @@ function withPlainDiagnostics(error) {
84
84
 
85
85
 
86
86
 
87
- exports.isDeclarationFile = isDeclarationFile; exports.resolvePackageWithoutTsconfig = resolvePackageWithoutTsconfig; exports.bundleNodeModule = bundleNodeModule;
87
+
88
+ exports.isDeclarationFile = isDeclarationFile; exports.resolvePackageWithoutTsconfig = resolvePackageWithoutTsconfig; exports.bundleNodeModule = bundleNodeModule; exports.withPlainDiagnostics = withPlainDiagnostics;
@@ -14,6 +14,7 @@ import {
14
14
  var MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
15
15
  var FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
16
16
  var SERVER_HTML_TAG = "f-html";
17
+ var SERVER_HTML_TEMPLATE_TAG = "template";
17
18
  var FARM_SERVER_TREE_SCRIPT_TYPE = "f/tree";
18
19
  var FARM_NOT_A_MARKER = /* @__PURE__ */ Symbol.for("farm.codec.not-a-marker");
19
20
  var SERVER_TREE_CHUNK_SCRIPT_TYPE = "f/chunk";
@@ -312,52 +313,79 @@ function fulfilledThenable(value) {
312
313
  promise.value = value;
313
314
  return promise;
314
315
  }
315
- function createTreeChildren(ReactRuntime, children, resolver) {
316
+ function createTreeChildren(ReactRuntime, children, resolver, inClient) {
316
317
  if (children === void 0) return [];
317
- const node = createTreeValue(ReactRuntime, children, resolver);
318
+ const node = createTreeValue(ReactRuntime, children, resolver, inClient);
318
319
  return Array.isArray(children) ? node : [node];
319
320
  }
320
- function createTreeProps(ReactRuntime, props, resolver, key) {
321
+ function createTreeProps(ReactRuntime, props, resolver, key, inClient) {
321
322
  const { children, ...rest } = props;
322
323
  const created = {};
323
324
  for (const [name, value] of Object.entries(rest)) {
324
- created[name] = createTreeValue(ReactRuntime, value, resolver);
325
+ created[name] = createTreeValue(ReactRuntime, value, resolver, inClient);
325
326
  }
326
327
  if (typeof key === "string") created.key = key;
327
- return { props: created, children: createTreeChildren(ReactRuntime, children, resolver) };
328
+ return {
329
+ props: created,
330
+ children: createTreeChildren(ReactRuntime, children, resolver, inClient)
331
+ };
332
+ }
333
+ function collectServerHtml(value, ids) {
334
+ if (value === null || typeof value !== "object") return ids;
335
+ if (Array.isArray(value)) {
336
+ for (const entry of value) collectServerHtml(entry, ids);
337
+ return ids;
338
+ }
339
+ if (value.$ === "x") {
340
+ ids.push(value.i);
341
+ return ids;
342
+ }
343
+ const object = value.$ === "o" ? value.v : value;
344
+ for (const entry of Object.values(object)) collectServerHtml(entry, ids);
345
+ return ids;
328
346
  }
329
- function createTreeValue(ReactRuntime, value, resolver) {
347
+ function createTreeValue(ReactRuntime, value, resolver, inClient = false) {
330
348
  if (value === null || typeof value !== "object") return value;
331
349
  if (Array.isArray(value))
332
- return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver));
350
+ return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver, inClient));
333
351
  switch (value.$) {
334
352
  case "h": {
335
353
  const { props, children } = createTreeProps(
336
354
  ReactRuntime,
337
355
  value.p,
338
356
  resolver,
339
- value.k
357
+ value.k,
358
+ inClient
340
359
  );
341
360
  return ReactRuntime.createElement(value.t, props, ...children);
342
361
  }
343
362
  case "c": {
363
+ const ids = inClient ? [] : collectServerHtml(value.p, []);
344
364
  const { props, children } = createTreeProps(
345
365
  ReactRuntime,
346
366
  value.p,
347
367
  resolver,
348
- value.k
368
+ ids.length > 0 ? void 0 : value.k,
369
+ true
349
370
  );
350
- return ReactRuntime.createElement(
371
+ const element = ReactRuntime.createElement(
351
372
  resolver.component(value.r, value.e),
352
373
  props,
353
374
  ...children
354
375
  );
376
+ if (ids.length === 0) return element;
377
+ return ReactRuntime.createElement(
378
+ ReactRuntime.Fragment,
379
+ typeof value.k === "string" ? { key: value.k } : null,
380
+ element,
381
+ resolver.unrendered(ids)
382
+ );
355
383
  }
356
384
  case "f":
357
385
  return ReactRuntime.createElement(
358
386
  ReactRuntime.Fragment,
359
387
  typeof value.k === "string" ? { key: value.k } : null,
360
- ...createTreeChildren(ReactRuntime, value.c, resolver)
388
+ ...createTreeChildren(ReactRuntime, value.c, resolver, inClient)
361
389
  );
362
390
  case "p":
363
391
  return ReactRuntime.createElement(
@@ -367,7 +395,8 @@ function createTreeValue(ReactRuntime, value, resolver) {
367
395
  fallback: createTreeValue(
368
396
  ReactRuntime,
369
397
  value.f,
370
- resolver
398
+ resolver,
399
+ inClient
371
400
  )
372
401
  },
373
402
  ReactRuntime.createElement(getChunkComponent(ReactRuntime), {
@@ -381,13 +410,15 @@ function createTreeValue(ReactRuntime, value, resolver) {
381
410
  case "a":
382
411
  return resolver.action(value.v);
383
412
  case "P":
384
- return fulfilledThenable(createTreeValue(ReactRuntime, value.v, resolver));
413
+ return fulfilledThenable(
414
+ createTreeValue(ReactRuntime, value.v, resolver, inClient)
415
+ );
385
416
  case "o": {
386
417
  const object = value.v;
387
418
  return Object.fromEntries(
388
419
  Object.entries(object).map(([name, entry]) => [
389
420
  name,
390
- createTreeValue(ReactRuntime, entry, resolver)
421
+ createTreeValue(ReactRuntime, entry, resolver, inClient)
391
422
  ])
392
423
  );
393
424
  }
@@ -396,14 +427,14 @@ function createTreeValue(ReactRuntime, value, resolver) {
396
427
  if (!resolver.decode) throw new Error("typed props need islands mode");
397
428
  const decoded = resolver.decode(
398
429
  value,
399
- (child) => createTreeValue(ReactRuntime, child, resolver)
430
+ (child) => createTreeValue(ReactRuntime, child, resolver, inClient)
400
431
  );
401
432
  if (decoded !== FARM_NOT_A_MARKER) return decoded;
402
433
  }
403
434
  return Object.fromEntries(
404
435
  Object.entries(value).map(([name, entry]) => [
405
436
  name,
406
- createTreeValue(ReactRuntime, entry, resolver)
437
+ createTreeValue(ReactRuntime, entry, resolver, inClient)
407
438
  ])
408
439
  );
409
440
  }
@@ -493,6 +524,49 @@ async function createPayloadOnlyPage(state, payload, encode, resolver) {
493
524
  })
494
525
  );
495
526
  }
527
+ function RenderedServerHtml({
528
+ id,
529
+ rendered,
530
+ children
531
+ }) {
532
+ rendered.add(id);
533
+ return children;
534
+ }
535
+ function UnrenderedServerHtml({
536
+ ReactRuntime,
537
+ ids,
538
+ rendered,
539
+ part
540
+ }) {
541
+ const unrendered = ids.filter((id) => !rendered.has(id));
542
+ if (unrendered.length === 0) return null;
543
+ return ReactRuntime.createElement(
544
+ SERVER_HTML_TEMPLATE_TAG,
545
+ { [SERVER_HTML_ATTRIBUTE]: String(unrendered[0]) },
546
+ unrendered.map((id) => part(id, `h${id}`))
547
+ );
548
+ }
549
+ function createServerHtmlParts(state, isolate) {
550
+ const ReactRuntime = state.ReactRuntime;
551
+ const rendered = /* @__PURE__ */ new Set();
552
+ const part = (id, key) => ReactRuntime.createElement(
553
+ SERVER_HTML_TAG,
554
+ {
555
+ ...key === null ? {} : { key },
556
+ [SERVER_HTML_ATTRIBUTE]: String(id),
557
+ style: { display: "contents" }
558
+ },
559
+ isolate(state.serverHtml.get(id))
560
+ );
561
+ return {
562
+ serverHtml: (id, key) => ReactRuntime.createElement(
563
+ RenderedServerHtml,
564
+ { ...key === null ? {} : { key }, id, rendered },
565
+ part(id, null)
566
+ ),
567
+ unrendered: (ids) => ReactRuntime.createElement(UnrenderedServerHtml, { ReactRuntime, ids, rendered, part })
568
+ };
569
+ }
496
570
  async function renderFarmServerTreePage(ReactRuntime, element, options) {
497
571
  const state = {
498
572
  ReactRuntime,
@@ -558,17 +632,7 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
558
632
  entry.chunk = chunk;
559
633
  return chunk;
560
634
  },
561
- serverHtml(id, key) {
562
- return ReactRuntime.createElement(
563
- SERVER_HTML_TAG,
564
- {
565
- ...key === null ? {} : { key },
566
- [SERVER_HTML_ATTRIBUTE]: String(id),
567
- style: { display: "contents" }
568
- },
569
- options.isolate(state.serverHtml.get(id))
570
- );
571
- },
635
+ ...createServerHtmlParts(state, options.isolate),
572
636
  action(id) {
573
637
  return state.actions.get(id);
574
638
  },
@@ -645,8 +709,19 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
645
709
  })
646
710
  );
647
711
  const serverHtml = /* @__PURE__ */ new Map();
648
- for (const container of root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`)) {
649
- serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
712
+ const readParts = (parts) => {
713
+ for (const container of parts) {
714
+ if (container.localName !== SERVER_HTML_TAG) continue;
715
+ serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
716
+ }
717
+ };
718
+ readParts(root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`));
719
+ const templates = /* @__PURE__ */ new Map();
720
+ for (const template of root.querySelectorAll(
721
+ `${SERVER_HTML_TEMPLATE_TAG}[${SERVER_HTML_ATTRIBUTE}]`
722
+ )) {
723
+ templates.set(Number(template.getAttribute(SERVER_HTML_ATTRIBUTE)), template.innerHTML);
724
+ readParts(template.content.children);
650
725
  }
651
726
  const resolver = {
652
727
  component(reference, exportName) {
@@ -683,6 +758,15 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
683
758
  dangerouslySetInnerHTML: { __html: html }
684
759
  });
685
760
  },
761
+ unrendered(ids) {
762
+ const id = ids.find((candidate) => templates.has(candidate));
763
+ if (id === void 0) return null;
764
+ return ReactRuntime.createElement(SERVER_HTML_TEMPLATE_TAG, {
765
+ [SERVER_HTML_ATTRIBUTE]: String(id),
766
+ suppressHydrationWarning: true,
767
+ dangerouslySetInnerHTML: { __html: templates.get(id) }
768
+ });
769
+ },
686
770
  action(id) {
687
771
  if (!options.actions) throw new Error("server action props need islands mode");
688
772
  return options.actions(id);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useRouter
3
- } from "./chunk-JWSI5WO4.mjs";
3
+ } from "./chunk-4ZXKYCYK.mjs";
4
4
  import {
5
5
  getRouter
6
- } from "./chunk-HFHJJXSV.mjs";
6
+ } from "./chunk-GFPS7MNE.mjs";
7
7
  import {
8
8
  applyFarmBasePath
9
9
  } from "./chunk-SF3JB56B.mjs";