@deepseek-insight/dsi 0.5.5

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 (285) hide show
  1. package/LICENSE +204 -0
  2. package/README.md +98 -0
  3. package/bin/dsi.mjs +147 -0
  4. package/build/client/_app/immutable/assets/0.DqFt8jIM.css +2 -0
  5. package/build/client/_app/immutable/assets/2.YlW45hiM.css +1 -0
  6. package/build/client/_app/immutable/assets/codicon.Brq4_Ui5.ttf +0 -0
  7. package/build/client/_app/immutable/assets/editor.jjEx9u7D.css +1 -0
  8. package/build/client/_app/immutable/assets/settings-monaco.C1CMdMvw.css +1 -0
  9. package/build/client/_app/immutable/chunks/-g7BcI22.js +4 -0
  10. package/build/client/_app/immutable/chunks/08VXUWAP.js +1 -0
  11. package/build/client/_app/immutable/chunks/2irkVCIh.js +10 -0
  12. package/build/client/_app/immutable/chunks/43DmfD33.js +1 -0
  13. package/build/client/_app/immutable/chunks/6GKQw8m6.js +99 -0
  14. package/build/client/_app/immutable/chunks/6RTg0lbw.js +1 -0
  15. package/build/client/_app/immutable/chunks/9TvT6fta.js +120 -0
  16. package/build/client/_app/immutable/chunks/B1YSaoU7.js +96 -0
  17. package/build/client/_app/immutable/chunks/B2J2w5EN.js +1 -0
  18. package/build/client/_app/immutable/chunks/B5-_aFwp.js +2 -0
  19. package/build/client/_app/immutable/chunks/B8-Q2PIv.js +1 -0
  20. package/build/client/_app/immutable/chunks/B8J7ngcE.js +1 -0
  21. package/build/client/_app/immutable/chunks/B9JPFI3C.js +2 -0
  22. package/build/client/_app/immutable/chunks/BAZKJuQw.js +1 -0
  23. package/build/client/_app/immutable/chunks/BBKpNcUe.js +1 -0
  24. package/build/client/_app/immutable/chunks/BEEn4gHE.js +1 -0
  25. package/build/client/_app/immutable/chunks/BEtHBSE6.js +1 -0
  26. package/build/client/_app/immutable/chunks/BFoDCU3G.js +1 -0
  27. package/build/client/_app/immutable/chunks/BHtPwB2y.js +847 -0
  28. package/build/client/_app/immutable/chunks/BI-MrBd-.js +1 -0
  29. package/build/client/_app/immutable/chunks/BI4pMaIG.js +1 -0
  30. package/build/client/_app/immutable/chunks/BJL7RCQE.js +4 -0
  31. package/build/client/_app/immutable/chunks/BKxtCVv1.js +1 -0
  32. package/build/client/_app/immutable/chunks/BOfSXrr7.js +1 -0
  33. package/build/client/_app/immutable/chunks/BOotOW0E.js +1 -0
  34. package/build/client/_app/immutable/chunks/BTzV9O1M.js +3 -0
  35. package/build/client/_app/immutable/chunks/BW-FRVGs.js +1 -0
  36. package/build/client/_app/immutable/chunks/BWPQTe0t.js +1 -0
  37. package/build/client/_app/immutable/chunks/BYgofb2h.js +1 -0
  38. package/build/client/_app/immutable/chunks/Ba7i2nA0.js +1 -0
  39. package/build/client/_app/immutable/chunks/Bb19NAkg.js +1 -0
  40. package/build/client/_app/immutable/chunks/Bc_sGQ0U.js +1 -0
  41. package/build/client/_app/immutable/chunks/BeGwcela.js +1 -0
  42. package/build/client/_app/immutable/chunks/BeZqd5lB.js +1 -0
  43. package/build/client/_app/immutable/chunks/Beo7Z46k.js +7 -0
  44. package/build/client/_app/immutable/chunks/BhNEBkk_.js +39 -0
  45. package/build/client/_app/immutable/chunks/BifhSqXX.js +1 -0
  46. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  47. package/build/client/_app/immutable/chunks/BlltJnm0.js +1 -0
  48. package/build/client/_app/immutable/chunks/Bn9NRi0R.js +168 -0
  49. package/build/client/_app/immutable/chunks/BnF5Jm-h.js +1 -0
  50. package/build/client/_app/immutable/chunks/Bp4uuUjI.js +3 -0
  51. package/build/client/_app/immutable/chunks/BrTsmS-o.js +57 -0
  52. package/build/client/_app/immutable/chunks/Bri6UV-V.js +1 -0
  53. package/build/client/_app/immutable/chunks/Btk-1DaX.js +1 -0
  54. package/build/client/_app/immutable/chunks/BwWrilGY.js +1 -0
  55. package/build/client/_app/immutable/chunks/Bxkupp3x.js +1 -0
  56. package/build/client/_app/immutable/chunks/Bz4Y3fRF.js +1 -0
  57. package/build/client/_app/immutable/chunks/C-OQMol4.js +1 -0
  58. package/build/client/_app/immutable/chunks/C-y9NEjX.js +1 -0
  59. package/build/client/_app/immutable/chunks/C1JXY9b5.js +30 -0
  60. package/build/client/_app/immutable/chunks/C2x7inlt.js +321 -0
  61. package/build/client/_app/immutable/chunks/C531GsRP.js +2 -0
  62. package/build/client/_app/immutable/chunks/C5TAQhFO.js +1 -0
  63. package/build/client/_app/immutable/chunks/C5_-GSwl.js +1 -0
  64. package/build/client/_app/immutable/chunks/C6lv30UQ.js +1 -0
  65. package/build/client/_app/immutable/chunks/C7h46wYY.js +1 -0
  66. package/build/client/_app/immutable/chunks/C8Ef5oNN.js +1 -0
  67. package/build/client/_app/immutable/chunks/CA_WNCsl.js +41 -0
  68. package/build/client/_app/immutable/chunks/CC2rA5mh.js +1 -0
  69. package/build/client/_app/immutable/chunks/CHdTS7qa.js +15 -0
  70. package/build/client/_app/immutable/chunks/CIPQ_RoX.js +1 -0
  71. package/build/client/_app/immutable/chunks/CJ_zvTBg.js +72 -0
  72. package/build/client/_app/immutable/chunks/CPEyWost.js +1 -0
  73. package/build/client/_app/immutable/chunks/CPgSxomx.js +1 -0
  74. package/build/client/_app/immutable/chunks/CRfGWb83.js +1 -0
  75. package/build/client/_app/immutable/chunks/CTgm3pse.js +1 -0
  76. package/build/client/_app/immutable/chunks/CVaqCwHa.js +1 -0
  77. package/build/client/_app/immutable/chunks/CWKM3f5q.js +1 -0
  78. package/build/client/_app/immutable/chunks/CWVpRRWx.js +162 -0
  79. package/build/client/_app/immutable/chunks/CXMH3UgJ.js +257 -0
  80. package/build/client/_app/immutable/chunks/CZ-RNlot.js +1 -0
  81. package/build/client/_app/immutable/chunks/CZXl7qUb.js +70 -0
  82. package/build/client/_app/immutable/chunks/C_N-eONP.js +1 -0
  83. package/build/client/_app/immutable/chunks/Cb1pwoev.js +1 -0
  84. package/build/client/_app/immutable/chunks/CcL1k2On.js +11 -0
  85. package/build/client/_app/immutable/chunks/CcWV7GYH.js +1 -0
  86. package/build/client/_app/immutable/chunks/CcwsVR0C.js +1 -0
  87. package/build/client/_app/immutable/chunks/Cd6K7Y8m.js +1 -0
  88. package/build/client/_app/immutable/chunks/CfSJPG6W.js +1 -0
  89. package/build/client/_app/immutable/chunks/CfZ7uSQe.js +38 -0
  90. package/build/client/_app/immutable/chunks/Cimd5fb3.js +1 -0
  91. package/build/client/_app/immutable/chunks/Cj-Zm41R.js +36 -0
  92. package/build/client/_app/immutable/chunks/CjZ_QSbm.js +1 -0
  93. package/build/client/_app/immutable/chunks/CkrcOjFY.js +1 -0
  94. package/build/client/_app/immutable/chunks/ClamHrr6.js +1 -0
  95. package/build/client/_app/immutable/chunks/Cm7r79vr.js +1 -0
  96. package/build/client/_app/immutable/chunks/CmbEK4CY.js +84 -0
  97. package/build/client/_app/immutable/chunks/CmvnEPtD.js +7 -0
  98. package/build/client/_app/immutable/chunks/CopQ2nXW.js +1 -0
  99. package/build/client/_app/immutable/chunks/CpzslTdj.js +1 -0
  100. package/build/client/_app/immutable/chunks/CsHVnZCH.js +1 -0
  101. package/build/client/_app/immutable/chunks/CsQS60Ue.js +1 -0
  102. package/build/client/_app/immutable/chunks/CuRJVwEq.js +1 -0
  103. package/build/client/_app/immutable/chunks/D-oSqn_W.js +1 -0
  104. package/build/client/_app/immutable/chunks/D-ptJ9y-.js +1 -0
  105. package/build/client/_app/immutable/chunks/D05T4iGw.js +1 -0
  106. package/build/client/_app/immutable/chunks/D0I62FkS.js +1 -0
  107. package/build/client/_app/immutable/chunks/D16vkywU.js +1 -0
  108. package/build/client/_app/immutable/chunks/D1qzYj9m.js +1 -0
  109. package/build/client/_app/immutable/chunks/D3hlyOfw.js +1 -0
  110. package/build/client/_app/immutable/chunks/D4gq_dik.js +1 -0
  111. package/build/client/_app/immutable/chunks/D7fX-3xy.js +1 -0
  112. package/build/client/_app/immutable/chunks/D8-5qLJg.js +231 -0
  113. package/build/client/_app/immutable/chunks/D8hlhfM3.js +1 -0
  114. package/build/client/_app/immutable/chunks/DAS1CLuE.js +24 -0
  115. package/build/client/_app/immutable/chunks/DGarjVZC.js +1 -0
  116. package/build/client/_app/immutable/chunks/DGd2pJF5.js +1 -0
  117. package/build/client/_app/immutable/chunks/DHpiXF5c.js +1 -0
  118. package/build/client/_app/immutable/chunks/DHwB1DNv.js +161 -0
  119. package/build/client/_app/immutable/chunks/DIMkf-bt.js +3 -0
  120. package/build/client/_app/immutable/chunks/DISqw1ZD.js +1 -0
  121. package/build/client/_app/immutable/chunks/DITEY8D_.js +62 -0
  122. package/build/client/_app/immutable/chunks/DL0yNkAA.js +1 -0
  123. package/build/client/_app/immutable/chunks/DL1Hc2zs.js +1 -0
  124. package/build/client/_app/immutable/chunks/DLOOos_8.js +292 -0
  125. package/build/client/_app/immutable/chunks/DMUM7wLl.js +1 -0
  126. package/build/client/_app/immutable/chunks/DPKol_4Z.js +139 -0
  127. package/build/client/_app/immutable/chunks/DS17s2tU.js +1 -0
  128. package/build/client/_app/immutable/chunks/DT7zqm-g.js +1 -0
  129. package/build/client/_app/immutable/chunks/DTj74zXo.js +1 -0
  130. package/build/client/_app/immutable/chunks/DV3o63ZY.js +1 -0
  131. package/build/client/_app/immutable/chunks/DVXVVWkX.js +129 -0
  132. package/build/client/_app/immutable/chunks/DWDfcLfy.js +206 -0
  133. package/build/client/_app/immutable/chunks/DXeGLmed.js +8 -0
  134. package/build/client/_app/immutable/chunks/DYqsupvX.js +1 -0
  135. package/build/client/_app/immutable/chunks/DZ6u0Z-K.js +1 -0
  136. package/build/client/_app/immutable/chunks/DZFCIeNp.js +1 -0
  137. package/build/client/_app/immutable/chunks/D_Lu-MrJ.js +1 -0
  138. package/build/client/_app/immutable/chunks/DauUninz.js +1 -0
  139. package/build/client/_app/immutable/chunks/DbInun42.js +1 -0
  140. package/build/client/_app/immutable/chunks/DbcKN35_.js +3 -0
  141. package/build/client/_app/immutable/chunks/DcZe4Woe.js +1 -0
  142. package/build/client/_app/immutable/chunks/DdL9SqIa.js +1 -0
  143. package/build/client/_app/immutable/chunks/De2hgUGE.js +1 -0
  144. package/build/client/_app/immutable/chunks/DezsRK8O.js +1 -0
  145. package/build/client/_app/immutable/chunks/Dg_UWGX7.js +24 -0
  146. package/build/client/_app/immutable/chunks/Dj2t5yNg.js +1 -0
  147. package/build/client/_app/immutable/chunks/DkqhCAOL.js +1 -0
  148. package/build/client/_app/immutable/chunks/DlQrSOw4.js +7 -0
  149. package/build/client/_app/immutable/chunks/DmHpPYUd.js +1 -0
  150. package/build/client/_app/immutable/chunks/Dmn-tsie.js +1 -0
  151. package/build/client/_app/immutable/chunks/DpFanUEy.js +298 -0
  152. package/build/client/_app/immutable/chunks/DqwfDHZH.js +89 -0
  153. package/build/client/_app/immutable/chunks/Dr0pcX_F.js +1 -0
  154. package/build/client/_app/immutable/chunks/DrH0SRf2.js +1 -0
  155. package/build/client/_app/immutable/chunks/DsF7k-Jl.js +1 -0
  156. package/build/client/_app/immutable/chunks/DtBGId5S.js +2 -0
  157. package/build/client/_app/immutable/chunks/DuM1hSCa.js +1 -0
  158. package/build/client/_app/immutable/chunks/Du_ODUAO.js +1 -0
  159. package/build/client/_app/immutable/chunks/DvCMcJ3P.js +1 -0
  160. package/build/client/_app/immutable/chunks/Dy-Kn_BL.js +1 -0
  161. package/build/client/_app/immutable/chunks/DzVMo6mB.js +62 -0
  162. package/build/client/_app/immutable/chunks/ESmLJICu.js +1 -0
  163. package/build/client/_app/immutable/chunks/FvmIjYaQ.js +1 -0
  164. package/build/client/_app/immutable/chunks/GBaNblmo.js +1 -0
  165. package/build/client/_app/immutable/chunks/HclGiUj8.js +1 -0
  166. package/build/client/_app/immutable/chunks/Ju5jF6hy.js +1 -0
  167. package/build/client/_app/immutable/chunks/KythIMN8.js +1 -0
  168. package/build/client/_app/immutable/chunks/LWre5GKl.js +40 -0
  169. package/build/client/_app/immutable/chunks/NEE52Syq.js +1 -0
  170. package/build/client/_app/immutable/chunks/No6lfiAw.js +1 -0
  171. package/build/client/_app/immutable/chunks/OmE6SGvs.js +106 -0
  172. package/build/client/_app/immutable/chunks/P_ok0Z_j.js +2 -0
  173. package/build/client/_app/immutable/chunks/PaZBB01u.js +1 -0
  174. package/build/client/_app/immutable/chunks/Rh9cy7xg.js +2 -0
  175. package/build/client/_app/immutable/chunks/SOo6toE5.js +1 -0
  176. package/build/client/_app/immutable/chunks/TNLUqJaC.js +1 -0
  177. package/build/client/_app/immutable/chunks/UNxFjlik.js +1 -0
  178. package/build/client/_app/immutable/chunks/UmdltqoE.js +1 -0
  179. package/build/client/_app/immutable/chunks/Z5eAx3Zn.js +1 -0
  180. package/build/client/_app/immutable/chunks/bTuwJoIa.js +1 -0
  181. package/build/client/_app/immutable/chunks/fmXr3nnJ.js +1 -0
  182. package/build/client/_app/immutable/chunks/fybaL0A-.js +1 -0
  183. package/build/client/_app/immutable/chunks/gp-XZpBa.js +3 -0
  184. package/build/client/_app/immutable/chunks/h-p5ZdY8.js +1 -0
  185. package/build/client/_app/immutable/chunks/hxYEUgOo.js +1 -0
  186. package/build/client/_app/immutable/chunks/i0VQdJtv.js +1 -0
  187. package/build/client/_app/immutable/chunks/i0X4ZdIN.js +1 -0
  188. package/build/client/_app/immutable/chunks/mVHw7KEX.js +7 -0
  189. package/build/client/_app/immutable/chunks/nDMCpPkF.js +1 -0
  190. package/build/client/_app/immutable/chunks/nr791fC2.js +1 -0
  191. package/build/client/_app/immutable/chunks/onAF5SnQ.js +1 -0
  192. package/build/client/_app/immutable/chunks/oz_6vUea.js +1 -0
  193. package/build/client/_app/immutable/chunks/qEGLx2Wc.js +78 -0
  194. package/build/client/_app/immutable/chunks/raVGrKQy.js +44 -0
  195. package/build/client/_app/immutable/chunks/sBoK_t0W.js +1 -0
  196. package/build/client/_app/immutable/chunks/sIEmSkn6.js +34 -0
  197. package/build/client/_app/immutable/chunks/wFIeY1Cf.js +88 -0
  198. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  199. package/build/client/_app/immutable/chunks/zpcgJjUg.js +127 -0
  200. package/build/client/_app/immutable/entry/app.B2QxMn0t.js +2 -0
  201. package/build/client/_app/immutable/entry/start.BR3A4iFi.js +1 -0
  202. package/build/client/_app/immutable/nodes/0.B_ZEZy7b.js +1 -0
  203. package/build/client/_app/immutable/nodes/1.By3Gd2cs.js +1 -0
  204. package/build/client/_app/immutable/nodes/2.1TAwiWw1.js +69 -0
  205. package/build/client/_app/immutable/workers/css.worker-DRH2OcAG.js +93 -0
  206. package/build/client/_app/immutable/workers/html.worker-DQLddT9h.js +506 -0
  207. package/build/client/_app/immutable/workers/json.worker-D_Dqrls5.js +62 -0
  208. package/build/client/_app/immutable/workers/settings-editor-worker-D9zwrD0f.js +30 -0
  209. package/build/client/_app/immutable/workers/ts.worker-DkYoA6bF.js +67738 -0
  210. package/build/client/_app/immutable/workers/yaml.worker-BTGFEDOA.js +449 -0
  211. package/build/client/_app/version.json +1 -0
  212. package/build/client/favicon.svg +7 -0
  213. package/build/env.js +70 -0
  214. package/build/handler.js +23 -0
  215. package/build/index.js +146 -0
  216. package/build/server/chunks/chunks/a2a-protocol.js-C77mVg2Q.js +52 -0
  217. package/build/server/chunks/chunks/app-config.svelte.js-Co9jacqT.js +52 -0
  218. package/build/server/chunks/chunks/config.js-BBYogCe7.js +123 -0
  219. package/build/server/chunks/chunks/db.js-DcmO3JAx.js +120 -0
  220. package/build/server/chunks/chunks/db2.js-DBltVUGg.js +717 -0
  221. package/build/server/chunks/chunks/dsh-connection.js-DwihVtk_.js +1957 -0
  222. package/build/server/chunks/chunks/dsh-events.js-BtDxaV6Q.js +706 -0
  223. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  224. package/build/server/chunks/chunks/exports.js-DMiPee3x.js +263 -0
  225. package/build/server/chunks/chunks/goal-projection.js-0_34t60K.js +44 -0
  226. package/build/server/chunks/chunks/image-limits.js-BMPZ55kJ.js +186 -0
  227. package/build/server/chunks/chunks/insight-config.js-CfMPTA6Z.js +352 -0
  228. package/build/server/chunks/chunks/internal.js-CQzEjdyk.js +747 -0
  229. package/build/server/chunks/chunks/internal2.js-D-DAuSVh.js +22 -0
  230. package/build/server/chunks/chunks/server.js-DoCd0fEo.js +4104 -0
  231. package/build/server/chunks/chunks/shared.js-C4-Py8s_.js +775 -0
  232. package/build/server/chunks/chunks/state.js-CpmOS0a2.js +114 -0
  233. package/build/server/chunks/chunks/uneval.js-BJ9Qq2SF.js +488 -0
  234. package/build/server/chunks/chunks/utils.js-tOWCe9Wk.js +933 -0
  235. package/build/server/chunks/chunks/watcher.js-BelxjMOP.js +473 -0
  236. package/build/server/chunks/entries/endpoints/api/a2a/_id_/_server.ts.js-B4HUNFZv.js +37 -0
  237. package/build/server/chunks/entries/endpoints/api/a2a/_server.ts.js-JDV_oqbX.js +61 -0
  238. package/build/server/chunks/entries/endpoints/api/a2a/register/_server.ts.js-Dxwc-7-5.js +99 -0
  239. package/build/server/chunks/entries/endpoints/api/config/_server.ts.js-D8i35bGH.js +35 -0
  240. package/build/server/chunks/entries/endpoints/api/dsh/directory/_server.ts.js-CeBU1G85.js +43 -0
  241. package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/_server.ts.js-CyrVUxv3.js +36 -0
  242. package/build/server/chunks/entries/endpoints/api/dsh/presets/_server.ts.js-qeO_1htT.js +33 -0
  243. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/_server.ts.js-DnHffohz.js +44 -0
  244. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/_server.ts.js-fm6MFyjP.js +33 -0
  245. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/_server.ts.js-wJ9V_Ue7.js +42 -0
  246. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/_server.ts.js-o83L4GUY.js +85 -0
  247. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/_server.ts.js-DLCHSC1M.js +212 -0
  248. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/_server.ts.js-Ca6NU9HO.js +58 -0
  249. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/_server.ts.js-RteR85vn.js +138 -0
  250. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/_server.ts.js-CEKDkK7v.js +55 -0
  251. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/_server.ts.js-D7ziyW3d.js +35 -0
  252. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/_server.ts.js-DbkD4JZb.js +92 -0
  253. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/_server.ts.js-eOLNlf1-.js +94 -0
  254. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/_server.ts.js-txQRocK9.js +57 -0
  255. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/_server.ts.js-D3WGYzkE.js +69 -0
  256. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/_server.ts.js-g2GtvLTs.js +69 -0
  257. package/build/server/chunks/entries/endpoints/api/dsh/sessions/_server.ts.js-17yKojU_.js +85 -0
  258. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/_server.ts.js-D16pEhvd.js +99 -0
  259. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/save/_server.ts.js-BXpZNLK8.js +110 -0
  260. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/_server.ts.js-hBlyjq-x.js +113 -0
  261. package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/_server.ts.js-KWRnsAkm.js +59 -0
  262. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_server.ts.js-DzNvvCxK.js +55 -0
  263. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/_server.ts.js-MK5925CY.js +45 -0
  264. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/_server.ts.js-w3Mo0nf7.js +63 -0
  265. package/build/server/chunks/entries/endpoints/api/prompts/_id_/_server.ts.js-CInfjM-i.js +64 -0
  266. package/build/server/chunks/entries/endpoints/api/prompts/_server.ts.js-C1lqP1OV.js +87 -0
  267. package/build/server/chunks/entries/endpoints/api/prompts/use/_server.ts.js-B36YMKMt.js +54 -0
  268. package/build/server/chunks/entries/endpoints/api/settings/_server.ts.js-CHvHNzeB.js +101 -0
  269. package/build/server/chunks/entries/pages/_error.svelte.js-BE3-BWDd.js +41 -0
  270. package/build/server/chunks/entries/pages/_layout.svelte.js-EFiihTdF.js +18 -0
  271. package/build/server/chunks/entries/pages/_layout.ts.js-CNSo-Z1U.js +22 -0
  272. package/build/server/chunks/entries/pages/_page.server.ts.js-Bk8UuUXA.js +85 -0
  273. package/build/server/chunks/entries/pages/_page.svelte.js-CfmKQYLK.js +13883 -0
  274. package/build/server/chunks/handler-BshnD4Y4.js +1735 -0
  275. package/build/server/chunks/index.js-I_pMeIwQ.js +3864 -0
  276. package/build/server/chunks/manifest.js-DwhpAk_y.js +273 -0
  277. package/build/server/chunks/nodes/0.js-DCyDo8-C.js +12 -0
  278. package/build/server/chunks/nodes/1.js-Dx7z_VWN.js +9 -0
  279. package/build/server/chunks/nodes/2.js-CLw9pxho.js +24 -0
  280. package/build/shims.js +33 -0
  281. package/package.json +65 -0
  282. package/template/.dsi/a2a.sqlite +0 -0
  283. package/template/.dsi/config.json +42 -0
  284. package/template/.dsi/prompts.sqlite +0 -0
  285. package/template/.dsi/settings.yaml +33 -0
@@ -0,0 +1,4104 @@
1
+ import { u as uneval } from './uneval.js-BJ9Qq2SF.js';
2
+
3
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/shared/utils.js
4
+ var is_array = Array.isArray;
5
+ var index_of = Array.prototype.indexOf;
6
+ var includes = Array.prototype.includes;
7
+ var array_from = Array.from;
8
+ var define_property = Object.defineProperty;
9
+ var get_descriptor = Object.getOwnPropertyDescriptor;
10
+ var object_prototype = Object.prototype;
11
+ var array_prototype = Array.prototype;
12
+ var get_prototype_of = Object.getPrototypeOf;
13
+ var is_extensible = Object.isExtensible;
14
+ var has_own_property = Object.prototype.hasOwnProperty;
15
+ var noop = () => {};
16
+ /** @param {Function} fn */
17
+ function run(fn) {
18
+ return fn();
19
+ }
20
+ /** @param {Array<() => void>} arr */
21
+ function run_all(arr) {
22
+ for (var i = 0; i < arr.length; i++) arr[i]();
23
+ }
24
+ /**
25
+ * TODO replace with Promise.withResolvers once supported widely enough
26
+ * @template [T=void]
27
+ */
28
+ function deferred() {
29
+ /** @type {(value: T) => void} */
30
+ var resolve;
31
+ /** @type {(reason: any) => void} */
32
+ var reject;
33
+ return {
34
+ promise: new Promise((res, rej) => {
35
+ resolve = res;
36
+ reject = rej;
37
+ }),
38
+ resolve,
39
+ reject
40
+ };
41
+ }
42
+ //#endregion
43
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/equality.js
44
+ /** @import { Equals } from '#client' */
45
+ /** @type {Equals} */
46
+ function equals(value) {
47
+ return value === this.v;
48
+ }
49
+ /**
50
+ * @param {unknown} a
51
+ * @param {unknown} b
52
+ * @returns {boolean}
53
+ */
54
+ function safe_not_equal(a, b) {
55
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
56
+ }
57
+ /** @type {Equals} */
58
+ function safe_equals(value) {
59
+ return !safe_not_equal(value, this.v);
60
+ }
61
+ var CLEAN = 1024;
62
+ var DIRTY = 2048;
63
+ var MAYBE_DIRTY = 4096;
64
+ var INERT = 8192;
65
+ var DESTROYED = 16384;
66
+ /** Set once a reaction has run for the first time */
67
+ var REACTION_RAN = 32768;
68
+ /** Effect is in the process of getting destroyed. Can be observed in child teardown functions */
69
+ var DESTROYING = 1 << 25;
70
+ /**
71
+ * 'Transparent' effects do not create a transition boundary.
72
+ * This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned
73
+ */
74
+ var EFFECT_TRANSPARENT = 65536;
75
+ var EFFECT_PRESERVED = 1 << 19;
76
+ var USER_EFFECT = 1 << 20;
77
+ /**
78
+ * Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase.
79
+ * Will be lifted during execution of the derived and during checking its dirty state (both are necessary
80
+ * because a derived might be checked but not executed). This is a pure performance optimization flag and
81
+ * should not be used for any other purpose!
82
+ */
83
+ var WAS_MARKED = 65536;
84
+ var REACTION_IS_UPDATING = 1 << 21;
85
+ var ERROR_VALUE = 1 << 23;
86
+ var STATE_SYMBOL = Symbol("$state");
87
+ var LEGACY_PROPS = Symbol("legacy props");
88
+ var ATTRIBUTES_CACHE = Symbol("attributes");
89
+ var CLASS_CACHE = Symbol("class");
90
+ var STYLE_CACHE = Symbol("style");
91
+ var TEXT_CACHE = Symbol("text");
92
+ /** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
93
+ var STALE_REACTION = new class StaleReactionError extends Error {
94
+ name = "StaleReactionError";
95
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
96
+ }();
97
+ //#endregion
98
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/shared/errors.js
99
+ /**
100
+ * Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true`
101
+ * @param {string} name
102
+ * @returns {never}
103
+ */
104
+ function experimental_async_required(name) {
105
+ throw new Error(`https://svelte.dev/e/experimental_async_required`);
106
+ }
107
+ /**
108
+ * `%name%(...)` can only be used during component initialisation
109
+ * @param {string} name
110
+ * @returns {never}
111
+ */
112
+ function lifecycle_outside_component(name) {
113
+ throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
114
+ }
115
+ /**
116
+ * Context was not set in the current component or any of its ancestors
117
+ * @returns {never}
118
+ */
119
+ function missing_context() {
120
+ throw new Error(`https://svelte.dev/e/missing_context`);
121
+ }
122
+ /**
123
+ * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
124
+ * @returns {never}
125
+ */
126
+ function effect_update_depth_exceeded() {
127
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
128
+ }
129
+ /**
130
+ * Failed to hydrate the application
131
+ * @returns {never}
132
+ */
133
+ function hydration_failed() {
134
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
135
+ }
136
+ /**
137
+ * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
138
+ * @returns {never}
139
+ */
140
+ function state_descriptors_fixed() {
141
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
142
+ }
143
+ /**
144
+ * Cannot set prototype of `$state` object
145
+ * @returns {never}
146
+ */
147
+ function state_prototype_fixed() {
148
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
149
+ }
150
+ /**
151
+ * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
152
+ * @returns {never}
153
+ */
154
+ function state_unsafe_mutation() {
155
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
156
+ }
157
+ /**
158
+ * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
159
+ * @returns {never}
160
+ */
161
+ function svelte_boundary_reset_onerror() {
162
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
163
+ }
164
+ //#endregion
165
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/constants.js
166
+ var HYDRATION_ERROR = {};
167
+ var UNINITIALIZED = Symbol("uninitialized");
168
+ /**
169
+ * Reading a derived belonging to a now-destroyed effect may result in stale values
170
+ */
171
+ function derived_inert() {
172
+ console.warn(`https://svelte.dev/e/derived_inert`);
173
+ }
174
+ /**
175
+ * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%
176
+ * @param {string | undefined | null} [location]
177
+ */
178
+ function hydration_mismatch(location) {
179
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
180
+ }
181
+ /**
182
+ * A `<svelte:boundary>` `reset` function only resets the boundary the first time it is called
183
+ */
184
+ function svelte_boundary_reset_noop() {
185
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
186
+ }
187
+ //#endregion
188
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/dom/hydration.js
189
+ /** @import { TemplateNode } from '#client' */
190
+ /**
191
+ * Use this variable to guard everything related to hydration code so it can be treeshaken out
192
+ * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.
193
+ */
194
+ var hydrating = false;
195
+ /** @param {boolean} value */
196
+ function set_hydrating(value) {
197
+ hydrating = value;
198
+ }
199
+ /**
200
+ * The node that is currently being hydrated. This starts out as the first node inside the opening
201
+ * <!--[--> comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.
202
+ * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the
203
+ * time we leave the block it is the closing comment, which serves as the block's anchor.
204
+ * @type {TemplateNode}
205
+ */
206
+ var hydrate_node;
207
+ /** @param {TemplateNode | null} node */
208
+ function set_hydrate_node(node) {
209
+ if (node === null) {
210
+ hydration_mismatch();
211
+ throw HYDRATION_ERROR;
212
+ }
213
+ return hydrate_node = node;
214
+ }
215
+ function hydrate_next() {
216
+ return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
217
+ }
218
+ function next(count = 1) {
219
+ if (hydrating) {
220
+ var i = count;
221
+ var node = hydrate_node;
222
+ while (i--) node = /* @__PURE__ */ get_next_sibling(node);
223
+ hydrate_node = node;
224
+ }
225
+ }
226
+ /**
227
+ * Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment
228
+ * @param {boolean} remove
229
+ */
230
+ function skip_nodes(remove = true) {
231
+ var depth = 0;
232
+ var node = hydrate_node;
233
+ while (true) {
234
+ if (node.nodeType === 8) {
235
+ var data = node.data;
236
+ if (data === "]") {
237
+ if (depth === 0) return node;
238
+ depth -= 1;
239
+ } else if (data === "[" || data === "[!" || data[0] === "[" && !isNaN(Number(data.slice(1)))) depth += 1;
240
+ }
241
+ var next = /* @__PURE__ */ get_next_sibling(node);
242
+ if (remove) node.remove();
243
+ node = next;
244
+ }
245
+ }
246
+ //#endregion
247
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/shared/context.js
248
+ /**
249
+ * @template T
250
+ * @param {(key: object) => T} get_context
251
+ * @param {(key: object, context: T) => T} set_context
252
+ * @param {(key: object) => boolean} has_context
253
+ * @returns {[() => T, (context: T) => T]}
254
+ */
255
+ function create_context(get_context, set_context, has_context) {
256
+ const key = {};
257
+ return [() => {
258
+ if (!has_context(key)) missing_context();
259
+ return get_context(key);
260
+ }, (context) => set_context(key, context)];
261
+ }
262
+ /**
263
+ * @typedef {{ p: Context | null, c: Map<unknown, unknown> | null }} Context
264
+ */
265
+ /**
266
+ * @param {Context} context
267
+ * @returns {Map<unknown, unknown> | null}
268
+ */
269
+ function get_parent_context(context) {
270
+ let parent = context.p;
271
+ while (parent !== null && parent.c === null) parent = parent.p;
272
+ return parent?.c ?? null;
273
+ }
274
+ /**
275
+ * @param {Context | null} context
276
+ * @param {string} name
277
+ * @returns {Map<unknown, unknown>}
278
+ */
279
+ function get_or_init_context_map(context, name) {
280
+ if (context === null) lifecycle_outside_component();
281
+ return context.c ??= new Map(get_parent_context(context) || void 0);
282
+ }
283
+ //#endregion
284
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/context.js
285
+ /** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
286
+ /** @type {ComponentContext | null} */
287
+ var component_context = null;
288
+ /** @param {ComponentContext | null} context */
289
+ function set_component_context(context) {
290
+ component_context = context;
291
+ }
292
+ /**
293
+ * @param {Record<string, unknown>} props
294
+ * @param {any} runes
295
+ * @param {Function} [fn]
296
+ * @returns {void}
297
+ */
298
+ function push$1(props, runes = false, fn) {
299
+ component_context = {
300
+ p: component_context,
301
+ i: false,
302
+ c: null,
303
+ e: null,
304
+ s: props,
305
+ x: null,
306
+ r: active_effect,
307
+ l: null
308
+ };
309
+ }
310
+ /**
311
+ * @template {Record<string, any>} T
312
+ * @param {T} [component]
313
+ * @returns {T}
314
+ */
315
+ function pop$1(component) {
316
+ var context = component_context;
317
+ var effects = context.e;
318
+ if (effects !== null) {
319
+ context.e = null;
320
+ for (var fn of effects) create_user_effect(fn);
321
+ }
322
+ context.i = true;
323
+ component_context = context.p;
324
+ return {};
325
+ }
326
+ /** @returns {boolean} */
327
+ function is_runes() {
328
+ return true;
329
+ }
330
+ //#endregion
331
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/dom/task.js
332
+ /** @type {Array<() => void>} */
333
+ var micro_tasks = [];
334
+ function run_micro_tasks() {
335
+ var tasks = micro_tasks;
336
+ micro_tasks = [];
337
+ run_all(tasks);
338
+ }
339
+ /**
340
+ * @param {() => void} fn
341
+ */
342
+ function queue_micro_task(fn) {
343
+ if (micro_tasks.length === 0 && !is_flushing_sync) {
344
+ var tasks = micro_tasks;
345
+ queueMicrotask(() => {
346
+ if (tasks === micro_tasks) run_micro_tasks();
347
+ });
348
+ }
349
+ micro_tasks.push(fn);
350
+ }
351
+ /**
352
+ * Synchronously run any queued tasks.
353
+ */
354
+ function flush_tasks() {
355
+ while (micro_tasks.length > 0) run_micro_tasks();
356
+ }
357
+ /**
358
+ * @param {unknown} error
359
+ */
360
+ function handle_error(error) {
361
+ var effect = active_effect;
362
+ if (effect === null) {
363
+ /** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
364
+ return error;
365
+ }
366
+ if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
367
+ invoke_error_boundary(error, effect);
368
+ }
369
+ /**
370
+ * @param {unknown} error
371
+ * @param {Effect | null} effect
372
+ */
373
+ function invoke_error_boundary(error, effect) {
374
+ if (effect !== null && (effect.f & 16384) !== 0) return;
375
+ while (effect !== null) {
376
+ if ((effect.f & 128) !== 0) {
377
+ if ((effect.f & 32768) === 0) throw error;
378
+ try {
379
+ /** @type {Boundary} */ effect.b.error(error);
380
+ return;
381
+ } catch (e) {
382
+ error = e;
383
+ }
384
+ }
385
+ effect = effect.parent;
386
+ }
387
+ throw error;
388
+ }
389
+ //#endregion
390
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/status.js
391
+ /** @import { Derived, Signal } from '#client' */
392
+ var STATUS_MASK = -7169;
393
+ /**
394
+ * @param {Signal} signal
395
+ * @param {number} status
396
+ */
397
+ function set_signal_status(signal, status) {
398
+ signal.f = signal.f & STATUS_MASK | status;
399
+ }
400
+ /**
401
+ * Set a derived's status to CLEAN or MAYBE_DIRTY based on its connection state.
402
+ * @param {Derived} derived
403
+ */
404
+ function update_derived_status(derived) {
405
+ if ((derived.f & 512) !== 0 || derived.deps === null) set_signal_status(derived, CLEAN);
406
+ else set_signal_status(derived, MAYBE_DIRTY);
407
+ }
408
+ //#endregion
409
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/utils.js
410
+ /** @import { Derived, Effect, Value } from '#client' */
411
+ /**
412
+ * @param {Value[] | null} deps
413
+ */
414
+ function clear_marked(deps) {
415
+ if (deps === null) return;
416
+ for (const dep of deps) {
417
+ if ((dep.f & 2) === 0 || (dep.f & 65536) === 0) continue;
418
+ dep.f ^= WAS_MARKED;
419
+ clear_marked(
420
+ /** @type {Derived} */
421
+ dep.deps
422
+ );
423
+ }
424
+ }
425
+ /**
426
+ * @param {Effect} effect
427
+ * @param {Set<Effect>} dirty_effects
428
+ * @param {Set<Effect>} maybe_dirty_effects
429
+ */
430
+ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
431
+ if ((effect.f & 2048) !== 0) dirty_effects.add(effect);
432
+ else if ((effect.f & 4096) !== 0) maybe_dirty_effects.add(effect);
433
+ clear_marked(effect.deps);
434
+ set_signal_status(effect, CLEAN);
435
+ }
436
+ //#endregion
437
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
438
+ /**
439
+ * @template T
440
+ * @param {() => T} fn
441
+ */
442
+ function without_reactive_context(fn) {
443
+ var previous_reaction = active_reaction;
444
+ var previous_effect = active_effect;
445
+ set_active_reaction(null);
446
+ set_active_effect(null);
447
+ try {
448
+ return fn();
449
+ } finally {
450
+ set_active_reaction(previous_reaction);
451
+ set_active_effect(previous_effect);
452
+ }
453
+ }
454
+ //#endregion
455
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/reactivity/create-subscriber.js
456
+ /**
457
+ * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
458
+ * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
459
+ *
460
+ * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
461
+ * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
462
+ *
463
+ * If `start` returns a cleanup function, it will be called when the effect is destroyed.
464
+ *
465
+ * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
466
+ * are active, and the returned teardown function will only be called when all effects are destroyed.
467
+ *
468
+ * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
469
+ *
470
+ * ```js
471
+ * import { createSubscriber } from 'svelte/reactivity';
472
+ * import { on } from 'svelte/events';
473
+ *
474
+ * export class MediaQuery {
475
+ * #query;
476
+ * #subscribe;
477
+ *
478
+ * constructor(query) {
479
+ * this.#query = window.matchMedia(`(${query})`);
480
+ *
481
+ * this.#subscribe = createSubscriber((update) => {
482
+ * // when the `change` event occurs, re-run any effects that read `this.current`
483
+ * const off = on(this.#query, 'change', update);
484
+ *
485
+ * // stop listening when all the effects are destroyed
486
+ * return () => off();
487
+ * });
488
+ * }
489
+ *
490
+ * get current() {
491
+ * // This makes the getter reactive, if read in an effect
492
+ * this.#subscribe();
493
+ *
494
+ * // Return the current state of the query, whether or not we're in an effect
495
+ * return this.#query.matches;
496
+ * }
497
+ * }
498
+ * ```
499
+ * @param {(update: () => void) => (() => void) | void} start
500
+ * @since 5.7.0
501
+ */
502
+ function createSubscriber(start) {
503
+ let subscribers = 0;
504
+ let version = source(0);
505
+ /** @type {(() => void) | void} */
506
+ let stop;
507
+ return () => {
508
+ if (effect_tracking()) {
509
+ get(version);
510
+ render_effect(() => {
511
+ if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
512
+ subscribers += 1;
513
+ return () => {
514
+ queue_micro_task(() => {
515
+ subscribers -= 1;
516
+ if (subscribers === 0) {
517
+ stop?.();
518
+ stop = void 0;
519
+ increment(version);
520
+ }
521
+ });
522
+ };
523
+ });
524
+ }
525
+ };
526
+ }
527
+ //#endregion
528
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
529
+ /** @import { Effect, Source, TemplateNode, } from '#client' */
530
+ /**
531
+ * @typedef {{
532
+ * onerror?: ((error: unknown, reset: () => void) => void) | null;
533
+ * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
534
+ * pending?: ((anchor: Node) => void) | null;
535
+ * }} BoundaryProps
536
+ */
537
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
538
+ /**
539
+ * @param {TemplateNode} node
540
+ * @param {BoundaryProps} props
541
+ * @param {((anchor: Node) => void)} children
542
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
543
+ * @returns {void}
544
+ */
545
+ function boundary(node, props, children, transform_error) {
546
+ new Boundary(node, props, children, transform_error);
547
+ }
548
+ var Boundary = class {
549
+ /** @type {Boundary | null} */
550
+ parent;
551
+ is_pending = false;
552
+ /**
553
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
554
+ * Inherited from parent boundary, or defaults to identity.
555
+ * @type {(error: unknown) => unknown}
556
+ */
557
+ transform_error;
558
+ /** @type {TemplateNode} */
559
+ #anchor;
560
+ /** @type {TemplateNode | null} */
561
+ #hydrate_open = hydrating ? hydrate_node : null;
562
+ /** @type {BoundaryProps} */
563
+ #props;
564
+ /** @type {((anchor: Node) => void)} */
565
+ #children;
566
+ /** @type {Effect} */
567
+ #effect;
568
+ /** @type {Effect | null} */
569
+ #main_effect = null;
570
+ /** @type {Effect | null} */
571
+ #pending_effect = null;
572
+ /** @type {Effect | null} */
573
+ #failed_effect = null;
574
+ /** @type {DocumentFragment | null} */
575
+ #offscreen_fragment = null;
576
+ #local_pending_count = 0;
577
+ #pending_count = 0;
578
+ #pending_count_update_queued = false;
579
+ /** @type {Set<Effect>} */
580
+ #dirty_effects = /* @__PURE__ */ new Set();
581
+ /** @type {Set<Effect>} */
582
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
583
+ /**
584
+ * A source containing the number of pending async deriveds/expressions.
585
+ * Only created if `$effect.pending()` is used inside the boundary,
586
+ * otherwise updating the source results in needless `Batch.ensure()`
587
+ * calls followed by no-op flushes
588
+ * @type {Source<number> | null}
589
+ */
590
+ #effect_pending = null;
591
+ #effect_pending_subscriber = createSubscriber(() => {
592
+ this.#effect_pending = source(this.#local_pending_count);
593
+ return () => {
594
+ this.#effect_pending = null;
595
+ };
596
+ });
597
+ /**
598
+ * @param {TemplateNode} node
599
+ * @param {BoundaryProps} props
600
+ * @param {((anchor: Node) => void)} children
601
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
602
+ */
603
+ constructor(node, props, children, transform_error) {
604
+ this.#anchor = node;
605
+ this.#props = props;
606
+ this.#children = (anchor) => {
607
+ var effect = active_effect;
608
+ effect.b = this;
609
+ effect.f |= 128;
610
+ children(anchor);
611
+ };
612
+ this.parent = active_effect.b;
613
+ this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
614
+ this.#effect = block(() => {
615
+ if (hydrating) {
616
+ const comment = this.#hydrate_open;
617
+ hydrate_next();
618
+ const server_rendered_pending = comment.data === "[!";
619
+ if (comment.data.startsWith("[?")) {
620
+ const serialized_error = JSON.parse(comment.data.slice(2));
621
+ this.#hydrate_failed_content(serialized_error);
622
+ } else if (server_rendered_pending) this.#hydrate_pending_content();
623
+ else this.#hydrate_resolved_content();
624
+ } else this.#render();
625
+ }, flags);
626
+ if (hydrating) this.#anchor = hydrate_node;
627
+ }
628
+ #hydrate_resolved_content() {
629
+ try {
630
+ this.#main_effect = branch(() => this.#children(this.#anchor));
631
+ } catch (error) {
632
+ this.error(error);
633
+ }
634
+ }
635
+ /**
636
+ * @param {unknown} error The deserialized error from the server's hydration comment
637
+ */
638
+ #hydrate_failed_content(error) {
639
+ const failed = this.#props.failed;
640
+ const { reset, invoke_onerror } = this.#create_reset(error);
641
+ queue_micro_task(invoke_onerror);
642
+ if (!failed) return;
643
+ this.#failed_effect = branch(() => {
644
+ failed(this.#anchor, () => error, () => reset);
645
+ });
646
+ }
647
+ /**
648
+ * Creates the `reset` function for a failed boundary, along with a function
649
+ * that invokes `onerror` with it (if provided)
650
+ * @param {unknown} error
651
+ * @returns {{ reset: () => void, invoke_onerror: () => void }}
652
+ */
653
+ #create_reset(error) {
654
+ var did_reset = false;
655
+ var calling_on_error = false;
656
+ const reset = () => {
657
+ if (did_reset) {
658
+ svelte_boundary_reset_noop();
659
+ return;
660
+ }
661
+ did_reset = true;
662
+ if (calling_on_error) svelte_boundary_reset_onerror();
663
+ if (this.#failed_effect !== null) pause_effect(this.#failed_effect, () => {
664
+ this.#failed_effect = null;
665
+ });
666
+ this.#run(() => {
667
+ this.#render();
668
+ });
669
+ };
670
+ const invoke_onerror = () => {
671
+ try {
672
+ calling_on_error = true;
673
+ this.#props.onerror?.(error, reset);
674
+ calling_on_error = false;
675
+ } catch (err) {
676
+ invoke_error_boundary(err, this.#effect && this.#effect.parent);
677
+ }
678
+ };
679
+ return {
680
+ reset,
681
+ invoke_onerror
682
+ };
683
+ }
684
+ #hydrate_pending_content() {
685
+ const pending = this.#props.pending;
686
+ if (!pending) return;
687
+ this.is_pending = true;
688
+ this.#pending_effect = branch(() => pending(this.#anchor));
689
+ queue_micro_task(() => {
690
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
691
+ var anchor = create_text();
692
+ fragment.append(anchor);
693
+ this.#main_effect = this.#run(() => {
694
+ return branch(() => this.#children(anchor));
695
+ });
696
+ if (this.#pending_count === 0) {
697
+ this.#anchor.before(fragment);
698
+ this.#offscreen_fragment = null;
699
+ pause_effect(this.#pending_effect, () => {
700
+ this.#pending_effect = null;
701
+ });
702
+ this.#resolve(current_batch);
703
+ }
704
+ });
705
+ }
706
+ #render() {
707
+ try {
708
+ this.is_pending = this.has_pending_snippet();
709
+ this.#pending_count = 0;
710
+ this.#local_pending_count = 0;
711
+ this.#main_effect = branch(() => {
712
+ this.#children(this.#anchor);
713
+ });
714
+ if (this.#pending_count > 0) {
715
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
716
+ move_effect(this.#main_effect, fragment);
717
+ const pending = this.#props.pending;
718
+ this.#pending_effect = branch(() => pending(this.#anchor));
719
+ } else this.#resolve(current_batch);
720
+ } catch (error) {
721
+ this.error(error);
722
+ }
723
+ }
724
+ /**
725
+ * @param {Batch} batch
726
+ */
727
+ #resolve(batch) {
728
+ this.is_pending = false;
729
+ batch.transfer_effects(this.#dirty_effects, this.#maybe_dirty_effects);
730
+ }
731
+ /**
732
+ * Defer an effect inside a pending boundary until the boundary resolves
733
+ * @param {Effect} effect
734
+ */
735
+ defer_effect(effect) {
736
+ defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);
737
+ }
738
+ /**
739
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
740
+ * @returns {boolean}
741
+ */
742
+ is_rendered() {
743
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
744
+ }
745
+ has_pending_snippet() {
746
+ return !!this.#props.pending;
747
+ }
748
+ /**
749
+ * @template T
750
+ * @param {() => T} fn
751
+ */
752
+ #run(fn) {
753
+ var previous_effect = active_effect;
754
+ var previous_reaction = active_reaction;
755
+ var previous_ctx = component_context;
756
+ set_active_effect(this.#effect);
757
+ set_active_reaction(this.#effect);
758
+ set_component_context(this.#effect.ctx);
759
+ try {
760
+ Batch.ensure();
761
+ return fn();
762
+ } catch (e) {
763
+ handle_error(e);
764
+ return null;
765
+ } finally {
766
+ set_active_effect(previous_effect);
767
+ set_active_reaction(previous_reaction);
768
+ set_component_context(previous_ctx);
769
+ }
770
+ }
771
+ /**
772
+ * Updates the pending count associated with the currently visible pending snippet,
773
+ * if any, such that we can replace the snippet with content once work is done
774
+ * @param {1 | -1} d
775
+ * @param {Batch} batch
776
+ */
777
+ #update_pending_count(d, batch) {
778
+ if (!this.has_pending_snippet()) {
779
+ if (this.parent) this.parent.#update_pending_count(d, batch);
780
+ return;
781
+ }
782
+ this.#pending_count += d;
783
+ if (this.#pending_count === 0) {
784
+ this.#resolve(batch);
785
+ if (this.#pending_effect) pause_effect(this.#pending_effect, () => {
786
+ this.#pending_effect = null;
787
+ });
788
+ if (this.#offscreen_fragment) {
789
+ this.#anchor.before(this.#offscreen_fragment);
790
+ this.#offscreen_fragment = null;
791
+ }
792
+ }
793
+ }
794
+ /**
795
+ * Update the source that powers `$effect.pending()` inside this boundary,
796
+ * and controls when the current `pending` snippet (if any) is removed.
797
+ * Do not call from inside the class
798
+ * @param {1 | -1} d
799
+ * @param {Batch} batch
800
+ */
801
+ update_pending_count(d, batch) {
802
+ this.#update_pending_count(d, batch);
803
+ this.#local_pending_count += d;
804
+ if (!this.#effect_pending || this.#pending_count_update_queued) return;
805
+ this.#pending_count_update_queued = true;
806
+ queue_micro_task(() => {
807
+ this.#pending_count_update_queued = false;
808
+ if (this.#effect_pending) internal_set(this.#effect_pending, this.#local_pending_count);
809
+ });
810
+ }
811
+ get_effect_pending() {
812
+ this.#effect_pending_subscriber();
813
+ return get(this.#effect_pending);
814
+ }
815
+ /** @param {unknown} error */
816
+ error(error) {
817
+ if (!this.#props.onerror && !this.#props.failed) throw error;
818
+ if (current_batch?.is_fork) {
819
+ if (this.#main_effect) current_batch.skip_effect(this.#main_effect);
820
+ if (this.#pending_effect) current_batch.skip_effect(this.#pending_effect);
821
+ if (this.#failed_effect) current_batch.skip_effect(this.#failed_effect);
822
+ current_batch.oncommit(() => {
823
+ this.#handle_error(error);
824
+ });
825
+ } else this.#handle_error(error);
826
+ }
827
+ /**
828
+ * @param {unknown} error
829
+ */
830
+ #handle_error(error) {
831
+ if (this.#main_effect) {
832
+ destroy_effect(this.#main_effect);
833
+ this.#main_effect = null;
834
+ }
835
+ if (this.#pending_effect) {
836
+ destroy_effect(this.#pending_effect);
837
+ this.#pending_effect = null;
838
+ }
839
+ if (this.#failed_effect) {
840
+ destroy_effect(this.#failed_effect);
841
+ this.#failed_effect = null;
842
+ }
843
+ if (hydrating) {
844
+ set_hydrate_node(this.#hydrate_open);
845
+ next();
846
+ set_hydrate_node(skip_nodes());
847
+ }
848
+ let failed = this.#props.failed;
849
+ /** @param {unknown} transformed_error */
850
+ const handle_error_result = (transformed_error) => {
851
+ const { reset, invoke_onerror } = this.#create_reset(transformed_error);
852
+ invoke_onerror();
853
+ if (failed) this.#failed_effect = this.#run(() => {
854
+ try {
855
+ return branch(() => {
856
+ var effect = active_effect;
857
+ effect.b = this;
858
+ effect.f |= 128;
859
+ failed(this.#anchor, () => transformed_error, () => reset);
860
+ });
861
+ } catch (error) {
862
+ invoke_error_boundary(error, this.#effect.parent);
863
+ return null;
864
+ }
865
+ });
866
+ };
867
+ queue_micro_task(() => {
868
+ /** @type {unknown} */
869
+ var result;
870
+ try {
871
+ result = this.transform_error(error);
872
+ } catch (e) {
873
+ invoke_error_boundary(e, this.#effect && this.#effect.parent);
874
+ return;
875
+ }
876
+ if (result !== null && typeof result === "object" && typeof result.then === "function")
877
+ /** @type {any} */ result.then(
878
+ handle_error_result,
879
+ /** @param {unknown} e */
880
+ (e) => invoke_error_boundary(e, this.#effect && this.#effect.parent)
881
+ );
882
+ else handle_error_result(result);
883
+ });
884
+ }
885
+ };
886
+ var OBSOLETE = Symbol("obsolete");
887
+ /**
888
+ * @param {Derived} derived
889
+ * @returns {void}
890
+ */
891
+ function destroy_derived_effects(derived) {
892
+ var effects = derived.effects;
893
+ if (effects !== null) {
894
+ derived.effects = null;
895
+ for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
896
+ }
897
+ }
898
+ /**
899
+ * @template T
900
+ * @param {Derived} derived
901
+ * @returns {T}
902
+ */
903
+ function execute_derived(derived) {
904
+ var value;
905
+ var prev_active_effect = active_effect;
906
+ var parent = derived.parent;
907
+ if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
908
+ derived_inert();
909
+ return derived.v;
910
+ }
911
+ set_active_effect(parent);
912
+ try {
913
+ derived.f &= ~WAS_MARKED;
914
+ destroy_derived_effects(derived);
915
+ value = update_reaction(derived);
916
+ } finally {
917
+ set_active_effect(prev_active_effect);
918
+ }
919
+ return value;
920
+ }
921
+ /**
922
+ * @param {Derived} derived
923
+ * @returns {void}
924
+ */
925
+ function update_derived(derived) {
926
+ var value = execute_derived(derived);
927
+ if (!derived.equals(value)) {
928
+ derived.wv = increment_write_version();
929
+ if (!current_batch?.is_fork || derived.deps === null) {
930
+ if (current_batch !== null) {
931
+ current_batch.capture(derived, value, true);
932
+ previous_batch?.capture(derived, value, true);
933
+ } else derived.v = value;
934
+ if (derived.deps === null) {
935
+ set_signal_status(derived, CLEAN);
936
+ return;
937
+ }
938
+ }
939
+ }
940
+ if (is_destroying_effect) return;
941
+ if (batch_values !== null) {
942
+ if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
943
+ } else update_derived_status(derived);
944
+ }
945
+ /**
946
+ * @param {Derived} derived
947
+ */
948
+ function freeze_derived_effects(derived) {
949
+ if (derived.effects === null) return;
950
+ for (const e of derived.effects) if (e.teardown || e.ac) {
951
+ e.teardown?.();
952
+ if (e.ac !== null) without_reactive_context(() => {
953
+ /** @type {AbortController} */ e.ac.abort(STALE_REACTION);
954
+ e.ac = null;
955
+ });
956
+ if (e.fn !== null) e.teardown = noop;
957
+ remove_reactions(e, 0);
958
+ destroy_effect_children(e);
959
+ }
960
+ }
961
+ /**
962
+ * @param {Derived} derived
963
+ */
964
+ function unfreeze_derived_effects(derived) {
965
+ if (derived.effects === null) return;
966
+ for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
967
+ }
968
+ //#endregion
969
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/batch.js
970
+ /** @import { Fork } from 'svelte' */
971
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
972
+ /** @type {Batch | null} */
973
+ var first_batch = null;
974
+ /** @type {Batch | null} */
975
+ var last_batch = null;
976
+ /** @type {Batch | null} */
977
+ var current_batch = null;
978
+ /**
979
+ * This is needed to avoid overwriting inputs
980
+ * @type {Batch | null}
981
+ */
982
+ var previous_batch = null;
983
+ /**
984
+ * When time travelling (i.e. working in one batch, while other batches
985
+ * still have ongoing work), we ignore the real values of affected
986
+ * signals in favour of their values within the batch
987
+ * @type {Map<Value, any> | null}
988
+ */
989
+ var batch_values = null;
990
+ /** @type {Effect | null} */
991
+ var last_scheduled_effect = null;
992
+ var is_flushing_sync = false;
993
+ var is_processing = false;
994
+ /**
995
+ * During traversal, this is an array. Newly created effects are (if not immediately
996
+ * executed) pushed to this array, rather than going through the scheduling
997
+ * rigamarole that would cause another turn of the flush loop.
998
+ * @type {Effect[] | null}
999
+ */
1000
+ var collected_effects = null;
1001
+ /**
1002
+ * An array of effects that are marked during traversal as a result of a `set`
1003
+ * (not `internal_set`) call. These will be added to the next batch and
1004
+ * trigger another `batch.process()`
1005
+ * @type {Effect[] | null}
1006
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1007
+ */
1008
+ var legacy_updates = null;
1009
+ var flush_count = 0;
1010
+ var uid = 1;
1011
+ var Batch = class Batch {
1012
+ id = uid++;
1013
+ /** True as soon as `#process` was called */
1014
+ #started = false;
1015
+ linked = true;
1016
+ /** @type {Batch | null} */
1017
+ #prev = null;
1018
+ /** @type {Batch | null} */
1019
+ #next = null;
1020
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
1021
+ async_deriveds = /* @__PURE__ */ new Map();
1022
+ /**
1023
+ * The current values of any signals that are updated in this batch.
1024
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
1025
+ * They keys of this map are identical to `this.#previous`
1026
+ * @type {Map<Value, [any, boolean]>}
1027
+ */
1028
+ current = /* @__PURE__ */ new Map();
1029
+ /**
1030
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
1031
+ * They keys of this map are identical to `this.#current`
1032
+ * @type {Map<Value, any>}
1033
+ */
1034
+ previous = /* @__PURE__ */ new Map();
1035
+ /**
1036
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
1037
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
1038
+ * @type {Set<(batch: Batch) => void>}
1039
+ */
1040
+ #commit_callbacks = /* @__PURE__ */ new Set();
1041
+ /**
1042
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
1043
+ * @type {Set<(batch: Batch) => void>}
1044
+ */
1045
+ #discard_callbacks = /* @__PURE__ */ new Set();
1046
+ /**
1047
+ * The number of async effects that are currently in flight
1048
+ */
1049
+ #pending = 0;
1050
+ /**
1051
+ * Async effects that are currently in flight, _not_ inside a pending boundary
1052
+ * @type {Map<Effect, number>}
1053
+ */
1054
+ #blocking_pending = /* @__PURE__ */ new Map();
1055
+ /**
1056
+ * A deferred that resolves when the batch is committed, used with `settled()`
1057
+ * TODO replace with Promise.withResolvers once supported widely enough
1058
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
1059
+ */
1060
+ #deferred = null;
1061
+ /**
1062
+ * The root effects that need to be flushed
1063
+ * @type {Effect[]}
1064
+ */
1065
+ #roots = [];
1066
+ /**
1067
+ * Effects created while this batch was active.
1068
+ * @type {Effect[]}
1069
+ */
1070
+ #new_effects = [];
1071
+ /**
1072
+ * Deferred effects (which run after async work has completed) that are DIRTY
1073
+ * @type {Set<Effect>}
1074
+ */
1075
+ #dirty_effects = /* @__PURE__ */ new Set();
1076
+ /**
1077
+ * Deferred effects that are MAYBE_DIRTY
1078
+ * @type {Set<Effect>}
1079
+ */
1080
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
1081
+ /**
1082
+ * A map of branches that still exist, but will be destroyed when this batch
1083
+ * is committed — we skip over these during `process`.
1084
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
1085
+ * so they can be rescheduled if the branch survives.
1086
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
1087
+ */
1088
+ #skipped_branches = /* @__PURE__ */ new Map();
1089
+ /**
1090
+ * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
1091
+ * @type {Set<Effect>}
1092
+ */
1093
+ #unskipped_branches = /* @__PURE__ */ new Set();
1094
+ is_fork = false;
1095
+ #decrement_queued = false;
1096
+ constructor() {
1097
+ if (last_batch === null) first_batch = last_batch = this;
1098
+ else {
1099
+ last_batch.#next = this;
1100
+ this.#prev = last_batch;
1101
+ }
1102
+ last_batch = this;
1103
+ }
1104
+ #is_deferred() {
1105
+ if (this.is_fork) return true;
1106
+ for (const effect of this.#blocking_pending.keys()) {
1107
+ var e = effect;
1108
+ var skipped = false;
1109
+ while (e.parent !== null) {
1110
+ if (this.#skipped_branches.has(e)) {
1111
+ skipped = true;
1112
+ break;
1113
+ }
1114
+ e = e.parent;
1115
+ }
1116
+ if (!skipped) return true;
1117
+ }
1118
+ return false;
1119
+ }
1120
+ /**
1121
+ * Add an effect to the #skipped_branches map and reset its children
1122
+ * @param {Effect} effect
1123
+ */
1124
+ skip_effect(effect) {
1125
+ if (!this.#skipped_branches.has(effect)) this.#skipped_branches.set(effect, {
1126
+ d: [],
1127
+ m: []
1128
+ });
1129
+ this.#unskipped_branches.delete(effect);
1130
+ }
1131
+ /**
1132
+ * Remove an effect from the #skipped_branches map and reschedule
1133
+ * any tracked dirty/maybe_dirty child effects
1134
+ * @param {Effect} effect
1135
+ * @param {(e: Effect) => void} callback
1136
+ */
1137
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
1138
+ var tracked = this.#skipped_branches.get(effect);
1139
+ if (tracked) {
1140
+ this.#skipped_branches.delete(effect);
1141
+ for (var e of tracked.d) {
1142
+ set_signal_status(e, DIRTY);
1143
+ callback(e);
1144
+ }
1145
+ for (e of tracked.m) {
1146
+ set_signal_status(e, MAYBE_DIRTY);
1147
+ callback(e);
1148
+ }
1149
+ }
1150
+ this.#unskipped_branches.add(effect);
1151
+ }
1152
+ #process() {
1153
+ this.#started = true;
1154
+ if (flush_count++ > 1e3) {
1155
+ this.#unlink();
1156
+ infinite_loop_guard();
1157
+ }
1158
+ for (const e of this.#dirty_effects) {
1159
+ this.#maybe_dirty_effects.delete(e);
1160
+ set_signal_status(e, DIRTY);
1161
+ this.schedule(e);
1162
+ }
1163
+ for (const e of this.#maybe_dirty_effects) {
1164
+ set_signal_status(e, MAYBE_DIRTY);
1165
+ this.schedule(e);
1166
+ }
1167
+ const roots = this.#roots;
1168
+ this.#roots = [];
1169
+ this.apply();
1170
+ /** @type {Effect[]} */
1171
+ var effects = collected_effects = [];
1172
+ /** @type {Effect[]} */
1173
+ var render_effects = [];
1174
+ /**
1175
+ * @type {Effect[]}
1176
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1177
+ */
1178
+ var updates = legacy_updates = [];
1179
+ for (const root of roots) try {
1180
+ this.#traverse(root, effects, render_effects);
1181
+ } catch (e) {
1182
+ reset_all(root);
1183
+ if (!this.#is_deferred()) this.discard();
1184
+ throw e;
1185
+ }
1186
+ current_batch = null;
1187
+ if (updates.length > 0) {
1188
+ var batch = Batch.ensure();
1189
+ for (const e of updates) batch.schedule(e);
1190
+ }
1191
+ collected_effects = null;
1192
+ legacy_updates = null;
1193
+ if (this.#is_deferred()) {
1194
+ this.#defer_effects(render_effects);
1195
+ this.#defer_effects(effects);
1196
+ for (const [e, t] of this.#skipped_branches) reset_branch(e, t);
1197
+ if (updates.length > 0)
1198
+ /** @type {Batch} */ current_batch.#process();
1199
+ return;
1200
+ }
1201
+ const earlier_batch = this.#find_earlier_batch();
1202
+ if (earlier_batch) {
1203
+ this.#defer_effects(render_effects);
1204
+ this.#defer_effects(effects);
1205
+ earlier_batch.#merge(this);
1206
+ return;
1207
+ }
1208
+ this.#dirty_effects.clear();
1209
+ this.#maybe_dirty_effects.clear();
1210
+ for (const fn of this.#commit_callbacks) fn(this);
1211
+ this.#commit_callbacks.clear();
1212
+ previous_batch = this;
1213
+ flush_queued_effects(render_effects);
1214
+ flush_queued_effects(effects);
1215
+ previous_batch = null;
1216
+ this.#deferred?.resolve();
1217
+ var next_batch = current_batch;
1218
+ if (this.#pending === 0 && (this.#roots.length === 0 || next_batch !== null)) {
1219
+ this.#unlink();
1220
+ }
1221
+ if (this.#roots.length > 0) {
1222
+ if (next_batch !== null) {
1223
+ const batch = next_batch;
1224
+ batch.#roots.push(...this.#roots.filter((r) => !batch.#roots.includes(r)));
1225
+ } else next_batch = this;
1226
+ }
1227
+ if (next_batch !== null) {
1228
+ old_values.clear();
1229
+ next_batch.#process();
1230
+ }
1231
+ }
1232
+ /**
1233
+ * Traverse the effect tree, executing effects or stashing
1234
+ * them for later execution as appropriate
1235
+ * @param {Effect} root
1236
+ * @param {Effect[]} effects
1237
+ * @param {Effect[]} render_effects
1238
+ */
1239
+ #traverse(root, effects, render_effects) {
1240
+ root.f ^= CLEAN;
1241
+ var effect = root.first;
1242
+ while (effect !== null) {
1243
+ var flags = effect.f;
1244
+ var is_branch = (flags & 96) !== 0;
1245
+ if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || this.#skipped_branches.has(effect)) && effect.fn !== null) {
1246
+ if (is_branch) effect.f ^= CLEAN;
1247
+ else if ((flags & 4) !== 0) effects.push(effect);
1248
+ else if (is_dirty(effect)) {
1249
+ if ((flags & 16) !== 0) this.#maybe_dirty_effects.add(effect);
1250
+ update_effect(effect);
1251
+ }
1252
+ var child = effect.first;
1253
+ if (child !== null) {
1254
+ effect = child;
1255
+ continue;
1256
+ }
1257
+ }
1258
+ while (effect !== null) {
1259
+ var next = effect.next;
1260
+ if (next !== null) {
1261
+ effect = next;
1262
+ break;
1263
+ }
1264
+ effect = effect.parent;
1265
+ }
1266
+ }
1267
+ }
1268
+ #find_earlier_batch() {
1269
+ var batch = this.#prev;
1270
+ while (batch !== null) {
1271
+ if (!batch.is_fork) {
1272
+ for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
1273
+ }
1274
+ batch = batch.#prev;
1275
+ }
1276
+ return null;
1277
+ }
1278
+ /**
1279
+ * @param {Batch} batch
1280
+ */
1281
+ #merge(batch) {
1282
+ for (const [source, value] of batch.current) {
1283
+ if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
1284
+ this.current.set(source, value);
1285
+ }
1286
+ for (const [effect, deferred] of batch.async_deriveds) {
1287
+ const d = this.async_deriveds.get(effect);
1288
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1289
+ }
1290
+ batch.async_deriveds.clear();
1291
+ this.transfer_effects(batch.#dirty_effects, batch.#maybe_dirty_effects);
1292
+ /**
1293
+ * mark all effects that depend on `batch.current`, except the
1294
+ * async effects that we just resolved (TODO unless they depend
1295
+ * on values in this batch that are NOT in the later batch?).
1296
+ * Through this we also will populate the correct #skipped_branches,
1297
+ * oncommit callbacks etc, so we don't need to merge them separately.
1298
+ * @param {Value} value
1299
+ */
1300
+ const mark = (value) => {
1301
+ var reactions = value.reactions;
1302
+ if (reactions === null) return;
1303
+ if ((value.f & 2) !== 0 && (value.f & 6144) === 0) return;
1304
+ for (const reaction of reactions) {
1305
+ var flags = reaction.f;
1306
+ if ((flags & 2) !== 0) mark(reaction);
1307
+ else {
1308
+ var effect = reaction;
1309
+ if (flags & 4194320 && !this.async_deriveds.has(effect)) {
1310
+ this.#maybe_dirty_effects.delete(effect);
1311
+ set_signal_status(effect, DIRTY);
1312
+ this.schedule(effect);
1313
+ }
1314
+ }
1315
+ }
1316
+ };
1317
+ for (const source of this.current.keys()) mark(source);
1318
+ this.oncommit(() => batch.discard());
1319
+ batch.#unlink();
1320
+ current_batch = this;
1321
+ this.#process();
1322
+ }
1323
+ /**
1324
+ * @param {Effect[]} effects
1325
+ */
1326
+ #defer_effects(effects) {
1327
+ for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
1328
+ }
1329
+ /**
1330
+ * Associate a change to a given source with the current
1331
+ * batch, noting its previous and current values
1332
+ * @param {Value} source
1333
+ * @param {any} value
1334
+ * @param {boolean} [is_derived]
1335
+ */
1336
+ capture(source, value, is_derived = false) {
1337
+ if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
1338
+ if ((source.f & 8388608) === 0) {
1339
+ this.current.set(source, [value, is_derived]);
1340
+ batch_values?.set(source, value);
1341
+ }
1342
+ if (!this.is_fork) source.v = value;
1343
+ }
1344
+ activate() {
1345
+ current_batch = this;
1346
+ }
1347
+ deactivate() {
1348
+ current_batch = null;
1349
+ batch_values = null;
1350
+ }
1351
+ flush() {
1352
+ try {
1353
+ is_processing = true;
1354
+ current_batch = this;
1355
+ this.#process();
1356
+ } finally {
1357
+ flush_count = 0;
1358
+ last_scheduled_effect = null;
1359
+ collected_effects = null;
1360
+ legacy_updates = null;
1361
+ is_processing = false;
1362
+ current_batch = null;
1363
+ batch_values = null;
1364
+ old_values.clear();
1365
+ }
1366
+ }
1367
+ discard() {
1368
+ for (const fn of this.#discard_callbacks) fn(this);
1369
+ this.#discard_callbacks.clear();
1370
+ for (const deferred of this.async_deriveds.values()) deferred.reject(OBSOLETE);
1371
+ this.#unlink();
1372
+ this.#deferred?.resolve();
1373
+ }
1374
+ /**
1375
+ * @param {Effect} effect
1376
+ */
1377
+ register_created_effect(effect) {
1378
+ this.#new_effects.push(effect);
1379
+ }
1380
+ #commit() {
1381
+ for (let batch = first_batch; batch !== null; batch = batch.#next) {
1382
+ var is_earlier = batch.id < this.id;
1383
+ /** @type {Source[]} */
1384
+ var sources = [];
1385
+ for (const [source, [value, is_derived]] of this.current) {
1386
+ if (batch.current.has(source)) {
1387
+ var batch_value = batch.current.get(source)[0];
1388
+ if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
1389
+ else continue;
1390
+ }
1391
+ sources.push(source);
1392
+ }
1393
+ if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
1394
+ const d = batch.async_deriveds.get(effect);
1395
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1396
+ }
1397
+ var current = [...batch.current.keys()].filter((source) => !batch.current.get(source)[1]);
1398
+ if (!batch.#started || current.length === 0) continue;
1399
+ var others = current.filter((source) => !this.current.has(source));
1400
+ if (others.length === 0) {
1401
+ if (is_earlier) batch.discard();
1402
+ } else if (sources.length > 0) {
1403
+ if (is_earlier) for (const unskipped of this.#unskipped_branches) batch.unskip_effect(unskipped, (e) => {
1404
+ if ((e.f & 4194320) !== 0) batch.schedule(e);
1405
+ else batch.#defer_effects([e]);
1406
+ });
1407
+ batch.activate();
1408
+ /** @type {Set<Value>} */
1409
+ var marked = /* @__PURE__ */ new Set();
1410
+ /** @type {Map<Reaction, boolean>} */
1411
+ var checked = /* @__PURE__ */ new Map();
1412
+ for (var source of sources) mark_effects(source, others, marked, checked);
1413
+ checked = /* @__PURE__ */ new Map();
1414
+ var current_unequal = [...batch.current].filter(([c, v1]) => {
1415
+ const v2 = this.current.get(c);
1416
+ if (!v2) return true;
1417
+ return v2[0] !== v1[0] || v2[1] !== v1[1];
1418
+ }).map(([c]) => c);
1419
+ if (current_unequal.length > 0) {
1420
+ for (const effect of this.#new_effects) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) {
1421
+ if ((effect.f & 4194320) !== 0) {
1422
+ set_signal_status(effect, DIRTY);
1423
+ batch.schedule(effect);
1424
+ } else batch.#dirty_effects.add(effect);
1425
+ }
1426
+ }
1427
+ if (batch.#roots.length > 0 && !batch.#decrement_queued) {
1428
+ batch.apply();
1429
+ for (var root of batch.#roots) batch.#traverse(root, [], []);
1430
+ batch.#roots = [];
1431
+ }
1432
+ batch.deactivate();
1433
+ }
1434
+ }
1435
+ }
1436
+ /**
1437
+ * @param {boolean} blocking
1438
+ * @param {Effect} effect
1439
+ */
1440
+ increment(blocking, effect) {
1441
+ this.#pending += 1;
1442
+ if (blocking) {
1443
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1444
+ this.#blocking_pending.set(effect, blocking_pending_count + 1);
1445
+ }
1446
+ }
1447
+ /**
1448
+ * @param {boolean} blocking
1449
+ * @param {Effect} effect
1450
+ */
1451
+ decrement(blocking, effect) {
1452
+ this.#pending -= 1;
1453
+ if (blocking) {
1454
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1455
+ if (blocking_pending_count === 1) this.#blocking_pending.delete(effect);
1456
+ else this.#blocking_pending.set(effect, blocking_pending_count - 1);
1457
+ }
1458
+ if (this.#decrement_queued) return;
1459
+ this.#decrement_queued = true;
1460
+ queue_micro_task(() => {
1461
+ this.#decrement_queued = false;
1462
+ if (this.linked) this.flush();
1463
+ });
1464
+ }
1465
+ /**
1466
+ * @param {Set<Effect>} dirty_effects
1467
+ * @param {Set<Effect>} maybe_dirty_effects
1468
+ */
1469
+ transfer_effects(dirty_effects, maybe_dirty_effects) {
1470
+ for (const e of dirty_effects) this.#dirty_effects.add(e);
1471
+ for (const e of maybe_dirty_effects) this.#maybe_dirty_effects.add(e);
1472
+ dirty_effects.clear();
1473
+ maybe_dirty_effects.clear();
1474
+ }
1475
+ /** @param {(batch: Batch) => void} fn */
1476
+ oncommit(fn) {
1477
+ this.#commit_callbacks.add(fn);
1478
+ }
1479
+ /** @param {(batch: Batch) => void} fn */
1480
+ ondiscard(fn) {
1481
+ this.#discard_callbacks.add(fn);
1482
+ }
1483
+ settled() {
1484
+ return (this.#deferred ??= deferred()).promise;
1485
+ }
1486
+ static ensure() {
1487
+ if (current_batch === null) {
1488
+ const batch = current_batch = new Batch();
1489
+ if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
1490
+ if (!batch.#started) batch.flush();
1491
+ });
1492
+ }
1493
+ return current_batch;
1494
+ }
1495
+ apply() {
1496
+ {
1497
+ batch_values = null;
1498
+ return;
1499
+ }
1500
+ }
1501
+ /**
1502
+ *
1503
+ * @param {Effect} effect
1504
+ */
1505
+ schedule(effect) {
1506
+ last_scheduled_effect = effect;
1507
+ if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
1508
+ effect.b.defer_effect(effect);
1509
+ return;
1510
+ }
1511
+ var e = effect;
1512
+ while (e.parent !== null) {
1513
+ e = e.parent;
1514
+ var flags = e.f;
1515
+ if (collected_effects !== null && e === active_effect) {
1516
+ if ((active_reaction === null || (active_reaction.f & 2) === 0) && true) return;
1517
+ }
1518
+ if ((flags & 96) !== 0) {
1519
+ if ((flags & 1024) === 0) return;
1520
+ e.f ^= CLEAN;
1521
+ }
1522
+ }
1523
+ this.#roots.push(e);
1524
+ }
1525
+ #unlink() {
1526
+ if (!this.linked) return;
1527
+ var prev = this.#prev;
1528
+ var next = this.#next;
1529
+ if (prev === null) first_batch = next;
1530
+ else prev.#next = next;
1531
+ if (next === null) last_batch = prev;
1532
+ else next.#prev = prev;
1533
+ this.linked = false;
1534
+ }
1535
+ };
1536
+ /**
1537
+ * Synchronously flush any pending updates.
1538
+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
1539
+ * @template [T=void]
1540
+ * @param {(() => T) | undefined} [fn]
1541
+ * @returns {T}
1542
+ */
1543
+ function flushSync(fn) {
1544
+ var was_flushing_sync = is_flushing_sync;
1545
+ is_flushing_sync = true;
1546
+ try {
1547
+ var result;
1548
+ if (fn) ;
1549
+ while (true) {
1550
+ flush_tasks();
1551
+ if (current_batch === null) return result;
1552
+ current_batch.flush();
1553
+ }
1554
+ } finally {
1555
+ is_flushing_sync = was_flushing_sync;
1556
+ }
1557
+ }
1558
+ function infinite_loop_guard() {
1559
+ try {
1560
+ effect_update_depth_exceeded();
1561
+ } catch (error) {
1562
+ invoke_error_boundary(error, last_scheduled_effect);
1563
+ }
1564
+ }
1565
+ /** @type {Set<Effect> | null} */
1566
+ var eager_block_effects = null;
1567
+ /**
1568
+ * @param {Array<Effect>} effects
1569
+ * @returns {void}
1570
+ */
1571
+ function flush_queued_effects(effects) {
1572
+ var length = effects.length;
1573
+ if (length === 0) return;
1574
+ var i = 0;
1575
+ while (i < length) {
1576
+ var effect = effects[i++];
1577
+ if ((effect.f & 24576) === 0 && is_dirty(effect)) {
1578
+ eager_block_effects = /* @__PURE__ */ new Set();
1579
+ update_effect(effect);
1580
+ if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
1581
+ if (eager_block_effects?.size > 0) {
1582
+ old_values.clear();
1583
+ for (const e of eager_block_effects) {
1584
+ if ((e.f & 24576) !== 0) continue;
1585
+ /** @type {Effect[]} */
1586
+ const ordered_effects = [e];
1587
+ let ancestor = e.parent;
1588
+ while (ancestor !== null) {
1589
+ if (eager_block_effects.has(ancestor)) {
1590
+ eager_block_effects.delete(ancestor);
1591
+ ordered_effects.push(ancestor);
1592
+ }
1593
+ ancestor = ancestor.parent;
1594
+ }
1595
+ for (let j = ordered_effects.length - 1; j >= 0; j--) {
1596
+ const e = ordered_effects[j];
1597
+ if ((e.f & 24576) !== 0) continue;
1598
+ update_effect(e);
1599
+ }
1600
+ }
1601
+ eager_block_effects.clear();
1602
+ }
1603
+ }
1604
+ }
1605
+ eager_block_effects = null;
1606
+ }
1607
+ /**
1608
+ * This is similar to `mark_reactions`, but it only marks async/block effects
1609
+ * depending on `value` and at least one of the other `sources`, so that
1610
+ * these effects can re-run after another batch has been committed
1611
+ * @param {Value} value
1612
+ * @param {Source[]} sources
1613
+ * @param {Set<Value>} marked
1614
+ * @param {Map<Reaction, boolean>} checked
1615
+ */
1616
+ function mark_effects(value, sources, marked, checked) {
1617
+ if (marked.has(value)) return;
1618
+ marked.add(value);
1619
+ if (value.reactions !== null) for (const reaction of value.reactions) {
1620
+ const flags = reaction.f;
1621
+ if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
1622
+ else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
1623
+ set_signal_status(reaction, DIRTY);
1624
+ schedule_effect(reaction);
1625
+ }
1626
+ }
1627
+ }
1628
+ /**
1629
+ * @param {Reaction} reaction
1630
+ * @param {Source[]} sources
1631
+ * @param {Map<Reaction, boolean>} checked
1632
+ */
1633
+ function depends_on(reaction, sources, checked) {
1634
+ const depends = checked.get(reaction);
1635
+ if (depends !== void 0) return depends;
1636
+ if (reaction.deps !== null) for (const dep of reaction.deps) {
1637
+ if (includes.call(sources, dep)) return true;
1638
+ if ((dep.f & 2) !== 0 && depends_on(dep, sources, checked)) {
1639
+ checked.set(dep, true);
1640
+ return true;
1641
+ }
1642
+ }
1643
+ checked.set(reaction, false);
1644
+ return false;
1645
+ }
1646
+ /**
1647
+ * @param {Effect} effect
1648
+ * @returns {void}
1649
+ */
1650
+ function schedule_effect(effect) {
1651
+ /** @type {Batch} */ current_batch.schedule(effect);
1652
+ }
1653
+ /**
1654
+ * Mark all the effects inside a skipped branch CLEAN, so that
1655
+ * they can be correctly rescheduled later. Tracks dirty and maybe_dirty
1656
+ * effects so they can be rescheduled if the branch survives.
1657
+ * @param {Effect} effect
1658
+ * @param {{ d: Effect[], m: Effect[] }} tracked
1659
+ */
1660
+ function reset_branch(effect, tracked) {
1661
+ if ((effect.f & 32) !== 0 && (effect.f & 1024) !== 0) return;
1662
+ if ((effect.f & 2048) !== 0) tracked.d.push(effect);
1663
+ else if ((effect.f & 4096) !== 0) tracked.m.push(effect);
1664
+ set_signal_status(effect, CLEAN);
1665
+ var e = effect.first;
1666
+ while (e !== null) {
1667
+ reset_branch(e, tracked);
1668
+ e = e.next;
1669
+ }
1670
+ }
1671
+ /**
1672
+ * Mark an entire effect tree clean following an error
1673
+ * @param {Effect} effect
1674
+ */
1675
+ function reset_all(effect) {
1676
+ set_signal_status(effect, CLEAN);
1677
+ var e = effect.first;
1678
+ while (e !== null) {
1679
+ reset_all(e);
1680
+ e = e.next;
1681
+ }
1682
+ }
1683
+ //#endregion
1684
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/sources.js
1685
+ /** @import { Derived, Effect, Source, Value } from '#client' */
1686
+ /** @type {Set<Effect>} */
1687
+ var eager_effects = /* @__PURE__ */ new Set();
1688
+ /** @type {Map<Source, any>} */
1689
+ var old_values = /* @__PURE__ */ new Map();
1690
+ var eager_effects_deferred = false;
1691
+ /**
1692
+ * @template V
1693
+ * @param {V} v
1694
+ * @param {Error | null} [stack]
1695
+ * @returns {Source<V>}
1696
+ */
1697
+ function source(v, stack) {
1698
+ return {
1699
+ f: 0,
1700
+ v,
1701
+ reactions: null,
1702
+ equals,
1703
+ rv: 0,
1704
+ wv: 0
1705
+ };
1706
+ }
1707
+ /**
1708
+ * @template V
1709
+ * @param {V} v
1710
+ * @param {Error | null} [stack]
1711
+ */
1712
+ /*#__NO_SIDE_EFFECTS__*/
1713
+ function state(v, stack) {
1714
+ const s = source(v);
1715
+ push_reaction_value(s);
1716
+ return s;
1717
+ }
1718
+ /**
1719
+ * @template V
1720
+ * @param {V} initial_value
1721
+ * @param {boolean} [immutable]
1722
+ * @returns {Source<V>}
1723
+ */
1724
+ /*#__NO_SIDE_EFFECTS__*/
1725
+ function mutable_source(initial_value, immutable = false, trackable = true) {
1726
+ const s = source(initial_value);
1727
+ if (!immutable) s.equals = safe_equals;
1728
+ return s;
1729
+ }
1730
+ /**
1731
+ * @template V
1732
+ * @param {Source<V>} source
1733
+ * @param {V} value
1734
+ * @param {boolean} [should_proxy]
1735
+ * @returns {V}
1736
+ */
1737
+ function set(source, value, should_proxy = false) {
1738
+ if (active_reaction !== null && (!untracking || (active_reaction.f & 131072) !== 0) && is_runes() && (active_reaction.f & 4325394) !== 0 && (current_sources === null || !current_sources.has(source))) state_unsafe_mutation();
1739
+ return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
1740
+ }
1741
+ /**
1742
+ * @template V
1743
+ * @param {Source<V>} source
1744
+ * @param {V} value
1745
+ * @param {Effect[] | null} [updated_during_traversal]
1746
+ * @returns {V}
1747
+ */
1748
+ function internal_set(source, value, updated_during_traversal = null) {
1749
+ if (!source.equals(value)) {
1750
+ if (is_destroying_effect) old_values.set(source, value);
1751
+ else if (!old_values.has(source)) old_values.set(source, source.v);
1752
+ var batch = Batch.ensure();
1753
+ batch.capture(source, value);
1754
+ if ((source.f & 2) !== 0) {
1755
+ const derived = source;
1756
+ if ((source.f & 2048) !== 0) execute_derived(derived);
1757
+ if (batch_values === null) update_derived_status(derived);
1758
+ }
1759
+ source.wv = increment_write_version();
1760
+ mark_reactions(source, DIRTY, updated_during_traversal);
1761
+ if (active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) {
1762
+ if (untracked_writes === null) set_untracked_writes([source]);
1763
+ else untracked_writes.push(source);
1764
+ }
1765
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects();
1766
+ }
1767
+ return value;
1768
+ }
1769
+ function flush_eager_effects() {
1770
+ eager_effects_deferred = false;
1771
+ for (const effect of eager_effects) {
1772
+ if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY);
1773
+ let dirty;
1774
+ try {
1775
+ dirty = is_dirty(effect);
1776
+ } catch {
1777
+ dirty = true;
1778
+ }
1779
+ if (dirty) update_effect(effect);
1780
+ }
1781
+ eager_effects.clear();
1782
+ }
1783
+ /**
1784
+ * Silently (without using `get`) increment a source
1785
+ * @param {Source<number>} source
1786
+ */
1787
+ function increment(source) {
1788
+ set(source, source.v + 1);
1789
+ }
1790
+ /**
1791
+ * @param {Value} signal
1792
+ * @param {number} status should be DIRTY or MAYBE_DIRTY
1793
+ * @param {Effect[] | null} updated_during_traversal
1794
+ * @returns {void}
1795
+ */
1796
+ function mark_reactions(signal, status, updated_during_traversal) {
1797
+ var reactions = signal.reactions;
1798
+ if (reactions === null) return;
1799
+ var length = reactions.length;
1800
+ for (var i = 0; i < length; i++) {
1801
+ var reaction = reactions[i];
1802
+ var flags = reaction.f;
1803
+ var not_dirty = (flags & DIRTY) === 0;
1804
+ if (not_dirty) set_signal_status(reaction, status);
1805
+ if ((flags & 131072) !== 0) eager_effects.add(reaction);
1806
+ else if ((flags & 2) !== 0) {
1807
+ var derived = reaction;
1808
+ batch_values?.delete(derived);
1809
+ if ((flags & 65536) === 0) {
1810
+ if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
1811
+ mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
1812
+ }
1813
+ } else if (not_dirty) {
1814
+ var effect = reaction;
1815
+ if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect);
1816
+ if (updated_during_traversal !== null) updated_during_traversal.push(effect);
1817
+ else schedule_effect(effect);
1818
+ }
1819
+ }
1820
+ }
1821
+ /**
1822
+ * @template T
1823
+ * @param {T} value
1824
+ * @returns {T}
1825
+ */
1826
+ function proxy(value) {
1827
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value;
1828
+ const prototype = get_prototype_of(value);
1829
+ if (prototype !== object_prototype && prototype !== array_prototype) return value;
1830
+ /** @type {Map<any, Source<any>>} */
1831
+ var sources = /* @__PURE__ */ new Map();
1832
+ var is_proxied_array = is_array(value);
1833
+ var version = /* @__PURE__ */ state(0);
1834
+ var parent_version = update_version;
1835
+ /**
1836
+ * Executes the proxy in the context of the reaction it was originally created in, if any
1837
+ * @template T
1838
+ * @param {() => T} fn
1839
+ */
1840
+ var with_parent = (fn) => {
1841
+ if (update_version === parent_version) return fn();
1842
+ var reaction = active_reaction;
1843
+ var version = update_version;
1844
+ set_active_reaction(null);
1845
+ set_update_version(parent_version);
1846
+ var result = fn();
1847
+ set_active_reaction(reaction);
1848
+ set_update_version(version);
1849
+ return result;
1850
+ };
1851
+ if (is_proxied_array) sources.set("length", /* @__PURE__ */ state(
1852
+ /** @type {any[]} */
1853
+ value.length));
1854
+ return new Proxy(value, {
1855
+ defineProperty(_, prop, descriptor) {
1856
+ if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) state_descriptors_fixed();
1857
+ var s = sources.get(prop);
1858
+ if (s === void 0) with_parent(() => {
1859
+ var s = /* @__PURE__ */ state(descriptor.value);
1860
+ sources.set(prop, s);
1861
+ return s;
1862
+ });
1863
+ else set(s, descriptor.value, true);
1864
+ return true;
1865
+ },
1866
+ deleteProperty(target, prop) {
1867
+ var s = sources.get(prop);
1868
+ if (s === void 0) {
1869
+ if (prop in target) {
1870
+ const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1871
+ sources.set(prop, s);
1872
+ increment(version);
1873
+ }
1874
+ } else {
1875
+ set(s, UNINITIALIZED);
1876
+ increment(version);
1877
+ }
1878
+ return true;
1879
+ },
1880
+ get(target, prop, receiver) {
1881
+ if (prop === STATE_SYMBOL) return value;
1882
+ var s = sources.get(prop);
1883
+ var exists = prop in target;
1884
+ if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
1885
+ s = with_parent(() => {
1886
+ return /* @__PURE__ */ state(proxy(exists ? target[prop] : UNINITIALIZED));
1887
+ });
1888
+ sources.set(prop, s);
1889
+ }
1890
+ if (s !== void 0) {
1891
+ var v = get(s);
1892
+ return v === UNINITIALIZED ? void 0 : v;
1893
+ }
1894
+ return Reflect.get(target, prop, receiver);
1895
+ },
1896
+ getOwnPropertyDescriptor(target, prop) {
1897
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1898
+ if (descriptor && "value" in descriptor) {
1899
+ var s = sources.get(prop);
1900
+ if (s) descriptor.value = get(s);
1901
+ } else if (descriptor === void 0) {
1902
+ var source = sources.get(prop);
1903
+ var value = source?.v;
1904
+ if (source !== void 0 && value !== UNINITIALIZED) return {
1905
+ enumerable: true,
1906
+ configurable: true,
1907
+ value,
1908
+ writable: true
1909
+ };
1910
+ }
1911
+ return descriptor;
1912
+ },
1913
+ has(target, prop) {
1914
+ if (prop === STATE_SYMBOL) return true;
1915
+ var s = sources.get(prop);
1916
+ var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
1917
+ if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
1918
+ if (s === void 0) {
1919
+ s = with_parent(() => {
1920
+ return /* @__PURE__ */ state(has ? proxy(target[prop]) : UNINITIALIZED);
1921
+ });
1922
+ sources.set(prop, s);
1923
+ }
1924
+ if (get(s) === UNINITIALIZED) return false;
1925
+ }
1926
+ return has;
1927
+ },
1928
+ set(target, prop, value, receiver) {
1929
+ var s = sources.get(prop);
1930
+ var has = prop in target;
1931
+ if (is_proxied_array && prop === "length") for (var i = value; i < s.v; i += 1) {
1932
+ var other_s = sources.get(i + "");
1933
+ if (other_s !== void 0) set(other_s, UNINITIALIZED);
1934
+ else if (i in target) {
1935
+ other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1936
+ sources.set(i + "", other_s);
1937
+ }
1938
+ }
1939
+ if (s === void 0) {
1940
+ if (!has || get_descriptor(target, prop)?.writable) {
1941
+ s = with_parent(() => /* @__PURE__ */ state(void 0));
1942
+ set(s, proxy(value));
1943
+ sources.set(prop, s);
1944
+ }
1945
+ } else {
1946
+ has = s.v !== UNINITIALIZED;
1947
+ var p = with_parent(() => proxy(value));
1948
+ set(s, p);
1949
+ }
1950
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1951
+ if (descriptor?.set) descriptor.set.call(receiver, value);
1952
+ if (!has) {
1953
+ if (is_proxied_array && typeof prop === "string") {
1954
+ var ls = sources.get("length");
1955
+ var n = Number(prop);
1956
+ if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
1957
+ }
1958
+ increment(version);
1959
+ }
1960
+ return true;
1961
+ },
1962
+ ownKeys(target) {
1963
+ get(version);
1964
+ var own_keys = Reflect.ownKeys(target).filter((key) => {
1965
+ var source = sources.get(key);
1966
+ return source === void 0 || source.v !== UNINITIALIZED;
1967
+ });
1968
+ for (var [key, source] of sources) if (source.v !== UNINITIALIZED && !(key in target)) own_keys.push(key);
1969
+ return own_keys;
1970
+ },
1971
+ setPrototypeOf() {
1972
+ state_prototype_fixed();
1973
+ }
1974
+ });
1975
+ }
1976
+ //#endregion
1977
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/dom/operations.js
1978
+ /** @type {Window} */
1979
+ var $window;
1980
+ /** @type {() => Node | null} */
1981
+ var first_child_getter;
1982
+ /** @type {() => Node | null} */
1983
+ var next_sibling_getter;
1984
+ /**
1985
+ * Initialize these lazily to avoid issues when using the runtime in a server context
1986
+ * where these globals are not available while avoiding a separate server entry point
1987
+ */
1988
+ function init_operations() {
1989
+ if ($window !== void 0) return;
1990
+ $window = window;
1991
+ var element_prototype = Element.prototype;
1992
+ var node_prototype = Node.prototype;
1993
+ var text_prototype = Text.prototype;
1994
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
1995
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
1996
+ if (is_extensible(element_prototype)) {
1997
+ /** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
1998
+ /** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
1999
+ /** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
2000
+ element_prototype.__e = void 0;
2001
+ }
2002
+ if (is_extensible(text_prototype))
2003
+ /** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
2004
+ }
2005
+ /**
2006
+ * @param {string} value
2007
+ * @returns {Text}
2008
+ */
2009
+ function create_text(value = "") {
2010
+ return document.createTextNode(value);
2011
+ }
2012
+ /**
2013
+ * @template {Node} N
2014
+ * @param {N} node
2015
+ */
2016
+ /*@__NO_SIDE_EFFECTS__*/
2017
+ function get_first_child(node) {
2018
+ return first_child_getter.call(node);
2019
+ }
2020
+ /**
2021
+ * @template {Node} N
2022
+ * @param {N} node
2023
+ */
2024
+ /*@__NO_SIDE_EFFECTS__*/
2025
+ function get_next_sibling(node) {
2026
+ return next_sibling_getter.call(node);
2027
+ }
2028
+ /**
2029
+ * @template {Node} N
2030
+ * @param {N} node
2031
+ * @returns {void}
2032
+ */
2033
+ function clear_text_content(node) {
2034
+ node.textContent = "";
2035
+ }
2036
+ //#endregion
2037
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/reactivity/effects.js
2038
+ /** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
2039
+ /**
2040
+ * @param {Effect} effect
2041
+ * @param {Effect} parent_effect
2042
+ */
2043
+ function push_effect(effect, parent_effect) {
2044
+ var parent_last = parent_effect.last;
2045
+ if (parent_last === null) parent_effect.last = parent_effect.first = effect;
2046
+ else {
2047
+ parent_last.next = effect;
2048
+ effect.prev = parent_last;
2049
+ parent_effect.last = effect;
2050
+ }
2051
+ }
2052
+ /**
2053
+ * @param {number} type
2054
+ * @param {null | (() => void | (() => void))} fn
2055
+ * @returns {Effect}
2056
+ */
2057
+ function create_effect(type, fn) {
2058
+ var parent = active_effect;
2059
+ if (parent !== null && (parent.f & 8192) !== 0) type |= INERT;
2060
+ /** @type {Effect} */
2061
+ var effect = {
2062
+ ctx: component_context,
2063
+ deps: null,
2064
+ nodes: null,
2065
+ f: type | DIRTY | 512,
2066
+ first: null,
2067
+ fn,
2068
+ last: null,
2069
+ next: null,
2070
+ parent,
2071
+ b: parent && parent.b,
2072
+ prev: null,
2073
+ teardown: null,
2074
+ wv: 0,
2075
+ ac: null
2076
+ };
2077
+ current_batch?.register_created_effect(effect);
2078
+ /** @type {Effect | null} */
2079
+ var e = effect;
2080
+ if ((type & 4) !== 0) {
2081
+ if (collected_effects !== null) collected_effects.push(effect);
2082
+ else Batch.ensure().schedule(effect);
2083
+ } else if (fn !== null) {
2084
+ try {
2085
+ update_effect(effect);
2086
+ } catch (e) {
2087
+ destroy_effect(effect);
2088
+ throw e;
2089
+ }
2090
+ if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & 524288) === 0) {
2091
+ e = e.first;
2092
+ if ((type & 16) !== 0 && (type & 65536) !== 0 && e !== null) e.f |= EFFECT_TRANSPARENT;
2093
+ }
2094
+ }
2095
+ if (e !== null) {
2096
+ e.parent = parent;
2097
+ if (parent !== null) push_effect(e, parent);
2098
+ if (active_reaction !== null && (active_reaction.f & 2) !== 0 && (type & 64) === 0) {
2099
+ var derived = active_reaction;
2100
+ (derived.effects ??= []).push(e);
2101
+ }
2102
+ }
2103
+ return effect;
2104
+ }
2105
+ /**
2106
+ * Internal representation of `$effect.tracking()`
2107
+ * @returns {boolean}
2108
+ */
2109
+ function effect_tracking() {
2110
+ return active_reaction !== null && !untracking;
2111
+ }
2112
+ /**
2113
+ * @param {() => void | (() => void)} fn
2114
+ */
2115
+ function create_user_effect(fn) {
2116
+ return create_effect(4 | USER_EFFECT, fn);
2117
+ }
2118
+ /**
2119
+ * An effect root whose children can transition out
2120
+ * @param {() => void} fn
2121
+ * @returns {(options?: { outro?: boolean }) => Promise<void>}
2122
+ */
2123
+ function component_root(fn) {
2124
+ Batch.ensure();
2125
+ const effect = create_effect(64 | EFFECT_PRESERVED, fn);
2126
+ return (options = {}) => {
2127
+ return new Promise((fulfil) => {
2128
+ if (options.outro) pause_effect(effect, () => {
2129
+ destroy_effect(effect);
2130
+ fulfil(void 0);
2131
+ });
2132
+ else {
2133
+ destroy_effect(effect);
2134
+ fulfil(void 0);
2135
+ }
2136
+ });
2137
+ };
2138
+ }
2139
+ /**
2140
+ * @param {() => void | (() => void)} fn
2141
+ * @returns {Effect}
2142
+ */
2143
+ function render_effect(fn, flags = 0) {
2144
+ return create_effect(8 | flags, fn);
2145
+ }
2146
+ /**
2147
+ * @param {(() => void)} fn
2148
+ * @param {number} flags
2149
+ */
2150
+ function block(fn, flags = 0) {
2151
+ return create_effect(16 | flags, fn);
2152
+ }
2153
+ /**
2154
+ * @param {(() => void)} fn
2155
+ */
2156
+ function branch(fn) {
2157
+ return create_effect(32 | EFFECT_PRESERVED, fn);
2158
+ }
2159
+ /**
2160
+ * @param {Effect} effect
2161
+ */
2162
+ function execute_effect_teardown(effect) {
2163
+ var teardown = effect.teardown;
2164
+ if (teardown !== null) {
2165
+ const previously_destroying_effect = is_destroying_effect;
2166
+ const previous_reaction = active_reaction;
2167
+ set_is_destroying_effect(true);
2168
+ set_active_reaction(null);
2169
+ try {
2170
+ teardown.call(null);
2171
+ } finally {
2172
+ set_is_destroying_effect(previously_destroying_effect);
2173
+ set_active_reaction(previous_reaction);
2174
+ }
2175
+ }
2176
+ }
2177
+ /**
2178
+ * @param {Effect} signal
2179
+ * @param {boolean} remove_dom
2180
+ * @returns {void}
2181
+ */
2182
+ function destroy_effect_children(signal, remove_dom = false) {
2183
+ var effect = signal.first;
2184
+ signal.first = signal.last = null;
2185
+ while (effect !== null) {
2186
+ const controller = effect.ac;
2187
+ if (controller !== null) without_reactive_context(() => {
2188
+ controller.abort(STALE_REACTION);
2189
+ });
2190
+ var next = effect.next;
2191
+ if ((effect.f & 64) !== 0) effect.parent = null;
2192
+ else destroy_effect(effect, remove_dom);
2193
+ effect = next;
2194
+ }
2195
+ }
2196
+ /**
2197
+ * @param {Effect} signal
2198
+ * @returns {void}
2199
+ */
2200
+ function destroy_block_effect_children(signal) {
2201
+ var effect = signal.first;
2202
+ while (effect !== null) {
2203
+ var next = effect.next;
2204
+ if ((effect.f & 32) === 0) destroy_effect(effect);
2205
+ effect = next;
2206
+ }
2207
+ }
2208
+ /**
2209
+ * @param {Effect} effect
2210
+ * @param {boolean} [remove_dom]
2211
+ * @returns {void}
2212
+ */
2213
+ function destroy_effect(effect, remove_dom = true) {
2214
+ var removed = false;
2215
+ if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2216
+ remove_effect_dom(effect.nodes.start, effect.nodes.end);
2217
+ removed = true;
2218
+ }
2219
+ effect.f |= DESTROYING;
2220
+ destroy_effect_children(effect, remove_dom && !removed);
2221
+ remove_reactions(effect, 0);
2222
+ var transitions = effect.nodes && effect.nodes.t;
2223
+ if (transitions !== null) for (const transition of transitions) transition.stop();
2224
+ execute_effect_teardown(effect);
2225
+ effect.f ^= DESTROYING;
2226
+ effect.f |= DESTROYED;
2227
+ var parent = effect.parent;
2228
+ if (parent !== null && parent.first !== null) unlink_effect(effect);
2229
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2230
+ }
2231
+ /**
2232
+ *
2233
+ * @param {TemplateNode | null} node
2234
+ * @param {TemplateNode} end
2235
+ */
2236
+ function remove_effect_dom(node, end) {
2237
+ while (node !== null) {
2238
+ /** @type {TemplateNode | null} */
2239
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2240
+ node.remove();
2241
+ node = next;
2242
+ }
2243
+ }
2244
+ /**
2245
+ * Detach an effect from the effect tree, freeing up memory and
2246
+ * reducing the amount of work that happens on subsequent traversals
2247
+ * @param {Effect} effect
2248
+ */
2249
+ function unlink_effect(effect) {
2250
+ var parent = effect.parent;
2251
+ var prev = effect.prev;
2252
+ var next = effect.next;
2253
+ if (prev !== null) prev.next = next;
2254
+ if (next !== null) next.prev = prev;
2255
+ if (parent !== null) {
2256
+ if (parent.first === effect) parent.first = next;
2257
+ if (parent.last === effect) parent.last = prev;
2258
+ }
2259
+ }
2260
+ /**
2261
+ * When a block effect is removed, we don't immediately destroy it or yank it
2262
+ * out of the DOM, because it might have transitions. Instead, we 'pause' it.
2263
+ * It stays around (in memory, and in the DOM) until outro transitions have
2264
+ * completed, and if the state change is reversed then we _resume_ it.
2265
+ * A paused effect does not update, and the DOM subtree becomes inert.
2266
+ * @param {Effect} effect
2267
+ * @param {() => void} [callback]
2268
+ * @param {boolean} [destroy]
2269
+ */
2270
+ function pause_effect(effect, callback, destroy = true) {
2271
+ /** @type {TransitionManager[]} */
2272
+ var transitions = [];
2273
+ pause_children(effect, transitions, true);
2274
+ var fn = () => {
2275
+ if (destroy) destroy_effect(effect);
2276
+ if (callback) callback();
2277
+ };
2278
+ var remaining = transitions.length;
2279
+ if (remaining > 0) {
2280
+ var check = () => --remaining || fn();
2281
+ for (var transition of transitions) transition.out(check);
2282
+ } else fn();
2283
+ }
2284
+ /**
2285
+ * @param {Effect} effect
2286
+ * @param {TransitionManager[]} transitions
2287
+ * @param {boolean} local
2288
+ */
2289
+ function pause_children(effect, transitions, local) {
2290
+ if ((effect.f & 8192) !== 0) return;
2291
+ effect.f ^= INERT;
2292
+ var t = effect.nodes && effect.nodes.t;
2293
+ if (t !== null) {
2294
+ for (const transition of t) if (transition.is_global || local) transitions.push(transition);
2295
+ }
2296
+ var child = effect.first;
2297
+ while (child !== null) {
2298
+ var sibling = child.next;
2299
+ if ((child.f & 64) === 0) {
2300
+ var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
2301
+ pause_children(child, transitions, transparent ? local : false);
2302
+ }
2303
+ child = sibling;
2304
+ }
2305
+ }
2306
+ /**
2307
+ * @param {Effect} effect
2308
+ * @param {DocumentFragment} fragment
2309
+ */
2310
+ function move_effect(effect, fragment) {
2311
+ if (!effect.nodes) return;
2312
+ /** @type {TemplateNode | null} */
2313
+ var node = effect.nodes.start;
2314
+ var end = effect.nodes.end;
2315
+ while (node !== null) {
2316
+ /** @type {TemplateNode | null} */
2317
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2318
+ fragment.append(node);
2319
+ node = next;
2320
+ }
2321
+ }
2322
+ //#endregion
2323
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/client/runtime.js
2324
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2325
+ /**
2326
+ * True if updating in an effect context that is reactive (i.e. not branch/root effects)
2327
+ */
2328
+ var is_updating_effect = false;
2329
+ var is_destroying_effect = false;
2330
+ /** @param {boolean} value */
2331
+ function set_is_destroying_effect(value) {
2332
+ is_destroying_effect = value;
2333
+ }
2334
+ /** @type {null | Reaction} */
2335
+ var active_reaction = null;
2336
+ var untracking = false;
2337
+ /** @param {null | Reaction} reaction */
2338
+ function set_active_reaction(reaction) {
2339
+ active_reaction = reaction;
2340
+ }
2341
+ /** @type {null | Effect} */
2342
+ var active_effect = null;
2343
+ /** @param {null | Effect} effect */
2344
+ function set_active_effect(effect) {
2345
+ active_effect = effect;
2346
+ }
2347
+ /**
2348
+ * When sources are created within a reaction, reading and writing
2349
+ * them within that reaction should not cause a re-run
2350
+ * @type {null | Set<Source>}
2351
+ */
2352
+ var current_sources = null;
2353
+ /** @param {Value} value */
2354
+ function push_reaction_value(value) {
2355
+ if (active_reaction !== null && (true)) (current_sources ??= /* @__PURE__ */ new Set()).add(value);
2356
+ }
2357
+ /**
2358
+ * The dependencies of the reaction that is currently being executed. In many cases,
2359
+ * the dependencies are unchanged between runs, and so this will be `null` unless
2360
+ * and until a new dependency is accessed — we track this via `skipped_deps`
2361
+ * @type {null | Value[]}
2362
+ */
2363
+ var new_deps = null;
2364
+ var skipped_deps = 0;
2365
+ /**
2366
+ * Tracks writes that the effect it's executed in doesn't listen to yet,
2367
+ * so that the dependency can be added to the effect later on if it then reads it
2368
+ * @type {null | Source[]}
2369
+ */
2370
+ var untracked_writes = null;
2371
+ /** @param {null | Source[]} value */
2372
+ function set_untracked_writes(value) {
2373
+ untracked_writes = value;
2374
+ }
2375
+ /**
2376
+ * @type {number} Used by sources and deriveds for handling updates.
2377
+ * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
2378
+ **/
2379
+ var write_version = 1;
2380
+ /** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */
2381
+ var read_version = 0;
2382
+ var update_version = read_version;
2383
+ /** @param {number} value */
2384
+ function set_update_version(value) {
2385
+ update_version = value;
2386
+ }
2387
+ function increment_write_version() {
2388
+ return ++write_version;
2389
+ }
2390
+ /**
2391
+ * Determines whether a derived or effect is dirty.
2392
+ * If it is MAYBE_DIRTY, will set the status to CLEAN
2393
+ * @param {Reaction} reaction
2394
+ * @returns {boolean}
2395
+ */
2396
+ function is_dirty(reaction) {
2397
+ var flags = reaction.f;
2398
+ if ((flags & 2048) !== 0) return true;
2399
+ if (flags & 2) reaction.f &= ~WAS_MARKED;
2400
+ if ((flags & 4096) !== 0) {
2401
+ var dependencies = reaction.deps;
2402
+ var length = dependencies.length;
2403
+ for (var i = 0; i < length; i++) {
2404
+ var dependency = dependencies[i];
2405
+ if (is_dirty(dependency)) update_derived(dependency);
2406
+ if (dependency.wv > reaction.wv) return true;
2407
+ }
2408
+ if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
2409
+ }
2410
+ return false;
2411
+ }
2412
+ /**
2413
+ * @param {Value} signal
2414
+ * @param {Effect} effect
2415
+ * @param {boolean} [root]
2416
+ */
2417
+ function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2418
+ var reactions = signal.reactions;
2419
+ if (reactions === null) return;
2420
+ if (current_sources !== null && current_sources.has(signal)) return;
2421
+ for (var i = 0; i < reactions.length; i++) {
2422
+ var reaction = reactions[i];
2423
+ if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
2424
+ else if (effect === reaction) {
2425
+ if (root) set_signal_status(reaction, DIRTY);
2426
+ else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
2427
+ schedule_effect(reaction);
2428
+ }
2429
+ }
2430
+ }
2431
+ /** @param {Reaction} reaction */
2432
+ function update_reaction(reaction) {
2433
+ var previous_deps = new_deps;
2434
+ var previous_skipped_deps = skipped_deps;
2435
+ var previous_untracked_writes = untracked_writes;
2436
+ var previous_reaction = active_reaction;
2437
+ var previous_sources = current_sources;
2438
+ var previous_component_context = component_context;
2439
+ var previous_untracking = untracking;
2440
+ var previous_update_version = update_version;
2441
+ var flags = reaction.f;
2442
+ new_deps = null;
2443
+ skipped_deps = 0;
2444
+ untracked_writes = null;
2445
+ active_reaction = (flags & 96) === 0 ? reaction : null;
2446
+ current_sources = null;
2447
+ set_component_context(reaction.ctx);
2448
+ untracking = false;
2449
+ update_version = ++read_version;
2450
+ if (reaction.ac !== null) {
2451
+ without_reactive_context(() => {
2452
+ /** @type {AbortController} */ reaction.ac.abort(STALE_REACTION);
2453
+ });
2454
+ reaction.ac = null;
2455
+ }
2456
+ try {
2457
+ reaction.f |= REACTION_IS_UPDATING;
2458
+ var fn = reaction.fn;
2459
+ var result = fn();
2460
+ reaction.f |= REACTION_RAN;
2461
+ var deps = reaction.deps;
2462
+ var is_fork = current_batch?.is_fork;
2463
+ if (new_deps !== null) {
2464
+ var i;
2465
+ if (!is_fork) remove_reactions(reaction, skipped_deps);
2466
+ if (deps !== null && skipped_deps > 0) {
2467
+ deps.length = skipped_deps + new_deps.length;
2468
+ for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
2469
+ } else reaction.deps = deps = new_deps;
2470
+ if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) (deps[i].reactions ??= []).push(reaction);
2471
+ } else if (!is_fork && deps !== null && skipped_deps < deps.length) {
2472
+ remove_reactions(reaction, skipped_deps);
2473
+ deps.length = skipped_deps;
2474
+ }
2475
+ if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
2476
+ if (previous_reaction !== null && previous_reaction !== reaction) {
2477
+ read_version++;
2478
+ if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
2479
+ if (previous_deps !== null) for (const dep of previous_deps) dep.rv = read_version;
2480
+ if (untracked_writes !== null) {
2481
+ if (previous_untracked_writes === null) previous_untracked_writes = untracked_writes;
2482
+ else previous_untracked_writes.push(...untracked_writes);
2483
+ }
2484
+ }
2485
+ if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
2486
+ return result;
2487
+ } catch (error) {
2488
+ return handle_error(error);
2489
+ } finally {
2490
+ reaction.f ^= REACTION_IS_UPDATING;
2491
+ new_deps = previous_deps;
2492
+ skipped_deps = previous_skipped_deps;
2493
+ untracked_writes = previous_untracked_writes;
2494
+ active_reaction = previous_reaction;
2495
+ current_sources = previous_sources;
2496
+ set_component_context(previous_component_context);
2497
+ untracking = previous_untracking;
2498
+ update_version = previous_update_version;
2499
+ }
2500
+ }
2501
+ /**
2502
+ * @template V
2503
+ * @param {Reaction} signal
2504
+ * @param {Value<V>} dependency
2505
+ * @returns {void}
2506
+ */
2507
+ function remove_reaction(signal, dependency) {
2508
+ let reactions = dependency.reactions;
2509
+ if (reactions !== null) {
2510
+ var index = index_of.call(reactions, signal);
2511
+ if (index !== -1) {
2512
+ var new_length = reactions.length - 1;
2513
+ if (new_length === 0) reactions = dependency.reactions = null;
2514
+ else {
2515
+ reactions[index] = reactions[new_length];
2516
+ reactions.pop();
2517
+ }
2518
+ }
2519
+ }
2520
+ if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
2521
+ var derived = dependency;
2522
+ if ((derived.f & 512) !== 0) {
2523
+ derived.f ^= 512;
2524
+ derived.f &= ~WAS_MARKED;
2525
+ }
2526
+ if (derived.v !== UNINITIALIZED) update_derived_status(derived);
2527
+ if (derived.ac !== null) without_reactive_context(() => {
2528
+ /** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
2529
+ derived.ac = null;
2530
+ set_signal_status(derived, DIRTY);
2531
+ });
2532
+ freeze_derived_effects(derived);
2533
+ remove_reactions(derived, 0);
2534
+ }
2535
+ }
2536
+ /**
2537
+ * @param {Reaction} signal
2538
+ * @param {number} start_index
2539
+ * @returns {void}
2540
+ */
2541
+ function remove_reactions(signal, start_index) {
2542
+ var dependencies = signal.deps;
2543
+ if (dependencies === null) return;
2544
+ for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
2545
+ }
2546
+ /**
2547
+ * @param {Effect} effect
2548
+ * @returns {void}
2549
+ */
2550
+ function update_effect(effect) {
2551
+ var flags = effect.f;
2552
+ if ((flags & 16384) !== 0) return;
2553
+ set_signal_status(effect, CLEAN);
2554
+ var previous_effect = active_effect;
2555
+ var was_updating_effect = is_updating_effect;
2556
+ active_effect = effect;
2557
+ is_updating_effect = (flags & 96) === 0;
2558
+ try {
2559
+ if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
2560
+ else destroy_effect_children(effect);
2561
+ execute_effect_teardown(effect);
2562
+ var teardown = update_reaction(effect);
2563
+ effect.teardown = typeof teardown === "function" ? teardown : null;
2564
+ effect.wv = write_version;
2565
+ } finally {
2566
+ is_updating_effect = was_updating_effect;
2567
+ active_effect = previous_effect;
2568
+ }
2569
+ }
2570
+ /**
2571
+ * @template V
2572
+ * @param {Value<V>} signal
2573
+ * @returns {V}
2574
+ */
2575
+ function get(signal) {
2576
+ var is_derived = (signal.f & 2) !== 0;
2577
+ if (active_reaction !== null && !untracking) {
2578
+ if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
2579
+ var deps = active_reaction.deps;
2580
+ if ((active_reaction.f & 2097152) !== 0) {
2581
+ if (signal.rv < read_version) {
2582
+ signal.rv = read_version;
2583
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
2584
+ else if (new_deps === null) new_deps = [signal];
2585
+ else new_deps.push(signal);
2586
+ }
2587
+ } else {
2588
+ active_reaction.deps ??= [];
2589
+ if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
2590
+ var reactions = signal.reactions;
2591
+ if (reactions === null) signal.reactions = [active_reaction];
2592
+ else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
2593
+ }
2594
+ }
2595
+ }
2596
+ if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal);
2597
+ if (is_derived) {
2598
+ var derived = signal;
2599
+ if (is_destroying_effect) {
2600
+ var value = derived.v;
2601
+ if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived);
2602
+ old_values.set(derived, value);
2603
+ return value;
2604
+ }
2605
+ var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0);
2606
+ var is_new = (derived.f & REACTION_RAN) === 0;
2607
+ if (is_dirty(derived)) {
2608
+ if (should_connect) derived.f |= 512;
2609
+ update_derived(derived);
2610
+ }
2611
+ if (should_connect && !is_new) {
2612
+ unfreeze_derived_effects(derived);
2613
+ reconnect(derived);
2614
+ }
2615
+ }
2616
+ if (batch_values?.has(signal)) return batch_values.get(signal);
2617
+ if ((signal.f & 8388608) !== 0) throw signal.v;
2618
+ return signal.v;
2619
+ }
2620
+ /**
2621
+ * (Re)connect a disconnected derived, so that it is notified
2622
+ * of changes in `mark_reactions`
2623
+ * @param {Derived} derived
2624
+ */
2625
+ function reconnect(derived) {
2626
+ derived.f |= 512;
2627
+ if (derived.deps === null) return;
2628
+ for (const dep of derived.deps) {
2629
+ (dep.reactions ??= []).push(derived);
2630
+ if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
2631
+ unfreeze_derived_effects(dep);
2632
+ reconnect(dep);
2633
+ }
2634
+ }
2635
+ }
2636
+ /** @param {Derived} derived */
2637
+ function depends_on_old_values(derived) {
2638
+ if (derived.v === UNINITIALIZED) return true;
2639
+ if (derived.deps === null) return false;
2640
+ for (const dep of derived.deps) {
2641
+ if (old_values.has(dep)) return true;
2642
+ if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true;
2643
+ }
2644
+ return false;
2645
+ }
2646
+ /**
2647
+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
2648
+ * any state read inside `fn` will not be treated as a dependency.
2649
+ *
2650
+ * ```ts
2651
+ * $effect(() => {
2652
+ * // this will run when `data` changes, but not when `time` changes
2653
+ * save(data, {
2654
+ * timestamp: untrack(() => time)
2655
+ * });
2656
+ * });
2657
+ * ```
2658
+ * @template T
2659
+ * @param {() => T} fn
2660
+ * @returns {T}
2661
+ */
2662
+ function untrack(fn) {
2663
+ var previous_untracking = untracking;
2664
+ try {
2665
+ untracking = true;
2666
+ return fn();
2667
+ } finally {
2668
+ untracking = previous_untracking;
2669
+ }
2670
+ }
2671
+ //#endregion
2672
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/store/shared/index.js
2673
+ /** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */
2674
+ /** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */
2675
+ /**
2676
+ * @type {Array<SubscribeInvalidateTuple<any> | any>}
2677
+ */
2678
+ var subscriber_queue = [];
2679
+ /**
2680
+ * Creates a `Readable` store that allows reading by subscription.
2681
+ *
2682
+ * @template T
2683
+ * @param {T} [value] initial value
2684
+ * @param {StartStopNotifier<T>} [start]
2685
+ * @returns {Readable<T>}
2686
+ */
2687
+ function readable(value, start) {
2688
+ return { subscribe: writable(value, start).subscribe };
2689
+ }
2690
+ /**
2691
+ * Create a `Writable` store that allows both updating and reading by subscription.
2692
+ *
2693
+ * @template T
2694
+ * @param {T} [value] initial value
2695
+ * @param {StartStopNotifier<T>} [start]
2696
+ * @returns {Writable<T>}
2697
+ */
2698
+ function writable(value, start = noop) {
2699
+ /** @type {Unsubscriber | null} */
2700
+ let stop = null;
2701
+ /** @type {Set<SubscribeInvalidateTuple<T>>} */
2702
+ const subscribers = /* @__PURE__ */ new Set();
2703
+ /**
2704
+ * @param {T} new_value
2705
+ * @returns {void}
2706
+ */
2707
+ function set(new_value) {
2708
+ if (safe_not_equal(value, new_value)) {
2709
+ value = new_value;
2710
+ if (stop) {
2711
+ const run_queue = !subscriber_queue.length;
2712
+ for (const subscriber of subscribers) {
2713
+ subscriber[1]();
2714
+ subscriber_queue.push(subscriber, value);
2715
+ }
2716
+ if (run_queue) {
2717
+ for (let i = 0; i < subscriber_queue.length; i += 2) subscriber_queue[i][0](subscriber_queue[i + 1]);
2718
+ subscriber_queue.length = 0;
2719
+ }
2720
+ }
2721
+ }
2722
+ }
2723
+ /**
2724
+ * @param {Updater<T>} fn
2725
+ * @returns {void}
2726
+ */
2727
+ function update(fn) {
2728
+ set(fn(value));
2729
+ }
2730
+ /**
2731
+ * @param {Subscriber<T>} run
2732
+ * @param {() => void} [invalidate]
2733
+ * @returns {Unsubscriber}
2734
+ */
2735
+ function subscribe(run, invalidate = noop) {
2736
+ /** @type {SubscribeInvalidateTuple<T>} */
2737
+ const subscriber = [run, invalidate];
2738
+ subscribers.add(subscriber);
2739
+ if (subscribers.size === 1) stop = start(set, update) || noop;
2740
+ run(value);
2741
+ return () => {
2742
+ subscribers.delete(subscriber);
2743
+ if (subscribers.size === 0 && stop) {
2744
+ stop();
2745
+ stop = null;
2746
+ }
2747
+ };
2748
+ }
2749
+ return {
2750
+ set,
2751
+ update,
2752
+ subscribe
2753
+ };
2754
+ }
2755
+ var VOID_ELEMENT_NAMES = [
2756
+ "area",
2757
+ "base",
2758
+ "br",
2759
+ "col",
2760
+ "command",
2761
+ "embed",
2762
+ "hr",
2763
+ "img",
2764
+ "input",
2765
+ "keygen",
2766
+ "link",
2767
+ "meta",
2768
+ "param",
2769
+ "source",
2770
+ "track",
2771
+ "wbr"
2772
+ ];
2773
+ /**
2774
+ * Returns `true` if `name` is of a void element
2775
+ * @param {string} name
2776
+ */
2777
+ function is_void(name) {
2778
+ return VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === "!doctype";
2779
+ }
2780
+ /**
2781
+ * Attributes that are boolean, i.e. they are present or not present.
2782
+ */
2783
+ var DOM_BOOLEAN_ATTRIBUTES = [
2784
+ "allowfullscreen",
2785
+ "async",
2786
+ "autofocus",
2787
+ "autoplay",
2788
+ "checked",
2789
+ "controls",
2790
+ "default",
2791
+ "disabled",
2792
+ "formnovalidate",
2793
+ "indeterminate",
2794
+ "inert",
2795
+ "ismap",
2796
+ "loop",
2797
+ "multiple",
2798
+ "muted",
2799
+ "nomodule",
2800
+ "novalidate",
2801
+ "open",
2802
+ "playsinline",
2803
+ "readonly",
2804
+ "required",
2805
+ "reversed",
2806
+ "seamless",
2807
+ "selected",
2808
+ "webkitdirectory",
2809
+ "defer",
2810
+ "disablepictureinpicture",
2811
+ "disableremoteplayback"
2812
+ ];
2813
+ /**
2814
+ * Returns `true` if `name` is a boolean attribute
2815
+ * @param {string} name
2816
+ */
2817
+ function is_boolean_attribute(name) {
2818
+ return DOM_BOOLEAN_ATTRIBUTES.includes(name);
2819
+ }
2820
+ /**
2821
+ * Subset of delegated events which should be passive by default.
2822
+ * These two are already passive via browser defaults on window, document and body.
2823
+ * But since
2824
+ * - we're delegating them
2825
+ * - they happen often
2826
+ * - they apply to mobile which is generally less performant
2827
+ * we're marking them as passive by default for other elements, too.
2828
+ */
2829
+ var PASSIVE_EVENTS = ["touchstart", "touchmove"];
2830
+ /**
2831
+ * Returns `true` if `name` is a passive event
2832
+ * @param {string} name
2833
+ */
2834
+ function is_passive_event(name) {
2835
+ return PASSIVE_EVENTS.includes(name);
2836
+ }
2837
+ /** List of elements that require raw contents and should not have SSR comments put in them */
2838
+ var RAW_TEXT_ELEMENTS = [
2839
+ "textarea",
2840
+ "script",
2841
+ "style",
2842
+ "title"
2843
+ ];
2844
+ /** @param {string} name */
2845
+ function is_raw_text_element(name) {
2846
+ return RAW_TEXT_ELEMENTS.includes(name);
2847
+ }
2848
+ var REGEX_VALID_TAG_NAME = /^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u;
2849
+ //#endregion
2850
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/escaping.js
2851
+ var ATTR_REGEX = /[&"<]/g;
2852
+ var CONTENT_REGEX = /[&<]/g;
2853
+ /**
2854
+ * @template V
2855
+ * @param {V} value
2856
+ * @param {boolean} [is_attr]
2857
+ */
2858
+ function escape_html(value, is_attr) {
2859
+ const str = String(value ?? "");
2860
+ const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
2861
+ pattern.lastIndex = 0;
2862
+ let escaped = "";
2863
+ let last = 0;
2864
+ while (pattern.test(str)) {
2865
+ const i = pattern.lastIndex - 1;
2866
+ const ch = str[i];
2867
+ escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === "\"" ? "&quot;" : "&lt;");
2868
+ last = i + 1;
2869
+ }
2870
+ return escaped + str.substring(last);
2871
+ }
2872
+ //#endregion
2873
+ //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
2874
+ function r(e) {
2875
+ var t, f, n = "";
2876
+ if ("string" == typeof e || "number" == typeof e) n += e;
2877
+ else if ("object" == typeof e) if (Array.isArray(e)) {
2878
+ var o = e.length;
2879
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
2880
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
2881
+ return n;
2882
+ }
2883
+ function clsx$1() {
2884
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
2885
+ return n;
2886
+ }
2887
+ //#endregion
2888
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/shared/attributes.js
2889
+ /**
2890
+ * `<div translate={false}>` should be rendered as `<div translate="no">` and _not_
2891
+ * `<div translate="false">`, which is equivalent to `<div translate="yes">`. There
2892
+ * may be other odd cases that need to be added to this list in future
2893
+ * @type {Record<string, Map<any, string>>}
2894
+ */
2895
+ var replacements = { translate: /* @__PURE__ */ new Map([[true, "yes"], [false, "no"]]) };
2896
+ /**
2897
+ * @template V
2898
+ * @param {string} name
2899
+ * @param {V} value
2900
+ * @param {boolean} [is_boolean]
2901
+ * @returns {string}
2902
+ */
2903
+ function attr(name, value, is_boolean = false) {
2904
+ if (name === "hidden" && value !== "until-found") is_boolean = true;
2905
+ if (value == null || !value && is_boolean) return "";
2906
+ const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
2907
+ return ` ${name}${is_boolean ? `=""` : `="${escape_html(normalized, true)}"`}`;
2908
+ }
2909
+ /**
2910
+ * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.
2911
+ * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)
2912
+ * @param {any} value
2913
+ */
2914
+ function clsx(value) {
2915
+ if (typeof value === "object") return clsx$1(value);
2916
+ else return value ?? "";
2917
+ }
2918
+ var whitespace = [..." \n\r\f\xA0\v"];
2919
+ /**
2920
+ * @param {any} value
2921
+ * @param {string | null} [hash]
2922
+ * @param {Record<string, boolean>} [directives]
2923
+ * @returns {string | null}
2924
+ */
2925
+ function to_class(value, hash, directives) {
2926
+ var classname = value == null ? "" : "" + value;
2927
+ if (hash) classname = classname ? classname + " " + hash : hash;
2928
+ if (directives) {
2929
+ for (var key of Object.keys(directives)) if (directives[key]) classname = classname ? classname + " " + key : key;
2930
+ else if (classname.length) {
2931
+ var len = key.length;
2932
+ var a = 0;
2933
+ while ((a = classname.indexOf(key, a)) >= 0) {
2934
+ var b = a + len;
2935
+ if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
2936
+ else a = b;
2937
+ }
2938
+ }
2939
+ }
2940
+ return classname === "" ? null : classname;
2941
+ }
2942
+ /**
2943
+ *
2944
+ * @param {Record<string,any>} styles
2945
+ * @param {boolean} important
2946
+ */
2947
+ function append_styles(styles, important = false) {
2948
+ var separator = important ? " !important;" : ";";
2949
+ var css = "";
2950
+ for (var key of Object.keys(styles)) {
2951
+ var value = styles[key];
2952
+ if (value != null && value !== "") css += " " + key + ": " + value + separator;
2953
+ }
2954
+ return css;
2955
+ }
2956
+ /**
2957
+ * @param {string} name
2958
+ * @returns {string}
2959
+ */
2960
+ function to_css_name(name) {
2961
+ if (name[0] !== "-" || name[1] !== "-") return name.toLowerCase();
2962
+ return name;
2963
+ }
2964
+ /**
2965
+ * @param {any} value
2966
+ * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]
2967
+ * @returns {string | null}
2968
+ */
2969
+ function to_style(value, styles) {
2970
+ if (styles) {
2971
+ var new_style = "";
2972
+ /** @type {Record<string,any> | undefined} */
2973
+ var normal_styles;
2974
+ /** @type {Record<string,any> | undefined} */
2975
+ var important_styles;
2976
+ if (Array.isArray(styles)) {
2977
+ normal_styles = styles[0];
2978
+ important_styles = styles[1];
2979
+ } else normal_styles = styles;
2980
+ if (value) {
2981
+ value = String(value).replaceAll(/\/\*.*?\*\//g, "").trim();
2982
+ /** @type {boolean | '"' | "'"} */
2983
+ var in_str = false;
2984
+ var in_apo = 0;
2985
+ var in_comment = false;
2986
+ var reserved_names = [];
2987
+ if (normal_styles) reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
2988
+ if (important_styles) reserved_names.push(...Object.keys(important_styles).map(to_css_name));
2989
+ var start_index = 0;
2990
+ var name_index = -1;
2991
+ const len = value.length;
2992
+ for (var i = 0; i < len; i++) {
2993
+ var c = value[i];
2994
+ if (in_comment) {
2995
+ if (c === "/" && value[i - 1] === "*") in_comment = false;
2996
+ } else if (in_str) {
2997
+ if (in_str === c) in_str = false;
2998
+ } else if (c === "/" && value[i + 1] === "*") in_comment = true;
2999
+ else if (c === "\"" || c === "'") in_str = c;
3000
+ else if (c === "(") in_apo++;
3001
+ else if (c === ")") in_apo--;
3002
+ if (!in_comment && in_str === false && in_apo === 0) {
3003
+ if (c === ":" && name_index === -1) name_index = i;
3004
+ else if (c === ";" || i === len - 1) {
3005
+ if (name_index !== -1) {
3006
+ var name = to_css_name(value.substring(start_index, name_index).trim());
3007
+ if (!reserved_names.includes(name)) {
3008
+ if (c !== ";") i++;
3009
+ var property = value.substring(start_index, i).trim();
3010
+ new_style += " " + property + ";";
3011
+ }
3012
+ }
3013
+ start_index = i + 1;
3014
+ name_index = -1;
3015
+ }
3016
+ }
3017
+ }
3018
+ }
3019
+ if (normal_styles) new_style += append_styles(normal_styles);
3020
+ if (important_styles) new_style += append_styles(important_styles, true);
3021
+ new_style = new_style.trim();
3022
+ return new_style === "" ? null : new_style;
3023
+ }
3024
+ return value == null ? null : String(value);
3025
+ }
3026
+ //#endregion
3027
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/hydration.js
3028
+ var BLOCK_OPEN = `<!--[-->`;
3029
+ var BLOCK_CLOSE = `<!--]-->`;
3030
+ var EMPTY_COMMENT = `<!---->`;
3031
+ //#endregion
3032
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/abort-signal.js
3033
+ /** @type {AbortController | null} */
3034
+ var controller = null;
3035
+ function abort() {
3036
+ controller?.abort(STALE_REACTION);
3037
+ controller = null;
3038
+ }
3039
+ function getAbortSignal() {
3040
+ return (controller ??= new AbortController()).signal;
3041
+ }
3042
+ //#endregion
3043
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/context.js
3044
+ /** @import { SSRContext } from '#server' */
3045
+ /** @type {SSRContext | null} */
3046
+ var ssr_context = null;
3047
+ /** @param {SSRContext | null} v */
3048
+ function set_ssr_context(v) {
3049
+ ssr_context = v;
3050
+ }
3051
+ /**
3052
+ * @template T
3053
+ * @returns {[() => T, (context: T) => T]}
3054
+ * @since 5.40.0
3055
+ */
3056
+ function createContext() {
3057
+ return create_context(getContext, setContext, hasContext);
3058
+ }
3059
+ /**
3060
+ * @template T
3061
+ * @param {any} key
3062
+ * @returns {T}
3063
+ */
3064
+ function getContext(key) {
3065
+ return get_or_init_context_map(ssr_context).get(key);
3066
+ }
3067
+ /**
3068
+ * @template T
3069
+ * @param {any} key
3070
+ * @param {T} context
3071
+ * @returns {T}
3072
+ */
3073
+ function setContext(key, context) {
3074
+ get_or_init_context_map(ssr_context).set(key, context);
3075
+ return context;
3076
+ }
3077
+ /**
3078
+ * @param {any} key
3079
+ * @returns {boolean}
3080
+ */
3081
+ function hasContext(key) {
3082
+ return get_or_init_context_map(ssr_context).has(key);
3083
+ }
3084
+ /** @returns {Map<any, any>} */
3085
+ function getAllContexts() {
3086
+ return get_or_init_context_map(ssr_context);
3087
+ }
3088
+ /**
3089
+ * @param {Function} [fn]
3090
+ */
3091
+ function push(fn) {
3092
+ ssr_context = {
3093
+ p: ssr_context,
3094
+ c: null,
3095
+ r: null
3096
+ };
3097
+ }
3098
+ function pop() {
3099
+ ssr_context = ssr_context.p;
3100
+ }
3101
+ /**
3102
+ * Encountered asynchronous work while rendering synchronously.
3103
+ * @returns {never}
3104
+ */
3105
+ function await_invalid() {
3106
+ const error = /* @__PURE__ */ new Error(`await_invalid\nEncountered asynchronous work while rendering synchronously.\nhttps://svelte.dev/e/await_invalid`);
3107
+ error.name = "Svelte error";
3108
+ throw error;
3109
+ }
3110
+ /**
3111
+ * `<svelte:element this="%tag%">` is not a valid element name — the element will not be rendered
3112
+ * @param {string} tag
3113
+ * @returns {never}
3114
+ */
3115
+ function dynamic_element_invalid_tag(tag) {
3116
+ const error = /* @__PURE__ */ new Error(`dynamic_element_invalid_tag\n\`<svelte:element this="${tag}">\` is not a valid element name — the element will not be rendered\nhttps://svelte.dev/e/dynamic_element_invalid_tag`);
3117
+ error.name = "Svelte error";
3118
+ throw error;
3119
+ }
3120
+ /**
3121
+ * Failed to serialize `hydratable` data for key `%key%`.
3122
+ *
3123
+ * `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
3124
+ *
3125
+ * Cause:
3126
+ * %stack%
3127
+ * @param {string} key
3128
+ * @param {string} stack
3129
+ * @returns {never}
3130
+ */
3131
+ function hydratable_serialization_failed(key, stack) {
3132
+ const error = /* @__PURE__ */ new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data for key \`${key}\`.
3133
+
3134
+ \`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises.
3135
+
3136
+ Cause:
3137
+ ${stack}\nhttps://svelte.dev/e/hydratable_serialization_failed`);
3138
+ error.name = "Svelte error";
3139
+ throw error;
3140
+ }
3141
+ /**
3142
+ * `csp.nonce` was set while `csp.hash` was `true`. These options cannot be used simultaneously.
3143
+ * @returns {never}
3144
+ */
3145
+ function invalid_csp() {
3146
+ const error = /* @__PURE__ */ new Error(`invalid_csp\n\`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.\nhttps://svelte.dev/e/invalid_csp`);
3147
+ error.name = "Svelte error";
3148
+ throw error;
3149
+ }
3150
+ /**
3151
+ * The `idPrefix` option cannot include `--`.
3152
+ * @returns {never}
3153
+ */
3154
+ function invalid_id_prefix() {
3155
+ const error = /* @__PURE__ */ new Error(`invalid_id_prefix\nThe \`idPrefix\` option cannot include \`--\`.\nhttps://svelte.dev/e/invalid_id_prefix`);
3156
+ error.name = "Svelte error";
3157
+ throw error;
3158
+ }
3159
+ /**
3160
+ * `%name%(...)` is not available on the server
3161
+ * @param {string} name
3162
+ * @returns {never}
3163
+ */
3164
+ function lifecycle_function_unavailable(name) {
3165
+ const error = /* @__PURE__ */ new Error(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`);
3166
+ error.name = "Svelte error";
3167
+ throw error;
3168
+ }
3169
+ /**
3170
+ * Could not resolve `render` context.
3171
+ * @returns {never}
3172
+ */
3173
+ function server_context_required() {
3174
+ const error = /* @__PURE__ */ new Error(`server_context_required\nCould not resolve \`render\` context.\nhttps://svelte.dev/e/server_context_required`);
3175
+ error.name = "Svelte error";
3176
+ throw error;
3177
+ }
3178
+ /**
3179
+ * A `hydratable` value with key `%key%` was created, but at least part of it was not used during the render.
3180
+ *
3181
+ * The `hydratable` was initialized in:
3182
+ * %stack%
3183
+ * @param {string} key
3184
+ * @param {string} stack
3185
+ */
3186
+ function unresolved_hydratable(key, stack) {
3187
+ console.warn(`https://svelte.dev/e/unresolved_hydratable`);
3188
+ }
3189
+ /** @returns {RenderContext} */
3190
+ function get_render_context() {
3191
+ const store = als?.getStore();
3192
+ server_context_required();
3193
+ return store;
3194
+ }
3195
+ /** @type {AsyncLocalStorage<RenderContext | null> | null} */
3196
+ var als = null;
3197
+ //#endregion
3198
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/crypto.js
3199
+ var text_encoder;
3200
+ var crypto;
3201
+ /** @param {string} module_name */
3202
+ var obfuscated_import = (module_name) => import(
3203
+ /* @vite-ignore */
3204
+ module_name
3205
+ );
3206
+ /** @param {string} data */
3207
+ async function sha256(data) {
3208
+ text_encoder ??= new TextEncoder();
3209
+ crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (await obfuscated_import("node:crypto")).webcrypto;
3210
+ return base64_encode(await crypto.subtle.digest("SHA-256", text_encoder.encode(data)));
3211
+ }
3212
+ /**
3213
+ * @param {Uint8Array} bytes
3214
+ * @returns {string}
3215
+ */
3216
+ function base64_encode(bytes) {
3217
+ if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
3218
+ let binary = "";
3219
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
3220
+ return btoa(binary);
3221
+ }
3222
+ //#endregion
3223
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/renderer.js
3224
+ /** @import { Component } from 'svelte' */
3225
+ /** @import { Csp, HydratableContext, RenderOutput, SSRContext, SyncRenderOutput, Sha256Source } from './types.js' */
3226
+ /** @import { MaybePromise } from '#shared' */
3227
+ /** @typedef {'head' | 'body'} RendererType */
3228
+ /** @typedef {{ [key in RendererType]: string }} AccumulatedContent */
3229
+ /**
3230
+ * @typedef {string | Renderer} RendererItem
3231
+ */
3232
+ /**
3233
+ * Renderers are basically a tree of `string | Renderer`s, where each `Renderer` in the tree represents
3234
+ * work that may or may not have completed. A renderer can be {@link collect}ed to aggregate the
3235
+ * content from itself and all of its children, but this will throw if any of the children are
3236
+ * performing asynchronous work. To asynchronously collect a renderer, just `await` it.
3237
+ *
3238
+ * The `string` values within a renderer are always associated with the {@link type} of that renderer. To switch types,
3239
+ * call {@link child} with a different `type` argument.
3240
+ */
3241
+ var Renderer = class Renderer {
3242
+ /**
3243
+ * The contents of the renderer.
3244
+ * @type {RendererItem[]}
3245
+ */
3246
+ #out = [];
3247
+ /**
3248
+ * Any `onDestroy` callbacks registered during execution of this renderer.
3249
+ * @type {(() => void)[] | undefined}
3250
+ */
3251
+ #on_destroy = void 0;
3252
+ /**
3253
+ * Whether this renderer is a component body.
3254
+ * @type {boolean}
3255
+ */
3256
+ #is_component_body = false;
3257
+ /**
3258
+ * If set, this renderer is an error boundary. When async collection
3259
+ * of the children fails, the failed snippet is rendered instead.
3260
+ * @type {{
3261
+ * failed: (renderer: Renderer, error: unknown, reset: () => void) => void;
3262
+ * transformError: (error: unknown) => unknown;
3263
+ * context: SSRContext | null;
3264
+ * } | null}
3265
+ */
3266
+ #boundary = null;
3267
+ /**
3268
+ * The type of string content that this renderer is accumulating.
3269
+ * @type {RendererType}
3270
+ */
3271
+ type;
3272
+ /** @type {Renderer | undefined} */
3273
+ #parent;
3274
+ /**
3275
+ * Asynchronous work associated with this renderer
3276
+ * @type {Promise<void> | undefined}
3277
+ */
3278
+ promise = void 0;
3279
+ /**
3280
+ * State which is associated with the content tree as a whole.
3281
+ * It will be re-exposed, uncopied, on all children.
3282
+ * @type {SSRState}
3283
+ * @readonly
3284
+ */
3285
+ global;
3286
+ /**
3287
+ * State that is local to the branch it is declared in.
3288
+ * It will be shallow-copied to all children.
3289
+ *
3290
+ * @type {{ select_value: string | undefined }}
3291
+ */
3292
+ local;
3293
+ /**
3294
+ * @param {SSRState} global
3295
+ * @param {Renderer | undefined} [parent]
3296
+ */
3297
+ constructor(global, parent) {
3298
+ this.#parent = parent;
3299
+ this.global = global;
3300
+ this.local = parent ? { ...parent.local } : { select_value: void 0 };
3301
+ this.type = parent ? parent.type : "body";
3302
+ }
3303
+ /**
3304
+ * @param {(renderer: Renderer) => void} fn
3305
+ */
3306
+ head(fn) {
3307
+ const head = new Renderer(this.global, this);
3308
+ head.type = "head";
3309
+ this.#out.push(head);
3310
+ head.child(fn);
3311
+ }
3312
+ /**
3313
+ * @param {Array<Promise<void>>} blockers
3314
+ * @param {(renderer: Renderer) => void} fn
3315
+ */
3316
+ async_block(blockers, fn) {
3317
+ this.#out.push(BLOCK_OPEN);
3318
+ this.async(blockers, fn);
3319
+ this.#out.push(BLOCK_CLOSE);
3320
+ }
3321
+ /**
3322
+ * @param {Array<Promise<void>>} blockers
3323
+ * @param {(renderer: Renderer) => void} fn
3324
+ */
3325
+ async(blockers, fn) {
3326
+ let callback = fn;
3327
+ if (blockers.length > 0) {
3328
+ const context = ssr_context;
3329
+ callback = (renderer) => {
3330
+ return Promise.all(blockers).then(() => {
3331
+ const previous_context = ssr_context;
3332
+ try {
3333
+ set_ssr_context(context);
3334
+ return fn(renderer);
3335
+ } finally {
3336
+ set_ssr_context(previous_context);
3337
+ }
3338
+ });
3339
+ };
3340
+ }
3341
+ this.child(callback);
3342
+ }
3343
+ /**
3344
+ * @param {Array<() => void>} thunks
3345
+ */
3346
+ run(thunks) {
3347
+ const context = ssr_context;
3348
+ let promise = Promise.resolve(thunks[0]());
3349
+ const promises = [promise];
3350
+ for (const fn of thunks.slice(1)) {
3351
+ promise = promise.then(() => {
3352
+ const previous_context = ssr_context;
3353
+ set_ssr_context(context);
3354
+ try {
3355
+ return fn();
3356
+ } finally {
3357
+ set_ssr_context(previous_context);
3358
+ }
3359
+ });
3360
+ promises.push(promise);
3361
+ }
3362
+ promise.catch(noop);
3363
+ this.promise = promise;
3364
+ return promises;
3365
+ }
3366
+ /**
3367
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3368
+ */
3369
+ child_block(fn) {
3370
+ this.#out.push(BLOCK_OPEN);
3371
+ this.child(fn);
3372
+ this.#out.push(BLOCK_CLOSE);
3373
+ }
3374
+ /**
3375
+ * Create a child renderer. The child renderer inherits the state from the parent,
3376
+ * but has its own content.
3377
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3378
+ */
3379
+ child(fn) {
3380
+ const child = new Renderer(this.global, this);
3381
+ this.#out.push(child);
3382
+ const parent = ssr_context;
3383
+ set_ssr_context({
3384
+ ...ssr_context,
3385
+ p: parent,
3386
+ c: null,
3387
+ r: child
3388
+ });
3389
+ const result = fn(child);
3390
+ set_ssr_context(parent);
3391
+ if (result instanceof Promise) {
3392
+ result.catch(noop);
3393
+ result.finally(() => set_ssr_context(null)).catch(noop);
3394
+ if (child.global.mode === "sync") await_invalid();
3395
+ child.promise = result;
3396
+ }
3397
+ return child;
3398
+ }
3399
+ /**
3400
+ * Render children inside an error boundary. If the children throw and the API-level
3401
+ * `transformError` transform handles the error (doesn't re-throw), the `failed` snippet is
3402
+ * rendered instead. Otherwise the error propagates.
3403
+ *
3404
+ * @param {{ failed?: (renderer: Renderer, error: unknown, reset: () => void) => void }} props
3405
+ * @param {(renderer: Renderer) => MaybePromise<void>} children_fn
3406
+ */
3407
+ boundary(props, children_fn) {
3408
+ const child = new Renderer(this.global, this);
3409
+ this.#out.push(child);
3410
+ const parent_context = ssr_context;
3411
+ if (props.failed) child.#boundary = {
3412
+ failed: props.failed,
3413
+ transformError: this.global.transformError,
3414
+ context: parent_context
3415
+ };
3416
+ set_ssr_context({
3417
+ ...ssr_context,
3418
+ p: parent_context,
3419
+ c: null,
3420
+ r: child
3421
+ });
3422
+ try {
3423
+ const result = children_fn(child);
3424
+ set_ssr_context(parent_context);
3425
+ if (result instanceof Promise) {
3426
+ if (child.global.mode === "sync") await_invalid();
3427
+ result.catch(noop);
3428
+ child.promise = result;
3429
+ }
3430
+ } catch (error) {
3431
+ set_ssr_context(parent_context);
3432
+ const failed_snippet = props.failed;
3433
+ if (!failed_snippet) throw error;
3434
+ const result = this.global.transformError(error);
3435
+ child.#out.length = 0;
3436
+ child.#boundary = null;
3437
+ if (result instanceof Promise) {
3438
+ if (this.global.mode === "sync") await_invalid();
3439
+ child.promise = result.then((transformed) => {
3440
+ set_ssr_context(parent_context);
3441
+ child.#out.push(Renderer.#serialize_failed_boundary(transformed));
3442
+ failed_snippet(child, transformed, noop);
3443
+ child.#out.push(BLOCK_CLOSE);
3444
+ });
3445
+ child.promise.catch(noop);
3446
+ } else {
3447
+ child.#out.push(Renderer.#serialize_failed_boundary(result));
3448
+ failed_snippet(child, result, noop);
3449
+ child.#out.push(BLOCK_CLOSE);
3450
+ }
3451
+ }
3452
+ }
3453
+ /**
3454
+ * Create a component renderer. The component renderer inherits the state from the parent,
3455
+ * but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
3456
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3457
+ * @param {Function} [component_fn]
3458
+ * @returns {void}
3459
+ */
3460
+ component(fn, component_fn) {
3461
+ push();
3462
+ const child = this.child(fn);
3463
+ child.#is_component_body = true;
3464
+ pop();
3465
+ }
3466
+ /**
3467
+ * @param {Record<string, any>} attrs
3468
+ * @param {(renderer: Renderer) => void} fn
3469
+ * @param {string | undefined} [css_hash]
3470
+ * @param {Record<string, boolean> | undefined} [classes]
3471
+ * @param {Record<string, string> | undefined} [styles]
3472
+ * @param {number | undefined} [flags]
3473
+ * @param {boolean | undefined} [is_rich]
3474
+ * @returns {void}
3475
+ */
3476
+ select(attrs, fn, css_hash, classes, styles, flags, is_rich) {
3477
+ const { value, ...select_attrs } = attrs;
3478
+ this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
3479
+ this.child((renderer) => {
3480
+ renderer.local.select_value = value;
3481
+ fn(renderer);
3482
+ });
3483
+ this.push(`${is_rich ? "<!>" : ""}</select>`);
3484
+ }
3485
+ /**
3486
+ * @param {Record<string, any>} attrs
3487
+ * @param {string | number | boolean | ((renderer: Renderer) => void)} body
3488
+ * @param {string | undefined} [css_hash]
3489
+ * @param {Record<string, boolean> | undefined} [classes]
3490
+ * @param {Record<string, string> | undefined} [styles]
3491
+ * @param {number | undefined} [flags]
3492
+ * @param {boolean | undefined} [is_rich]
3493
+ */
3494
+ option(attrs, body, css_hash, classes, styles, flags, is_rich) {
3495
+ this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
3496
+ /**
3497
+ * @param {Renderer} renderer
3498
+ * @param {any} value
3499
+ * @param {{ head?: string, body: any }} content
3500
+ */
3501
+ const close = (renderer, value, { head, body }) => {
3502
+ if (has_own_property.call(attrs, "value")) value = attrs.value;
3503
+ if (value === this.local.select_value) renderer.#out.push(" selected=\"\"");
3504
+ renderer.#out.push(`>${body}${is_rich ? "<!>" : ""}</option>`);
3505
+ if (head) renderer.head((child) => child.push(head));
3506
+ };
3507
+ if (typeof body === "function") this.child((renderer) => {
3508
+ const r = new Renderer(this.global, this);
3509
+ body(r);
3510
+ if (this.global.mode === "async") return r.#collect_content_async().then((content) => {
3511
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
3512
+ });
3513
+ else {
3514
+ const content = r.#collect_content();
3515
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
3516
+ }
3517
+ });
3518
+ else close(this, body, { body: escape_html(body) });
3519
+ }
3520
+ /**
3521
+ * @param {(renderer: Renderer) => void} fn
3522
+ */
3523
+ title(fn) {
3524
+ const path = this.get_path();
3525
+ /** @param {string} head */
3526
+ const close = (head) => {
3527
+ this.global.set_title(head, path);
3528
+ };
3529
+ this.child((renderer) => {
3530
+ const r = new Renderer(renderer.global, renderer);
3531
+ fn(r);
3532
+ if (renderer.global.mode === "async") return r.#collect_content_async().then((content) => {
3533
+ close(content.head);
3534
+ });
3535
+ else {
3536
+ const content = r.#collect_content();
3537
+ close(content.head);
3538
+ }
3539
+ });
3540
+ }
3541
+ /**
3542
+ * @param {string | (() => Promise<string>)} content
3543
+ */
3544
+ push(content) {
3545
+ if (typeof content === "function") this.child(async (renderer) => renderer.push(await content()));
3546
+ else this.#out.push(content);
3547
+ }
3548
+ /**
3549
+ * @param {() => void} fn
3550
+ */
3551
+ on_destroy(fn) {
3552
+ (this.#on_destroy ??= []).push(fn);
3553
+ }
3554
+ /**
3555
+ * @returns {number[]}
3556
+ */
3557
+ get_path() {
3558
+ return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : [];
3559
+ }
3560
+ /**
3561
+ * @deprecated this is needed for legacy component bindings
3562
+ */
3563
+ copy() {
3564
+ const copy = new Renderer(this.global, this.#parent);
3565
+ copy.type = this.type;
3566
+ copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
3567
+ copy.promise = this.promise;
3568
+ return copy;
3569
+ }
3570
+ /**
3571
+ * @param {Renderer} other
3572
+ * @deprecated this is needed for legacy component bindings
3573
+ */
3574
+ subsume(other) {
3575
+ if (this.global.mode !== other.global.mode) throw new Error("invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!");
3576
+ this.local = other.local;
3577
+ this.#out = other.#out.map((item, i) => {
3578
+ const current = this.#out[i];
3579
+ if (current instanceof Renderer && item instanceof Renderer) {
3580
+ current.subsume(item);
3581
+ return current;
3582
+ }
3583
+ return item;
3584
+ });
3585
+ this.promise = other.promise;
3586
+ this.type = other.type;
3587
+ }
3588
+ get length() {
3589
+ return this.#out.length;
3590
+ }
3591
+ /**
3592
+ * Creates the hydration comment that marks the start of a failed boundary.
3593
+ * The error is JSON-serialized and embedded inside an HTML comment for the client
3594
+ * to parse during hydration. The JSON is escaped to prevent `-->` or `<!--` sequences
3595
+ * from breaking out of the comment (XSS). Uses unicode escapes which `JSON.parse()`
3596
+ * handles transparently.
3597
+ * @param {unknown} error
3598
+ * @returns {string}
3599
+ */
3600
+ static #serialize_failed_boundary(error) {
3601
+ return `<!--[?${JSON.stringify(error).replace(/>/g, "\\u003e").replace(/</g, "\\u003c")}-->`;
3602
+ }
3603
+ /**
3604
+ * Only available on the server and when compiling with the `server` option.
3605
+ * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
3606
+ * @template {Record<string, any>} Props
3607
+ * @param {Component<Props>} component
3608
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} [options]
3609
+ * @returns {RenderOutput}
3610
+ */
3611
+ static render(component, options = {}) {
3612
+ /** @type {AccumulatedContent | undefined} */
3613
+ let sync;
3614
+ const result = {};
3615
+ Object.defineProperties(result, {
3616
+ html: { get: () => {
3617
+ return (sync ??= Renderer.#render(component, options)).body;
3618
+ } },
3619
+ head: { get: () => {
3620
+ return (sync ??= Renderer.#render(component, options)).head;
3621
+ } },
3622
+ body: { get: () => {
3623
+ return (sync ??= Renderer.#render(component, options)).body;
3624
+ } },
3625
+ hashes: { value: { script: "" } },
3626
+ then: { value:
3627
+ /**
3628
+ * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
3629
+ *
3630
+ * @template TResult1
3631
+ * @template [TResult2=never]
3632
+ * @param { (value: SyncRenderOutput) => TResult1 } onfulfilled
3633
+ * @param { (reason: unknown) => TResult2 } onrejected
3634
+ */
3635
+ (onfulfilled, onrejected) => {
3636
+ {
3637
+ const result = sync ??= Renderer.#render(component, options);
3638
+ const user_result = onfulfilled({
3639
+ head: result.head,
3640
+ body: result.body,
3641
+ html: result.body,
3642
+ hashes: { script: [] }
3643
+ });
3644
+ return Promise.resolve(user_result);
3645
+ }
3646
+ } }
3647
+ });
3648
+ return result;
3649
+ }
3650
+ /**
3651
+ * Collect all of the `onDestroy` callbacks registered during rendering. In an async context, this is only safe to call
3652
+ * after awaiting `collect_async`.
3653
+ *
3654
+ * Child renderers are "porous" and don't affect execution order, but component body renderers
3655
+ * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary.
3656
+ * @returns {Iterable<() => void>}
3657
+ */
3658
+ *#collect_on_destroy() {
3659
+ for (const component of this.#traverse_components()) yield* component.#collect_ondestroy();
3660
+ }
3661
+ /**
3662
+ * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree.
3663
+ * @returns {Iterable<Renderer>}
3664
+ */
3665
+ *#traverse_components() {
3666
+ for (const child of this.#out) if (typeof child !== "string") yield* child.#traverse_components();
3667
+ if (this.#is_component_body) yield this;
3668
+ }
3669
+ /**
3670
+ * @returns {Iterable<() => void>}
3671
+ */
3672
+ *#collect_ondestroy() {
3673
+ if (this.#on_destroy) for (const fn of this.#on_destroy) yield fn;
3674
+ for (const child of this.#out) if (child instanceof Renderer && !child.#is_component_body) yield* child.#collect_ondestroy();
3675
+ }
3676
+ /**
3677
+ * Render a component. Throws if any of the children are performing asynchronous work.
3678
+ *
3679
+ * @template {Record<string, any>} Props
3680
+ * @param {Component<Props>} component
3681
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
3682
+ * @returns {AccumulatedContent}
3683
+ */
3684
+ static #render(component, options) {
3685
+ var previous_context = ssr_context;
3686
+ try {
3687
+ const renderer = Renderer.#open_render("sync", component, options);
3688
+ const content = renderer.#collect_content();
3689
+ return Renderer.#close_render(content, renderer);
3690
+ } finally {
3691
+ abort();
3692
+ set_ssr_context(previous_context);
3693
+ }
3694
+ }
3695
+ /**
3696
+ * Render a component.
3697
+ *
3698
+ * @template {Record<string, any>} Props
3699
+ * @param {Component<Props>} component
3700
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
3701
+ * @returns {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>}
3702
+ */
3703
+ static async #render_async(component, options) {
3704
+ const previous_context = ssr_context;
3705
+ try {
3706
+ const renderer = Renderer.#open_render("async", component, options);
3707
+ const content = await renderer.#collect_content_async();
3708
+ const hydratables = await renderer.#collect_hydratables();
3709
+ if (hydratables !== null) content.head = hydratables + content.head;
3710
+ return Renderer.#close_render(content, renderer);
3711
+ } finally {
3712
+ set_ssr_context(previous_context);
3713
+ abort();
3714
+ }
3715
+ }
3716
+ /**
3717
+ * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
3718
+ * @param {AccumulatedContent} content
3719
+ * @returns {AccumulatedContent}
3720
+ */
3721
+ #collect_content(content = {
3722
+ head: "",
3723
+ body: ""
3724
+ }) {
3725
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
3726
+ else if (item instanceof Renderer) item.#collect_content(content);
3727
+ return content;
3728
+ }
3729
+ /**
3730
+ * Collect all of the code from the `out` array and return it as a string.
3731
+ * @param {AccumulatedContent} content
3732
+ * @returns {Promise<AccumulatedContent>}
3733
+ */
3734
+ async #collect_content_async(content = {
3735
+ head: "",
3736
+ body: ""
3737
+ }) {
3738
+ await this.promise;
3739
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
3740
+ else if (item instanceof Renderer) {
3741
+ if (item.#boundary) {
3742
+ /** @type {AccumulatedContent} */
3743
+ const boundary_content = {
3744
+ head: "",
3745
+ body: ""
3746
+ };
3747
+ try {
3748
+ await item.#collect_content_async(boundary_content);
3749
+ content.head += boundary_content.head;
3750
+ content.body += boundary_content.body;
3751
+ } catch (error) {
3752
+ const { context, failed, transformError } = item.#boundary;
3753
+ set_ssr_context(context);
3754
+ let promise = transformError(error);
3755
+ set_ssr_context(null);
3756
+ let transformed = await promise;
3757
+ set_ssr_context(context);
3758
+ const failed_renderer = new Renderer(item.global, item);
3759
+ failed_renderer.type = item.type;
3760
+ failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed));
3761
+ failed(failed_renderer, transformed, noop);
3762
+ failed_renderer.#out.push(BLOCK_CLOSE);
3763
+ await failed_renderer.#collect_content_async(content);
3764
+ }
3765
+ } else await item.#collect_content_async(content);
3766
+ }
3767
+ return content;
3768
+ }
3769
+ async #collect_hydratables() {
3770
+ const ctx = get_render_context().hydratable;
3771
+ for (const [_, key] of ctx.unresolved_promises) unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? "<missing stack trace>");
3772
+ for (const comparison of ctx.comparisons) await comparison;
3773
+ return await this.#hydratable_block(ctx);
3774
+ }
3775
+ /**
3776
+ * @template {Record<string, any>} Props
3777
+ * @param {'sync' | 'async'} mode
3778
+ * @param {import('svelte').Component<Props>} component
3779
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options
3780
+ * @returns {Renderer}
3781
+ */
3782
+ static #open_render(mode, component, options) {
3783
+ if (options.idPrefix?.includes("--")) invalid_id_prefix();
3784
+ var previous_context = ssr_context;
3785
+ try {
3786
+ const renderer = new Renderer(new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp, options.transformError));
3787
+ set_ssr_context({
3788
+ p: null,
3789
+ c: options.context ?? null,
3790
+ r: renderer
3791
+ });
3792
+ renderer.push(BLOCK_OPEN);
3793
+ component(renderer, options.props ?? {});
3794
+ renderer.push(BLOCK_CLOSE);
3795
+ return renderer;
3796
+ } finally {
3797
+ set_ssr_context(previous_context);
3798
+ }
3799
+ }
3800
+ /**
3801
+ * @param {AccumulatedContent} content
3802
+ * @param {Renderer} renderer
3803
+ * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
3804
+ */
3805
+ static #close_render(content, renderer) {
3806
+ for (const cleanup of renderer.#collect_on_destroy()) cleanup();
3807
+ let head = content.head + renderer.global.get_title();
3808
+ let body = content.body;
3809
+ for (const { hash, code } of renderer.global.css) head += `<style id="${hash}">${code}</style>`;
3810
+ return {
3811
+ head,
3812
+ body,
3813
+ hashes: { script: renderer.global.csp.script_hashes }
3814
+ };
3815
+ }
3816
+ /**
3817
+ * @param {HydratableContext} ctx
3818
+ */
3819
+ async #hydratable_block(ctx) {
3820
+ if (ctx.lookup.size === 0) return null;
3821
+ let entries = [];
3822
+ let has_promises = false;
3823
+ for (const [k, v] of ctx.lookup) {
3824
+ if (v.promises) {
3825
+ has_promises = true;
3826
+ for (const p of v.promises) await p;
3827
+ }
3828
+ entries.push(`[${uneval(k)},${v.serialized}]`);
3829
+ }
3830
+ let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`;
3831
+ if (has_promises) prelude = `const r = (v) => Promise.resolve(v);
3832
+ ${prelude}`;
3833
+ const body = `
3834
+ {
3835
+ ${prelude}
3836
+
3837
+ for (const [k, v] of [
3838
+ ${entries.join(",\n ")}
3839
+ ]) {
3840
+ h.set(k, v);
3841
+ }
3842
+ }
3843
+ `;
3844
+ let csp_attr = "";
3845
+ if (this.global.csp.nonce) csp_attr = ` nonce="${this.global.csp.nonce}"`;
3846
+ else if (this.global.csp.hash) {
3847
+ const hash = await sha256(body);
3848
+ this.global.csp.script_hashes.push(`sha256-${hash}`);
3849
+ }
3850
+ return `\n\t\t<script${csp_attr}>${body}<\/script>`;
3851
+ }
3852
+ };
3853
+ var SSRState = class {
3854
+ /** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */
3855
+ csp;
3856
+ /** @readonly @type {'sync' | 'async'} */
3857
+ mode;
3858
+ /** @readonly @type {() => string} */
3859
+ uid;
3860
+ /** @readonly @type {Set<{ hash: string; code: string }>} */
3861
+ css = /* @__PURE__ */ new Set();
3862
+ /**
3863
+ * `transformError` passed to `render`. Called when an error boundary catches an error.
3864
+ * Throws by default if unset in `render`.
3865
+ * @type {(error: unknown) => unknown}
3866
+ */
3867
+ transformError;
3868
+ /** @type {{ path: number[], value: string }} */
3869
+ #title = {
3870
+ path: [],
3871
+ value: ""
3872
+ };
3873
+ /**
3874
+ * @param {'sync' | 'async'} mode
3875
+ * @param {string} id_prefix
3876
+ * @param {Csp} csp
3877
+ * @param {((error: unknown) => unknown) | undefined} [transformError]
3878
+ */
3879
+ constructor(mode, id_prefix = "", csp = { hash: false }, transformError) {
3880
+ this.mode = mode;
3881
+ this.csp = {
3882
+ ...csp,
3883
+ script_hashes: []
3884
+ };
3885
+ this.transformError = transformError ?? ((error) => {
3886
+ throw error;
3887
+ });
3888
+ let uid = 1;
3889
+ this.uid = () => `${id_prefix}s${uid++}`;
3890
+ }
3891
+ get_title() {
3892
+ return this.#title.value;
3893
+ }
3894
+ /**
3895
+ * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
3896
+ * from earlier than or equal to the current value.
3897
+ * @param {string} value
3898
+ * @param {number[]} path
3899
+ */
3900
+ set_title(value, path) {
3901
+ const current = this.#title.path;
3902
+ let i = 0;
3903
+ let l = Math.min(path.length, current.length);
3904
+ while (i < l && path[i] === current[i]) i += 1;
3905
+ if (path[i] === void 0) return;
3906
+ if (current[i] === void 0 || path[i] > current[i]) {
3907
+ this.#title.path = path;
3908
+ this.#title.value = value;
3909
+ }
3910
+ }
3911
+ };
3912
+ //#endregion
3913
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/blocks/html.js
3914
+ /**
3915
+ * @param {string} value
3916
+ */
3917
+ function html(value) {
3918
+ return "<!---->" + String(value ?? "") + "<!---->";
3919
+ }
3920
+ //#endregion
3921
+ //#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/index.js
3922
+ var INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
3923
+ /**
3924
+ * @param {Renderer} renderer
3925
+ * @param {string} tag
3926
+ * @param {() => void} attributes_fn
3927
+ * @param {() => void} children_fn
3928
+ * @returns {void}
3929
+ */
3930
+ function element(renderer, tag, attributes_fn = noop, children_fn = noop) {
3931
+ renderer.push("<!---->");
3932
+ if (tag) {
3933
+ if (!REGEX_VALID_TAG_NAME.test(tag)) dynamic_element_invalid_tag(tag);
3934
+ renderer.push(`<${tag}`);
3935
+ attributes_fn();
3936
+ renderer.push(`>`);
3937
+ if (!is_void(tag)) {
3938
+ children_fn();
3939
+ if (!is_raw_text_element(tag)) renderer.push(EMPTY_COMMENT);
3940
+ renderer.push(`</${tag}>`);
3941
+ }
3942
+ }
3943
+ renderer.push("<!---->");
3944
+ }
3945
+ /**
3946
+ * Only available on the server and when compiling with the `server` option.
3947
+ * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
3948
+ * @template {Record<string, any>} Props
3949
+ * @param {Component<Props> | ComponentType<SvelteComponent<Props>>} component
3950
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} [options]
3951
+ * @returns {RenderOutput}
3952
+ */
3953
+ function render(component, options = {}) {
3954
+ if (options.csp?.hash && options.csp.nonce) invalid_csp();
3955
+ return Renderer.render(component, options);
3956
+ }
3957
+ /**
3958
+ * @param {string} hash
3959
+ * @param {Renderer} renderer
3960
+ * @param {(renderer: Renderer) => Promise<void> | void} fn
3961
+ * @returns {void}
3962
+ */
3963
+ function head(hash, renderer, fn) {
3964
+ renderer.head((renderer) => {
3965
+ renderer.push(`<!--${hash}-->`);
3966
+ renderer.child(fn);
3967
+ renderer.push(EMPTY_COMMENT);
3968
+ });
3969
+ }
3970
+ /**
3971
+ * @param {Record<string, unknown>} attrs
3972
+ * @param {string} [css_hash]
3973
+ * @param {Record<string, boolean>} [classes]
3974
+ * @param {Record<string, string>} [styles]
3975
+ * @param {number} [flags]
3976
+ * @returns {string}
3977
+ */
3978
+ function attributes(attrs, css_hash, classes, styles, flags = 0) {
3979
+ if (styles) attrs.style = to_style(attrs.style, styles);
3980
+ if (attrs.class) attrs.class = clsx(attrs.class);
3981
+ if (css_hash || classes) attrs.class = to_class(attrs.class, css_hash, classes);
3982
+ let attr_str = "";
3983
+ let name;
3984
+ const is_html = (flags & 1) === 0;
3985
+ const lowercase = (flags & 2) === 0;
3986
+ const is_input = (flags & 4) !== 0;
3987
+ for (name of Object.keys(attrs)) {
3988
+ if (typeof attrs[name] === "function") continue;
3989
+ if (name[0] === "$" && name[1] === "$") continue;
3990
+ if (name === "" || INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
3991
+ var value = attrs[name];
3992
+ var lower = name.toLowerCase();
3993
+ if (lowercase) name = lower;
3994
+ if (lower.length > 2 && lower.startsWith("on")) continue;
3995
+ if (is_input) {
3996
+ if (name === "defaultvalue" || name === "defaultchecked") {
3997
+ name = name === "defaultvalue" ? "value" : "checked";
3998
+ if (attrs[name]) continue;
3999
+ }
4000
+ }
4001
+ attr_str += attr(name, value, is_html && is_boolean_attribute(name));
4002
+ }
4003
+ return attr_str;
4004
+ }
4005
+ /**
4006
+ * @param {Record<string, unknown>[]} props
4007
+ * @returns {Record<string, unknown>}
4008
+ */
4009
+ function spread_props(props) {
4010
+ /** @type {Record<string, unknown>} */
4011
+ const merged_props = {};
4012
+ let key;
4013
+ for (let i = 0; i < props.length; i++) {
4014
+ const obj = props[i];
4015
+ if (obj == null) continue;
4016
+ for (key of Object.keys(obj)) {
4017
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
4018
+ if (desc) Object.defineProperty(merged_props, key, desc);
4019
+ else merged_props[key] = obj[key];
4020
+ }
4021
+ }
4022
+ return merged_props;
4023
+ }
4024
+ /**
4025
+ * @param {unknown} value
4026
+ * @returns {string}
4027
+ */
4028
+ function stringify(value) {
4029
+ return typeof value === "string" ? value : value == null ? "" : value + "";
4030
+ }
4031
+ /**
4032
+ * @param {any} value
4033
+ * @param {string | undefined} [hash]
4034
+ * @param {Record<string, boolean>} [directives]
4035
+ */
4036
+ function attr_class(value, hash, directives) {
4037
+ var result = to_class(value, hash, directives);
4038
+ return result ? ` class="${escape_html(result, true)}"` : "";
4039
+ }
4040
+ /**
4041
+ * @param {any} value
4042
+ * @param {Record<string,any>|[Record<string,any>,Record<string,any>]} [directives]
4043
+ */
4044
+ function attr_style(value, directives) {
4045
+ var result = to_style(value, directives);
4046
+ return result ? ` style="${escape_html(result, true)}"` : "";
4047
+ }
4048
+ /**
4049
+ * Legacy mode: If the prop has a fallback and is bound in the
4050
+ * parent component, propagate the fallback value upwards.
4051
+ * @param {Record<string, unknown>} props_parent
4052
+ * @param {Record<string, unknown>} props_now
4053
+ */
4054
+ function bind_props(props_parent, props_now) {
4055
+ for (const key of Object.keys(props_now)) {
4056
+ const initial_value = props_parent[key];
4057
+ const value = props_now[key];
4058
+ if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) props_parent[key] = value;
4059
+ }
4060
+ }
4061
+ /** @param {any} array_like_or_iterator */
4062
+ function ensure_array_like(array_like_or_iterator) {
4063
+ if (array_like_or_iterator) return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
4064
+ return [];
4065
+ }
4066
+ /**
4067
+ * @template V
4068
+ * @param {() => V} get_value
4069
+ */
4070
+ function once(get_value) {
4071
+ let value = UNINITIALIZED;
4072
+ return () => {
4073
+ if (value === UNINITIALIZED) value = get_value();
4074
+ return value;
4075
+ };
4076
+ }
4077
+ /**
4078
+ * Create an unique ID
4079
+ * @param {Renderer} renderer
4080
+ * @returns {string}
4081
+ */
4082
+ function props_id(renderer) {
4083
+ const uid = renderer.global.uid();
4084
+ renderer.push("<!--$" + uid + "-->");
4085
+ return uid;
4086
+ }
4087
+ /**
4088
+ * @template T
4089
+ * @param {()=>T} fn
4090
+ * @returns {(new_value?: T) => (T | void)}
4091
+ */
4092
+ function derived(fn) {
4093
+ const get_value = ssr_context === null ? fn : once(fn);
4094
+ /** @type {T | undefined} */
4095
+ let updated_value;
4096
+ return function(new_value) {
4097
+ if (arguments.length === 0) return updated_value ?? get_value();
4098
+ updated_value = new_value;
4099
+ return updated_value;
4100
+ };
4101
+ }
4102
+
4103
+ export { spread_props as $, push$1 as A, component_context as B, hydration_mismatch as C, pop$1 as D, run as E, noop as F, hasContext as G, HYDRATION_ERROR as H, getContext as I, getAllContexts as J, getAbortSignal as K, LEGACY_PROPS as L, createContext as M, ssr_context as N, lifecycle_function_unavailable as O, experimental_async_required as P, get_render_context as Q, hydratable_serialization_failed as R, writable as S, readable as T, head as U, escape_html as V, bind_props as W, attr as X, attr_style as Y, attr_class as Z, stringify as _, get_first_child as a, attributes as a0, clsx as a1, ensure_array_like as a2, element as a3, html as a4, props_id as a5, get_next_sibling as b, set_hydrating as c, define_property as d, set_hydrate_node as e, flushSync as f, get as g, hydration_failed as h, init_operations as i, clear_text_content as j, component_root as k, hydrate_node as l, mutable_source as m, create_text as n, boundary as o, array_from as p, is_passive_event as q, render as r, set as s, set_active_reaction as t, set_active_effect as u, active_reaction as v, active_effect as w, setContext as x, derived as y, hydrating as z };
4104
+ //# sourceMappingURL=server.js-DoCd0fEo.js.map