@graphrefly/graphrefly 0.38.0 → 0.40.0

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 (321) hide show
  1. package/dist/budget-gate-CmmVtasH.d.ts +115 -0
  2. package/dist/budget-gate-DiP_nK0n.d.cts +115 -0
  3. package/dist/{cascading-BsJ4GbnS.d.ts → cascading-BNfxffgc.d.ts} +2 -2
  4. package/dist/{cascading-B25wxpRa.d.cts → cascading-Cxs1eztH.d.cts} +2 -2
  5. package/dist/chunk-2BX4NB34.js +3 -0
  6. package/dist/{chunk-6VFC334U.js → chunk-2DMKW2AD.js} +1 -1
  7. package/dist/{chunk-4BDQXBXE.js → chunk-2QXRYP7Q.js} +1 -1
  8. package/dist/chunk-32N3JALT.js +1 -0
  9. package/dist/chunk-35JTVPOX.js +1 -0
  10. package/dist/chunk-3G5U5QNE.js +5 -0
  11. package/dist/{chunk-PHXZRR6C.js → chunk-4I45FVQS.js} +1 -1
  12. package/dist/{chunk-B5S7KTGP.js → chunk-6I726LZU.js} +1 -1
  13. package/dist/{chunk-NV63VQHI.js → chunk-6VWBPSSY.js} +1 -1
  14. package/dist/chunk-6XVD5TZV.js +1 -0
  15. package/dist/chunk-756D5TFD.js +1 -0
  16. package/dist/{chunk-DSOVKKTI.js → chunk-7Q4ZD3YW.js} +1 -1
  17. package/dist/{chunk-TMVY7OWG.js → chunk-B7LCDQEV.js} +1 -1
  18. package/dist/chunk-C72GO4IZ.js +1 -0
  19. package/dist/{chunk-RZ5HKPGI.js → chunk-CKFQS2CJ.js} +1 -1
  20. package/dist/chunk-D27JNOLZ.js +1 -0
  21. package/dist/chunk-ECQRP2UT.js +1 -0
  22. package/dist/{chunk-6773HURD.js → chunk-FHRBBHJN.js} +1 -1
  23. package/dist/{chunk-UVLZX2OU.js → chunk-I2DEVPMU.js} +1 -1
  24. package/dist/chunk-INQFTVZA.js +61 -0
  25. package/dist/{chunk-6KZZ6XQE.js → chunk-J63M5U46.js} +1 -1
  26. package/dist/{chunk-POCWFIJ7.js → chunk-JKBOIJ22.js} +1 -1
  27. package/dist/chunk-K2Z7UENB.js +1 -0
  28. package/dist/chunk-L6NSJVJZ.js +1 -0
  29. package/dist/{chunk-K5C67OGE.js → chunk-LCGAVGGV.js} +2 -2
  30. package/dist/chunk-LYM4PBMV.js +1 -0
  31. package/dist/{chunk-O2BLVQU4.js → chunk-MNZIKXK4.js} +1 -1
  32. package/dist/chunk-N43XM7BM.js +1 -0
  33. package/dist/{chunk-FWGIZP3W.js → chunk-OSZ22J7O.js} +1 -1
  34. package/dist/{chunk-FAYEMS5M.js → chunk-PPUYQ66A.js} +1 -1
  35. package/dist/{chunk-SP5O2MIX.js → chunk-QSK3RRII.js} +1 -1
  36. package/dist/chunk-RZJDIV2G.js +1 -0
  37. package/dist/chunk-SSCGRYJ2.js +1 -0
  38. package/dist/chunk-SVFKHUCW.js +1 -0
  39. package/dist/chunk-TSOYJ743.js +1 -0
  40. package/dist/{chunk-O245YLM5.js → chunk-UWA6D7UF.js} +1 -1
  41. package/dist/chunk-VMF23LGB.js +1 -0
  42. package/dist/chunk-WL6LFPJB.js +1 -0
  43. package/dist/chunk-WUT362QV.js +1 -0
  44. package/dist/chunk-XJLYLLIJ.js +1 -0
  45. package/dist/{chunk-IBGE62GZ.js → chunk-XW4YDF6G.js} +1 -1
  46. package/dist/chunk-YKD7WUYJ.js +43 -0
  47. package/dist/{chunk-7KZZLWZ6.js → chunk-YXDRGKXP.js} +1 -1
  48. package/dist/chunk-Z4F3DOWS.js +84 -0
  49. package/dist/compat/index.cjs +9 -13
  50. package/dist/compat/index.d.cts +16 -16
  51. package/dist/compat/index.d.ts +16 -16
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.d.cts +2 -2
  54. package/dist/compat/jotai/index.d.ts +2 -2
  55. package/dist/compat/nanostores/index.d.cts +2 -2
  56. package/dist/compat/nanostores/index.d.ts +2 -2
  57. package/dist/compat/nestjs/index.cjs +7 -11
  58. package/dist/compat/nestjs/index.d.cts +8 -8
  59. package/dist/compat/nestjs/index.d.ts +8 -8
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/react/index.d.cts +2 -2
  62. package/dist/compat/react/index.d.ts +2 -2
  63. package/dist/compat/solid/index.d.cts +2 -2
  64. package/dist/compat/solid/index.d.ts +2 -2
  65. package/dist/compat/svelte/index.d.cts +2 -2
  66. package/dist/compat/svelte/index.d.ts +2 -2
  67. package/dist/compat/vue/index.d.cts +2 -2
  68. package/dist/compat/vue/index.d.ts +2 -2
  69. package/dist/compat/zustand/index.cjs +3 -7
  70. package/dist/compat/zustand/index.d.cts +4 -4
  71. package/dist/compat/zustand/index.d.ts +4 -4
  72. package/dist/compat/zustand/index.js +1 -1
  73. package/dist/core/index.cjs +1 -1
  74. package/dist/core/index.d.cts +4 -4
  75. package/dist/core/index.d.ts +4 -4
  76. package/dist/core/index.js +1 -1
  77. package/dist/{composite-DTOlDuch.d.ts → decay-BnrlbxSv.d.ts} +39 -3
  78. package/dist/{composite-CgG0MqHm.d.cts → decay-C25AyNAj.d.cts} +39 -3
  79. package/dist/extra/browser.d.cts +1 -1
  80. package/dist/extra/browser.d.ts +1 -1
  81. package/dist/extra/index.cjs +16 -20
  82. package/dist/extra/index.d.cts +11 -9
  83. package/dist/extra/index.d.ts +11 -9
  84. package/dist/extra/index.js +1 -1
  85. package/dist/extra/node.cjs +2 -2
  86. package/dist/extra/node.d.cts +1 -1
  87. package/dist/extra/node.d.ts +1 -1
  88. package/dist/extra/node.js +1 -1
  89. package/dist/extra/operators.cjs +1 -1
  90. package/dist/extra/operators.d.cts +1 -1
  91. package/dist/extra/operators.d.ts +1 -1
  92. package/dist/extra/operators.js +1 -1
  93. package/dist/extra/reactive.cjs +1 -1
  94. package/dist/extra/reactive.d.cts +3 -3
  95. package/dist/extra/reactive.d.ts +3 -3
  96. package/dist/extra/reactive.js +1 -1
  97. package/dist/extra/render/index.cjs +5 -0
  98. package/dist/extra/render/index.d.cts +183 -0
  99. package/dist/extra/render/index.d.ts +183 -0
  100. package/dist/extra/render/index.js +1 -0
  101. package/dist/extra/sources.cjs +1 -1
  102. package/dist/extra/sources.d.cts +1 -1
  103. package/dist/extra/sources.d.ts +1 -1
  104. package/dist/extra/sources.js +1 -1
  105. package/dist/extra/storage-browser.d.cts +1 -1
  106. package/dist/extra/storage-browser.d.ts +1 -1
  107. package/dist/{fallback-axI2cXwt.d.cts → fallback-8JYU8tlT.d.cts} +1 -1
  108. package/dist/{fallback-DuEXfA4F.d.ts → fallback-CMZl39L5.d.ts} +1 -1
  109. package/dist/graph/index.cjs +7 -7
  110. package/dist/graph/index.d.cts +5 -5
  111. package/dist/graph/index.d.ts +5 -5
  112. package/dist/graph/index.js +1 -1
  113. package/dist/{graph-BjW1taJl.d.ts → graph-BkIkog4h.d.ts} +76 -100
  114. package/dist/{graph-CHsVwf9S.d.cts → graph-E6likq7w.d.cts} +76 -100
  115. package/dist/{index-CIcu6fIR.d.ts → index-2n8Eai6M.d.ts} +1 -1
  116. package/dist/{index-BwOsJfLJ.d.ts → index-3k4Gg6-n.d.ts} +3 -3
  117. package/dist/{index-BUFCHvOR.d.ts → index-40ZT4MHj.d.ts} +3 -3
  118. package/dist/index-8s-Qm-gz.d.ts +218 -0
  119. package/dist/index-A3U3CSve.d.cts +113 -0
  120. package/dist/{index-CDvC1m5p.d.ts → index-B2RUoIUz.d.ts} +1 -1
  121. package/dist/{index-Byp771zP.d.ts → index-B6iTqKtJ.d.ts} +2 -2
  122. package/dist/{index-D-B7U42V.d.cts → index-B72TQQHd.d.cts} +2 -2
  123. package/dist/{resilience-Bys63Cpd.d.ts → index-BAQrjuZF.d.ts} +202 -26
  124. package/dist/{index-BiomL7AW.d.ts → index-BJSZxSFX.d.ts} +1 -1
  125. package/dist/index-BQ1fR4li.d.ts +210 -0
  126. package/dist/{index-D7-RSD93.d.cts → index-BTHOTC0Q.d.cts} +4 -4
  127. package/dist/{index-CEVzBWeB.d.ts → index-BaA-xpSw.d.ts} +26 -19
  128. package/dist/{index-CAV-3RpJ.d.cts → index-Bd91Nmf4.d.cts} +4 -4
  129. package/dist/{index-BI1wMfyc.d.ts → index-BgjS2b8N.d.ts} +3 -3
  130. package/dist/{index-Bpr0Pwgl.d.cts → index-BiHUBEKq.d.cts} +3 -3
  131. package/dist/{index-UsU9ptzs.d.cts → index-BilOa6AE.d.cts} +55 -9
  132. package/dist/{index-DJVQ-t07.d.ts → index-BmSQLAZo.d.cts} +41 -48
  133. package/dist/{index-DTDVDzhA.d.ts → index-C-dkXOpB.d.cts} +56 -54
  134. package/dist/{index-B-ORMr3k.d.ts → index-C5cQ7Gfx.d.ts} +4 -4
  135. package/dist/{index-ML6vHKXK.d.ts → index-C6ZUaos7.d.ts} +1 -1
  136. package/dist/{index-Vz7KPfgz.d.ts → index-CAP3UGsq.d.ts} +1 -1
  137. package/dist/{index-BFaALJxR.d.ts → index-CD2dBMet.d.ts} +10 -8
  138. package/dist/index-CGhMJNHb.d.cts +128 -0
  139. package/dist/{index-B3D_z0Z6.d.cts → index-CL7oilfm.d.cts} +1 -1
  140. package/dist/{index-Bn0uZEL4.d.ts → index-CQtWm7jS.d.ts} +9 -9
  141. package/dist/{index-CM-i58FY.d.cts → index-CRm0YIzC.d.cts} +9 -9
  142. package/dist/index-CUIkE1l9.d.cts +230 -0
  143. package/dist/{index-CijfwEWx.d.ts → index-Cczxgd2D.d.ts} +2 -2
  144. package/dist/{index-CAbHN_rP.d.cts → index-CgnCFhr2.d.cts} +1 -1
  145. package/dist/{index-B2IUcH13.d.cts → index-Ck35nA-T.d.ts} +41 -48
  146. package/dist/{index-BpMZzX9P.d.cts → index-Cnr1WrlX.d.cts} +3 -3
  147. package/dist/{index-JYtN9uqM.d.ts → index-CoM4rzyB.d.ts} +1 -1
  148. package/dist/{index-Ckil6miL.d.cts → index-CtFNGe-m.d.cts} +2 -2
  149. package/dist/{index-BjWZARLy.d.ts → index-Ctb7_2sG.d.ts} +1 -1
  150. package/dist/index-CuPUehFa.d.cts +218 -0
  151. package/dist/index-D1Gc7wV5.d.ts +230 -0
  152. package/dist/{index-DqICM_I7.d.ts → index-D1IEZUsj.d.ts} +67 -9
  153. package/dist/{index-BFuVcqL8.d.cts → index-D3ayz3hy.d.cts} +1 -1
  154. package/dist/{index-CQsqqEVz.d.cts → index-D4uimgee.d.cts} +1 -1
  155. package/dist/{resilience-BWP2c7Af.d.cts → index-DGTo1yka.d.cts} +202 -26
  156. package/dist/{index-BmWuVdER.d.ts → index-DH4fm2Ck.d.ts} +2 -2
  157. package/dist/{index-BkQqf1EF.d.cts → index-DJ_MPOJ5.d.cts} +67 -9
  158. package/dist/{index-9xhIaM-w.d.cts → index-DOBLxOti.d.cts} +1 -1
  159. package/dist/{index-BqcgiSQg.d.cts → index-DQQCOIt8.d.cts} +10 -8
  160. package/dist/{index-DJNAWzcH.d.cts → index-DVAlsmEU.d.cts} +26 -19
  161. package/dist/index-DVDapw2k.d.cts +210 -0
  162. package/dist/{index-D_QQ_dTD.d.cts → index-DYTBbF8T.d.cts} +1 -1
  163. package/dist/{index-BgzPO43H.d.cts → index-DgJc8Zgc.d.cts} +6 -6
  164. package/dist/{index-Czk3r0yA.d.cts → index-DhLyOHYZ.d.ts} +56 -54
  165. package/dist/{index-CrlHFsiT.d.ts → index-DhnsQfa3.d.ts} +100 -118
  166. package/dist/{index-Bub6x_D4.d.cts → index-DktLSZOc.d.cts} +37 -90
  167. package/dist/{index-BaSy4L6w.d.cts → index-DpiGqtrs.d.cts} +100 -118
  168. package/dist/{index-D-HZ7sP4.d.ts → index-I1cCY3ZI.d.ts} +6 -6
  169. package/dist/{index-D9vBTuzo.d.ts → index-IUCY0OFN.d.ts} +4 -4
  170. package/dist/{index-DeSsvHDD.d.cts → index-MxYuWOrf.d.cts} +3 -3
  171. package/dist/index-N2MAxt7_.d.ts +128 -0
  172. package/dist/{index-CpZKtdMw.d.cts → index-PgwvGWa1.d.cts} +1 -1
  173. package/dist/{index-AUqWe_fX.d.ts → index-WSlcjhQF.d.ts} +55 -9
  174. package/dist/{index-Di7OdwlO.d.ts → index-bXXLSvor.d.ts} +37 -90
  175. package/dist/index-da2V5vPy.d.ts +113 -0
  176. package/dist/{index-DY2f2b9z.d.ts → index-eaQuGJnv.d.ts} +3 -3
  177. package/dist/{index-BsgxnHN8.d.cts → index-t6L2qpHh.d.cts} +3 -3
  178. package/dist/{index-C-3UXnHT.d.cts → index-tV3AA9hI.d.cts} +2 -2
  179. package/dist/{index-8OxXae3g.d.ts → index-yLt-aPMp.d.ts} +1 -1
  180. package/dist/{index-CqSJ25A9.d.cts → index-z8WFPVI8.d.cts} +1 -1
  181. package/dist/index.cjs +63 -59
  182. package/dist/index.d.cts +48 -47
  183. package/dist/index.d.ts +48 -47
  184. package/dist/index.js +1 -1
  185. package/dist/{meta-DreaEM_a.d.cts → meta-Ct9nqQS5.d.cts} +11 -7
  186. package/dist/{meta-BYqlATmg.d.ts → meta-D8OyedKp.d.ts} +11 -7
  187. package/dist/{node-fSc-hCv8.d.cts → node-BYInONRr.d.cts} +3 -3
  188. package/dist/{node-fSc-hCv8.d.ts → node-BYInONRr.d.ts} +3 -3
  189. package/dist/{observable-Cqty11jG.d.cts → observable-DMIlYJV1.d.cts} +1 -1
  190. package/dist/{observable-EAV_rNfM.d.ts → observable-DO8DDEzv.d.ts} +1 -1
  191. package/dist/patterns/ai/browser.cjs +5 -5
  192. package/dist/patterns/ai/browser.d.cts +4 -4
  193. package/dist/patterns/ai/browser.d.ts +4 -4
  194. package/dist/patterns/ai/browser.js +1 -1
  195. package/dist/patterns/ai/index.cjs +16 -20
  196. package/dist/patterns/ai/index.d.cts +17 -17
  197. package/dist/patterns/ai/index.d.ts +17 -17
  198. package/dist/patterns/ai/index.js +1 -1
  199. package/dist/patterns/ai/node.cjs +1 -1
  200. package/dist/patterns/ai/node.d.cts +4 -4
  201. package/dist/patterns/ai/node.d.ts +4 -4
  202. package/dist/patterns/ai/node.js +1 -1
  203. package/dist/patterns/audit/index.cjs +3 -7
  204. package/dist/patterns/audit/index.d.cts +6 -6
  205. package/dist/patterns/audit/index.d.ts +6 -6
  206. package/dist/patterns/audit/index.js +1 -1
  207. package/dist/patterns/cqrs/index.cjs +3 -7
  208. package/dist/patterns/cqrs/index.d.cts +6 -6
  209. package/dist/patterns/cqrs/index.d.ts +6 -6
  210. package/dist/patterns/cqrs/index.js +1 -1
  211. package/dist/patterns/demo-shell/index.cjs +5 -8
  212. package/dist/patterns/demo-shell/index.d.cts +5 -5
  213. package/dist/patterns/demo-shell/index.d.ts +5 -5
  214. package/dist/patterns/demo-shell/index.js +1 -1
  215. package/dist/patterns/domain-templates/index.cjs +3 -7
  216. package/dist/patterns/domain-templates/index.d.cts +4 -4
  217. package/dist/patterns/domain-templates/index.d.ts +4 -4
  218. package/dist/patterns/domain-templates/index.js +1 -1
  219. package/dist/patterns/graphspec/index.cjs +37 -37
  220. package/dist/patterns/graphspec/index.d.cts +5 -5
  221. package/dist/patterns/graphspec/index.d.ts +5 -5
  222. package/dist/patterns/graphspec/index.js +1 -1
  223. package/dist/patterns/guarded-execution/index.cjs +3 -7
  224. package/dist/patterns/guarded-execution/index.d.cts +7 -7
  225. package/dist/patterns/guarded-execution/index.d.ts +7 -7
  226. package/dist/patterns/guarded-execution/index.js +1 -1
  227. package/dist/patterns/harness/index.cjs +8 -12
  228. package/dist/patterns/harness/index.d.cts +12 -12
  229. package/dist/patterns/harness/index.d.ts +12 -12
  230. package/dist/patterns/harness/index.js +1 -1
  231. package/dist/patterns/job-queue/index.cjs +3 -7
  232. package/dist/patterns/job-queue/index.d.cts +6 -6
  233. package/dist/patterns/job-queue/index.d.ts +6 -6
  234. package/dist/patterns/job-queue/index.js +1 -1
  235. package/dist/patterns/lens/index.cjs +3 -7
  236. package/dist/patterns/lens/index.d.cts +5 -6
  237. package/dist/patterns/lens/index.d.ts +5 -6
  238. package/dist/patterns/lens/index.js +1 -1
  239. package/dist/patterns/memory/index.cjs +3 -7
  240. package/dist/patterns/memory/index.d.cts +6 -6
  241. package/dist/patterns/memory/index.d.ts +6 -6
  242. package/dist/patterns/memory/index.js +1 -1
  243. package/dist/patterns/messaging/index.cjs +3 -7
  244. package/dist/patterns/messaging/index.d.cts +5 -5
  245. package/dist/patterns/messaging/index.d.ts +5 -5
  246. package/dist/patterns/messaging/index.js +1 -1
  247. package/dist/patterns/orchestration/index.cjs +3 -7
  248. package/dist/patterns/orchestration/index.d.cts +8 -8
  249. package/dist/patterns/orchestration/index.d.ts +8 -8
  250. package/dist/patterns/orchestration/index.js +1 -1
  251. package/dist/patterns/process/index.cjs +1 -1
  252. package/dist/patterns/process/index.d.cts +7 -7
  253. package/dist/patterns/process/index.d.ts +7 -7
  254. package/dist/patterns/process/index.js +1 -1
  255. package/dist/patterns/reactive-layout/index.cjs +4 -8
  256. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  257. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  258. package/dist/patterns/reactive-layout/index.js +1 -1
  259. package/dist/patterns/reduction/index.cjs +3 -7
  260. package/dist/patterns/reduction/index.d.cts +4 -4
  261. package/dist/patterns/reduction/index.d.ts +4 -4
  262. package/dist/patterns/reduction/index.js +1 -1
  263. package/dist/patterns/refine-loop/index.cjs +5 -9
  264. package/dist/patterns/refine-loop/index.d.cts +6 -6
  265. package/dist/patterns/refine-loop/index.d.ts +6 -6
  266. package/dist/patterns/refine-loop/index.js +1 -1
  267. package/dist/patterns/resilient-pipeline/index.cjs +3 -1
  268. package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
  269. package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
  270. package/dist/patterns/resilient-pipeline/index.js +1 -1
  271. package/dist/patterns/surface/index.cjs +12 -16
  272. package/dist/patterns/surface/index.d.cts +6 -6
  273. package/dist/patterns/surface/index.d.ts +6 -6
  274. package/dist/patterns/surface/index.js +1 -1
  275. package/dist/{pipeline-graph-9JBbmRxA.d.ts → pipeline-graph-CB4La-UW.d.ts} +34 -17
  276. package/dist/{pipeline-graph-DuHpXSOn.d.cts → pipeline-graph-MWrQZXCq.d.cts} +34 -17
  277. package/dist/{reactive-layout-BMLDB4Vd.d.cts → reactive-layout-BtZfUKuL.d.cts} +2 -2
  278. package/dist/{reactive-layout-D-tRiNhg.d.ts → reactive-layout-KJj4E2dT.d.ts} +2 -2
  279. package/dist/{reactive-log-BgWSA1fg.d.ts → reactive-log-BlAsPLl2.d.ts} +2 -2
  280. package/dist/{reactive-log-C3IMAGpT.d.cts → reactive-log-_zeEnB9H.d.cts} +2 -2
  281. package/dist/{reactive-map-DmgeADH8.d.cts → reactive-map-6P_k3AQM.d.cts} +2 -2
  282. package/dist/{reactive-map-CHyeCf4D.d.ts → reactive-map-CjXByDV-.d.ts} +2 -2
  283. package/dist/resilience-S33JV6XC.js +1 -0
  284. package/dist/{sugar-D13E2M_z.d.ts → sugar-BhfjgetH.d.ts} +1 -1
  285. package/dist/{sugar-DgaGJcI6.d.cts → sugar-DzePN5-g.d.cts} +1 -1
  286. package/dist/{topology-tree-jrZue3ao.d.cts → topology-tree-3LBKFsUo.d.cts} +1 -1
  287. package/dist/{topology-tree-D47-nI6Z.d.ts → topology-tree-mF7Emqzm.d.ts} +1 -1
  288. package/dist/{types-BMSGPlpO.d.cts → types-1Dhoi7HM.d.cts} +1 -1
  289. package/dist/{types-CidcBDuk.d.ts → types-39jk0kaV.d.ts} +1 -1
  290. package/package.json +11 -1
  291. package/dist/chunk-2YFDSYEF.js +0 -1
  292. package/dist/chunk-5BGFS2XH.js +0 -1
  293. package/dist/chunk-CMTN3KPT.js +0 -80
  294. package/dist/chunk-DQJLC6YY.js +0 -1
  295. package/dist/chunk-G7JN6LCB.js +0 -1
  296. package/dist/chunk-KJEAIIIY.js +0 -43
  297. package/dist/chunk-LV3ACS5J.js +0 -1
  298. package/dist/chunk-NBGPXQSP.js +0 -1
  299. package/dist/chunk-NN3QPJ6U.js +0 -1
  300. package/dist/chunk-NSAZ6PR6.js +0 -1
  301. package/dist/chunk-O32GJOUJ.js +0 -1
  302. package/dist/chunk-QEVSIVSF.js +0 -1
  303. package/dist/chunk-QMC2PLNM.js +0 -7
  304. package/dist/chunk-QOJFR6GS.js +0 -1
  305. package/dist/chunk-SFK7MN7S.js +0 -1
  306. package/dist/chunk-TB7JKSVS.js +0 -61
  307. package/dist/chunk-UAXFKMAG.js +0 -1
  308. package/dist/chunk-XIMFHEKV.js +0 -1
  309. package/dist/chunk-XLMYQB6F.js +0 -1
  310. package/dist/chunk-XLYF4LBH.js +0 -1
  311. package/dist/imperative-audit-ahAE65a9.d.cts +0 -28
  312. package/dist/imperative-audit-ahAE65a9.d.ts +0 -28
  313. package/dist/index-5dNRlW7J.d.ts +0 -135
  314. package/dist/index-BWUMIt7J.d.cts +0 -135
  315. package/dist/index-BhzwpIJc.d.cts +0 -105
  316. package/dist/index-BsZk9T8y.d.ts +0 -105
  317. package/dist/index-C56XZiDe.d.cts +0 -163
  318. package/dist/index-CpdnP-0y.d.cts +0 -186
  319. package/dist/index-DKrIuF-r.d.ts +0 -163
  320. package/dist/index-DOU1Ee_k.d.ts +0 -186
  321. package/dist/resilience-LGBK236C.js +0 -1
@@ -0,0 +1,183 @@
1
+ import { b as GraphDescribeOutput } from '../../graph-E6likq7w.cjs';
2
+ import '../../node-BYInONRr.cjs';
3
+ import '../../meta-Ct9nqQS5.cjs';
4
+ import '../storage-core.cjs';
5
+ import '../storage-tiers.cjs';
6
+
7
+ /**
8
+ * Internal helpers shared across renderers in `extra/render/`.
9
+ *
10
+ * These are pure functions over `GraphDescribeOutput` — no Graph instance
11
+ * dependency. Extracted from `src/graph/graph.ts` (the consolidated
12
+ * ex-dumpGraph / ex-toMermaid / ex-toD2 renderers) per Tier 2.1 A2.
13
+ */
14
+
15
+ /** Direction options for diagram exports. */
16
+ type DiagramDirection = "TD" | "LR" | "BT" | "RL";
17
+
18
+ /**
19
+ * Sugiyama-style layered DAG layout on an integer grid.
20
+ *
21
+ * Pipeline:
22
+ * 1. Longest-path layer assignment (sources at layer 0).
23
+ * 2. Virtual-node splitting — every edge spanning more than one layer
24
+ * becomes a chain of synthetic nodes on intermediate layers. Downstream
25
+ * passes treat real and virtual nodes identically; crossing
26
+ * minimization therefore works on wide + deep DAGs, not only
27
+ * adjacent-layer cases.
28
+ * 3. Crossing minimization — barycenter heuristic with alternating up /
29
+ * down sweeps plus an adjacent-transposition polish pass.
30
+ * 4. Coordinate assignment — greedy median-aligned packing with collision
31
+ * resolution. Straightens vertical runs of virtual nodes so long edges
32
+ * become straight lines where topology allows.
33
+ * 5. Orthogonal edge routing — per-gutter x-track assignment; horizontal
34
+ * segments sit at endpoint centerlines, vertical segments pack into the
35
+ * gutter column range without overlap. Remaining crossings are
36
+ * topologically unavoidable and will render as `┼` at draw time.
37
+ *
38
+ * Output coordinates are cell-grid integers (LR direction). TD rendering
39
+ * swaps axes at draw time — the layout is direction-agnostic by
40
+ * construction.
41
+ *
42
+ * Used only by [to-ascii.ts](./to-ascii.ts); not part of the public
43
+ * `extra/render/index.ts` surface (underscore-prefixed).
44
+ */
45
+ type LayoutDirection = "LR" | "TD";
46
+
47
+ /**
48
+ * `toAscii(g, opts?)` — stdout-native DAG flowchart renderer for a
49
+ * {@link GraphDescribeOutput}.
50
+ *
51
+ * Zero external dependencies, graph-size independent via proper Sugiyama
52
+ * (layer assignment → virtual-node splitting → barycenter crossing
53
+ * minimization → median-aligned coordinate assignment → per-gutter
54
+ * track-assigned orthogonal routing). See
55
+ * [_layout-sugiyama.ts](./_layout-sugiyama.ts) for the layout pipeline and
56
+ * [_ascii-grid.ts](./_ascii-grid.ts) for the character blitter.
57
+ *
58
+ * Pure function over the describe snapshot; no Graph instance dependency.
59
+ *
60
+ * @category extra
61
+ */
62
+
63
+ type ToAsciiOptions = {
64
+ /**
65
+ * ASCII layout direction. ASCII grid semantics are meaningful only for
66
+ * `"LR"` (default) and `"TD"`.
67
+ */
68
+ direction?: LayoutDirection;
69
+ /** Per-box label cell cap; longer labels are truncated with `…`. Default `24`. */
70
+ maxLabelWidth?: number;
71
+ /** Glyph set: `"unicode"` (default, box-drawing) or `"ascii"` (`-|+<>v`). */
72
+ asciiCharset?: "unicode" | "ascii";
73
+ /** Optional logger hook; fires with the rendered text before return. */
74
+ logger?: (text: string) => void;
75
+ };
76
+ declare function toAscii(g: GraphDescribeOutput, opts?: ToAsciiOptions): string;
77
+
78
+ /**
79
+ * `toD2(g, opts?)` — render a {@link GraphDescribeOutput} as D2 diagram text.
80
+ *
81
+ * Pure function over the describe snapshot; no Graph instance dependency.
82
+ *
83
+ * @category extra
84
+ */
85
+
86
+ type ToD2Options = {
87
+ /** Diagram direction; default `"LR"`. */
88
+ direction?: DiagramDirection;
89
+ };
90
+ declare function toD2(g: GraphDescribeOutput, opts?: ToD2Options): string;
91
+
92
+ /**
93
+ * `toJson(g, opts?)` — render a {@link GraphDescribeOutput} as deterministic
94
+ * JSON text with sorted keys.
95
+ *
96
+ * Pure function over the describe snapshot; no Graph instance dependency.
97
+ *
98
+ * @category extra
99
+ */
100
+
101
+ type ToJsonOptions = {
102
+ /** Include the Edges section (default `true`). */
103
+ includeEdges?: boolean;
104
+ /** Include the Subgraphs section (default `true`). */
105
+ includeSubgraphs?: boolean;
106
+ /** JSON indent (default `2`). */
107
+ indent?: number;
108
+ /** Optional logger hook; fires with the rendered text before return. */
109
+ logger?: (text: string) => void;
110
+ };
111
+ declare function toJson(g: GraphDescribeOutput, opts?: ToJsonOptions): string;
112
+
113
+ /**
114
+ * `toMermaid(g, opts?)` — render a {@link GraphDescribeOutput} as Mermaid
115
+ * flowchart text.
116
+ *
117
+ * Pure function over the describe snapshot; no Graph instance dependency.
118
+ * Compose with `derived` for live formatted output:
119
+ *
120
+ * ```ts
121
+ * import { toMermaid } from "@graphrefly/graphrefly/extra/render";
122
+ * import { derived } from "@graphrefly/graphrefly";
123
+ *
124
+ * const live = derived([graph.describe({ reactive: true }).node], ([g]) => toMermaid(g));
125
+ * ```
126
+ *
127
+ * @category extra
128
+ */
129
+
130
+ type ToMermaidOptions = {
131
+ /** Diagram direction; default `"LR"`. */
132
+ direction?: DiagramDirection;
133
+ };
134
+ declare function toMermaid(g: GraphDescribeOutput, opts?: ToMermaidOptions): string;
135
+
136
+ /**
137
+ * `toMermaidUrl(g, opts?)` — encode a {@link GraphDescribeOutput} as a
138
+ * `https://mermaid.live/edit#base64:…` deep link.
139
+ *
140
+ * Round-trip with the mermaid.live editor's `/edit#base64:` share format —
141
+ * payload is `base64url(JSON({code, mermaid: {theme}, ...}))`. No network
142
+ * calls; the payload is encoded into the URL fragment.
143
+ *
144
+ * @category extra
145
+ */
146
+
147
+ type MermaidLiveTheme = "default" | "dark" | "forest" | "neutral" | "base";
148
+ type ToMermaidUrlOptions = ToMermaidOptions & {
149
+ theme?: MermaidLiveTheme;
150
+ autoSync?: boolean;
151
+ };
152
+ /**
153
+ * Encode an arbitrary mermaid source string to a `mermaid.live` deep link.
154
+ * Exported separately so callers that already rendered mermaid text can
155
+ * upgrade to a live-editor URL without re-rendering.
156
+ */
157
+ declare function mermaidLiveUrl(mermaidSrc: string, opts?: {
158
+ theme?: MermaidLiveTheme;
159
+ autoSync?: boolean;
160
+ }): string;
161
+ declare function toMermaidUrl(g: GraphDescribeOutput, opts?: ToMermaidUrlOptions): string;
162
+
163
+ /**
164
+ * `toPretty(g, opts?)` — render a {@link GraphDescribeOutput} as
165
+ * human-readable plaintext (Node list with values, plus optional Edges and
166
+ * Subgraphs sections).
167
+ *
168
+ * Pure function over the describe snapshot; no Graph instance dependency.
169
+ *
170
+ * @category extra
171
+ */
172
+
173
+ type ToPrettyOptions = {
174
+ /** Include the Edges section (default `true`). */
175
+ includeEdges?: boolean;
176
+ /** Include the Subgraphs section (default `true`). */
177
+ includeSubgraphs?: boolean;
178
+ /** Optional logger hook; fires with the rendered text before return. */
179
+ logger?: (text: string) => void;
180
+ };
181
+ declare function toPretty(g: GraphDescribeOutput, opts?: ToPrettyOptions): string;
182
+
183
+ export { type DiagramDirection, type LayoutDirection, type MermaidLiveTheme, type ToAsciiOptions, type ToD2Options, type ToJsonOptions, type ToMermaidOptions, type ToMermaidUrlOptions, type ToPrettyOptions, mermaidLiveUrl, toAscii, toD2, toJson, toMermaid, toMermaidUrl, toPretty };
@@ -0,0 +1,183 @@
1
+ import { b as GraphDescribeOutput } from '../../graph-BkIkog4h.js';
2
+ import '../../node-BYInONRr.js';
3
+ import '../../meta-D8OyedKp.js';
4
+ import '../storage-core.js';
5
+ import '../storage-tiers.js';
6
+
7
+ /**
8
+ * Internal helpers shared across renderers in `extra/render/`.
9
+ *
10
+ * These are pure functions over `GraphDescribeOutput` — no Graph instance
11
+ * dependency. Extracted from `src/graph/graph.ts` (the consolidated
12
+ * ex-dumpGraph / ex-toMermaid / ex-toD2 renderers) per Tier 2.1 A2.
13
+ */
14
+
15
+ /** Direction options for diagram exports. */
16
+ type DiagramDirection = "TD" | "LR" | "BT" | "RL";
17
+
18
+ /**
19
+ * Sugiyama-style layered DAG layout on an integer grid.
20
+ *
21
+ * Pipeline:
22
+ * 1. Longest-path layer assignment (sources at layer 0).
23
+ * 2. Virtual-node splitting — every edge spanning more than one layer
24
+ * becomes a chain of synthetic nodes on intermediate layers. Downstream
25
+ * passes treat real and virtual nodes identically; crossing
26
+ * minimization therefore works on wide + deep DAGs, not only
27
+ * adjacent-layer cases.
28
+ * 3. Crossing minimization — barycenter heuristic with alternating up /
29
+ * down sweeps plus an adjacent-transposition polish pass.
30
+ * 4. Coordinate assignment — greedy median-aligned packing with collision
31
+ * resolution. Straightens vertical runs of virtual nodes so long edges
32
+ * become straight lines where topology allows.
33
+ * 5. Orthogonal edge routing — per-gutter x-track assignment; horizontal
34
+ * segments sit at endpoint centerlines, vertical segments pack into the
35
+ * gutter column range without overlap. Remaining crossings are
36
+ * topologically unavoidable and will render as `┼` at draw time.
37
+ *
38
+ * Output coordinates are cell-grid integers (LR direction). TD rendering
39
+ * swaps axes at draw time — the layout is direction-agnostic by
40
+ * construction.
41
+ *
42
+ * Used only by [to-ascii.ts](./to-ascii.ts); not part of the public
43
+ * `extra/render/index.ts` surface (underscore-prefixed).
44
+ */
45
+ type LayoutDirection = "LR" | "TD";
46
+
47
+ /**
48
+ * `toAscii(g, opts?)` — stdout-native DAG flowchart renderer for a
49
+ * {@link GraphDescribeOutput}.
50
+ *
51
+ * Zero external dependencies, graph-size independent via proper Sugiyama
52
+ * (layer assignment → virtual-node splitting → barycenter crossing
53
+ * minimization → median-aligned coordinate assignment → per-gutter
54
+ * track-assigned orthogonal routing). See
55
+ * [_layout-sugiyama.ts](./_layout-sugiyama.ts) for the layout pipeline and
56
+ * [_ascii-grid.ts](./_ascii-grid.ts) for the character blitter.
57
+ *
58
+ * Pure function over the describe snapshot; no Graph instance dependency.
59
+ *
60
+ * @category extra
61
+ */
62
+
63
+ type ToAsciiOptions = {
64
+ /**
65
+ * ASCII layout direction. ASCII grid semantics are meaningful only for
66
+ * `"LR"` (default) and `"TD"`.
67
+ */
68
+ direction?: LayoutDirection;
69
+ /** Per-box label cell cap; longer labels are truncated with `…`. Default `24`. */
70
+ maxLabelWidth?: number;
71
+ /** Glyph set: `"unicode"` (default, box-drawing) or `"ascii"` (`-|+<>v`). */
72
+ asciiCharset?: "unicode" | "ascii";
73
+ /** Optional logger hook; fires with the rendered text before return. */
74
+ logger?: (text: string) => void;
75
+ };
76
+ declare function toAscii(g: GraphDescribeOutput, opts?: ToAsciiOptions): string;
77
+
78
+ /**
79
+ * `toD2(g, opts?)` — render a {@link GraphDescribeOutput} as D2 diagram text.
80
+ *
81
+ * Pure function over the describe snapshot; no Graph instance dependency.
82
+ *
83
+ * @category extra
84
+ */
85
+
86
+ type ToD2Options = {
87
+ /** Diagram direction; default `"LR"`. */
88
+ direction?: DiagramDirection;
89
+ };
90
+ declare function toD2(g: GraphDescribeOutput, opts?: ToD2Options): string;
91
+
92
+ /**
93
+ * `toJson(g, opts?)` — render a {@link GraphDescribeOutput} as deterministic
94
+ * JSON text with sorted keys.
95
+ *
96
+ * Pure function over the describe snapshot; no Graph instance dependency.
97
+ *
98
+ * @category extra
99
+ */
100
+
101
+ type ToJsonOptions = {
102
+ /** Include the Edges section (default `true`). */
103
+ includeEdges?: boolean;
104
+ /** Include the Subgraphs section (default `true`). */
105
+ includeSubgraphs?: boolean;
106
+ /** JSON indent (default `2`). */
107
+ indent?: number;
108
+ /** Optional logger hook; fires with the rendered text before return. */
109
+ logger?: (text: string) => void;
110
+ };
111
+ declare function toJson(g: GraphDescribeOutput, opts?: ToJsonOptions): string;
112
+
113
+ /**
114
+ * `toMermaid(g, opts?)` — render a {@link GraphDescribeOutput} as Mermaid
115
+ * flowchart text.
116
+ *
117
+ * Pure function over the describe snapshot; no Graph instance dependency.
118
+ * Compose with `derived` for live formatted output:
119
+ *
120
+ * ```ts
121
+ * import { toMermaid } from "@graphrefly/graphrefly/extra/render";
122
+ * import { derived } from "@graphrefly/graphrefly";
123
+ *
124
+ * const live = derived([graph.describe({ reactive: true }).node], ([g]) => toMermaid(g));
125
+ * ```
126
+ *
127
+ * @category extra
128
+ */
129
+
130
+ type ToMermaidOptions = {
131
+ /** Diagram direction; default `"LR"`. */
132
+ direction?: DiagramDirection;
133
+ };
134
+ declare function toMermaid(g: GraphDescribeOutput, opts?: ToMermaidOptions): string;
135
+
136
+ /**
137
+ * `toMermaidUrl(g, opts?)` — encode a {@link GraphDescribeOutput} as a
138
+ * `https://mermaid.live/edit#base64:…` deep link.
139
+ *
140
+ * Round-trip with the mermaid.live editor's `/edit#base64:` share format —
141
+ * payload is `base64url(JSON({code, mermaid: {theme}, ...}))`. No network
142
+ * calls; the payload is encoded into the URL fragment.
143
+ *
144
+ * @category extra
145
+ */
146
+
147
+ type MermaidLiveTheme = "default" | "dark" | "forest" | "neutral" | "base";
148
+ type ToMermaidUrlOptions = ToMermaidOptions & {
149
+ theme?: MermaidLiveTheme;
150
+ autoSync?: boolean;
151
+ };
152
+ /**
153
+ * Encode an arbitrary mermaid source string to a `mermaid.live` deep link.
154
+ * Exported separately so callers that already rendered mermaid text can
155
+ * upgrade to a live-editor URL without re-rendering.
156
+ */
157
+ declare function mermaidLiveUrl(mermaidSrc: string, opts?: {
158
+ theme?: MermaidLiveTheme;
159
+ autoSync?: boolean;
160
+ }): string;
161
+ declare function toMermaidUrl(g: GraphDescribeOutput, opts?: ToMermaidUrlOptions): string;
162
+
163
+ /**
164
+ * `toPretty(g, opts?)` — render a {@link GraphDescribeOutput} as
165
+ * human-readable plaintext (Node list with values, plus optional Edges and
166
+ * Subgraphs sections).
167
+ *
168
+ * Pure function over the describe snapshot; no Graph instance dependency.
169
+ *
170
+ * @category extra
171
+ */
172
+
173
+ type ToPrettyOptions = {
174
+ /** Include the Edges section (default `true`). */
175
+ includeEdges?: boolean;
176
+ /** Include the Subgraphs section (default `true`). */
177
+ includeSubgraphs?: boolean;
178
+ /** Optional logger hook; fires with the rendered text before return. */
179
+ logger?: (text: string) => void;
180
+ };
181
+ declare function toPretty(g: GraphDescribeOutput, opts?: ToPrettyOptions): string;
182
+
183
+ export { type DiagramDirection, type LayoutDirection, type MermaidLiveTheme, type ToAsciiOptions, type ToD2Options, type ToJsonOptions, type ToMermaidOptions, type ToMermaidUrlOptions, type ToPrettyOptions, mermaidLiveUrl, toAscii, toD2, toJson, toMermaid, toMermaidUrl, toPretty };
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g}from"../../chunk-3G5U5QNE.js";import"../../chunk-C72GO4IZ.js";import"../../chunk-QYADASLV.js";export{e as mermaidLiveUrl,a as toAscii,b as toD2,c as toJson,d as toMermaid,f as toMermaidUrl,g as toPretty};
@@ -1 +1 @@
1
- "use strict";var xe=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var It=Object.prototype.hasOwnProperty;var E=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ne=(t,e)=>{for(var n in e)xe(t,n,{get:e[n],enumerable:!0})},Ft=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Dt(e))!It.call(t,o)&&o!==n&&xe(t,o,{get:()=>e[o],enumerable:!(r=Ct(e,o))||r.enumerable});return t};var Lt=t=>Ft(xe({},"__esModule",{value:!0}),t);function U(){return Math.trunc(performance.now()*1e6)}function ie(){return Date.now()*1e6}var ae=E(()=>{"use strict"});var D,b,T,w,I,F,Z,A,y,p,W,ke,Pt,Ee,Bt,Gt,Se,We,$e,je,Ae,Q=E(()=>{"use strict";D=Symbol.for("graphrefly/START"),b=Symbol.for("graphrefly/DATA"),T=Symbol.for("graphrefly/DIRTY"),w=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),F=Symbol.for("graphrefly/PAUSE"),Z=Symbol.for("graphrefly/RESUME"),A=Symbol.for("graphrefly/TEARDOWN"),y=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),W=Object.freeze([T]),ke=Object.freeze([w]),Pt=Object.freeze([I]),Ee=Object.freeze([D]),Bt=Object.freeze([y]),Gt=Object.freeze([A]),Se=Object.freeze([W]),We=Object.freeze([ke]),$e=Object.freeze([Pt]),je=Object.freeze([Bt]),Ae=Object.freeze([Gt])});function ze(t){t.registerCodec(Vt)}var Vt,Ke=E(()=>{"use strict";Vt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function ue(t){if(t==null)return Ht;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Ht,qe=E(()=>{"use strict";Ht={type:"system",id:""}});function Ye(){return $>0||ee}function Je(){return $>0}function Xe(t){$>0?te.push(t):t()}function Oe(t){$+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if($-=1,$===0)if(e){if(!ee){let n=te.splice(0);for(let r of n)try{r()}catch{}L.length=0,P.length=0,j.length=0}}else Ut()}}function Ut(){let t=!ee;t&&(ee=!0);let e=[],n=0;try{for(;L.length>0||P.length>0||j.length>0||t&&te.length>0;){if(t&&te.length>0){let i=te.splice(0);for(let s of i)try{s()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw L.length=0,P.length=0,j.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(L.length>0?L:P.length>0?P:j).splice(0);for(let i of o)try{i()}catch(s){e.push(s)}}}finally{t&&(ee=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function ce(t,e,n){if(e.length===0)return;if(e.length===1){let c=n(e[0][0]);if(c<3||!Ye()){t(e);return}(c>=5?j:c===4?P:L).push(()=>t(e));return}let r=e.length,o=r,i=r,s=r,a=0;for(;a<r&&n(e[a][0])<3;)a++;for(o=a;a<r&&n(e[a][0])===3;)a++;for(i=a;a<r&&n(e[a][0])===4;)a++;s=a;let u=Ye();if(o>0){let c=e.slice(0,o);t(c)}if(i>o){let c=e.slice(o,i);u?L.push(()=>t(c)):t(c)}if(s>i){let c=e.slice(i,s);u?P.push(()=>t(c)):t(c)}if(r>s){let c=e.slice(s,r);u?j.push(()=>t(c)):t(c)}}var $,ee,L,P,j,te,Re=E(()=>{"use strict";$=0,ee=!1,L=[],P=[],j=[],te=[]});function Ze(t){t.registerMessageType(D,{tier:0,wireCrossing:!1}),t.registerMessageType(T,{tier:1,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(F,{tier:2,wireCrossing:!1}),t.registerMessageType(Z,{tier:2,wireCrossing:!1}),t.registerMessageType(b,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:3,wireCrossing:!0}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(A,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var de,Qe=E(()=>{"use strict";Q();de=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var z,et=E(()=>{"use strict";z=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function Me(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Me);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Me(t[n]);return e}return null}function jt(t){let e=$t.encode(t),n=e.length,r=n*8,o=n+9+63&-64,i=new Uint8Array(o);i.set(e),i[n]=128;let s=new DataView(i.buffer);s.setUint32(o-4,r>>>0,!1),s.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,u=3144134277,c=1013904242,d=2773480762,l=1359893119,f=2600822924,h=528734635,v=1541459225,_=new Uint32Array(64),g=(x,O)=>x>>>O|x<<32-O;for(let x=0;x<o;x+=64){for(let k=0;k<16;k++)_[k]=s.getUint32(x+k*4,!1);for(let k=16;k<64;k++){let J=_[k-15],X=_[k-2],se=g(J,7)^g(J,18)^J>>>3,Te=g(X,17)^g(X,19)^X>>>10;_[k]=_[k-16]+se+_[k-7]+Te>>>0}let O=a,q=u,Y=c,we=d,M=l,re=f,oe=h,ve=v;for(let k=0;k<64;k++){let J=g(M,6)^g(M,11)^g(M,25),X=M&re^~M&oe,se=ve+J+X+Wt[k]+_[k]>>>0,Te=g(O,2)^g(O,13)^g(O,22),Rt=O&q^O&Y^q&Y,Mt=Te+Rt>>>0;ve=oe,oe=re,re=M,M=we+se>>>0,we=Y,Y=q,q=O,O=se+Mt>>>0}a=a+O>>>0,u=u+q>>>0,c=c+Y>>>0,d=d+we>>>0,l=l+M>>>0,f=f+re>>>0,h=h+oe>>>0,v=v+ve>>>0}let m=x=>x.toString(16).padStart(8,"0");return m(a)+m(u)+m(c)+m(d)+m(l)+m(f)+m(h)+m(v)}function Ce(t){let e=Me(t??null),n=JSON.stringify(e);return jt(n).slice(0,16)}function zt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function De(t,e,n){let r=n?.id??zt();if(t===0)return{id:r,version:0};let i=(n?.hash??Ce)(e);return{id:r,version:0,cid:i,prev:null}}function tt(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var Wt,$t,nt=E(()=>{"use strict";Wt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),$t=new TextEncoder});function st(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ie(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function le(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function R(t,e,n){let r=it(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return it(t)?i=(Fe(e)?e:n)??{}:Fe(t)?i=t:i=(Fe(e)?e:n)??{},new fe(r,o,i)}var rt,ot,Kt,qt,Le,fe,it,Fe,pe=E(()=>{"use strict";Ke();qe();Re();ae();Qe();et();Q();nt();rt=()=>{},ot=100;Kt=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},qt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let i=o._cached,s=i===void 0?[Ee]:[Ee,[b,i]];o._status==="dirty"&&s.push(W),ce(e,s,o._config.tierOf)},Le=new de({onMessage:Kt,onSubscribe:qt});Ze(Le);ze(Le);fe=class t{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,r){this._config=r.config??Le,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Ce;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?De(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(st);let i={};for(let[a,u]of Object.entries(r.meta??{})){let c={initial:u,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(c.guard=r.guard),i[a]=new t([],void 0,c)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let s=this;this._actions={emit(a){s._emit([[b,a]])},down(a){s._emit(le(a))},up(a){s._emitUp(le(a))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let i=this._cached===void 0?void 0:this._cached,s=this._versioning,a=s?.id??n?.id,u=s?.version??0,c=De(e,i,{id:a,hash:o});c.version=u,this._versioning=c,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=ue(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=ue(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,i))throw new z({actor:o,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(o,i))throw new z({actor:o,action:i,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:ie()}}down(e,n){let r=le(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[b,e]])}up(e,n){if(this._deps.length===0)return;let r=le(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let u=ue(n);if(!this._guard(u,"observe"))throw new z({actor:u,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)Ie(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let r=0;r<e;r++){let o=r,i=this._deps[r];i.unsub=rt,i.unsub=i.node.subscribe(s=>{if(i.unsub===null)return;let a=this._config.tierOf,u=!1;for(let c of s)a(c[0])>=3&&(u=!0),this._config.onMessage(this,c,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let i=this._deps[o];if(i.unsub!=null){let s=i.unsub;i.unsub=null;try{s()}catch{}Ie(i)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=st(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se),r.unsub=rt;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let i=this._config.tierOf,s=!1;for(let a of o)i(a[0])>=3&&(s=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}Ie(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(i)}if(o!==D){if(o===T){this._depDirtied(r);return}if(o===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit($e);return}if(o===F||o===Z){this._emit([n]);return}if(o===A){this._emit(Ae);return}if(o===b)this._depSettledAsData(r,n[1]);else if(o===w)this._depSettledAsResolved(r);else if(o===y)this._depSettledAsTerminal(r,!0);else if(o===p)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===b||o===w)&&this._emit([n]),(o===y||o===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(We),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(je)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(s){this._emit([[p,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(a){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),r=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let a=n[s];a!=null&&a.length>0&&(this._deps[s].prevData=a[a.length-1])}let o=this._deps.map(s=>s.terminal),i={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:r};for(let a of this._inspectorHooks)a(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,i);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let a=s;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[p,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>ot?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${ot} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[W,e[0]]:e;let r=!0,o=!1,i=!1,s=-1;for(let u of e){let c=n(u[0]);c<s&&(r=!1),c===3&&(o=!0),u[0]===T&&(i=!0),s=c}let a=e;if(!r){let u=e.map((c,d)=>({m:c,i:d,tier:n(c[0])}));u.sort((c,d)=>c.tier-d.tier||c.i-d.i),a=u.map(c=>c.m)}if(o&&!i&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[W,...a]:[...a.slice(0,u),W,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===p&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===A||u[0]===I);if(a.length===0)return;n=a}n=this._frameBatch(n);let o=null;for(let a=0;a<n.length;a++){let u=n[a],c=u[0];if(c!==F&&c!==Z){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${c===F?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let d=!0;if(this._pausable!==!1){let l=u[1];if(c===F)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))d=!1;else if(this._pauseLocks.delete(l),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let f=this._pauseBuffer;this._pauseBuffer=[],this._emit(f)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}d?o?.push(u):o==null&&(o=n.slice(0,a))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(a=>a[0]===A))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Ae)}catch{}let{finalMessages:i,equalsError:s}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let c of i)a(c[0])===3?this._pauseBuffer.push(c):u.push(c);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(i);s!=null&&this._emit([[p,s]])}_updateState(e){let n=this._config.tierOf,r,o,i=-1,s=0;for(let d of e)n(d[0])===3&&s++;let a=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let d=e.length-1;d>=0;d--)if(e[d][0]===b){u=d;break}}for(let d=0;d<e.length;d++){let l=e[d],f=l[0];if(f===b){if(l.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,l[1])}catch(v){o=this._wrapFnError("equals threw",v),i=d;break}if(h){r==null&&(r=e.slice(0,d)),r.push(ke),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||d===u)&&tt(this._versioning,l[1],this._hashFn)}this._status="settled",r?.push(l)}else if(r?.push(l),f===T)this._status="dirty";else if(f===w)this._status="resolved";else if(f===y){this._status="completed";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===p){this._status="errored";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===I){if(this._cached!==void 0){let v=this._config.rigorRecorder;if(v!=null)try{v.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let h=this._cleanup;if(typeof h=="function"){this._cleanup=void 0;try{h()}catch{}}else if(h!=null&&typeof h=="object"){let v=h.invalidate;if(typeof v=="function")try{v()}catch{}}}else f===A&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let c=i>=0?r??e.slice(0,i):r??e;return o!=null?{finalMessages:c,equalsError:o}:{finalMessages:c}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if(Je()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Xe(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}ce(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);ce(this._deliverToSinks,n,this._config.tierOf)}},it=t=>Array.isArray(t),Fe=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function at(t,e){return R([],{...e,initial:t})}function N(t,e){return R((r,o,i)=>t(o,i)??void 0,{describeKind:"producer",...e})}var Pe=E(()=>{"use strict";pe()});function ne(t,e,n){let r=new Set;for(let o of t.split(",")){let[i,s]=o.split("/"),a=s?Number.parseInt(s,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let u,c;if(i==="*")u=e,c=n;else if(i.includes("-")){let[d,l]=i.split("-");u=Number.parseInt(d,10),c=Number.parseInt(l,10)}else u=Number.parseInt(i,10),c=u;if(Number.isNaN(u)||Number.isNaN(c))throw new Error(`Invalid cron field: ${t}`);if(u<e||c>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(u>c)throw new Error(`Invalid cron range: ${u}-${c} in ${t}`);for(let d=u;d<=c;d+=a)r.add(d)}return r}function ut(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:ne(e[0],0,59),hours:ne(e[1],0,23),daysOfMonth:ne(e[2],1,31),months:ne(e[3],1,12),daysOfWeek:ne(e[4],0,6)}}function ct(t,e){return t.minutes.has(e.getMinutes())&&t.hours.has(e.getHours())&&t.daysOfMonth.has(e.getDate())&&t.months.has(e.getMonth()+1)&&t.daysOfWeek.has(e.getDay())}var dt=E(()=>{"use strict"});function C(t,e){let n={factory:t};return e!==void 0&&(n.factoryArgs=e),n}var lt=E(()=>{"use strict"});var bt={};Ne(bt,{NS_PER_MS:()=>G,NS_PER_SEC:()=>K,constant:()=>ft,decorrelatedJitter:()=>gt,exponential:()=>ht,fibonacci:()=>mt,linear:()=>pt,resolveBackoffPreset:()=>he,withMaxAttempts:()=>Xt});function B(t){return t<0?0:t}function Yt(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function Jt(t,e){return t+Math.random()*(e-t)}function ft(t){let e=B(t);return()=>e}function pt(t,e){let n=B(t),r=e===void 0?n:B(e);return o=>n+r*Math.max(0,o)}function ht(t){let e=B(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,r=B(t?.maxDelayNs??30*1e9),o=t?.jitter??"none";return i=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let a=r/e,u=1;for(let c=0;c<Math.max(0,i);c++){if(u>=a){u=a;break}u*=n}s=e*u,s>r&&(s=r)}return Yt(s,o)}}function mt(t=100*1e6,e=30*1e9){let n=B(t),r=B(e);function o(i){if(i<=0)return 1;let s=1,a=2;for(let u=1;u<i;u++){let c=s+a;s=a,a=c}return a}return i=>{let s=o(i)*n;return s<=r?s:r}}function gt(t=100*1e6,e=30*1e9){return(n,r,o)=>{let s=Math.min(e,(o??t)*3);return Jt(t,s)}}function Xt(t,e){return(n,r,o)=>n>=e?null:t(n,r,o)}function he(t){if(t==="constant")return ft(1*1e9);if(t==="linear")return pt(1*1e9);if(t==="exponential")return ht();if(t==="fibonacci")return mt();if(t==="decorrelatedJitter")return gt();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var G,K,Be=E(()=>{"use strict";G=1e6,K=1e9});var V,yt=E(()=>{"use strict";V=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var Tt={};Ne(Tt,{CircuitOpenError:()=>me,RateLimiterOverflowError:()=>ge,TimeoutError:()=>be,circuitBreaker:()=>nn,fallback:()=>dn,rateLimiter:()=>on,retry:()=>Qt,timeout:()=>ln,tokenBucket:()=>vt,withBreaker:()=>rn,withStatus:()=>sn});function H(t){return{describeKind:"derived",...t}}function Zt(t){return t<0?0:t}function ye(t){return t[1]}function _t(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function Qt(t,e){return typeof t=="function"?tn(t,e):en(t,e)}function wt(t){let e={};return t?.count!==void 0&&(e.count=t.count),typeof t?.backoff=="string"&&(e.backoff=t.backoff),Object.keys(e).length>0?e:void 0}function en(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?he(r):r;return N(s=>{let a=0,u=!1,c=null,d,l=new V;function f(){d?.(),d=void 0}function h(_){if(u)return;if(a>=o){f(),s.down([[p,_]]);return}let g=i===null?0:i(a,_,c);if(g==null){f(),s.down([[p,_]]);return}let m;try{m=_t(g)}catch{f(),s.down([[p,_]]);return}c=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||v()})}function v(){l.cancel(),f(),d=t.subscribe(_=>{if(!u)for(let g of _){let m=g[0];if(m===T)s.down([[T]]);else if(m===b)a=0,c=null,s.emit(g[1]);else if(m===w)s.down([[w]]);else if(m===y)f(),s.down([[y]]);else if(m===p){h(ye(g));return}else s.down([g])}})}return v(),()=>{u=!0,l.cancel(),f()}},{...H(),initial:t.cache,meta:{...C("retry",wt(e))}})}function tn(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?he(r):r;return N(s=>{let a=0,u=!1,c=null,d,l=new V;function f(){d?.(),d=void 0}function h(_){if(u)return;if(a>=o){f(),s.down([[p,_]]);return}let g=i===null?0:i(a,_,c);if(g==null){f(),s.down([[p,_]]);return}let m;try{m=_t(g)}catch{f(),s.down([[p,_]]);return}c=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||v()})}function v(){l.cancel(),f();let _;try{_=t()}catch(g){h(g);return}d=_.subscribe(g=>{if(!u)for(let m of g){let x=m[0];if(x===T)s.down([[T]]);else if(x===b)a=0,c=null,s.emit(m[1]);else if(x===w)s.down([[w]]);else if(x===y)f(),s.down([[y]]);else if(x===p){h(ye(m));return}else s.down([m])}})}return v(),()=>{u=!0,l.cancel(),f()}},{...H(),initial:e?.initial,meta:{...C("retry",wt(e))}})}function nn(t){let e=Math.max(1,t?.failureThreshold??5),n=Zt(t?.cooldownNs??30*1e9),r=t?.cooldown??null,o=Math.max(1,t?.halfOpenMax??1),i=t?.now??U,s="closed",a=0,u=0,c=0,d=n,l=0;function f(){if(!r)return n;let _=r(u);return _!==null?_:n}function h(){s="open",d=f(),c=i(),l=0}return{canExecute(){return s==="closed"?!0:s==="open"?i()-c>=d?(s="half-open",l=1,!0):!1:l<o?(l++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",a=0,u=0):s==="closed"&&(a=0)},recordFailure(_){if(s==="half-open"){u++,h();return}s==="closed"&&(a++,a>=e&&h())},get state(){return s},get failureCount(){return a},reset(){s="closed",a=0,u=0,l=0}}}function rn(t,e){let n=e?.onOpen??"skip";return r=>{let o=R([],(i,s)=>{function a(){o.meta.breakerState.down([[b,t.state]])}let u=r.subscribe(c=>{for(let d of c){let l=d[0];l===T?s.down([[T]]):l===b?t.canExecute()?(a(),s.emit(d[1])):(a(),n==="error"?s.down([[p,new me]]):s.down([[w]])):l===w?s.down([[w]]):l===y?(t.recordSuccess(),a(),s.down([[y]])):l===p?(t.recordFailure(ye(d)),a(),s.down([d])):s.down([d])}});return a(),u},{...H(),meta:{breakerState:t.state,...C("withBreaker",{onOpen:n})},completeWhenDepsComplete:!1,initial:r.cache});return{node:o,breakerState:o.meta.breakerState}}}function vt(t,e){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let n=t,r=U();function o(i){if(e>0){let s=i-r;n=Math.min(t,n+s/1e9*e)}r=i}return{available(){return o(U()),n},tryConsume(i=1){if(i<=0)return!0;let s=U();return o(s),n>=i?(n-=i,!0):!1},putBack(i=1){i<=0||(o(U()),n=Math.min(t,n+i))}}}function on(t,e){let{maxEvents:n,windowNs:r}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o!==void 0&&o<1)throw new RangeError("maxBuffer must be >= 1");let i=e.onOverflow??"drop-newest",s=n*1e9/r;return N(a=>{let u=vt(n,s),c=[],d=new V,l=!1,f=1e9/s;function h(){for(;c.length>0;)if(u.tryConsume(1))a.emit(c.shift());else{d.start(Math.max(1,f/1e6),h);return}}let v=t.subscribe(_=>{for(let g of _){if(l)return;let m=g[0];if(m===T)a.down([[T]]);else if(m===b){if(o!==void 0&&c.length>=o){if(i!=="drop-newest")if(i==="drop-oldest")c.shift(),c.push(g[1]);else{l=!0,d.cancel(),c.length=0,a.down([[p,new ge(o)]]);return}}else c.push(g[1]);h()}else if(m===w)a.down([[w]]);else if(m===y)l=!0,d.cancel(),c.length=0,a.down([[y]]);else if(m===p)l=!0,d.cancel(),c.length=0,a.down([g]);else if(m===A){l=!0,d.cancel(),c.length=0,a.down([g]);return}else a.down([g])}});return()=>{l=!0,d.cancel(),v()}},{...H(),initial:t.cache,meta:{...C("rateLimiter",e)}})}function sn(t,e){let n=e?.initialStatus??"pending",r=R([],(o,i)=>{let s=n;return r.meta.status.down([[b,n]]),r.meta.error.down([[b,null]]),t.subscribe(u=>{for(let c of u){let d=c[0];if(d===T)i.down([[T]]);else if(d===b)s==="errored"?Oe(()=>{r.meta.error.down([[b,null]]),r.meta.status.down([[b,"active"]])}):r.meta.status.down([[b,"active"]]),s="active",i.emit(c[1]);else if(d===w)i.down([[w]]);else if(d===y)r.meta.status.down([[b,"completed"]]),s="completed",i.down([[y]]);else if(d===p){let l=ye(c);Oe(()=>{r.meta.error.down([[b,l]]),r.meta.status.down([[b,"errored"]])}),s="errored",i.down([c])}else i.down([c])}})},{...H(),meta:{status:n,error:null,...C("withStatus",{initialStatus:n})},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function an(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function un(t){return t!=null&&typeof t.then=="function"}function cn(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function dn(t,e){return N(n=>{let r,o;function i(){o?.(),o=void 0,an(e)||un(e)||cn(e)?r=_e(e).subscribe(a=>{n.down(a)}):(n.emit(e),n.down([[y]]))}return o=t.subscribe(s=>{for(let a of s){let u=a[0];if(u===T)n.down([[T]]);else if(u===b)n.emit(a[1]);else if(u===w)n.down([[w]]);else if(u===y)n.down([[y]]);else if(u===p){i();return}else if(u===A){r?.(),n.down([a]);return}else n.down([a])}}),()=>{o?.(),r?.()}},{...H(),initial:t.cache,meta:{...C("fallback")}})}function ln(t,e){if(e<=0)throw new RangeError("timeoutNs must be > 0");return N(n=>{let r=!1,o=new V;function i(){let a=e/1e6;o.start(a,()=>{r||(r=!0,s(),n.down([[p,new be(e)]]))})}let s=t.subscribe(a=>{for(let u of a){if(r)return;let c=u[0];if(c===T)n.down([[T]]);else if(c===b)i(),n.emit(u[1]);else if(c===w)n.down([[w]]);else if(c===y){o.cancel(),r=!0,n.down([[y]]);return}else if(c===p){o.cancel(),r=!0,n.down([u]);return}else if(c===A){o.cancel(),r=!0,n.down([u]);return}else n.down([u])}});return i(),()=>{r=!0,o.cancel(),s()}},{...H(),initial:t.cache,meta:{...C("timeout",{timeoutNs:e})}})}var me,ge,be,xt=E(()=>{"use strict";Re();ae();Q();lt();pe();Pe();Be();Nt();yt();me=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};ge=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};be=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Fn={};Ne(Fn,{awaitSettled:()=>Rn,cached:()=>An,defer:()=>Nn,empty:()=>vn,escapeRegexChar:()=>Et,firstValueFrom:()=>On,firstWhere:()=>Ve,forEach:()=>kn,fromAny:()=>_e,fromAsyncIter:()=>At,fromCron:()=>bn,fromEvent:()=>yn,fromIter:()=>He,fromPromise:()=>St,fromRaf:()=>gn,fromTimer:()=>mn,globToRegExp:()=>fn,keepalive:()=>Dn,matchesAnyPattern:()=>pn,never:()=>Tn,nodeSignal:()=>Mn,of:()=>Ot,reactiveCounter:()=>In,replay:()=>Ue,share:()=>Sn,shareReplay:()=>Cn,throwError:()=>xn,toArray:()=>En});module.exports=Lt(Fn);function S(t){return{describeKind:"producer",...t}}function Et(t){return/[\\^$+?.()|[\]{}]/.test(t)?`\\${t}`:t}function fn(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){t[n+1]==="*"?(e+=".*",n+=1):e+="[^/]*";continue}e+=Et(r)}return e+="$",new RegExp(e)}function pn(t,e){for(let n of e)if(n.test(t))return!0;return!1}function hn(t,e){let n=R([t],(o,i)=>{let s=o[0];if(s==null||s.length===0){i.down([[w]]);return}for(let a of s)i.emit(a)},{describeKind:"derived",initial:t.cache}),r=n.subscribe.bind(n);return n.subscribe=(o,i)=>(e(o),r(o,i)),n}function mn(t,e){let{signal:n,period:r,...o}=e??{};return N(i=>{let s=!1,a=0,u,c,d=()=>{s=!0,u!==void 0&&clearTimeout(u),c!==void 0&&clearInterval(c),n?.removeEventListener("abort",f)},l=()=>{s||(r!=null?(i.emit(a++),c=setInterval(()=>{s||i.emit(a++)},r)):(s=!0,n?.removeEventListener("abort",f),i.emit(a++),i.down([[y]])))},f=()=>{s||(d(),i.down([[p,n.reason]]))};if(n?.aborted){f();return}return u=setTimeout(l,t),n?.addEventListener("abort",f,{once:!0}),d},S(o))}function gn(t){let{signal:e,...n}=t??{};return N(r=>{let o=!1,i,s,a=!1,u=!1,c=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,d=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,f=()=>{i!==void 0&&d&&d(i),s!==void 0&&clearTimeout(s),i=void 0,s=void 0},h=()=>{o=!0,f(),a&&(e?.removeEventListener("abort",v),a=!1),u&&l&&(l.removeEventListener("visibilitychange",m),u=!1)},v=()=>{o||(h(),r.down([[p,e.reason]]))},_=x=>{o||(r.emit(x),g())},g=()=>{o||(c&&(!l||l.visibilityState!=="hidden")?i=c(_):s=setTimeout(()=>_(performance.now()),16))},m=()=>{o||(f(),g())};return e?.aborted?(v(),h):(e?.addEventListener("abort",v,{once:!0}),a=e!==void 0,l&&c&&(l.addEventListener("visibilitychange",m),u=!0),g(),h)},S(n))}function bn(t,e){let n=ut(t),{tickMs:r,output:o,...i}=e??{},s=r??6e4,a=o==="date";return N(u=>{let c=-1,d=()=>{let f=new Date,h=f.getFullYear()*1e8+(f.getMonth()+1)*1e6+f.getDate()*1e4+f.getHours()*100+f.getMinutes();h!==c&&ct(n,f)&&(c=h,u.emit(a?f:ie()))};d();let l=setInterval(d,s);return()=>clearInterval(l)},{...S(i),name:i.name??`cron:${t}`})}function yn(t,e,n){let{capture:r,passive:o,once:i,...s}=n??{};return N(a=>{let u=d=>{a.emit(d)},c={capture:r,passive:o,once:i};return t.addEventListener(e,u,c),()=>t.removeEventListener(e,u,c)},S(s))}function He(t,e){return N(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[y]])}catch(o){r||n.down([[p,o]])}return()=>{r=!0}},S(e))}function _n(t){return t!=null&&typeof t.then=="function"}function St(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=!1,s=()=>{i||(i=!0,o.down([[p,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(a=>{i||(i=!0,n?.removeEventListener("abort",s),o.emit(a),o.down([[y]]))},a=>{i||(i=!0,n?.removeEventListener("abort",s),o.down([[p,a]]))}),()=>{i=!0,n?.removeEventListener("abort",s)}},S(r))}function At(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=new AbortController,s=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let a=n??i.signal,u=!1,c=t[Symbol.asyncIterator](),d=()=>{u||a.aborted||Promise.resolve(c.next()).then(l=>{if(!(u||a.aborted)){if(l.done){o.down([[y]]);return}o.emit(l.value),d()}},l=>{!u&&!a.aborted&&o.down([[p,l]])})};return d(),()=>{u=!0,n?.removeEventListener("abort",s),i.abort(),Promise.resolve(c.return?.()).catch(()=>{})}},S(r))}function wn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function _e(t,e){if(wn(t))return t;if(_n(t))return St(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return At(t,e);if(typeof n[Symbol.iterator]=="function")return He(t,e)}return Ot(t)}function Ot(...t){return He(t,void 0)}function vn(t){return N(e=>{e.down([[y]])},S(t))}function Tn(t){return N(()=>{},S(t))}function xn(t,e){return N(n=>{n.down([[p,t]])},S(e))}function Nn(t,e){let{signal:n,...r}=e??{},o=S(r),i=o.resubscribable===void 0?{...o,resubscribable:!0}:o;return N(s=>{let a,u=!1;try{let c=t();a=_e(c,e).subscribe(l=>{if(!u)for(let f of l){let h=f[0];if(h!==D)if(h===b)s.emit(f[1]);else if(h===y){u=!0,s.down([[y]]);break}else if(h===p){u=!0,s.down([[p,f[1]]]);break}else s.down([f])}})}catch(c){let d=c===void 0?new Error("defer: thunk threw undefined"):c;s.down([[p,d]])}return()=>{u=!0,a?.()}},i)}function kn(t,e,n){return R([t],(o,i)=>{let s=o[0];if(s!=null&&s.length>0)for(let a of s)e(a)},{describeKind:"effect",...n}).subscribe(()=>{})}function En(t,e){return R([t],(n,r,o)=>{o.store.buf||(o.store.buf=[]);let i=o.store.buf,s=n[0];if(s!=null&&s.length>0)for(let a of s)i.push(a);if(o.terminalDeps[0]===!0){r.emit([...i]),r.down([[y]]);return}(s==null||s.length===0)&&r.down([[w]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function Sn(t,e){return N(n=>t.subscribe(r=>{n.down(r)}),{...S(e),initial:t.cache})}function Ue(t,e,n){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let r=[],o=N(i=>t.subscribe(s=>{for(let a of s)a[0]===b&&(r.push(a[1]),r.length>e&&r.shift());i.down(s)}),{...S(n),initial:t.cache});return hn(o,i=>{for(let s of r)i([[b,s]])})}function An(t,e){return Ue(t,1,e)}function On(t){return new Promise((e,n)=>{let r=!1,o=!1,i;i=t.subscribe(s=>{for(let a of s){if(r)return;if(a[0]===b){r=!0,e(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===p){r=!0,n(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===y){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):o=!0;return}}}),o&&(i?.(),i=void 0)})}function Ve(t,e,n){return new Promise((r,o)=>{let i=!1,s=!1,a,u=n?.skipCurrent===!0;a=t.subscribe(c=>{for(let d of c){if(i)return;if(!(u&&d[0]===b)){if(d[0]===b){let l=d[1];if(e(l)){i=!0,r(l),a?(a(),a=void 0):s=!0;return}}if(d[0]===p){i=!0,o(d[1]),a?(a(),a=void 0):s=!0;return}if(d[0]===y){i=!0,o(new Error("completed without matching value")),a?(a(),a=void 0):s=!0;return}}}}),u=!1,s&&(a?.(),a=void 0)})}async function Rn(t,e){let n=e?.predicate??(i=>i!=null),r=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Ve(t,n,{skipCurrent:r});if(Ge===void 0){let[i,s]=await Promise.all([Promise.resolve().then(()=>(xt(),Tt)),Promise.resolve().then(()=>(Be(),bt))]);Ge=i.timeout,kt=s.NS_PER_MS}let o=Ge(t,e.timeoutMs*kt);return await Ve(o,n,{skipCurrent:r})}function Mn(t,e){let n=new AbortController,r=e?.reason??new Error("cancelled via nodeSignal"),o,i=!1,s=()=>{o?(o(),o=void 0):i=!0};return o=t.subscribe(a=>{if(!n.signal.aborted)for(let u of a){if(u[0]===b&&u[1]===!0){n.abort(r),s();return}if(u[0]===p){n.abort(u[1]),s();return}if(u[0]===y){s();return}}}),i&&(o?.(),o=void 0),{signal:n.signal,dispose:()=>{o&&(o(),o=void 0)}}}function Dn(t){return t.subscribe(()=>{})}function In(t){let e=at(0);return{node:e,increment(){let n=e.cache??0;return n>=t?!1:(e.down([[T],[b,n+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=t}}}var Ge,kt,Cn,Nt=E(()=>{ae();Q();pe();Pe();dt();Cn=Ue});Nt();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
1
+ "use strict";var ve=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var $t=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var xe=(t,e)=>{for(var n in e)ve(t,n,{get:e[n],enumerable:!0})},jt=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Wt(e))!$t.call(t,r)&&r!==n&&ve(t,r,{get:()=>e[r],enumerable:!(o=Ut(e,r))||o.enumerable});return t};var qt=t=>jt(ve({},"__esModule",{value:!0}),t);function Ne(){return Math.trunc(performance.now()*1e6)}function ue(){return Date.now()*1e6}var de=v(()=>{"use strict"});var H,b,T,w,z,L,G,R,y,h,q,ke,Kt,Ee,Yt,Jt,Se,je,qe,Ke,Re,K=v(()=>{"use strict";H=Symbol.for("graphrefly/START"),b=Symbol.for("graphrefly/DATA"),T=Symbol.for("graphrefly/DIRTY"),w=Symbol.for("graphrefly/RESOLVED"),z=Symbol.for("graphrefly/INVALIDATE"),L=Symbol.for("graphrefly/PAUSE"),G=Symbol.for("graphrefly/RESUME"),R=Symbol.for("graphrefly/TEARDOWN"),y=Symbol.for("graphrefly/COMPLETE"),h=Symbol.for("graphrefly/ERROR"),q=Object.freeze([T]),ke=Object.freeze([w]),Kt=Object.freeze([z]),Ee=Object.freeze([H]),Yt=Object.freeze([y]),Jt=Object.freeze([R]),Se=Object.freeze([q]),je=Object.freeze([ke]),qe=Object.freeze([Kt]),Ke=Object.freeze([Yt]),Re=Object.freeze([Jt])});function Ye(t){t.registerCodec(Xt)}var Xt,Je=v(()=>{"use strict";Xt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function ce(t){if(t==null)return Qt;let{type:e,id:n,...o}=t;return{type:e??"system",id:n??"",...o}}var Qt,Xe=v(()=>{"use strict";Qt={type:"system",id:""}});function Qe(){return Y>0||re}function Ze(){return Y>0}function et(t){Y>0?oe.push(t):t()}function Ae(t){Y+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(Y-=1,Y===0)if(e){if(!re){let n=oe.splice(0);for(let o of n)try{o()}catch{}U.length=0,W.length=0,J.length=0}}else Zt()}}function Zt(){let t=!re;t&&(re=!0);let e=[],n=0;try{for(;U.length>0||W.length>0||J.length>0||t&&oe.length>0;){if(t&&oe.length>0){let i=oe.splice(0);for(let s of i)try{s()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw U.length=0,W.length=0,J.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let r=(U.length>0?U:W.length>0?W:J).splice(0);for(let i of r)try{i()}catch(s){e.push(s)}}}finally{t&&(re=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function le(t,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!Qe()){t(e);return}(d>=5?J:d===4?W:U).push(()=>t(e));return}let o=e.length,r=o,i=o,s=o,a=0;for(;a<o&&n(e[a][0])<3;)a++;for(r=a;a<o&&n(e[a][0])===3;)a++;for(i=a;a<o&&n(e[a][0])===4;)a++;s=a;let u=Qe();if(r>0){let d=e.slice(0,r);t(d)}if(i>r){let d=e.slice(r,i);u?U.push(()=>t(d)):t(d)}if(s>i){let d=e.slice(i,s);u?W.push(()=>t(d)):t(d)}if(o>s){let d=e.slice(s,o);u?J.push(()=>t(d)):t(d)}}var Y,re,U,W,J,oe,Oe=v(()=>{"use strict";Y=0,re=!1,U=[],W=[],J=[],oe=[]});function tt(t){t.registerMessageType(H,{tier:0,wireCrossing:!1}),t.registerMessageType(T,{tier:1,wireCrossing:!1}),t.registerMessageType(z,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(L,{tier:2,wireCrossing:!1}),t.registerMessageType(G,{tier:2,wireCrossing:!1}),t.registerMessageType(b,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:3,wireCrossing:!0}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(h,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(R,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var fe,nt=v(()=>{"use strict";K();fe=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let o=this._messageTypes.get(n);return o!=null?o.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var X,rt=v(()=>{"use strict";X=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function Me(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Me);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Me(t[n]);return e}return null}function nn(t){let e=tn.encode(t),n=e.length,o=n*8,r=n+9+63&-64,i=new Uint8Array(r);i.set(e),i[n]=128;let s=new DataView(i.buffer);s.setUint32(r-4,o>>>0,!1),s.setUint32(r-8,Math.floor(o/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,l=1359893119,p=2600822924,f=528734635,g=1541459225,_=new Uint32Array(64),m=(S,k)=>S>>>k|S<<32-k;for(let S=0;S<r;S+=64){for(let E=0;E<16;E++)_[E]=s.getUint32(S+E*4,!1);for(let E=16;E<64;E++){let te=_[E-15],ne=_[E-2],ae=m(te,7)^m(te,18)^te>>>3,Te=m(ne,17)^m(ne,19)^ne>>>10;_[E]=_[E-16]+ae+_[E-7]+Te>>>0}let k=a,B=u,F=d,P=c,C=l,D=p,M=f,I=g;for(let E=0;E<64;E++){let te=m(C,6)^m(C,11)^m(C,25),ne=C&D^~C&M,ae=I+te+ne+en[E]+_[E]>>>0,Te=m(k,2)^m(k,13)^m(k,22),Ht=k&B^k&F^B&F,zt=Te+Ht>>>0;I=M,M=D,D=C,C=P+ae>>>0,P=F,F=B,B=k,k=ae+zt>>>0}a=a+k>>>0,u=u+B>>>0,d=d+F>>>0,c=c+P>>>0,l=l+C>>>0,p=p+D>>>0,f=f+M>>>0,g=g+I>>>0}let N=S=>S.toString(16).padStart(8,"0");return N(a)+N(u)+N(d)+N(c)+N(l)+N(p)+N(f)+N(g)}function Ce(t){let e=Me(t??null),n=JSON.stringify(e);return nn(n).slice(0,16)}function rn(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function De(t,e,n){let o=n?.id??rn();if(t===0)return{id:o,version:0};let i=(n?.hash??Ce)(e);return{id:o,version:0,cid:i,prev:null}}function ot(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var en,tn,st=v(()=>{"use strict";en=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),tn=new TextEncoder});function ut(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ie(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function pe(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function O(t,e,n){let o=dt(t)?t:[],r=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return dt(t)?i=(Le(e)?e:n)??{}:Le(t)?i=t:i=(Le(e)?e:n)??{},new he(o,r,i)}var it,at,on,sn,Fe,he,dt,Le,se=v(()=>{"use strict";Je();Xe();Oe();de();nt();rt();K();st();it=()=>{},at=100;on=(t,e,n,o)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},sn=(t,e,n,o)=>{let r=t;if(r._status==="completed"||r._status==="errored")return;let i=r._cached,s=i===void 0?[Ee]:[Ee,[b,i]];r._status==="dirty"&&s.push(q),le(e,s,r._config.tierOf)},Fe=new fe({onMessage:on,onSubscribe:sn});tt(Fe);Ye(Fe);he=class t{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,o){this._config=o.config??Fe,this._config.onMessage,this._optsName=o.name,this._describeKind=o.describeKind,this._equals=o.equals??Object.is,this._resubscribable=o.resubscribable??!1,this._resetOnTeardown=o.resetOnTeardown??!1,this._autoComplete=o.completeWhenDepsComplete??!0,this._autoError=o.errorWhenDepsError??!0,this._pausable=o.pausable??!0,this._guard=o.guard,this._fn=n,this._partial=o.partial??!1,this._cached=o.initial!==void 0?o.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=o.versioningHash??this._config.defaultHashFn??Ce;let r=o.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?De(r,this._cached===void 0?void 0:this._cached,{id:o.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(ut);let i={};for(let[a,u]of Object.entries(o.meta??{})){let d={initial:u,name:`${o.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};o.guard!=null&&(d.guard=o.guard),i[a]=new t([],void 0,d)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let s=this;this._actions={emit(a){s._emit([[b,a]])},down(a){s._emit(pe(a))},up(a){s._emitUp(pe(a))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let o=this._versioningLevel;if(o!=null&&e<=o)return;let r=n?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let i=this._cached===void 0?void 0:this._cached,s=this._versioning,a=s?.id??n?.id,u=s?.version??0,d=De(e,i,{id:a,hash:r});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=ce(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let o of this._extraGuards)if(!o(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,o=e?.actor!=null;if(!n&&!o)return;let r=ce(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,i))throw new X({actor:r,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(r,i))throw new X({actor:r,action:i,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:ue()}}down(e,n){let o=pe(e);o.length!==0&&(this._checkGuard(n),this._emit(o))}emit(e,n){this._checkGuard(n),this._emit([[b,e]])}up(e,n){if(this._deps.length===0)return;let o=pe(e);if(o.length===0)return;this._checkGuard(n);let r=n??{internal:!0};this._validateUpTiers(o);for(let i of this._deps)i.node.up?.(o,r)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let o of e){let r=n(o[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let u=ce(n);if(!this._guard(u,"observe"))throw new X({actor:u,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)Ie(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let o=0;o<e;o++){let r=o,i=this._deps[o];i.unsub=it,i.unsub=i.node.subscribe(s=>{if(i.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of s)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:r},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(o){this._deps[n].unsub=null;for(let r=0;r<n;r++){let i=this._deps[r];if(i.unsub!=null){let s=i.unsub;i.unsub=null;try{s()}catch{}Ie(i)}}throw this._dirtyDepCount=0,o}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let n=this._deps.length,o=ut(e);if(this._deps.push(o),this._sinks==null)return n;o.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se),o.unsub=it;try{o.unsub=e.subscribe(r=>{if(o.unsub===null)return;let i=this._config.tierOf,s=!1;for(let a of r)i(a[0])>=3&&(s=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(r){throw o.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(o){this._emit([[h,this._wrapFnError("cleanup threw",o)]])}else if(n!=null&&typeof n=="object"){let o=n.deactivate;if(typeof o=="function")try{o()}catch(r){this._emit([[h,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let o of this._deps){if(o.unsub!=null){let r=o.unsub;o.unsub=null;try{r()}catch{}}Ie(o)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let o=this._deps[e],r=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(i)}if(r!==H){if(r===T){this._depDirtied(o);return}if(r===z){if(this._depInvalidated(o),this._cached===void 0)return;this._emit(qe);return}if(r===L||r===G){this._emit([n]);return}if(r===R){this._emit(Re);return}if(r===b)this._depSettledAsData(o,n[1]);else if(r===w)this._depSettledAsResolved(o);else if(r===y)this._depSettledAsTerminal(o,!0);else if(r===h)this._depSettledAsTerminal(o,n[1]);else{this._emit([n]);return}if(!this._fn){(r===b||r===w)&&this._emit([n]),(r===y||r===h)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(je),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[h,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ke)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(s){this._emit([[h,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(a){this._emit([[h,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),o=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let a=n[s];a!=null&&a.length>0&&(this._deps[s].prevData=a[a.length-1])}let r=this._deps.map(s=>s.terminal),i={prevData:o,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:o};for(let a of this._inspectorHooks)a(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,i);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let a=s;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[h,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>at?(this._rerunDepth=0,this._emit([[h,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${at} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let o=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${o}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[q,e[0]]:e;let o=!0,r=!1,i=!1,s=-1;for(let u of e){let d=n(u[0]);d<s&&(o=!1),d===3&&(r=!0),u[0]===T&&(i=!0),s=d}let a=e;if(!o){let u=e.map((d,c)=>({m:d,i:c,tier:n(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(r&&!i&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[q,...a]:[...a.slice(0,u),q,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===h&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===R||u[0]===z);if(a.length===0)return;n=a}n=this._frameBatch(n);let r=null;for(let a=0;a<n.length;a++){let u=n[a],d=u[0];if(d!==L&&d!==G){r?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===L?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let l=u[1];if(d===L)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))c=!1;else if(this._pauseLocks.delete(l),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(u):r==null&&(r=n.slice(0,a))}if(r!=null){if(r.length===0)return;n=r}if(this._hasMeta&&n.some(a=>a[0]===R))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Re)}catch{}let{finalMessages:i,equalsError:s}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of i)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(i);s!=null&&this._emit([[h,s]])}_updateState(e){let n=this._config.tierOf,o,r,i=-1,s=0;for(let c of e)n(c[0])===3&&s++;let a=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===b){u=c;break}}for(let c=0;c<e.length;c++){let l=e[c],p=l[0];if(p===b){if(l.length>=2){let f=!1;if(a&&this._cached!==void 0)try{f=this._equals(this._cached,l[1])}catch(g){r=this._wrapFnError("equals threw",g),i=c;break}if(f){o==null&&(o=e.slice(0,c)),o.push(ke),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||c===u)&&ot(this._versioning,l[1],this._hashFn)}this._status="settled",o?.push(l)}else if(o?.push(l),p===T)this._status="dirty";else if(p===w)this._status="resolved";else if(p===y){this._status="completed";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===h){this._status="errored";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===z){if(this._cached!==void 0){let g=this._config.rigorRecorder;if(g!=null)try{g.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let g=f.invalidate;if(typeof g=="function")try{g()}catch{}}}else p===R&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=i>=0?o??e.slice(0,i):o??e;return r!=null?{finalMessages:d,equalsError:r}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let o of n)o(e)};_dispatchOrAccumulate(e){if(Ze()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],et(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}le(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);le(this._deliverToSinks,n,this._config.tierOf)}},dt=t=>Array.isArray(t),Le=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function ct(t,e){return O([],{...e,initial:t})}function x(t,e){return O((o,r,i)=>t(r,i)??void 0,{describeKind:"producer",...e})}var Be=v(()=>{"use strict";se()});function ie(t,e,n){let o=new Set;for(let r of t.split(",")){let[i,s]=r.split("/"),a=s?Number.parseInt(s,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${r}`);let u,d;if(i==="*")u=e,d=n;else if(i.includes("-")){let[c,l]=i.split("-");u=Number.parseInt(c,10),d=Number.parseInt(l,10)}else u=Number.parseInt(i,10),d=u;if(Number.isNaN(u)||Number.isNaN(d))throw new Error(`Invalid cron field: ${t}`);if(u<e||d>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(u>d)throw new Error(`Invalid cron range: ${u}-${d} in ${t}`);for(let c=u;c<=d;c+=a)o.add(c)}return o}function lt(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:ie(e[0],0,59),hours:ie(e[1],0,23),daysOfMonth:ie(e[2],1,31),months:ie(e[3],1,12),daysOfWeek:ie(e[4],0,6)}}function ft(t,e){return t.minutes.has(e.getMinutes())&&t.hours.has(e.getHours())&&t.daysOfMonth.has(e.getDate())&&t.months.has(e.getMonth()+1)&&t.daysOfWeek.has(e.getDay())}var pt=v(()=>{"use strict"});function ht(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}var mt=v(()=>{"use strict"});function gt(t,e,n){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let o=e.map(f=>f.node),r=[t,...o],i=new Pe,s=!1,a=!1,u=Symbol("budget-gate"),d=new Array(e.length);function c(){return e.every((f,g)=>f.check(d[g]))}function l(f){for(;i.size>0&&c();){let g=i.shift();f.emit(g)}i.size===0&&a&&(a=!1,f.down([[w]]))}return O([],(f,g)=>{for(let m=0;m<e.length;m++)d[m]=e[m].node.cache;let _=[];for(let m=0;m<r.length;m++){let N=r[m];_.push(N.subscribe(S=>{for(let k of S)p(k,m,g)}))}return()=>{for(let m of _)m()}},{...n,describeKind:"derived",meta:ht("resilience","budget_gate",n?.meta)});function p(f,g,_){let m=f[0];if(g===0){if(m===b)return c()&&i.size===0?_.emit(f[1]):(i.push(f[1]),s||(s=!0,_.up([[L,u]]))),!0;if(m===T)return _.down([[T]]),!0;if(m===w)return i.size===0?_.down([[w]]):a=!0,!0;if(m===y||m===h){for(;i.size>0;)_.emit(i.shift());return a=!1,s&&(s=!1,_.up([[G,u]])),_.down([f]),!0}return!1}if(m===b&&(d[g-1]=f[1]),m===b||m===w){let N=c();return N&&i.size>0?(l(_),i.size===0&&s&&(s=!1,_.up([[G,u]]))):!N&&!s&&i.size>0&&(s=!0,_.up([[L,u]])),!0}return m===T?!0:m===h?(_.down([f]),!0):m===y}}var Pe,bt=v(()=>{"use strict";K();se();mt();Pe=class{buf=[];head=0;get size(){return this.buf.length-this.head}push(e){this.buf.push(e)}shift(){if(this.head>=this.buf.length)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head++,this.head>32&&this.head*2>this.buf.length&&(this.buf=this.buf.slice(this.head),this.head=0),e}clear(){this.buf=[],this.head=0}}});function V(t,e){let n={factory:t};return e!==void 0&&(n.factoryArgs=e),n}var yt=v(()=>{"use strict"});var Nt={};xe(Nt,{NS_PER_MS:()=>Q,NS_PER_SEC:()=>Z,constant:()=>_t,decorrelatedJitter:()=>xt,exponential:()=>Tt,fibonacci:()=>vt,linear:()=>wt,resolveBackoffPreset:()=>Ge,withMaxAttempts:()=>dn});function $(t){return t<0?0:t}function an(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function un(t,e){return t+Math.random()*(e-t)}function _t(t){let e=$(t);return()=>e}function wt(t,e){let n=$(t),o=e===void 0?n:$(e);return r=>n+o*Math.max(0,r)}function Tt(t){let e=$(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,o=$(t?.maxDelayNs??30*1e9),r=t?.jitter??"none";return i=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let a=o/e,u=1;for(let d=0;d<Math.max(0,i);d++){if(u>=a){u=a;break}u*=n}s=e*u,s>o&&(s=o)}return an(s,r)}}function vt(t=100*1e6,e=30*1e9){let n=$(t),o=$(e);function r(i){if(i<=0)return 1;let s=1,a=2;for(let u=1;u<i;u++){let d=s+a;s=a,a=d}return a}return i=>{let s=r(i)*n;return s<=o?s:o}}function xt(t=100*1e6,e=30*1e9){return(n,o,r)=>{let s=Math.min(e,(r??t)*3);return un(t,s)}}function dn(t,e){return(n,o,r)=>n>=e?null:t(n,o,r)}function Ge(t){if(t==="constant")return _t(1*1e9);if(t==="linear")return wt(1*1e9);if(t==="exponential")return Tt();if(t==="fibonacci")return vt();if(t==="decorrelatedJitter")return xt();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var Q,Z,Ve=v(()=>{"use strict";Q=1e6,Z=1e9});var ee,kt=v(()=>{"use strict";ee=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let o=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,o===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var me,Et=v(()=>{"use strict";me=class{constructor(e){this.capacity=e;if(!Number.isInteger(e)||e<=0)throw new Error(`RingBuffer capacity must be a positive integer (got ${e})`);this.buf=new Array(e)}buf;head=0;_size=0;get size(){return this._size}get maxSize(){return this.capacity}push(e){let n=(this.head+this._size)%this.capacity;this.buf[n]=e,this._size<this.capacity?this._size++:this.head=(this.head+1)%this.capacity}shift(){if(this._size===0)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head=(this.head+1)%this.capacity,this._size--,e}at(e){if(this._size===0)return;let n=e<0?this._size+e:e;if(!(n<0||n>=this._size))return this.buf[(this.head+n)%this.capacity]}toArray(){let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this.buf[(this.head+n)%this.capacity];return e}clear(){for(let e=0;e<this._size;e++)this.buf[(this.head+e)%this.capacity]=void 0;this.head=0,this._size=0}}});function j(t){return{describeKind:"derived",...t}}function cn(t){return t<0?0:t}function He(t){return t[1]}function ln(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function St(t){let e=t?.count,n=t?.backoff;if(n!==void 0&&e===void 0)throw new RangeError("retry({ backoff }) requires explicit count to prevent unbounded retries; pass { count: <n>, backoff: ... }");let o=e!==void 0?e:0;if(o<0)throw new RangeError("retry count must be >= 0");let r=n===void 0?null:typeof n=="string"?Ge(n):n;return{maxRetries:o,strategy:r}}function Rt(t){let e={};return t?.count!==void 0&&(e.count=t.count),typeof t?.backoff=="string"&&(e.backoff=t.backoff),Object.keys(e).length>0?e:void 0}function At(t,e,n){let o=0,r=!1,i=null,s,a=new ee;function u(){s?.(),s=void 0}function d(l){if(r)return;if(o>=t.maxRetries){u(),n.down([[h,l]]);return}let p=t.strategy===null?0:t.strategy(o,l,i);if(p==null){u(),n.down([[h,l]]);return}let f;try{f=ln(p)}catch{u(),n.down([[h,l]]);return}i=f,o+=1,u();let g=f>0?f/1e6:1;a.start(g,()=>{r||c()})}function c(){a.cancel(),u();let l;try{l=e()}catch(p){d(p);return}s=l.subscribe(p=>{if(!r)for(let f of p){let g=f[0];if(g===T)n.down([[T]]);else if(g===b)o=0,i=null,n.emit(f[1]);else if(g===w)n.down([[w]]);else if(g===y)u(),n.down([[y]]);else if(g===h){d(He(f));return}else n.down([f])}})}return c(),()=>{r=!0,a.cancel(),u()}}function fn(t,e){return typeof t=="function"?hn(t,e):pn(t,e)}function pn(t,e){let n=St(e);return x(o=>At(n,()=>t,o),{...j(),initial:t.cache,meta:{...e?.meta??{},...V("retry",Rt(e))}})}function hn(t,e){let n=St(e);return x(o=>At(n,t,o),{...j(),initial:e?.initial,meta:{...e?.meta??{},...V("retry",Rt(e))}})}function mn(t){let e=Math.max(1,t?.failureThreshold??5),n=cn(t?.cooldownNs??30*1e9),o=t?.cooldown??null,r=Math.max(1,t?.halfOpenMax??1),i=t?.now??Ne,s="closed",a=0,u=0,d=0,c=n,l=0;function p(){if(!o)return n;let _=o(u);return _!==null?_:n}function f(){s="open",c=p(),d=i(),l=0}return{canExecute(){return s==="closed"?!0:s==="open"?i()-d>=c?(s="half-open",l=1,!0):!1:l<r?(l++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",a=0,u=0):s==="closed"&&(a=0)},recordFailure(_){if(s==="half-open"){u++,f();return}s==="closed"&&(a++,a>=e&&f())},get state(){return s},get failureCount(){return a},reset(){s="closed",a=0,u=0,l=0}}}function gn(t,e){let n=e?.onOpen??"skip",o=e?.meta;return r=>{let i=O([],(s,a)=>{function u(){i.meta.breakerState.down([[b,t.state]])}let d=r.subscribe(c=>{for(let l of c){let p=l[0];p===T?a.down([[T]]):p===b?t.canExecute()?(u(),a.emit(l[1])):(u(),n==="error"?a.down([[h,new be]]):a.down([[w]])):p===w?a.down([[w]]):p===y?(t.recordSuccess(),u(),a.down([[y]])):p===h?(t.recordFailure(He(l)),u(),a.down([l])):a.down([l])}});return u(),d},{...j(),meta:{...o??{},breakerState:t.state,...V("withBreaker",{onOpen:n})},completeWhenDepsComplete:!1,initial:r.cache});return{node:i,breakerState:i.meta.breakerState}}}function Ot(t,e,n){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let o=n?.clock??Ne,r=t,i=o();function s(a){if(e>0){let u=a-i;r=Math.min(t,r+u/1e9*e)}i=a}return{available(){return s(o()),r},tryConsume(a=1){if(a<=0)return!0;let u=o();return s(u),r>=a?(r-=a,!0):!1},putBack(a=1){a<=0||(s(o()),r=Math.min(t,r+a))}}}function bn(t,e){return t.droppedCount===e.droppedCount&&t.pendingCount===e.pendingCount&&t.paused===e.paused}function yn(t,e){let{maxEvents:n,windowNs:o}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(o<=0)throw new RangeError("windowNs must be > 0");let r=e.maxBuffer;if(r===void 0)throw new RangeError("rateLimiter requires explicit maxBuffer (use Infinity to opt in to unbounded)");let i=r===1/0;if(!i&&(!Number.isInteger(r)||r<1))throw new RangeError("maxBuffer must be a positive integer (or Infinity for unbounded)");let s=e.onOverflow??"drop-newest",a=n*1e9/o,u=x(d=>{let c=Ot(n,a),l=i?wn():_n(r),p=new ee,f=!1,g=0,_=1e9/a,m=u.meta.droppedCount,N=u.meta.rateLimitState,S=ge;function k(){m.emit(g);let D={droppedCount:g,pendingCount:l.size,paused:l.size>0};bn(S,D)||(S=D,N.emit(D))}S=ge,m.emit(0),N.emit(ge);function B(){for(;l.size>0;)if(c.tryConsume(1))d.emit(l.shift()),k();else{p.start(Math.max(1,_/1e6),B);return}}function F(){g+=1,k()}function P(){for(f=!0,p.cancel();l.size>0;)l.shift();g=0}let C=t.subscribe(D=>{for(let M of D){if(f)return;let I=M[0];if(I===T)d.down([[T]]);else if(I===b){if(!i&&l.size>=r)if(s==="drop-newest")F();else if(s==="drop-oldest")l.shift(),l.push(M[1]),F();else{F(),P(),d.down([[h,new ye(r)]]);return}else l.push(M[1]),k();B()}else if(I===w)d.down([[w]]);else if(I===y)P(),d.down([[y]]);else if(I===h)P(),d.down([M]);else if(I===R){P(),d.down([M]);return}else d.down([M])}});return()=>{f=!0,p.cancel(),C()}},{...j(),initial:t.cache,meta:{...e.meta??{},droppedCount:0,rateLimitState:ge,...V("rateLimiter",e)}});return{node:u,droppedCount:u.meta.droppedCount,rateLimitState:u.meta.rateLimitState}}function _n(t){let e=new me(t);return{push:n=>e.push(n),shift:()=>e.shift(),get size(){return e.size}}}function wn(){let t=[];return{push:e=>{t.push(e)},shift:()=>t.shift(),get size(){return t.length}}}function Tn(t,e){let n=e?.initialStatus??"pending",o=e?.meta,r=O([],(i,s)=>{let a=n;return r.meta.status.down([[b,n]]),r.meta.error.down([[b,null]]),t.subscribe(d=>{for(let c of d){let l=c[0];if(l===T)s.down([[T]]);else if(l===b)a==="errored"?Ae(()=>{r.meta.error.down([[b,null]]),r.meta.status.down([[b,"running"]])}):r.meta.status.down([[b,"running"]]),a="running",s.emit(c[1]);else if(l===w)s.down([[w]]);else if(l===y)r.meta.status.down([[b,"completed"]]),a="completed",s.down([[y]]);else if(l===h){let p=He(c);Ae(()=>{r.meta.error.down([[b,p]]),r.meta.status.down([[b,"errored"]])}),a="errored",s.down([c])}else s.down([c])}})},{...j(),meta:{...o??{},status:n,error:null,...V("withStatus",{initialStatus:n})},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function vn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function xn(t){return t!=null&&typeof t.then=="function"}function Nn(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function kn(t,e,n){let o=n?.meta;return x(r=>{let i,s;function a(){s?.(),s=void 0,vn(e)||xn(e)||Nn(e)?i=we(e).subscribe(d=>{r.down(d);for(let c of d){let l=c[0];if(l===y||l===h||l===R){i=void 0;return}}}):(r.emit(e),r.down([[y]]))}return s=t.subscribe(u=>{for(let d of u){let c=d[0];if(c===T)r.down([[T]]);else if(c===b)r.emit(d[1]);else if(c===w)r.down([[w]]);else if(c===y)r.down([[y]]);else if(c===h){a();return}else if(c===R){i?.(),r.down([d]);return}else r.down([d])}}),()=>{s?.(),i?.()}},{...j(),initial:t.cache,meta:{...o??{},...V("fallback")}})}function En(t,e,n){if(e<=0)throw new RangeError("timeoutNs must be > 0");let o=n?.meta;return x(r=>{let i=!1,s=new ee;function a(){let d=e/1e6;s.start(d,()=>{i||(i=!0,u(),r.down([[h,new _e(e)]]))})}let u=t.subscribe(d=>{for(let c of d){if(i)return;let l=c[0];if(l===T)r.down([[T]]);else if(l===b)a(),r.emit(c[1]);else if(l===w)r.down([[w]]);else if(l===y){s.cancel(),i=!0,r.down([[y]]);return}else if(l===h){s.cancel(),i=!0,r.down([c]);return}else if(l===R){s.cancel(),i=!0,r.down([c]);return}else r.down([c])}});return a(),()=>{i=!0,s.cancel(),u()}},{...j(),initial:t.cache,meta:{...o??{},...V("timeout",{timeoutNs:e})}})}var be,ye,ge,_e,Mt=v(()=>{"use strict";bt();Oe();de();K();yt();se();Be();Ve();Ct();kt();Et();be=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};ye=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};ge=Object.freeze({droppedCount:0,pendingCount:0,paused:!1});_e=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Dt={};xe(Dt,{CircuitOpenError:()=>be,RateLimiterOverflowError:()=>ye,TimeoutError:()=>_e,budgetGate:()=>gt,circuitBreaker:()=>mn,fallback:()=>kn,rateLimiter:()=>yn,retry:()=>fn,timeout:()=>En,tokenBucket:()=>Ot,withBreaker:()=>gn,withStatus:()=>Tn});var It=v(()=>{"use strict";Mt()});function A(t){return{describeKind:"producer",...t}}function Ft(t){return/[\\^$+?.()|[\]{}]/.test(t)?`\\${t}`:t}function Sn(t){let e="^";for(let n=0;n<t.length;n+=1){let o=t[n];if(o==="*"){t[n+1]==="*"?(e+=".*",n+=1):e+="[^/]*";continue}e+=Ft(o)}return e+="$",new RegExp(e)}function Rn(t,e){for(let n of e)if(n.test(t))return!0;return!1}function An(t,e){let n=O([t],(r,i)=>{let s=r[0];if(s==null||s.length===0){i.down([[w]]);return}for(let a of s)i.emit(a)},{describeKind:"derived",initial:t.cache}),o=n.subscribe.bind(n);return n.subscribe=(r,i)=>(e(r),o(r,i)),n}function On(t,e){let{signal:n,period:o,...r}=e??{};return x(i=>{let s=!1,a=0,u,d,c=()=>{s=!0,u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),n?.removeEventListener("abort",p)},l=()=>{s||(o!=null?(i.emit(a++),d=setInterval(()=>{s||i.emit(a++)},o)):(s=!0,n?.removeEventListener("abort",p),i.emit(a++),i.down([[y]])))},p=()=>{s||(c(),i.down([[h,n.reason]]))};if(n?.aborted){p();return}return u=setTimeout(l,t),n?.addEventListener("abort",p,{once:!0}),c},A(r))}function Mn(t){let{signal:e,...n}=t??{};return x(o=>{let r=!1,i,s,a=!1,u=!1,d=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,c=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,p=()=>{i!==void 0&&c&&c(i),s!==void 0&&clearTimeout(s),i=void 0,s=void 0},f=()=>{r=!0,p(),a&&(e?.removeEventListener("abort",g),a=!1),u&&l&&(l.removeEventListener("visibilitychange",N),u=!1)},g=()=>{r||(f(),o.down([[h,e.reason]]))},_=S=>{r||(o.emit(S),m())},m=()=>{r||(d&&(!l||l.visibilityState!=="hidden")?i=d(_):s=setTimeout(()=>_(performance.now()),16))},N=()=>{r||(p(),m())};return e?.aborted?(g(),f):(e?.addEventListener("abort",g,{once:!0}),a=e!==void 0,l&&d&&(l.addEventListener("visibilitychange",N),u=!0),m(),f)},A(n))}function Cn(t,e){let n=lt(t),{tickMs:o,output:r,...i}=e??{},s=o??6e4,a=r==="date";return x(u=>{let d=-1,c=()=>{let p=new Date,f=p.getFullYear()*1e8+(p.getMonth()+1)*1e6+p.getDate()*1e4+p.getHours()*100+p.getMinutes();f!==d&&ft(n,p)&&(d=f,u.emit(a?p:ue()))};c();let l=setInterval(c,s);return()=>clearInterval(l)},{...A(i),name:i.name??`cron:${t}`})}function Dn(t,e,n){let{capture:o,passive:r,once:i,...s}=n??{};return x(a=>{let u=c=>{a.emit(c)},d={capture:o,passive:r,once:i};return t.addEventListener(e,u,d),()=>t.removeEventListener(e,u,d)},A(s))}function We(t,e){return x(n=>{let o=!1;try{for(let r of t){if(o)return;n.emit(r)}o||n.down([[y]])}catch(r){o||n.down([[h,r]])}return()=>{o=!0}},A(e))}function In(t){return t!=null&&typeof t.then=="function"}function Bt(t,e){let{signal:n,...o}=e??{};return x(r=>{let i=!1,s=()=>{i||(i=!0,r.down([[h,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(a=>{i||(i=!0,n?.removeEventListener("abort",s),r.emit(a),r.down([[y]]))},a=>{i||(i=!0,n?.removeEventListener("abort",s),r.down([[h,a]]))}),()=>{i=!0,n?.removeEventListener("abort",s)}},A(o))}function Pt(t,e){let{signal:n,...o}=e??{};return x(r=>{let i=new AbortController,s=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let a=n??i.signal,u=!1,d=t[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(l=>{if(!(u||a.aborted)){if(l.done){r.down([[y]]);return}r.emit(l.value),c()}},l=>{!u&&!a.aborted&&r.down([[h,l]])})};return c(),()=>{u=!0,n?.removeEventListener("abort",s),i.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},A(o))}function Ln(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function we(t,e){if(Ln(t))return t;if(In(t))return Bt(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return Pt(t,e);if(typeof n[Symbol.iterator]=="function")return We(t,e)}return Gt(t)}function Gt(...t){return We(t,void 0)}function Fn(t){return x(e=>{e.down([[y]])},A(t))}function Bn(t){return x(()=>{},A(t))}function Pn(t,e){return x(n=>{n.down([[h,t]])},A(e))}function Gn(t,e){let{signal:n,...o}=e??{},r=A(o),i=r.resubscribable===void 0?{...r,resubscribable:!0}:r;return x(s=>{let a,u=!1;try{let d=t();a=we(d,e).subscribe(l=>{if(!u)for(let p of l){let f=p[0];if(f!==H)if(f===b)s.emit(p[1]);else if(f===y){u=!0,s.down([[y]]);break}else if(f===h){u=!0,s.down([[h,p[1]]]);break}else s.down([p])}})}catch(d){let c=d===void 0?new Error("defer: thunk threw undefined"):d;s.down([[h,c]])}return()=>{u=!0,a?.()}},i)}function Vn(t,e,n){return O([t],(r,i)=>{let s=r[0];if(s!=null&&s.length>0)for(let a of s)e(a)},{describeKind:"effect",...n}).subscribe(()=>{})}function Hn(t,e){return O([t],(n,o,r)=>{r.store.buf||(r.store.buf=[]);let i=r.store.buf,s=n[0];if(s!=null&&s.length>0)for(let a of s)i.push(a);if(r.terminalDeps[0]===!0){o.emit([...i]),o.down([[y]]);return}(s==null||s.length===0)&&o.down([[w]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function zn(t,e){return x(n=>t.subscribe(o=>{n.down(o)}),{...A(e),initial:t.cache})}function $e(t,e,n){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let o=[],r=x(i=>t.subscribe(s=>{for(let a of s)a[0]===b&&(o.push(a[1]),o.length>e&&o.shift());i.down(s)}),{...A(n),initial:t.cache});return An(r,i=>{for(let s of o)i([[b,s]])})}function Un(t,e){return $e(t,1,e)}function Wn(t){return new Promise((e,n)=>{let o=!1,r=!1,i;i=t.subscribe(s=>{for(let a of s){if(o)return;if(a[0]===b){o=!0,e(a[1]),i?(i(),i=void 0):r=!0;return}if(a[0]===h){o=!0,n(a[1]),i?(i(),i=void 0):r=!0;return}if(a[0]===y){o=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):r=!0;return}}}),r&&(i?.(),i=void 0)})}function Ue(t,e,n){return new Promise((o,r)=>{let i=!1,s=!1,a,u=n?.skipCurrent===!0;a=t.subscribe(d=>{for(let c of d){if(i)return;if(!(u&&c[0]===b)){if(c[0]===b){let l=c[1];if(e(l)){i=!0,o(l),a?(a(),a=void 0):s=!0;return}}if(c[0]===h){i=!0,r(c[1]),a?(a(),a=void 0):s=!0;return}if(c[0]===y){i=!0,r(new Error("completed without matching value")),a?(a(),a=void 0):s=!0;return}}}}),u=!1,s&&(a?.(),a=void 0)})}async function $n(t,e){let n=e?.predicate??(i=>i!=null),o=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Ue(t,n,{skipCurrent:o});if(ze===void 0){let[i,s]=await Promise.all([Promise.resolve().then(()=>(It(),Dt)),Promise.resolve().then(()=>(Ve(),Nt))]);ze=i.timeout,Lt=s.NS_PER_MS}let r=ze(t,e.timeoutMs*Lt);return await Ue(r,n,{skipCurrent:o})}function jn(t,e){let n=new AbortController,o=e?.reason??new Error("cancelled via nodeSignal"),r,i=!1,s=()=>{r?(r(),r=void 0):i=!0};return r=t.subscribe(a=>{if(!n.signal.aborted)for(let u of a){if(u[0]===b&&u[1]===!0){n.abort(o),s();return}if(u[0]===h){n.abort(u[1]),s();return}if(u[0]===y){s();return}}}),i&&(r?.(),r=void 0),{signal:n.signal,dispose:()=>{r&&(r(),r=void 0)}}}function Kn(t){return t.subscribe(()=>{})}function Yn(t){let e=ct(0);return{node:e,increment(){let n=e.cache??0;return n>=t?!1:(e.down([[T],[b,n+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=t}}}var ze,Lt,qn,Vt=v(()=>{"use strict";de();K();se();Be();pt();qn=$e});var Jn={};xe(Jn,{awaitSettled:()=>$n,cached:()=>Un,defer:()=>Gn,empty:()=>Fn,escapeRegexChar:()=>Ft,firstValueFrom:()=>Wn,firstWhere:()=>Ue,forEach:()=>Vn,fromAny:()=>we,fromAsyncIter:()=>Pt,fromCron:()=>Cn,fromEvent:()=>Dn,fromIter:()=>We,fromPromise:()=>Bt,fromRaf:()=>Mn,fromTimer:()=>On,globToRegExp:()=>Sn,keepalive:()=>Kn,matchesAnyPattern:()=>Rn,never:()=>Bn,nodeSignal:()=>jn,of:()=>Gt,reactiveCounter:()=>Yn,replay:()=>$e,share:()=>zn,shareReplay:()=>qn,throwError:()=>Pn,toArray:()=>Hn});module.exports=qt(Jn);var Ct=v(()=>{Vt()});Ct();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
@@ -1,4 +1,4 @@
1
- import { N as NodeOptions, a as Node } from '../node-fSc-hCv8.cjs';
1
+ import { a as NodeOptions, N as Node } from '../node-BYInONRr.cjs';
2
2
 
3
3
  /**
4
4
  * Core reactive sources, sinks, and utilities (roadmap §2.3).
@@ -1,4 +1,4 @@
1
- import { N as NodeOptions, a as Node } from '../node-fSc-hCv8.js';
1
+ import { a as NodeOptions, N as Node } from '../node-BYInONRr.js';
2
2
 
3
3
  /**
4
4
  * Core reactive sources, sinks, and utilities (roadmap §2.3).
@@ -1 +1 @@
1
- import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-RZ5HKPGI.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{x as awaitSettled,u as cached,p as defer,m as empty,a as escapeRegexChar,v as firstValueFrom,w as firstWhere,q as forEach,k as fromAny,j as fromAsyncIter,f as fromCron,g as fromEvent,h as fromIter,i as fromPromise,e as fromRaf,d as fromTimer,b as globToRegExp,A as keepalive,c as matchesAnyPattern,n as never,y as nodeSignal,l as of,B as reactiveCounter,t as replay,s as share,z as shareReplay,o as throwError,r as toArray};
1
+ import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-CKFQS2CJ.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{x as awaitSettled,u as cached,p as defer,m as empty,a as escapeRegexChar,v as firstValueFrom,w as firstWhere,q as forEach,k as fromAny,j as fromAsyncIter,f as fromCron,g as fromEvent,h as fromIter,i as fromPromise,e as fromRaf,d as fromTimer,b as globToRegExp,A as keepalive,c as matchesAnyPattern,n as never,y as nodeSignal,l as of,B as reactiveCounter,t as replay,s as share,z as shareReplay,o as throwError,r as toArray};
@@ -1,4 +1,4 @@
1
- import { a as Node } from '../node-fSc-hCv8.cjs';
1
+ import { N as Node } from '../node-BYInONRr.cjs';
2
2
 
3
3
  /**
4
4
  * Browser-only IndexedDB reactive sources.
@@ -1,4 +1,4 @@
1
- import { a as Node } from '../node-fSc-hCv8.js';
1
+ import { N as Node } from '../node-BYInONRr.js';
2
2
 
3
3
  /**
4
4
  * Browser-only IndexedDB reactive sources.