@graphrefly/graphrefly 0.30.0 → 0.32.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 (253) hide show
  1. package/dist/{cascading-dNCtjW8j.d.cts → cascading-BfQmSmjU.d.cts} +21 -2
  2. package/dist/{cascading-BszPheHD.d.ts → cascading-D3sapjue.d.ts} +21 -2
  3. package/dist/chunk-2JNT5NDF.js +61 -0
  4. package/dist/{chunk-DDPYNMGG.js → chunk-2RH4QNDQ.js} +1 -1
  5. package/dist/chunk-4JBKKUCJ.js +7 -0
  6. package/dist/{chunk-SLMYTGTU.js → chunk-4UUDNFYG.js} +1 -1
  7. package/dist/chunk-4VXL3UZK.js +1 -0
  8. package/dist/{chunk-SHYH5SXV.js → chunk-4YGJ7KZ6.js} +1 -1
  9. package/dist/{chunk-GJR3P6JG.js → chunk-5PBXUVHI.js} +1 -1
  10. package/dist/{chunk-W4TSQ6RJ.js → chunk-7AJKUA36.js} +1 -1
  11. package/dist/{chunk-XQAXYVXX.js → chunk-7EMUF2RY.js} +1 -1
  12. package/dist/chunk-7JZ3YORY.js +80 -0
  13. package/dist/chunk-7QMVU3IX.js +1 -0
  14. package/dist/{chunk-WANIEEKV.js → chunk-7QS77X6G.js} +1 -1
  15. package/dist/{chunk-BA5URFYW.js → chunk-A4JT4SAD.js} +1 -1
  16. package/dist/{chunk-Y36UZ5VS.js → chunk-BU4SUZSA.js} +1 -1
  17. package/dist/{chunk-P7JXGKDO.js → chunk-CNXUW2CU.js} +1 -1
  18. package/dist/{chunk-Y32RJO24.js → chunk-CZVYLXFK.js} +1 -1
  19. package/dist/{chunk-567NWZ3T.js → chunk-DWIAG62L.js} +1 -1
  20. package/dist/chunk-EIFHFDFD.js +1 -0
  21. package/dist/chunk-FTA5TB2A.js +1 -0
  22. package/dist/{chunk-T5SHIKJD.js → chunk-JAHAJU4G.js} +1 -1
  23. package/dist/{chunk-AV3PIDFQ.js → chunk-JYMNVEH6.js} +1 -1
  24. package/dist/{chunk-5Z4HDCO6.js → chunk-K54OKWNY.js} +1 -1
  25. package/dist/chunk-KD3IYBTD.js +3 -0
  26. package/dist/{chunk-3NEPQO2E.js → chunk-LG73TUF4.js} +2 -2
  27. package/dist/chunk-LJGPOJHS.js +1 -0
  28. package/dist/chunk-LWGLBCMU.js +1 -0
  29. package/dist/{chunk-BKPLTBL5.js → chunk-M2VFLRPJ.js} +1 -1
  30. package/dist/{chunk-GNCBXARM.js → chunk-MFNOZ5E6.js} +1 -1
  31. package/dist/{chunk-TWMEGG45.js → chunk-N2KKISCE.js} +1 -1
  32. package/dist/chunk-PNTBXOQ6.js +5 -0
  33. package/dist/{chunk-73Z3W2RN.js → chunk-PWKLZ2XU.js} +1 -1
  34. package/dist/{chunk-7TDOES3L.js → chunk-Q2SY7M7K.js} +1 -1
  35. package/dist/{chunk-OL33ZI6R.js → chunk-RWGJQQLT.js} +1 -1
  36. package/dist/chunk-SGS4OJGS.js +1 -0
  37. package/dist/{chunk-4OFIQ66T.js → chunk-TOCCHQI6.js} +1 -1
  38. package/dist/chunk-UMH3HSP7.js +1 -0
  39. package/dist/{chunk-XHVB6G6M.js → chunk-UXEB35L4.js} +1 -1
  40. package/dist/{chunk-33FA6V4B.js → chunk-VXJX3ZZP.js} +1 -1
  41. package/dist/{chunk-BZP5T4X6.js → chunk-W6FQIFVE.js} +1 -1
  42. package/dist/{chunk-RD52SNH2.js → chunk-WE32AFFA.js} +1 -1
  43. package/dist/{chunk-KA6MMXIY.js → chunk-WF3V5X2L.js} +1 -1
  44. package/dist/chunk-WQ7I7JVU.js +1 -0
  45. package/dist/{chunk-4JJCCD5S.js → chunk-X4OOM6QU.js} +1 -1
  46. package/dist/{chunk-AUY2YKCO.js → chunk-XRSHMHEG.js} +1 -1
  47. package/dist/chunk-Y26UN6J5.js +18 -0
  48. package/dist/{chunk-VWPRPPKR.js → chunk-ZWETYYQG.js} +1 -1
  49. package/dist/compat/index.cjs +2 -2
  50. package/dist/compat/index.d.cts +5 -5
  51. package/dist/compat/index.d.ts +5 -5
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.cjs +1 -1
  54. package/dist/compat/jotai/index.js +1 -1
  55. package/dist/compat/nanostores/index.cjs +1 -1
  56. package/dist/compat/nanostores/index.js +1 -1
  57. package/dist/compat/nestjs/index.cjs +5 -5
  58. package/dist/compat/nestjs/index.d.cts +3 -3
  59. package/dist/compat/nestjs/index.d.ts +3 -3
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/zustand/index.cjs +2 -2
  62. package/dist/compat/zustand/index.d.cts +2 -2
  63. package/dist/compat/zustand/index.d.ts +2 -2
  64. package/dist/compat/zustand/index.js +1 -1
  65. package/dist/{composite-DGspwCqk.d.ts → composite-BY9hMxN7.d.ts} +1 -1
  66. package/dist/{composite-nrRumJ7l.d.cts → composite-CH0S8DFn.d.cts} +1 -1
  67. package/dist/content-addressed-storage-BUiREIuj.d.ts +124 -0
  68. package/dist/content-addressed-storage-DqIWCmZG.d.cts +124 -0
  69. package/dist/core/index.cjs +1 -1
  70. package/dist/core/index.js +1 -1
  71. package/dist/extra/browser.cjs +1 -1
  72. package/dist/extra/browser.js +1 -1
  73. package/dist/extra/index.cjs +18 -18
  74. package/dist/extra/index.d.cts +7 -6
  75. package/dist/extra/index.d.ts +7 -6
  76. package/dist/extra/index.js +1 -1
  77. package/dist/extra/node.cjs +2 -2
  78. package/dist/extra/node.js +1 -1
  79. package/dist/extra/operators.cjs +1 -1
  80. package/dist/extra/operators.d.cts +41 -1
  81. package/dist/extra/operators.d.ts +41 -1
  82. package/dist/extra/operators.js +1 -1
  83. package/dist/extra/reactive.cjs +1 -1
  84. package/dist/extra/reactive.d.cts +1 -1
  85. package/dist/extra/reactive.d.ts +1 -1
  86. package/dist/extra/reactive.js +1 -1
  87. package/dist/extra/sources.cjs +1 -1
  88. package/dist/extra/sources.d.cts +62 -2
  89. package/dist/extra/sources.d.ts +62 -2
  90. package/dist/extra/sources.js +1 -1
  91. package/dist/extra/storage-browser.cjs +1 -1
  92. package/dist/extra/storage-browser.js +1 -1
  93. package/dist/{fallback-BaTS7vVY.d.cts → fallback-Cb3GH1O7.d.cts} +6 -14
  94. package/dist/{fallback-eOm3LNxP.d.ts → fallback-DRjJ_ZM8.d.ts} +6 -14
  95. package/dist/graph/index.cjs +4 -4
  96. package/dist/graph/index.d.cts +3 -3
  97. package/dist/graph/index.d.ts +3 -3
  98. package/dist/graph/index.js +1 -1
  99. package/dist/{graph-CWeI0aHd.d.ts → graph-BOhEGJ6E.d.ts} +10 -0
  100. package/dist/{graph-C4Uxwv0T.d.cts → graph-CdJeX7O7.d.cts} +10 -0
  101. package/dist/{index-B-z8WaSd.d.cts → index-BDLy6CQ9.d.cts} +1 -1
  102. package/dist/{index-iBp74eGU.d.cts → index-BJDXj9Wf.d.cts} +2 -2
  103. package/dist/{index-BBINVimG.d.ts → index-BUZPTPSQ.d.ts} +2 -2
  104. package/dist/{index-DnrZghBB.d.ts → index-BbcSZCAG.d.ts} +1 -1
  105. package/dist/{index-lKuLYmHO.d.cts → index-BiGeETJs.d.cts} +1 -1
  106. package/dist/{index-BHu_Wba0.d.cts → index-BmZb8fNF.d.cts} +3 -3
  107. package/dist/{index-Docdiu9a.d.ts → index-Bnmttu35.d.ts} +1 -1
  108. package/dist/{index-D6ajK8Mh.d.cts → index-BuN2wGJs.d.cts} +517 -134
  109. package/dist/{index-Cy7eFeIX.d.cts → index-BwdPDWI4.d.cts} +1 -1
  110. package/dist/{index-DylQCKEL.d.cts → index-BzxU4yhV.d.cts} +11 -2
  111. package/dist/{index-D9Y_u6BG.d.cts → index-C-Gsh-0a.d.cts} +2 -2
  112. package/dist/{index-ybtSyjWB.d.cts → index-C22aTC1X.d.cts} +5 -5
  113. package/dist/{index-yIdWFo2b.d.cts → index-C4QTaDli.d.cts} +2 -2
  114. package/dist/{index-BJHQUCZx.d.ts → index-C7RqYbOZ.d.ts} +82 -7
  115. package/dist/{index-C5Ghnp5B.d.ts → index-C9qCLIN4.d.ts} +2 -2
  116. package/dist/{index-DVNLe3pS.d.cts → index-CCdg0JLX.d.cts} +1 -1
  117. package/dist/{index-B5iVOD7w.d.ts → index-CEoU-r-g.d.ts} +2 -2
  118. package/dist/{index-CfFYyLR8.d.ts → index-CHfBm51k.d.ts} +11 -2
  119. package/dist/{index-Dljd76bC.d.ts → index-CNyiYQWF.d.ts} +5 -5
  120. package/dist/{index-C6NBfXj-.d.ts → index-CVevMZ0n.d.ts} +2 -2
  121. package/dist/{index-DGb1awva.d.ts → index-CZUzi6Dy.d.ts} +2 -2
  122. package/dist/{index-FrYrV-Vf.d.ts → index-Ckl03Q0s.d.ts} +1 -1
  123. package/dist/{index-Bvi5uJxX.d.ts → index-CmSjld-4.d.ts} +1 -1
  124. package/dist/{index-9iguV3bF.d.cts → index-CnjUhRbs.d.cts} +2 -2
  125. package/dist/{index-C98oJsEs.d.cts → index-D3HcdZ4d.d.cts} +1 -1
  126. package/dist/{index-IZ3l_vQ9.d.ts → index-DD1czHj3.d.ts} +1 -1
  127. package/dist/{index-BS220yqj.d.cts → index-DNhTQReY.d.cts} +82 -7
  128. package/dist/{index-UZO988ox.d.cts → index-DSawGt8n.d.cts} +2 -2
  129. package/dist/{index-CcpEvuPl.d.cts → index-DUkuH3jP.d.cts} +1 -1
  130. package/dist/{index-CRAkoq-y.d.cts → index-DY2QbdoP.d.cts} +1 -1
  131. package/dist/{index-CvS9IuTG.d.ts → index-Dbmj0iYR.d.ts} +1 -1
  132. package/dist/{index-ClgKmOHe.d.ts → index-DhlAMlm9.d.ts} +517 -134
  133. package/dist/{index-ClB7TCfL.d.cts → index-DlGaEBW5.d.cts} +2 -2
  134. package/dist/{index-CotRMjtJ.d.ts → index-Dp_pS7Bw.d.ts} +1 -1
  135. package/dist/{index-Cc8VQIgL.d.ts → index-Dxk-pUQI.d.ts} +2 -2
  136. package/dist/{index-DBQUKh59.d.cts → index-EGjF6iSY.d.cts} +3 -3
  137. package/dist/{index-D9HrBx2J.d.ts → index-LGzAYqdR.d.ts} +1 -1
  138. package/dist/{index-DR3gf_DG.d.cts → index-LzCJ0kMT.d.cts} +2 -2
  139. package/dist/{index-RQg6lTrN.d.ts → index-MV2yGIAq.d.ts} +2 -2
  140. package/dist/{index-Bs3-LC83.d.cts → index-_BXz9K7b.d.cts} +1 -1
  141. package/dist/{index-SSGqF8mI.d.cts → index-aBqZUx3B.d.cts} +1 -1
  142. package/dist/{index-CFW32Dy1.d.ts → index-eYHRkoK-.d.ts} +1 -1
  143. package/dist/{index-B2HBxvMb.d.ts → index-gXTVbSax.d.ts} +3 -3
  144. package/dist/{index-B8Aj_z8S.d.cts → index-j33Lfb1G.d.cts} +23 -2
  145. package/dist/{index-BEpRsvhg.d.ts → index-lpGUhTBn.d.ts} +3 -3
  146. package/dist/{index-BXbQUn4n.d.ts → index-zMQIQuDu.d.ts} +23 -2
  147. package/dist/index.cjs +106 -125
  148. package/dist/index.d.cts +34 -33
  149. package/dist/index.d.ts +34 -33
  150. package/dist/index.js +1 -1
  151. package/dist/patterns/ai/browser.cjs +5 -22
  152. package/dist/patterns/ai/browser.d.cts +3 -3
  153. package/dist/patterns/ai/browser.d.ts +3 -3
  154. package/dist/patterns/ai/browser.js +1 -1
  155. package/dist/patterns/ai/index.cjs +30 -44
  156. package/dist/patterns/ai/index.d.cts +13 -11
  157. package/dist/patterns/ai/index.d.ts +13 -11
  158. package/dist/patterns/ai/index.js +1 -1
  159. package/dist/patterns/ai/node.cjs +2 -2
  160. package/dist/patterns/ai/node.d.cts +5 -4
  161. package/dist/patterns/ai/node.d.ts +5 -4
  162. package/dist/patterns/ai/node.js +1 -1
  163. package/dist/patterns/audit/index.cjs +3 -3
  164. package/dist/patterns/audit/index.d.cts +3 -3
  165. package/dist/patterns/audit/index.d.ts +3 -3
  166. package/dist/patterns/audit/index.js +1 -1
  167. package/dist/patterns/cqrs/index.cjs +6 -6
  168. package/dist/patterns/cqrs/index.d.cts +2 -2
  169. package/dist/patterns/cqrs/index.d.ts +2 -2
  170. package/dist/patterns/cqrs/index.js +1 -1
  171. package/dist/patterns/demo-shell/index.cjs +2 -2
  172. package/dist/patterns/demo-shell/index.d.cts +3 -3
  173. package/dist/patterns/demo-shell/index.d.ts +3 -3
  174. package/dist/patterns/demo-shell/index.js +1 -1
  175. package/dist/patterns/domain-templates/index.cjs +6 -6
  176. package/dist/patterns/domain-templates/index.d.cts +2 -2
  177. package/dist/patterns/domain-templates/index.d.ts +2 -2
  178. package/dist/patterns/domain-templates/index.js +1 -1
  179. package/dist/patterns/graphspec/index.cjs +27 -25
  180. package/dist/patterns/graphspec/index.d.cts +3 -3
  181. package/dist/patterns/graphspec/index.d.ts +3 -3
  182. package/dist/patterns/graphspec/index.js +1 -1
  183. package/dist/patterns/guarded-execution/index.cjs +7 -7
  184. package/dist/patterns/guarded-execution/index.d.cts +4 -4
  185. package/dist/patterns/guarded-execution/index.d.ts +4 -4
  186. package/dist/patterns/guarded-execution/index.js +1 -1
  187. package/dist/patterns/harness/index.cjs +12 -11
  188. package/dist/patterns/harness/index.d.cts +6 -6
  189. package/dist/patterns/harness/index.d.ts +6 -6
  190. package/dist/patterns/harness/index.js +1 -1
  191. package/dist/patterns/job-queue/index.cjs +5 -5
  192. package/dist/patterns/job-queue/index.d.cts +2 -2
  193. package/dist/patterns/job-queue/index.d.ts +2 -2
  194. package/dist/patterns/job-queue/index.js +1 -1
  195. package/dist/patterns/lens/index.cjs +5 -5
  196. package/dist/patterns/lens/index.d.cts +4 -4
  197. package/dist/patterns/lens/index.d.ts +4 -4
  198. package/dist/patterns/lens/index.js +1 -1
  199. package/dist/patterns/memory/index.cjs +4 -4
  200. package/dist/patterns/memory/index.d.cts +2 -2
  201. package/dist/patterns/memory/index.d.ts +2 -2
  202. package/dist/patterns/memory/index.js +1 -1
  203. package/dist/patterns/messaging/index.cjs +5 -5
  204. package/dist/patterns/messaging/index.d.cts +2 -2
  205. package/dist/patterns/messaging/index.d.ts +2 -2
  206. package/dist/patterns/messaging/index.js +1 -1
  207. package/dist/patterns/orchestration/index.cjs +7 -7
  208. package/dist/patterns/orchestration/index.d.cts +2 -2
  209. package/dist/patterns/orchestration/index.d.ts +2 -2
  210. package/dist/patterns/orchestration/index.js +1 -1
  211. package/dist/patterns/reactive-layout/index.cjs +2 -2
  212. package/dist/patterns/reactive-layout/index.d.cts +3 -3
  213. package/dist/patterns/reactive-layout/index.d.ts +3 -3
  214. package/dist/patterns/reactive-layout/index.js +1 -1
  215. package/dist/patterns/reduction/index.cjs +5 -5
  216. package/dist/patterns/reduction/index.d.cts +2 -2
  217. package/dist/patterns/reduction/index.d.ts +2 -2
  218. package/dist/patterns/reduction/index.js +1 -1
  219. package/dist/patterns/refine-loop/index.cjs +8 -8
  220. package/dist/patterns/refine-loop/index.d.cts +3 -3
  221. package/dist/patterns/refine-loop/index.d.ts +3 -3
  222. package/dist/patterns/refine-loop/index.js +1 -1
  223. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  224. package/dist/patterns/resilient-pipeline/index.d.cts +3 -3
  225. package/dist/patterns/resilient-pipeline/index.d.ts +3 -3
  226. package/dist/patterns/resilient-pipeline/index.js +1 -1
  227. package/dist/patterns/surface/index.cjs +15 -13
  228. package/dist/patterns/surface/index.d.cts +4 -4
  229. package/dist/patterns/surface/index.d.ts +4 -4
  230. package/dist/patterns/surface/index.js +1 -1
  231. package/dist/{reactive-layout-BAr6-_o5.d.ts → reactive-layout-Bq0rA2Wb.d.ts} +1 -1
  232. package/dist/{reactive-layout-5oEn8lHM.d.cts → reactive-layout-Dhhe54Oj.d.cts} +1 -1
  233. package/dist/{reactive-map-BvDrRuwt.d.ts → reactive-map-CtRaCddO.d.ts} +59 -1
  234. package/dist/{reactive-map-CmlPPKHN.d.cts → reactive-map-IJIfZxoh.d.cts} +59 -1
  235. package/dist/{resilience-XRUF267O.js → resilience-IVNDYORD.js} +1 -1
  236. package/dist/{topology-tree-CVREibAc.d.cts → topology-tree-CpSjvIXp.d.cts} +1 -1
  237. package/dist/{topology-tree-CkjojcB6.d.ts → topology-tree-DAbCV2Yw.d.ts} +1 -1
  238. package/dist/{types-O3GzJY2U.d.cts → types-BgMqbc7N.d.cts} +41 -14
  239. package/dist/{types-u64Ose53.d.ts → types-CdfO2QTt.d.ts} +41 -14
  240. package/package.json +1 -1
  241. package/dist/chunk-2GQREQ6C.js +0 -1
  242. package/dist/chunk-4C2OR2GH.js +0 -18
  243. package/dist/chunk-5JDE5JHE.js +0 -1
  244. package/dist/chunk-7JDLFI6N.js +0 -1
  245. package/dist/chunk-AMBYCIOH.js +0 -3
  246. package/dist/chunk-GLSM33ZM.js +0 -78
  247. package/dist/chunk-ISCENNXS.js +0 -1
  248. package/dist/chunk-IUK4EFCE.js +0 -1
  249. package/dist/chunk-KASHOCF5.js +0 -1
  250. package/dist/chunk-LI3E75VE.js +0 -64
  251. package/dist/chunk-MGKAO4EK.js +0 -7
  252. package/dist/chunk-NSG4C6BF.js +0 -23
  253. package/dist/chunk-VIEUJSTT.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var so=Object.create;var Se=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var ao=Object.prototype.hasOwnProperty;var Sn=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ze=t=>{throw TypeError(t)};var uo=(t,e,n)=>e in t?Se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var En=(t,e)=>Se(t,"name",{value:e,configurable:!0});var Y=(t,e)=>()=>(t&&(e=t(t=0)),e);var ue=(t,e)=>{for(var n in e)Se(t,n,{get:e[n],enumerable:!0})},co=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of io(e))!ao.call(t,o)&&o!==n&&Se(t,o,{get:()=>e[o],enumerable:!(r=Nn(e,o))||r.enumerable});return t};var lo=t=>co(Se({},"__esModule",{value:!0}),t);var An=t=>[,,,so(t?.[Sn("metadata")]??null)],kn=["class","method","getter","setter","accessor","field","value","get","set"],Be=t=>t!==void 0&&typeof t!="function"?ze("Function expected"):t,fo=(t,e,n,r,o)=>({kind:kn[t],name:e,metadata:r,addInitializer:s=>n._?ze("Already initialized"):o.push(Be(s||null))}),po=(t,e)=>uo(e,Sn("metadata"),t[3]),Cn=(t,e,n,r)=>{for(var o=0,s=t[e>>1],i=s&&s.length;o<i;o++)e&1?s[o].call(n):r=s[o].call(n,r);return r},Mn=(t,e,n,r,o,s)=>{var i,a,c,u,l,f=e&7,p=!!(e&8),h=!!(e&16),d=f>3?t.length+1:f?p?1:2:0,g=kn[f+5],m=f>3&&(t[d-1]=[]),v=t[d]||(t[d]=[]),_=f&&(!h&&!p&&(o=o.prototype),f<5&&(f>3||!h)&&Nn(f<4?o:{get[n](){return On(this,s)},set[n](y){return Rn(this,s,y)}},n));f?h&&f<4&&En(s,(f>2?"set ":f>1?"get ":"")+n):En(o,n);for(var b=r.length-1;b>=0;b--)u=fo(f,n,c={},t[3],v),f&&(u.static=p,u.private=h,l=u.access={has:h?y=>ho(o,y):y=>n in y},f^3&&(l.get=h?y=>(f^1?On:go)(y,o,f^4?s:_.get):y=>y[n]),f>2&&(l.set=h?(y,w)=>Rn(y,o,w,f^4?s:_.set):(y,w)=>y[n]=w)),a=(0,r[b])(f?f<4?h?s:_[g]:f>4?void 0:{get:_.get,set:_.set}:o,u),c._=1,f^4||a===void 0?Be(a)&&(f>4?m.unshift(a):f?h?s=a:_[g]=a:o=a):typeof a!="object"||a===null?ze("Object expected"):(Be(i=a.get)&&(_.get=i),Be(i=a.set)&&(_.set=i),Be(i=a.init)&&m.unshift(i));return f||po(t,o),_&&Se(o,n,_),h?f^4?s:_:o};var Lt=(t,e,n)=>e.has(t)||ze("Cannot "+n),ho=(t,e)=>Object(e)!==e?ze('Cannot use the "in" operator on this value'):t.has(e),On=(t,e,n)=>(Lt(t,e,"read from private field"),n?n.call(t):e.get(t));var Rn=(t,e,n,r)=>(Lt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),go=(t,e,n)=>(Lt(t,e,"access private method"),n);var Ke,E,I,B,oe,X,se,q,P,C,Ae,Pt,mo,$t,bo,yo,Ht,Dn,Gn,In,Ft,W=Y(()=>{"use strict";Ke=Symbol.for("graphrefly/START"),E=Symbol.for("graphrefly/DATA"),I=Symbol.for("graphrefly/DIRTY"),B=Symbol.for("graphrefly/RESOLVED"),oe=Symbol.for("graphrefly/INVALIDATE"),X=Symbol.for("graphrefly/PAUSE"),se=Symbol.for("graphrefly/RESUME"),q=Symbol.for("graphrefly/TEARDOWN"),P=Symbol.for("graphrefly/COMPLETE"),C=Symbol.for("graphrefly/ERROR"),Ae=Object.freeze([I]),Pt=Object.freeze([B]),mo=Object.freeze([oe]),$t=Object.freeze([Ke]),bo=Object.freeze([P]),yo=Object.freeze([q]),Ht=Object.freeze([Ae]),Dn=Object.freeze([Pt]),Gn=Object.freeze([mo]),In=Object.freeze([bo]),Ft=Object.freeze([yo])});function Pn(t,e){let n=new TextEncoder().encode(t.name);if(n.length===0||n.length>255)throw new Error(`encodeEnvelope: codec name "${t.name}" encodes to ${n.length} bytes (must be 1\u2013255)`);let r=t.version;if(!Number.isInteger(r)||r<0||r>65535)throw new Error(`encodeEnvelope: codec.version ${r} out of u16 range (expected integer 0\u201365535)`);let o=2+n.length+2+e.length;if(o>4294967295)throw new Error(`encodeEnvelope: total envelope size ${o} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let s=new Uint8Array(o),i=0;return s[i++]=jt,s[i++]=n.length,s.set(n,i),i+=n.length,s[i++]=r>>>8&255,s[i++]=r&255,s.set(e,i),s}function $n(t,e){if(t.length<Ln)throw new Error(`decodeEnvelope: bytes too short (${t.length} < ${Ln})`);let n=0,r=t[n++];if(r!==jt)throw new Error(`decodeEnvelope: unsupported envelope version ${r} (expected ${jt})`);let o=t[n++];if(o===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(n+o+2>t.length)throw new Error(`decodeEnvelope: envelope truncated (need ${n+o+2} bytes, have ${t.length})`);let s=new TextDecoder().decode(t.subarray(n,n+o));n+=o;let i=(t[n]<<8|t[n+1])>>>0;n+=2;let a=t.subarray(n),c=e.lookupCodec(s);if(c==null)throw new Error(`decodeEnvelope: codec "${s}" not registered (envelope codec_v=${i})`);return{codec:c,codecVersion:i,payload:a}}function Hn(t){t.registerCodec(vo)}var vo,jt,Ln,Vt=Y(()=>{"use strict";vo={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)}},jt=1,Ln=4});function ve(t){if(t==null)return pe;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var pe,Ue=Y(()=>{"use strict";pe={type:"system",id:""}});function at(){return ke>0||Ye}function Fn(){return ke>0}function Qe(t){ke>0?Je.push(t):t()}function ce(t){ke+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(ke-=1,ke===0)if(e){if(!Ye){let n=Je.splice(0);for(let r of n)try{r()}catch{}_e.length=0,xe.length=0,Ce.length=0}}else _o()}}function _o(){let t=!Ye;t&&(Ye=!0);let e=[],n=0;try{for(;_e.length>0||xe.length>0||Ce.length>0||t&&Je.length>0;){if(t&&Je.length>0){let s=Je.splice(0);for(let i of s)try{i()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw _e.length=0,xe.length=0,Ce.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(_e.length>0?_e:xe.length>0?xe:Ce).splice(0);for(let s of o)try{s()}catch(i){e.push(i)}}}finally{t&&(Ye=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function ut(t,e,n){if(e.length===0)return;if(e.length===1){let u=n(e[0][0]);if(u<3||!at()){t(e);return}(u>=5?Ce:u===4?xe:_e).push(()=>t(e));return}let r=e.length,o=r,s=r,i=r,a=0;for(;a<r&&n(e[a][0])<3;)a++;for(o=a;a<r&&n(e[a][0])===3;)a++;for(s=a;a<r&&n(e[a][0])===4;)a++;i=a;let c=at();if(o>0){let u=e.slice(0,o);t(u)}if(s>o){let u=e.slice(o,s);c?_e.push(()=>t(u)):t(u)}if(i>s){let u=e.slice(s,i);c?xe.push(()=>t(u)):t(u)}if(r>i){let u=e.slice(i,r);c?Ce.push(()=>t(u)):t(u)}}var ke,Ye,_e,xe,Ce,Je,we=Y(()=>{"use strict";ke=0,Ye=!1,_e=[],xe=[],Ce=[],Je=[]});function Me(){return Math.trunc(performance.now()*1e6)}function he(){return Date.now()*1e6}var Xe=Y(()=>{"use strict"});function jn(t){t.registerMessageType(Ke,{tier:0,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1}),t.registerMessageType(oe,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(X,{tier:2,wireCrossing:!1}),t.registerMessageType(se,{tier:2,wireCrossing:!1}),t.registerMessageType(E,{tier:3,wireCrossing:!0}),t.registerMessageType(B,{tier:3,wireCrossing:!0}),t.registerMessageType(P,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(C,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(q,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var ct,Vn=Y(()=>{"use strict";W();ct=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_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}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.")}}});function qn(t){return Array.isArray(t)?[...t]:[t]}function xo(t,e){return t.has(e)||t.has("*")}function dt(t){let e=[];return t((o,s)=>{e.push({kind:"allow",actions:new Set(qn(o)),where:s?.where??(()=>!0)})},(o,s)=>{e.push({kind:"deny",actions:new Set(qn(o)),where:s?.where??(()=>!0)})}),(o,s)=>{let i=!1,a=!1;for(let c of e)xo(c.actions,s)&&c.where(o)&&(c.kind==="deny"?i=!0:a=!0);return i?!1:a}}function qt(t){let e=wo.filter(n=>t({type:n,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(n=>n==="human"||n==="llm"||n==="system")?"both":e.length===1?e[0]:e.join("+")}var Z,wo,De=Y(()=>{"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}};wo=["human","llm","wallet","system"]});function Wt(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(Wt);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Wt(t[n]);return e}return null}function Oo(t){let e=Eo.encode(t),n=e.length,r=n*8,o=n+9+63&-64,s=new Uint8Array(o);s.set(e),s[n]=128;let i=new DataView(s.buffer);i.setUint32(o-4,r>>>0,!1),i.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,c=3144134277,u=1013904242,l=2773480762,f=1359893119,p=2600822924,h=528734635,d=1541459225,g=new Uint32Array(64),m=(_,b)=>_>>>b|_<<32-b;for(let _=0;_<o;_+=64){for(let S=0;S<16;S++)g[S]=i.getUint32(_+S*4,!1);for(let S=16;S<64;S++){let k=g[S-15],A=g[S-2],F=m(k,7)^m(k,18)^k>>>3,U=m(A,17)^m(A,19)^A>>>10;g[S]=g[S-16]+F+g[S-7]+U>>>0}let b=a,y=c,w=u,T=l,x=f,O=p,N=h,M=d;for(let S=0;S<64;S++){let k=m(x,6)^m(x,11)^m(x,25),A=x&O^~x&N,F=M+k+A+To[S]+g[S]>>>0,U=m(b,2)^m(b,13)^m(b,22),re=b&y^b&w^y&w,ye=U+re>>>0;M=N,N=O,O=x,x=T+F>>>0,T=w,w=y,y=b,b=F+ye>>>0}a=a+b>>>0,c=c+y>>>0,u=u+w>>>0,l=l+T>>>0,f=f+x>>>0,p=p+O>>>0,h=h+N>>>0,d=d+M>>>0}let v=_=>_.toString(16).padStart(8,"0");return v(a)+v(c)+v(u)+v(l)+v(f)+v(p)+v(h)+v(d)}function Bt(t){let e=Wt(t??null),n=JSON.stringify(e);return Oo(n).slice(0,16)}function Ro(){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 zt(t,e,n){let r=n?.id??Ro();if(t===0)return{id:r,version:0};let s=(n?.hash??Bt)(e);return{id:r,version:0,cid:s,prev:null}}function Wn(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var To,Eo,Bn=Y(()=>{"use strict";To=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]),Eo=new TextEncoder});function Un(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Kt(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function lt(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function Ee(t,e,n){let r=Yn(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,s={};return Yn(t)?s=(Ut(e)?e:n)??{}:Ut(t)?s=t:s=(Ut(e)?e:n)??{},new $(r,o,s)}var zn,Kn,No,So,Te,$,Yn,Ut,Ge=Y(()=>{"use strict";Vt();Ue();we();Xe();Vn();De();W();Bn();zn=()=>{},Kn=100;No=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},So=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let s=o._cached,i=s===void 0?[$t]:[$t,[E,s]];o._status==="dirty"&&i.push(Ae),ut(e,i,o._config.tierOf)},Te=new ct({onMessage:No,onSubscribe:So});jn(Te);Hn(Te);$=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??Te,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??Bt;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?zt(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Un);let s={};for(let[a,c]of Object.entries(r.meta??{})){let u={initial:c,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(u.guard=r.guard),s[a]=new t([],void 0,u)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let i=this;this._actions={emit(a){i._emit([[E,a]])},down(a){i._emit(lt(a))},up(a){i._emitUp(lt(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 s=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??n?.id,c=i?.version??0,u=zt(e,s,{id:a,hash:o});u.version=c,this._versioning=u,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=ve(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=ve(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,s))throw new Z({actor:o,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(o,s))throw new Z({actor:o,action:s,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:he()}}down(e,n){let r=lt(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[E,e]])}up(e,n){if(this._deps.length===0)return;let r=lt(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.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 c=ve(n);if(!this._guard(c,"observe"))throw new Z({actor:c,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 c of this._deps)Kt(c);if(this._partial===!1){for(let c of this._deps)if(c.prevData!==void 0||c.dataBatch.length!==0||c.terminal!==void 0||c.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(c){throw this._sinkCount-=1,c}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(c){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw c}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),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,s=this._deps[r];s.unsub=zn,s.unsub=s.node.subscribe(i=>{if(s.unsub===null)return;let a=this._config.tierOf,c=!1;for(let u of i)a(u[0])>=3&&(c=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:o},this._actions);c&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let s=this._deps[o];if(s.unsub!=null){let i=s.unsub;s.unsub=null;try{i()}catch{}Kt(s)}}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=Un(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ht),r.unsub=zn;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let s=this._config.tierOf,i=!1;for(let a of o)s(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);i&&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([[C,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([[C,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{}}Kt(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 s={kind:"dep_message",depIndex:e,message:n};for(let i of this._inspectorHooks)i(s)}if(o!==Ke){if(o===I){this._depDirtied(r);return}if(o===oe){this._depInvalidated(r),this._emit(Gn);return}if(o===X||o===se){this._emit([n]);return}if(o===q){this._emit(Ft);return}if(o===E)this._depSettledAsData(r,n[1]);else if(o===B)this._depSettledAsResolved(r);else if(o===P)this._depSettledAsTerminal(r,!0);else if(o===C)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===E||o===B)&&this._emit([n]),(o===P||o===C)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ht))}_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(Dn),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([[C,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(In)}_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(i){this._emit([[C,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(a){this._emit([[C,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),r=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=n[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let o=this._deps.map(i=>i.terminal),s={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:n,prevData:r};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(n,this._actions,s);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let a=i;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[C,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Kn?(this._rerunDepth=0,this._emit([[C,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Kn} \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"?[Ae,e[0]]:e;let r=!0,o=!1,s=!1,i=-1;for(let c of e){let u=n(c[0]);u<i&&(r=!1),u===3&&(o=!0),c[0]===I&&(s=!0),i=u}let a=e;if(!r){let c=e.map((u,l)=>({m:u,i:l,tier:n(u[0])}));c.sort((u,l)=>u.tier-l.tier||u.i-l.i),a=c.map(u=>u.m)}if(o&&!s&&this._status!=="dirty"){let c=0;for(;c<a.length&&n(a[c][0])===0;)c++;return c===0?[Ae,...a]:[...a.slice(0,c),Ae,...a.slice(c)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let c=e[a];if(c[0]===C&&c[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(c=>c[0]===q||c[0]===oe);if(a.length===0)return;n=a}n=this._frameBatch(n);let o=null;for(let a=0;a<n.length;a++){let c=n[a],u=c[0];if(u!==X&&u!==se){o?.push(c);continue}if(c.length<2)throw new Error(`Node "${this.name}": [[${u===X?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let f=c[1];if(u===X)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))l=!1;else if(this._pauseLocks.delete(f),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())}}l?o?.push(c):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]===q))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Ft)}catch{}let{finalMessages:s,equalsError:i}=this._updateState(n);if(s.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,c=[];for(let u of s)a(u[0])===3?this._pauseBuffer.push(u):c.push(u);c.length>0&&this._dispatchOrAccumulate(c)}else this._dispatchOrAccumulate(s);i!=null&&this._emit([[C,i]])}_updateState(e){let n=this._config.tierOf,r,o,s=-1,i=0;for(let l of e)n(l[0])===3&&i++;let a=i<=1,c=-1;if(this._versioning!=null&&i>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===E){c=l;break}}for(let l=0;l<e.length;l++){let f=e[l],p=f[0];if(p===E){if(f.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,f[1])}catch(d){o=this._wrapFnError("equals threw",d),s=l;break}if(h){r==null&&(r=e.slice(0,l)),r.push(Pt),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(c<0||l===c)&&Wn(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),p===I)this._status="dirty";else if(p===B)this._status="resolved";else if(p===P)this._status="completed";else if(p===C)this._status="errored";else if(p===oe){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 d=h.invalidate;if(typeof d=="function")try{d()}catch{}}}else p===q&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=s>=0?r??e.slice(0,s):r??e;return o!=null?{finalMessages:u,equalsError:o}:{finalMessages:u}}_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(Fn()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Qe(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}ut(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);ut(this._deliverToSinks,n,this._config.tierOf)}},Yn=t=>Array.isArray(t),Ut=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function V(t,e){return Ee([],{...e,initial:t})}function Ie(t,e){return Ee((r,o,s)=>t(o,s)??void 0,{describeKind:"producer",...e})}function ie(t,e,n){return Ee(t,(o,s,i)=>{let a=o.map((c,u)=>c!=null&&c.length>0?c.at(-1):i.prevData[u]);s.emit(e(a,i))},{describeKind:"derived",...n})}function Yt(t,e,n){let r=new Map;return t.forEach((o,s)=>{r.set(o,s)}),ie(t,(o,s)=>e(a=>{let c=r.get(a);if(c==null)throw new Error(`dynamicNode: untracked dep "${a.name??"<unnamed>"}"`);return o[c]},s),n)}function Ze(t,e){let n,r=new Map,o=(s,i,a)=>{let c=!1,u=l=>{let f=r.get(l);if(f!==void 0){if(f<s.length){let h=s[f];return h!=null&&h.length>0?h.at(-1):a.prevData[f]}return l.cache}c=!0;let p=n._addDep(l);return r.set(l,p),l.cache};try{let l=t(u,a);c||(i.emit(l),a.store.__autoTrackLastDiscoveryError!=null&&delete a.store.__autoTrackLastDiscoveryError)}catch(l){if(!c)throw l;a.store.__autoTrackLastDiscoveryError=l}};return n=new $([],o,{describeKind:"derived",...e}),n}var de=Y(()=>{"use strict";Ge()});function nt(t,e,n){let r=new Set;for(let o of t.split(",")){let[s,i]=o.split("/"),a=i?Number.parseInt(i,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let c,u;if(s==="*")c=e,u=n;else if(s.includes("-")){let[l,f]=s.split("-");c=Number.parseInt(l,10),u=Number.parseInt(f,10)}else c=Number.parseInt(s,10),u=c;if(Number.isNaN(c)||Number.isNaN(u))throw new Error(`Invalid cron field: ${t}`);if(c<e||u>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(c>u)throw new Error(`Invalid cron range: ${c}-${u} in ${t}`);for(let l=c;l<=u;l+=a)r.add(l)}return r}function fr(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:nt(e[0],0,59),hours:nt(e[1],0,23),daysOfMonth:nt(e[2],1,31),months:nt(e[3],1,12),daysOfWeek:nt(e[4],0,6)}}function pr(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 hr=Y(()=>{"use strict"});function gr(t){return{describeKind:"producer",...t}}function mr(t,e){let{signal:n,period:r,...o}=e??{};return Ie(s=>{let i=!1,a=0,c,u,l=()=>{i=!0,c!==void 0&&clearTimeout(c),u!==void 0&&clearInterval(u),n?.removeEventListener("abort",p)},f=()=>{i||(r!=null?(s.emit(a++),u=setInterval(()=>{i||s.emit(a++)},r)):(i=!0,n?.removeEventListener("abort",p),s.emit(a++),s.down([[P]])))},p=()=>{i||(l(),s.down([[C,n.reason]]))};if(n?.aborted){p();return}return c=setTimeout(f,t),n?.addEventListener("abort",p,{once:!0}),l},gr(o))}function br(t,e){let n=fr(t),{tickMs:r,output:o,...s}=e??{},i=r??6e4,a=o==="date";return Ie(c=>{let u=-1,l=()=>{let p=new Date,h=p.getFullYear()*1e8+(p.getMonth()+1)*1e6+p.getDate()*1e4+p.getHours()*100+p.getMinutes();h!==u&&pr(n,p)&&(u=h,c.emit(a?p:he()))};l();let f=setInterval(l,i);return()=>clearInterval(f)},{...gr(s),name:s.name??`cron:${t}`})}function ge(t){return t.subscribe(()=>{})}var gt=Y(()=>{"use strict";Xe();W();de();hr()});var _t,Er=Y(()=>{"use strict";_t=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 Xs={};ue(Xs,{jotai:()=>Jt,nanostores:()=>Xt,nestjs:()=>hn,react:()=>gn,signals:()=>yn,solid:()=>vn,svelte:()=>_n,vue:()=>xn,zustand:()=>wn});module.exports=lo(Xs);var Jt={};ue(Jt,{atom:()=>Ao});W();de();function Ao(t,e,n){if(typeof t=="function"){let r=t;return typeof e=="function"?Jn(r,e,n):Jn(r,void 0,e)}return ko(t,e)}function et(t){let e=t.cache,n;if(t.subscribe(o=>{for(let[s,i]of o)s===E&&(e=i),s===C&&(n=i)})(),n)throw n;return e}function ko(t,e){let n=V(t,{...e,resubscribable:!0,resetOnTeardown:!0});return{get:()=>n.status==="sentinel"?et(n):n.cache,set:r=>n.emit(r),update:r=>{let o=n.status==="sentinel"?et(n):n.cache;n.emit(r(o))},subscribe:r=>{let o=!0;return n.subscribe(s=>{for(let[i,a]of s)if(i===E){if(o){o=!1;continue}r(a)}})},meta:n.meta,_node:n}}function Jn(t,e,n){let r=Ze(s=>t(i=>{let a=i._node;return a.status==="sentinel"&&et(a),s(a)}),{...n,resubscribable:!0,resetOnTeardown:!0}),o={get:()=>r.status==="sentinel"?et(r):r.cache,subscribe:s=>{let i=!0;return r.subscribe(a=>{for(let[c,u]of a)if(c===E){if(i){i=!1;continue}s(u)}})},meta:r.meta,_node:r};if(e){let s=c=>c.get(),i=(c,u)=>c.set(u),a=o;return a.set=c=>e(s,i,c),a.update=c=>{let u=r.status==="sentinel"?et(r):r.cache;return e(s,i,c(u))},a}return o}var Xt={};ue(Xt,{action:()=>Lo,atom:()=>Co,computed:()=>Mo,getValue:()=>Go,map:()=>Do,onMount:()=>Io,onStart:()=>Zn,onStop:()=>er});we();W();de();var pt=new WeakMap,ht=new WeakMap;function ft(t,e){let n=e.get(t);if(n)for(let r of n)r()}function Qt(t,e={}){let n=0;return{...e,get:()=>Xn(t),subscribe:o=>{n===0&&ft(t,pt),n++;let s=t.subscribe(i=>{for(let[a,c]of i)a===E&&o(c)});return()=>{s(),n--,n===0&&ft(t,ht)}},listen:o=>{n===0&&ft(t,pt),n++;let s=!0,i=t.subscribe(a=>{for(let[c,u]of a)if(c===E){if(s){s=!1;continue}o(u)}});return()=>{i(),n--,n===0&&ft(t,ht)}},_node:t}}function Qn(t){let e=t.cache,n;if(t.subscribe(o=>{for(let[s,i]of o)s===E&&(e=i),s===C&&(n=i)})(),n)throw n;return e}function Xn(t){return t.status==="sentinel"?Qn(t):t.cache}function Co(t){let e=V(t,{resubscribable:!0,resetOnTeardown:!0});return Qt(e,{set:n=>e.emit(n)})}function Mo(t,e){let n=Array.isArray(t)?t:[t],r=n.map(s=>s._node),o=Yt(r,s=>{let i=n.map(a=>{let c=a._node;return c.status==="sentinel"&&Qn(c),s(c)});return e(...i)},{resubscribable:!0,resetOnTeardown:!0,equals:Object.is});return Qt(o)}function Do(t){let e=V(t,{resubscribable:!0,resetOnTeardown:!0,equals:()=>!1});return Qt(e,{set:n=>e.emit(n),setKey:(n,r)=>{let o=Xn(e);e.emit({...o,[n]:r})}})}function Go(t){return t.get()}function Zn(t,e){let n=t._node,r=pt.get(n);r||(r=new Set,pt.set(n,r)),r.add(e)}function er(t,e){let n=t._node,r=ht.get(n);r||(r=new Set,ht.set(n,r)),r.add(e)}function Io(t,e){Zn(t,()=>{let n=e();typeof n=="function"&&er(t,n)})}function Lo(t,e,n){return(...r)=>{let o;return ce(()=>{o=n(...r)}),o}}var hn={};ue(hn,{ACTOR_KEY:()=>yt,COMMAND_HANDLERS:()=>He,CQRS_EVENT_HANDLERS:()=>Fe,CRON_HANDLERS:()=>$e,CommandHandler:()=>ur,EVENT_HANDLERS:()=>Le,EventHandler:()=>cr,GRAPHREFLY_REQUEST_GRAPH:()=>Oe,GRAPHREFLY_ROOT_GRAPH:()=>ee,GraphCron:()=>ar,GraphInterval:()=>ir,GraphReflyEventExplorer:()=>Re,GraphReflyGuard:()=>Tr,GraphReflyGuardImpl:()=>rt,GraphReflyModule:()=>kt,INTERVAL_HANDLERS:()=>Pe,InjectCqrsGraph:()=>rr,InjectGraph:()=>nr,InjectNode:()=>or,ObserveGateway:()=>bt,OnGraphEvent:()=>sr,QUERY_HANDLERS:()=>je,QueryHandler:()=>dr,SAGA_HANDLERS:()=>Ve,SagaHandler:()=>lr,fromHeader:()=>xr,fromJwtPayload:()=>nn,getActor:()=>wr,getGraphToken:()=>K,getNodeToken:()=>ae,observeSSE:()=>vr,observeSubscription:()=>_r,toObservable:()=>tr});var Zt=require("rxjs");W();function tr(t,e){return e?.raw?new Zt.Observable(n=>t.subscribe(o=>{if(!n.closed){n.next(o);for(let s of o){if(s[0]===C){n.error(s[1]);return}if(s[0]===P){n.complete();return}}}})):new Zt.Observable(n=>t.subscribe(o=>{for(let s of o){if(n.closed)return;if(s[0]===E)n.next(s[1]);else if(s[0]===C){n.error(s[1]);return}else if(s[0]===P){n.complete();return}}}))}var tt=require("@nestjs/common");var ee=Symbol.for("graphrefly:root-graph");var Oe=Symbol.for("graphrefly:request-graph");function K(t){return Symbol.for(`graphrefly:graph:${t}`)}function ae(t){return Symbol.for(`graphrefly:node:${t}`)}var Le=new Map,Pe=new Map,$e=new Map,He=new Map,Fe=new Map,je=new Map,Ve=new Map;function nr(t){return t==="request"?(0,tt.Inject)(Oe):(0,tt.Inject)(t?K(t):ee)}function rr(t){return(0,tt.Inject)(K(t))}function or(t){return(0,tt.Inject)(ae(t))}function sr(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=Le.get(o)??[];s.push({nodeName:t,methodKey:r}),Le.set(o,s)})}}function ir(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=Pe.get(o)??[];s.push({ms:t,methodKey:r}),Pe.set(o,s)})}}function ar(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=$e.get(o)??[];s.push({expr:t,methodKey:r}),$e.set(o,s)})}}function ur(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=He.get(s)??[];i.push({cqrsName:t,commandName:e,methodKey:o}),He.set(s,i)})}}function cr(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=Fe.get(s)??[];i.push({cqrsName:t,eventName:e,methodKey:o}),Fe.set(s,i)})}}function dr(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=je.get(s)??[];i.push({cqrsName:t,projectionName:e,methodKey:o}),je.set(s,i)})}}function lr(t,e,n){return(r,o)=>{let s=o.name;o.addInitializer(function(){let i=this.constructor,a=Ve.get(i)??[];a.push({cqrsName:t,eventNames:n,sagaName:e,methodKey:s}),Ve.set(i,a)})}}W();gt();var yr=0,Re=class{constructor(e,n){this.graph=e;this.moduleRef=n}disposers=[];scheduleNodeNames=[];onModuleInit(){this.wireEvents(),this.wireIntervals(),this.wireCrons(),this.wireCqrsCommands(),this.wireCqrsEvents(),this.wireCqrsQueries(),this.wireCqrsSagas()}onModuleDestroy(){for(let e of this.disposers)e();this.disposers.length=0;for(let e of this.scheduleNodeNames)try{this.graph.remove(e)}catch{}this.scheduleNodeNames.length=0}wireEvents(){for(let[e,n]of Le){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireEventHandler(r,o)}}wireEventHandler(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),i=this.observeNode(n.nodeName).subscribe(a=>{for(let c of a)c[0]===E&&o(c[1])});this.disposers.push(i)}wireIntervals(){for(let[e,n]of Pe){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireIntervalHandler(r,e,o)}}wireIntervalHandler(e,n,r){let o=e[r.methodKey];if(typeof o!="function")return;let s=o.bind(e),a=`__schedule__.${n.name??"anonymous"}.${String(r.methodKey)}.${yr++}`,c=mr(r.ms,{period:r.ms,name:a});this.graph.add(c),this.scheduleNodeNames.push(a);let l=this.observeNode(a).subscribe(f=>{for(let p of f)p[0]===E&&s(p[1])});this.disposers.push(l)}wireCrons(){for(let[e,n]of $e){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCronHandler(r,e,o)}}wireCronHandler(e,n,r){let o=e[r.methodKey];if(typeof o!="function")return;let s=o.bind(e),a=`__schedule__.${n.name??"anonymous"}.${String(r.methodKey)}.${yr++}`,c=br(r.expr,{name:a});this.graph.add(c),this.scheduleNodeNames.push(a);let l=this.observeNode(a).subscribe(f=>{for(let p of f)p[0]===E&&s(p[1])});this.disposers.push(l)}wireCqrsCommands(){for(let[e,n]of He){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsCommand(r,o)}}wireCqrsCommand(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);s&&s.command(n.commandName,o)}wireCqrsEvents(){for(let[e,n]of Fe){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsEventHandler(r,o)}}wireCqrsEventHandler(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);if(!s)return;s.event(n.eventName);let a=s.resolve(n.eventName).cache,c=a&&a.length>0?a[a.length-1].seq:0,l=this.observeNodeOn(s,n.eventName).subscribe(f=>{for(let p of f)if(p[0]===E){let h=p[1];for(let d of h)d.seq>c&&(o(d),c=d.seq)}});this.disposers.push(l)}wireCqrsQueries(){for(let[e,n]of je){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsQuery(r,o)}}wireCqrsQuery(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);if(!s)return;let a=this.observeNodeOn(s,n.projectionName).subscribe(c=>{for(let u of c)u[0]===E&&o(u[1])});this.disposers.push(a)}wireCqrsSagas(){for(let[e,n]of Ve){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsSaga(r,o)}}wireCqrsSaga(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);s&&s.saga(n.sagaName,n.eventNames,o)}observeNode(e){return this.graph.observe(e)}observeNodeOn(e,n){return e.observe(n)}resolveCqrsGraph(e){try{return this.moduleRef.get(K(e),{strict:!1})}catch{return console.warn(`[GraphReFly] CqrsGraph "${e}" not found in DI \u2014 did you import GraphReflyModule.forCqrs({ name: "${e}" })?`),null}}resolveInstance(e){try{return this.moduleRef.get(e,{strict:!1})}catch{return null}}};W();W();var Po=0;function mt(t,e){if(e.highWaterMark<1)throw new RangeError("highWaterMark must be >= 1");if(e.lowWaterMark<0)throw new RangeError("lowWaterMark must be >= 0");if(e.lowWaterMark>=e.highWaterMark)throw new RangeError("lowWaterMark must be < highWaterMark");let n=Symbol(`bp-${++Po}`),r=0,o=!1;return{onEnqueue(){return r+=1,!o&&r>=e.highWaterMark?(o=!0,t([[X,n]]),!0):!1},onDequeue(){return r>0&&(r-=1),o&&r<=e.lowWaterMark?(o=!1,t([[se,n]]),!0):!1},get pending(){return r},get paused(){return o},dispose(){o&&(o=!1,t([[se,n]]))}}}function vr(t,e,n){let{actor:r,serialize:o=$o,keepAliveMs:s,signal:i}=n??{},a=new TextEncoder,c,u=n?.highWaterMark!=null,l,f,p=[],h=!1;return new ReadableStream({start(d){let g,m=()=>{},v=()=>{if(!h){h=!0,g!==void 0&&clearInterval(g),i?.removeEventListener("abort",_),m(),l?.dispose(),f?.(),f=void 0;for(let y of p)d.enqueue(y.frame);p.length=0,d.close()}};c=v;let _=()=>v(),b=t.observe(e,{actor:r});u&&(l=mt(y=>b.up(y),{highWaterMark:n.highWaterMark,lowWaterMark:n.lowWaterMark??Math.floor(n.highWaterMark/2)})),m=b.subscribe(y=>{for(let w of y){if(h)return;let T=w[0];if(T===E){let x=a.encode(en("data",o(w[1])));u?(p.push({frame:x,counted:!0}),l.onEnqueue(),f?.(),f=void 0):d.enqueue(x)}else if(T===C){let x=a.encode(en("error",o(w[1])));u?(p.push({frame:x,counted:!1}),f?.(),f=void 0):d.enqueue(x),v();return}else if(T===P||T===q){if(T===P){let x=a.encode(en("complete"));u?(p.push({frame:x,counted:!1}),f?.(),f=void 0):d.enqueue(x)}v();return}}}),s!==void 0&&s>0&&(g=setInterval(()=>{h||(u?(p.push({frame:a.encode(`: keepalive
1
+ "use strict";var so=Object.create;var Se=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var ao=Object.prototype.hasOwnProperty;var Sn=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ze=t=>{throw TypeError(t)};var uo=(t,e,n)=>e in t?Se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var En=(t,e)=>Se(t,"name",{value:e,configurable:!0});var Y=(t,e)=>()=>(t&&(e=t(t=0)),e);var ue=(t,e)=>{for(var n in e)Se(t,n,{get:e[n],enumerable:!0})},co=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of io(e))!ao.call(t,o)&&o!==n&&Se(t,o,{get:()=>e[o],enumerable:!(r=Nn(e,o))||r.enumerable});return t};var lo=t=>co(Se({},"__esModule",{value:!0}),t);var An=t=>[,,,so(t?.[Sn("metadata")]??null)],kn=["class","method","getter","setter","accessor","field","value","get","set"],Be=t=>t!==void 0&&typeof t!="function"?ze("Function expected"):t,fo=(t,e,n,r,o)=>({kind:kn[t],name:e,metadata:r,addInitializer:s=>n._?ze("Already initialized"):o.push(Be(s||null))}),po=(t,e)=>uo(e,Sn("metadata"),t[3]),Cn=(t,e,n,r)=>{for(var o=0,s=t[e>>1],i=s&&s.length;o<i;o++)e&1?s[o].call(n):r=s[o].call(n,r);return r},Mn=(t,e,n,r,o,s)=>{var i,a,c,u,l,f=e&7,p=!!(e&8),h=!!(e&16),d=f>3?t.length+1:f?p?1:2:0,g=kn[f+5],m=f>3&&(t[d-1]=[]),v=t[d]||(t[d]=[]),_=f&&(!h&&!p&&(o=o.prototype),f<5&&(f>3||!h)&&Nn(f<4?o:{get[n](){return On(this,s)},set[n](y){return Rn(this,s,y)}},n));f?h&&f<4&&En(s,(f>2?"set ":f>1?"get ":"")+n):En(o,n);for(var b=r.length-1;b>=0;b--)u=fo(f,n,c={},t[3],v),f&&(u.static=p,u.private=h,l=u.access={has:h?y=>ho(o,y):y=>n in y},f^3&&(l.get=h?y=>(f^1?On:go)(y,o,f^4?s:_.get):y=>y[n]),f>2&&(l.set=h?(y,w)=>Rn(y,o,w,f^4?s:_.set):(y,w)=>y[n]=w)),a=(0,r[b])(f?f<4?h?s:_[g]:f>4?void 0:{get:_.get,set:_.set}:o,u),c._=1,f^4||a===void 0?Be(a)&&(f>4?m.unshift(a):f?h?s=a:_[g]=a:o=a):typeof a!="object"||a===null?ze("Object expected"):(Be(i=a.get)&&(_.get=i),Be(i=a.set)&&(_.set=i),Be(i=a.init)&&m.unshift(i));return f||po(t,o),_&&Se(o,n,_),h?f^4?s:_:o};var Lt=(t,e,n)=>e.has(t)||ze("Cannot "+n),ho=(t,e)=>Object(e)!==e?ze('Cannot use the "in" operator on this value'):t.has(e),On=(t,e,n)=>(Lt(t,e,"read from private field"),n?n.call(t):e.get(t));var Rn=(t,e,n,r)=>(Lt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),go=(t,e,n)=>(Lt(t,e,"access private method"),n);var Ke,E,I,B,oe,X,se,q,P,C,Ae,Pt,mo,$t,bo,yo,Ht,Dn,Gn,In,Ft,W=Y(()=>{"use strict";Ke=Symbol.for("graphrefly/START"),E=Symbol.for("graphrefly/DATA"),I=Symbol.for("graphrefly/DIRTY"),B=Symbol.for("graphrefly/RESOLVED"),oe=Symbol.for("graphrefly/INVALIDATE"),X=Symbol.for("graphrefly/PAUSE"),se=Symbol.for("graphrefly/RESUME"),q=Symbol.for("graphrefly/TEARDOWN"),P=Symbol.for("graphrefly/COMPLETE"),C=Symbol.for("graphrefly/ERROR"),Ae=Object.freeze([I]),Pt=Object.freeze([B]),mo=Object.freeze([oe]),$t=Object.freeze([Ke]),bo=Object.freeze([P]),yo=Object.freeze([q]),Ht=Object.freeze([Ae]),Dn=Object.freeze([Pt]),Gn=Object.freeze([mo]),In=Object.freeze([bo]),Ft=Object.freeze([yo])});function Pn(t,e){let n=new TextEncoder().encode(t.name);if(n.length===0||n.length>255)throw new Error(`encodeEnvelope: codec name "${t.name}" encodes to ${n.length} bytes (must be 1\u2013255)`);let r=t.version;if(!Number.isInteger(r)||r<0||r>65535)throw new Error(`encodeEnvelope: codec.version ${r} out of u16 range (expected integer 0\u201365535)`);let o=2+n.length+2+e.length;if(o>4294967295)throw new Error(`encodeEnvelope: total envelope size ${o} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let s=new Uint8Array(o),i=0;return s[i++]=jt,s[i++]=n.length,s.set(n,i),i+=n.length,s[i++]=r>>>8&255,s[i++]=r&255,s.set(e,i),s}function $n(t,e){if(t.length<Ln)throw new Error(`decodeEnvelope: bytes too short (${t.length} < ${Ln})`);let n=0,r=t[n++];if(r!==jt)throw new Error(`decodeEnvelope: unsupported envelope version ${r} (expected ${jt})`);let o=t[n++];if(o===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(n+o+2>t.length)throw new Error(`decodeEnvelope: envelope truncated (need ${n+o+2} bytes, have ${t.length})`);let s=new TextDecoder().decode(t.subarray(n,n+o));n+=o;let i=(t[n]<<8|t[n+1])>>>0;n+=2;let a=t.subarray(n),c=e.lookupCodec(s);if(c==null)throw new Error(`decodeEnvelope: codec "${s}" not registered (envelope codec_v=${i})`);return{codec:c,codecVersion:i,payload:a}}function Hn(t){t.registerCodec(vo)}var vo,jt,Ln,Vt=Y(()=>{"use strict";vo={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)}},jt=1,Ln=4});function ve(t){if(t==null)return pe;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var pe,Ue=Y(()=>{"use strict";pe={type:"system",id:""}});function at(){return ke>0||Ye}function Fn(){return ke>0}function Qe(t){ke>0?Je.push(t):t()}function ce(t){ke+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(ke-=1,ke===0)if(e){if(!Ye){let n=Je.splice(0);for(let r of n)try{r()}catch{}_e.length=0,xe.length=0,Ce.length=0}}else _o()}}function _o(){let t=!Ye;t&&(Ye=!0);let e=[],n=0;try{for(;_e.length>0||xe.length>0||Ce.length>0||t&&Je.length>0;){if(t&&Je.length>0){let s=Je.splice(0);for(let i of s)try{i()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw _e.length=0,xe.length=0,Ce.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(_e.length>0?_e:xe.length>0?xe:Ce).splice(0);for(let s of o)try{s()}catch(i){e.push(i)}}}finally{t&&(Ye=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function ut(t,e,n){if(e.length===0)return;if(e.length===1){let u=n(e[0][0]);if(u<3||!at()){t(e);return}(u>=5?Ce:u===4?xe:_e).push(()=>t(e));return}let r=e.length,o=r,s=r,i=r,a=0;for(;a<r&&n(e[a][0])<3;)a++;for(o=a;a<r&&n(e[a][0])===3;)a++;for(s=a;a<r&&n(e[a][0])===4;)a++;i=a;let c=at();if(o>0){let u=e.slice(0,o);t(u)}if(s>o){let u=e.slice(o,s);c?_e.push(()=>t(u)):t(u)}if(i>s){let u=e.slice(s,i);c?xe.push(()=>t(u)):t(u)}if(r>i){let u=e.slice(i,r);c?Ce.push(()=>t(u)):t(u)}}var ke,Ye,_e,xe,Ce,Je,we=Y(()=>{"use strict";ke=0,Ye=!1,_e=[],xe=[],Ce=[],Je=[]});function Me(){return Math.trunc(performance.now()*1e6)}function he(){return Date.now()*1e6}var Xe=Y(()=>{"use strict"});function jn(t){t.registerMessageType(Ke,{tier:0,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1}),t.registerMessageType(oe,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(X,{tier:2,wireCrossing:!1}),t.registerMessageType(se,{tier:2,wireCrossing:!1}),t.registerMessageType(E,{tier:3,wireCrossing:!0}),t.registerMessageType(B,{tier:3,wireCrossing:!0}),t.registerMessageType(P,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(C,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(q,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var ct,Vn=Y(()=>{"use strict";W();ct=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_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}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.")}}});function qn(t){return Array.isArray(t)?[...t]:[t]}function xo(t,e){return t.has(e)||t.has("*")}function dt(t){let e=[];return t((o,s)=>{e.push({kind:"allow",actions:new Set(qn(o)),where:s?.where??(()=>!0)})},(o,s)=>{e.push({kind:"deny",actions:new Set(qn(o)),where:s?.where??(()=>!0)})}),(o,s)=>{let i=!1,a=!1;for(let c of e)xo(c.actions,s)&&c.where(o)&&(c.kind==="deny"?i=!0:a=!0);return i?!1:a}}function qt(t){let e=wo.filter(n=>t({type:n,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(n=>n==="human"||n==="llm"||n==="system")?"both":e.length===1?e[0]:e.join("+")}var Z,wo,De=Y(()=>{"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}};wo=["human","llm","wallet","system"]});function Wt(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(Wt);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Wt(t[n]);return e}return null}function Oo(t){let e=Eo.encode(t),n=e.length,r=n*8,o=n+9+63&-64,s=new Uint8Array(o);s.set(e),s[n]=128;let i=new DataView(s.buffer);i.setUint32(o-4,r>>>0,!1),i.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,c=3144134277,u=1013904242,l=2773480762,f=1359893119,p=2600822924,h=528734635,d=1541459225,g=new Uint32Array(64),m=(_,b)=>_>>>b|_<<32-b;for(let _=0;_<o;_+=64){for(let S=0;S<16;S++)g[S]=i.getUint32(_+S*4,!1);for(let S=16;S<64;S++){let k=g[S-15],A=g[S-2],F=m(k,7)^m(k,18)^k>>>3,U=m(A,17)^m(A,19)^A>>>10;g[S]=g[S-16]+F+g[S-7]+U>>>0}let b=a,y=c,w=u,T=l,x=f,O=p,N=h,M=d;for(let S=0;S<64;S++){let k=m(x,6)^m(x,11)^m(x,25),A=x&O^~x&N,F=M+k+A+To[S]+g[S]>>>0,U=m(b,2)^m(b,13)^m(b,22),re=b&y^b&w^y&w,ye=U+re>>>0;M=N,N=O,O=x,x=T+F>>>0,T=w,w=y,y=b,b=F+ye>>>0}a=a+b>>>0,c=c+y>>>0,u=u+w>>>0,l=l+T>>>0,f=f+x>>>0,p=p+O>>>0,h=h+N>>>0,d=d+M>>>0}let v=_=>_.toString(16).padStart(8,"0");return v(a)+v(c)+v(u)+v(l)+v(f)+v(p)+v(h)+v(d)}function Bt(t){let e=Wt(t??null),n=JSON.stringify(e);return Oo(n).slice(0,16)}function Ro(){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 zt(t,e,n){let r=n?.id??Ro();if(t===0)return{id:r,version:0};let s=(n?.hash??Bt)(e);return{id:r,version:0,cid:s,prev:null}}function Wn(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var To,Eo,Bn=Y(()=>{"use strict";To=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]),Eo=new TextEncoder});function Un(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Kt(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function lt(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function Ee(t,e,n){let r=Yn(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,s={};return Yn(t)?s=(Ut(e)?e:n)??{}:Ut(t)?s=t:s=(Ut(e)?e:n)??{},new $(r,o,s)}var zn,Kn,No,So,Te,$,Yn,Ut,Ge=Y(()=>{"use strict";Vt();Ue();we();Xe();Vn();De();W();Bn();zn=()=>{},Kn=100;No=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},So=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let s=o._cached,i=s===void 0?[$t]:[$t,[E,s]];o._status==="dirty"&&i.push(Ae),ut(e,i,o._config.tierOf)},Te=new ct({onMessage:No,onSubscribe:So});jn(Te);Hn(Te);$=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??Te,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??Bt;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?zt(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Un);let s={};for(let[a,c]of Object.entries(r.meta??{})){let u={initial:c,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(u.guard=r.guard),s[a]=new t([],void 0,u)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let i=this;this._actions={emit(a){i._emit([[E,a]])},down(a){i._emit(lt(a))},up(a){i._emitUp(lt(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 s=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??n?.id,c=i?.version??0,u=zt(e,s,{id:a,hash:o});u.version=c,this._versioning=u,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=ve(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=ve(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,s))throw new Z({actor:o,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(o,s))throw new Z({actor:o,action:s,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:he()}}down(e,n){let r=lt(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[E,e]])}up(e,n){if(this._deps.length===0)return;let r=lt(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.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 c=ve(n);if(!this._guard(c,"observe"))throw new Z({actor:c,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 c of this._deps)Kt(c);if(this._partial===!1){for(let c of this._deps)if(c.prevData!==void 0||c.dataBatch.length!==0||c.terminal!==void 0||c.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(c){throw this._sinkCount-=1,c}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(c){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw c}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),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,s=this._deps[r];s.unsub=zn,s.unsub=s.node.subscribe(i=>{if(s.unsub===null)return;let a=this._config.tierOf,c=!1;for(let u of i)a(u[0])>=3&&(c=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:o},this._actions);c&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let s=this._deps[o];if(s.unsub!=null){let i=s.unsub;s.unsub=null;try{i()}catch{}Kt(s)}}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=Un(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ht),r.unsub=zn;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let s=this._config.tierOf,i=!1;for(let a of o)s(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);i&&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([[C,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([[C,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{}}Kt(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 s={kind:"dep_message",depIndex:e,message:n};for(let i of this._inspectorHooks)i(s)}if(o!==Ke){if(o===I){this._depDirtied(r);return}if(o===oe){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Gn);return}if(o===X||o===se){this._emit([n]);return}if(o===q){this._emit(Ft);return}if(o===E)this._depSettledAsData(r,n[1]);else if(o===B)this._depSettledAsResolved(r);else if(o===P)this._depSettledAsTerminal(r,!0);else if(o===C)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===E||o===B)&&this._emit([n]),(o===P||o===C)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ht))}_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(Dn),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([[C,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(In)}_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(i){this._emit([[C,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(a){this._emit([[C,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),r=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=n[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let o=this._deps.map(i=>i.terminal),s={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:n,prevData:r};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(n,this._actions,s);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let a=i;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[C,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Kn?(this._rerunDepth=0,this._emit([[C,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Kn} \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"?[Ae,e[0]]:e;let r=!0,o=!1,s=!1,i=-1;for(let c of e){let u=n(c[0]);u<i&&(r=!1),u===3&&(o=!0),c[0]===I&&(s=!0),i=u}let a=e;if(!r){let c=e.map((u,l)=>({m:u,i:l,tier:n(u[0])}));c.sort((u,l)=>u.tier-l.tier||u.i-l.i),a=c.map(u=>u.m)}if(o&&!s&&this._status!=="dirty"){let c=0;for(;c<a.length&&n(a[c][0])===0;)c++;return c===0?[Ae,...a]:[...a.slice(0,c),Ae,...a.slice(c)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let c=e[a];if(c[0]===C&&c[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(c=>c[0]===q||c[0]===oe);if(a.length===0)return;n=a}n=this._frameBatch(n);let o=null;for(let a=0;a<n.length;a++){let c=n[a],u=c[0];if(u!==X&&u!==se){o?.push(c);continue}if(c.length<2)throw new Error(`Node "${this.name}": [[${u===X?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let f=c[1];if(u===X)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))l=!1;else if(this._pauseLocks.delete(f),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())}}l?o?.push(c):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]===q))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Ft)}catch{}let{finalMessages:s,equalsError:i}=this._updateState(n);if(s.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,c=[];for(let u of s)a(u[0])===3?this._pauseBuffer.push(u):c.push(u);c.length>0&&this._dispatchOrAccumulate(c)}else this._dispatchOrAccumulate(s);i!=null&&this._emit([[C,i]])}_updateState(e){let n=this._config.tierOf,r,o,s=-1,i=0;for(let l of e)n(l[0])===3&&i++;let a=i<=1,c=-1;if(this._versioning!=null&&i>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===E){c=l;break}}for(let l=0;l<e.length;l++){let f=e[l],p=f[0];if(p===E){if(f.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,f[1])}catch(d){o=this._wrapFnError("equals threw",d),s=l;break}if(h){r==null&&(r=e.slice(0,l)),r.push(Pt),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(c<0||l===c)&&Wn(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),p===I)this._status="dirty";else if(p===B)this._status="resolved";else if(p===P)this._status="completed";else if(p===C)this._status="errored";else if(p===oe){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 d=h.invalidate;if(typeof d=="function")try{d()}catch{}}}else p===q&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=s>=0?r??e.slice(0,s):r??e;return o!=null?{finalMessages:u,equalsError:o}:{finalMessages:u}}_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(Fn()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Qe(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}ut(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);ut(this._deliverToSinks,n,this._config.tierOf)}},Yn=t=>Array.isArray(t),Ut=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function V(t,e){return Ee([],{...e,initial:t})}function Ie(t,e){return Ee((r,o,s)=>t(o,s)??void 0,{describeKind:"producer",...e})}function ie(t,e,n){return Ee(t,(o,s,i)=>{let a=o.map((c,u)=>c!=null&&c.length>0?c.at(-1):i.prevData[u]);s.emit(e(a,i))},{describeKind:"derived",...n})}function Yt(t,e,n){let r=new Map;return t.forEach((o,s)=>{r.set(o,s)}),ie(t,(o,s)=>e(a=>{let c=r.get(a);if(c==null)throw new Error(`dynamicNode: untracked dep "${a.name??"<unnamed>"}"`);return o[c]},s),n)}function Ze(t,e){let n,r=new Map,o=(s,i,a)=>{let c=!1,u=l=>{let f=r.get(l);if(f!==void 0){if(f<s.length){let h=s[f];return h!=null&&h.length>0?h.at(-1):a.prevData[f]}return l.cache}c=!0;let p=n._addDep(l);return r.set(l,p),l.cache};try{let l=t(u,a);c||(i.emit(l),a.store.__autoTrackLastDiscoveryError!=null&&delete a.store.__autoTrackLastDiscoveryError)}catch(l){if(!c)throw l;a.store.__autoTrackLastDiscoveryError=l}};return n=new $([],o,{describeKind:"derived",...e}),n}var de=Y(()=>{"use strict";Ge()});function nt(t,e,n){let r=new Set;for(let o of t.split(",")){let[s,i]=o.split("/"),a=i?Number.parseInt(i,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let c,u;if(s==="*")c=e,u=n;else if(s.includes("-")){let[l,f]=s.split("-");c=Number.parseInt(l,10),u=Number.parseInt(f,10)}else c=Number.parseInt(s,10),u=c;if(Number.isNaN(c)||Number.isNaN(u))throw new Error(`Invalid cron field: ${t}`);if(c<e||u>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(c>u)throw new Error(`Invalid cron range: ${c}-${u} in ${t}`);for(let l=c;l<=u;l+=a)r.add(l)}return r}function fr(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:nt(e[0],0,59),hours:nt(e[1],0,23),daysOfMonth:nt(e[2],1,31),months:nt(e[3],1,12),daysOfWeek:nt(e[4],0,6)}}function pr(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 hr=Y(()=>{"use strict"});function gr(t){return{describeKind:"producer",...t}}function mr(t,e){let{signal:n,period:r,...o}=e??{};return Ie(s=>{let i=!1,a=0,c,u,l=()=>{i=!0,c!==void 0&&clearTimeout(c),u!==void 0&&clearInterval(u),n?.removeEventListener("abort",p)},f=()=>{i||(r!=null?(s.emit(a++),u=setInterval(()=>{i||s.emit(a++)},r)):(i=!0,n?.removeEventListener("abort",p),s.emit(a++),s.down([[P]])))},p=()=>{i||(l(),s.down([[C,n.reason]]))};if(n?.aborted){p();return}return c=setTimeout(f,t),n?.addEventListener("abort",p,{once:!0}),l},gr(o))}function br(t,e){let n=fr(t),{tickMs:r,output:o,...s}=e??{},i=r??6e4,a=o==="date";return Ie(c=>{let u=-1,l=()=>{let p=new Date,h=p.getFullYear()*1e8+(p.getMonth()+1)*1e6+p.getDate()*1e4+p.getHours()*100+p.getMinutes();h!==u&&pr(n,p)&&(u=h,c.emit(a?p:he()))};l();let f=setInterval(l,i);return()=>clearInterval(f)},{...gr(s),name:s.name??`cron:${t}`})}function ge(t){return t.subscribe(()=>{})}var gt=Y(()=>{"use strict";Xe();W();de();hr()});var _t,Er=Y(()=>{"use strict";_t=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 Xs={};ue(Xs,{jotai:()=>Jt,nanostores:()=>Xt,nestjs:()=>hn,react:()=>gn,signals:()=>yn,solid:()=>vn,svelte:()=>_n,vue:()=>xn,zustand:()=>wn});module.exports=lo(Xs);var Jt={};ue(Jt,{atom:()=>Ao});W();de();function Ao(t,e,n){if(typeof t=="function"){let r=t;return typeof e=="function"?Jn(r,e,n):Jn(r,void 0,e)}return ko(t,e)}function et(t){let e=t.cache,n;if(t.subscribe(o=>{for(let[s,i]of o)s===E&&(e=i),s===C&&(n=i)})(),n)throw n;return e}function ko(t,e){let n=V(t,{...e,resubscribable:!0,resetOnTeardown:!0});return{get:()=>n.status==="sentinel"?et(n):n.cache,set:r=>n.emit(r),update:r=>{let o=n.status==="sentinel"?et(n):n.cache;n.emit(r(o))},subscribe:r=>{let o=!0;return n.subscribe(s=>{for(let[i,a]of s)if(i===E){if(o){o=!1;continue}r(a)}})},meta:n.meta,_node:n}}function Jn(t,e,n){let r=Ze(s=>t(i=>{let a=i._node;return a.status==="sentinel"&&et(a),s(a)}),{...n,resubscribable:!0,resetOnTeardown:!0}),o={get:()=>r.status==="sentinel"?et(r):r.cache,subscribe:s=>{let i=!0;return r.subscribe(a=>{for(let[c,u]of a)if(c===E){if(i){i=!1;continue}s(u)}})},meta:r.meta,_node:r};if(e){let s=c=>c.get(),i=(c,u)=>c.set(u),a=o;return a.set=c=>e(s,i,c),a.update=c=>{let u=r.status==="sentinel"?et(r):r.cache;return e(s,i,c(u))},a}return o}var Xt={};ue(Xt,{action:()=>Lo,atom:()=>Co,computed:()=>Mo,getValue:()=>Go,map:()=>Do,onMount:()=>Io,onStart:()=>Zn,onStop:()=>er});we();W();de();var pt=new WeakMap,ht=new WeakMap;function ft(t,e){let n=e.get(t);if(n)for(let r of n)r()}function Qt(t,e={}){let n=0;return{...e,get:()=>Xn(t),subscribe:o=>{n===0&&ft(t,pt),n++;let s=t.subscribe(i=>{for(let[a,c]of i)a===E&&o(c)});return()=>{s(),n--,n===0&&ft(t,ht)}},listen:o=>{n===0&&ft(t,pt),n++;let s=!0,i=t.subscribe(a=>{for(let[c,u]of a)if(c===E){if(s){s=!1;continue}o(u)}});return()=>{i(),n--,n===0&&ft(t,ht)}},_node:t}}function Qn(t){let e=t.cache,n;if(t.subscribe(o=>{for(let[s,i]of o)s===E&&(e=i),s===C&&(n=i)})(),n)throw n;return e}function Xn(t){return t.status==="sentinel"?Qn(t):t.cache}function Co(t){let e=V(t,{resubscribable:!0,resetOnTeardown:!0});return Qt(e,{set:n=>e.emit(n)})}function Mo(t,e){let n=Array.isArray(t)?t:[t],r=n.map(s=>s._node),o=Yt(r,s=>{let i=n.map(a=>{let c=a._node;return c.status==="sentinel"&&Qn(c),s(c)});return e(...i)},{resubscribable:!0,resetOnTeardown:!0,equals:Object.is});return Qt(o)}function Do(t){let e=V(t,{resubscribable:!0,resetOnTeardown:!0,equals:()=>!1});return Qt(e,{set:n=>e.emit(n),setKey:(n,r)=>{let o=Xn(e);e.emit({...o,[n]:r})}})}function Go(t){return t.get()}function Zn(t,e){let n=t._node,r=pt.get(n);r||(r=new Set,pt.set(n,r)),r.add(e)}function er(t,e){let n=t._node,r=ht.get(n);r||(r=new Set,ht.set(n,r)),r.add(e)}function Io(t,e){Zn(t,()=>{let n=e();typeof n=="function"&&er(t,n)})}function Lo(t,e,n){return(...r)=>{let o;return ce(()=>{o=n(...r)}),o}}var hn={};ue(hn,{ACTOR_KEY:()=>yt,COMMAND_HANDLERS:()=>He,CQRS_EVENT_HANDLERS:()=>Fe,CRON_HANDLERS:()=>$e,CommandHandler:()=>ur,EVENT_HANDLERS:()=>Le,EventHandler:()=>cr,GRAPHREFLY_REQUEST_GRAPH:()=>Oe,GRAPHREFLY_ROOT_GRAPH:()=>ee,GraphCron:()=>ar,GraphInterval:()=>ir,GraphReflyEventExplorer:()=>Re,GraphReflyGuard:()=>Tr,GraphReflyGuardImpl:()=>rt,GraphReflyModule:()=>kt,INTERVAL_HANDLERS:()=>Pe,InjectCqrsGraph:()=>rr,InjectGraph:()=>nr,InjectNode:()=>or,ObserveGateway:()=>bt,OnGraphEvent:()=>sr,QUERY_HANDLERS:()=>je,QueryHandler:()=>dr,SAGA_HANDLERS:()=>Ve,SagaHandler:()=>lr,fromHeader:()=>xr,fromJwtPayload:()=>nn,getActor:()=>wr,getGraphToken:()=>K,getNodeToken:()=>ae,observeSSE:()=>vr,observeSubscription:()=>_r,toObservable:()=>tr});var Zt=require("rxjs");W();function tr(t,e){return e?.raw?new Zt.Observable(n=>t.subscribe(o=>{if(!n.closed){n.next(o);for(let s of o){if(s[0]===C){n.error(s[1]);return}if(s[0]===P){n.complete();return}}}})):new Zt.Observable(n=>t.subscribe(o=>{for(let s of o){if(n.closed)return;if(s[0]===E)n.next(s[1]);else if(s[0]===C){n.error(s[1]);return}else if(s[0]===P){n.complete();return}}}))}var tt=require("@nestjs/common");var ee=Symbol.for("graphrefly:root-graph");var Oe=Symbol.for("graphrefly:request-graph");function K(t){return Symbol.for(`graphrefly:graph:${t}`)}function ae(t){return Symbol.for(`graphrefly:node:${t}`)}var Le=new Map,Pe=new Map,$e=new Map,He=new Map,Fe=new Map,je=new Map,Ve=new Map;function nr(t){return t==="request"?(0,tt.Inject)(Oe):(0,tt.Inject)(t?K(t):ee)}function rr(t){return(0,tt.Inject)(K(t))}function or(t){return(0,tt.Inject)(ae(t))}function sr(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=Le.get(o)??[];s.push({nodeName:t,methodKey:r}),Le.set(o,s)})}}function ir(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=Pe.get(o)??[];s.push({ms:t,methodKey:r}),Pe.set(o,s)})}}function ar(t){return(e,n)=>{let r=n.name;n.addInitializer(function(){let o=this.constructor,s=$e.get(o)??[];s.push({expr:t,methodKey:r}),$e.set(o,s)})}}function ur(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=He.get(s)??[];i.push({cqrsName:t,commandName:e,methodKey:o}),He.set(s,i)})}}function cr(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=Fe.get(s)??[];i.push({cqrsName:t,eventName:e,methodKey:o}),Fe.set(s,i)})}}function dr(t,e){return(n,r)=>{let o=r.name;r.addInitializer(function(){let s=this.constructor,i=je.get(s)??[];i.push({cqrsName:t,projectionName:e,methodKey:o}),je.set(s,i)})}}function lr(t,e,n){return(r,o)=>{let s=o.name;o.addInitializer(function(){let i=this.constructor,a=Ve.get(i)??[];a.push({cqrsName:t,eventNames:n,sagaName:e,methodKey:s}),Ve.set(i,a)})}}W();gt();var yr=0,Re=class{constructor(e,n){this.graph=e;this.moduleRef=n}disposers=[];scheduleNodeNames=[];onModuleInit(){this.wireEvents(),this.wireIntervals(),this.wireCrons(),this.wireCqrsCommands(),this.wireCqrsEvents(),this.wireCqrsQueries(),this.wireCqrsSagas()}onModuleDestroy(){for(let e of this.disposers)e();this.disposers.length=0;for(let e of this.scheduleNodeNames)try{this.graph.remove(e)}catch{}this.scheduleNodeNames.length=0}wireEvents(){for(let[e,n]of Le){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireEventHandler(r,o)}}wireEventHandler(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),i=this.observeNode(n.nodeName).subscribe(a=>{for(let c of a)c[0]===E&&o(c[1])});this.disposers.push(i)}wireIntervals(){for(let[e,n]of Pe){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireIntervalHandler(r,e,o)}}wireIntervalHandler(e,n,r){let o=e[r.methodKey];if(typeof o!="function")return;let s=o.bind(e),a=`__schedule__.${n.name??"anonymous"}.${String(r.methodKey)}.${yr++}`,c=mr(r.ms,{period:r.ms,name:a});this.graph.add(c),this.scheduleNodeNames.push(a);let l=this.observeNode(a).subscribe(f=>{for(let p of f)p[0]===E&&s(p[1])});this.disposers.push(l)}wireCrons(){for(let[e,n]of $e){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCronHandler(r,e,o)}}wireCronHandler(e,n,r){let o=e[r.methodKey];if(typeof o!="function")return;let s=o.bind(e),a=`__schedule__.${n.name??"anonymous"}.${String(r.methodKey)}.${yr++}`,c=br(r.expr,{name:a});this.graph.add(c),this.scheduleNodeNames.push(a);let l=this.observeNode(a).subscribe(f=>{for(let p of f)p[0]===E&&s(p[1])});this.disposers.push(l)}wireCqrsCommands(){for(let[e,n]of He){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsCommand(r,o)}}wireCqrsCommand(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);s&&s.command(n.commandName,o)}wireCqrsEvents(){for(let[e,n]of Fe){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsEventHandler(r,o)}}wireCqrsEventHandler(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);if(!s)return;s.event(n.eventName);let a=s.resolve(n.eventName).cache,c=a&&a.length>0?a[a.length-1].seq:0,l=this.observeNodeOn(s,n.eventName).subscribe(f=>{for(let p of f)if(p[0]===E){let h=p[1];for(let d of h)d.seq>c&&(o(d),c=d.seq)}});this.disposers.push(l)}wireCqrsQueries(){for(let[e,n]of je){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsQuery(r,o)}}wireCqrsQuery(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);if(!s)return;let a=this.observeNodeOn(s,n.projectionName).subscribe(c=>{for(let u of c)u[0]===E&&o(u[1])});this.disposers.push(a)}wireCqrsSagas(){for(let[e,n]of Ve){let r=this.resolveInstance(e);if(r)for(let o of n)this.wireCqrsSaga(r,o)}}wireCqrsSaga(e,n){let r=e[n.methodKey];if(typeof r!="function")return;let o=r.bind(e),s=this.resolveCqrsGraph(n.cqrsName);s&&s.saga(n.sagaName,n.eventNames,o)}observeNode(e){return this.graph.observe(e)}observeNodeOn(e,n){return e.observe(n)}resolveCqrsGraph(e){try{return this.moduleRef.get(K(e),{strict:!1})}catch{return console.warn(`[GraphReFly] CqrsGraph "${e}" not found in DI \u2014 did you import GraphReflyModule.forCqrs({ name: "${e}" })?`),null}}resolveInstance(e){try{return this.moduleRef.get(e,{strict:!1})}catch{return null}}};W();W();var Po=0;function mt(t,e){if(e.highWaterMark<1)throw new RangeError("highWaterMark must be >= 1");if(e.lowWaterMark<0)throw new RangeError("lowWaterMark must be >= 0");if(e.lowWaterMark>=e.highWaterMark)throw new RangeError("lowWaterMark must be < highWaterMark");let n=Symbol(`bp-${++Po}`),r=0,o=!1;return{onEnqueue(){return r+=1,!o&&r>=e.highWaterMark?(o=!0,t([[X,n]]),!0):!1},onDequeue(){return r>0&&(r-=1),o&&r<=e.lowWaterMark?(o=!1,t([[se,n]]),!0):!1},get pending(){return r},get paused(){return o},dispose(){o&&(o=!1,t([[se,n]]))}}}function vr(t,e,n){let{actor:r,serialize:o=$o,keepAliveMs:s,signal:i}=n??{},a=new TextEncoder,c,u=n?.highWaterMark!=null,l,f,p=[],h=!1;return new ReadableStream({start(d){let g,m=()=>{},v=()=>{if(!h){h=!0,g!==void 0&&clearInterval(g),i?.removeEventListener("abort",_),m(),l?.dispose(),f?.(),f=void 0;for(let y of p)d.enqueue(y.frame);p.length=0,d.close()}};c=v;let _=()=>v(),b=t.observe(e,{actor:r});u&&(l=mt(y=>b.up(y),{highWaterMark:n.highWaterMark,lowWaterMark:n.lowWaterMark??Math.floor(n.highWaterMark/2)})),m=b.subscribe(y=>{for(let w of y){if(h)return;let T=w[0];if(T===E){let x=a.encode(en("data",o(w[1])));u?(p.push({frame:x,counted:!0}),l.onEnqueue(),f?.(),f=void 0):d.enqueue(x)}else if(T===C){let x=a.encode(en("error",o(w[1])));u?(p.push({frame:x,counted:!1}),f?.(),f=void 0):d.enqueue(x),v();return}else if(T===P||T===q){if(T===P){let x=a.encode(en("complete"));u?(p.push({frame:x,counted:!1}),f?.(),f=void 0):d.enqueue(x)}v();return}}}),s!==void 0&&s>0&&(g=setInterval(()=>{h||(u?(p.push({frame:a.encode(`: keepalive
2
2
 
3
3
  `),counted:!1}),f?.(),f=void 0):d.enqueue(a.encode(`: keepalive
4
4
 
@@ -12,4 +12,4 @@
12
12
  `)}function qr(t){if(t.version!==Ne)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${Ne})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in t))throw new Error(`snapshot missing required key "${e}"`);if(typeof t.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof t.nodes!="object"||t.nodes===null||Array.isArray(t.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(t.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(t.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function vs(t,e){let n=new WeakMap,r=(o,s)=>{if(Object.is(o,s))return!0;if(o==null||s==null||typeof o!="object"||typeof s!="object")return!1;let i=n.get(o);if(i==null&&(i=new WeakSet,n.set(o,i)),i.has(s))return!0;i.add(s);let a=o.constructor,c=s.constructor;if(a!==c)return!1;if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.source===s.source&&o.flags===s.flags;if(Array.isArray(o)){let p=s;if(o.length!==p.length)return!1;for(let h=0;h<o.length;h++)if(!r(o[h],p[h]))return!1;return!0}if(o instanceof Map){let p=s;if(o.size!==p.size)return!1;for(let[h,d]of o)if(!p.has(h)||!r(d,p.get(h)))return!1;return!0}if(o instanceof Set){let p=s;if(o.size!==p.size)return!1;for(let h of o){let d=!1;for(let g of p)if(r(h,g)){d=!0;break}if(!d)return!1}return!0}if(ArrayBuffer.isView(o)){let p=o,h=s;if(p.length!==h.length)return!1;for(let d=0;d<p.length;d++)if(p[d]!==h[d])return!1;return!0}let u=Object.keys(o),l=Object.keys(s);if(u.length!==l.length)return!1;let f=new Set(l);for(let p of u)if(!f.has(p)||!r(o[p],s[p]))return!1;return!0};return r(t,e)}function an(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(an);let e=t,n=Object.keys(e).sort(),r={};for(let o of n)r[o]=an(e[o]);return r}function _s(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function xs(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function ws(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function Br(t){let e=new Set,n=[];function r(o,s){let i=`${o}\0${s}`;e.has(i)||(e.add(i),n.push([o,s]))}for(let[o,s]of Object.entries(t.nodes)){let i=s.deps;if(i)for(let a of i)r(a,o)}for(let o of t.edges)r(o.from,o.to);return n}function zr(t){if(t===void 0)return"LR";if(t==="TD"||t==="LR"||t==="BT"||t==="RL")return t;throw new Error(`invalid diagram direction ${String(t)}; expected one of: TD, LR, BT, RL`)}function Ts(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,{expand:o,...s}=t,i={...s,edges:n?t.edges:[],subgraphs:r?t.subgraphs:[]},a=JSON.stringify(an(i),null,e.indent??2);return e.logger?.(a),a}function Es(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,o=[];o.push(`Graph ${t.name}`),o.push("Nodes:");for(let i of Object.keys(t.nodes).sort()){let a=t.nodes[i];o.push(`- ${i} (${a.type}/${a.status}): ${St(a.value)}`)}if(n){o.push("Edges:");for(let i of t.edges)o.push(`- ${i.from} -> ${i.to}`)}if(r){o.push("Subgraphs:");for(let i of t.subgraphs)o.push(`- ${i}`)}let s=o.join(`
13
13
  `);return e.logger?.(s),s}function Kr(t,e){let n=zr(e.direction),r=Object.keys(t.nodes).sort(),o=new Map;for(let i=0;i<r.length;i+=1)o.set(r[i],`n${i}`);let s=[`flowchart ${n}`];for(let i of r){let a=o.get(i);s.push(` ${a}["${_s(i)}"]`)}for(let[i,a]of Br(t)){let c=o.get(i),u=o.get(a);!c||!u||s.push(` ${c} --> ${u}`)}return s.join(`
14
14
  `)}function Os(t,e){let n=Kr(t,e);return Ur(n)}function Ur(t,e){let n=e?.theme??"default",r=e?.autoSync??!0,s=JSON.stringify({code:t,mermaid:{theme:n},autoSync:r}),i=new TextEncoder().encode(s),a="";for(let u=0;u<i.length;u++)a+=String.fromCharCode(i[u]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function Rs(t,e){let n=zr(e.direction),r=Object.keys(t.nodes).sort(),o=new Map;for(let i=0;i<r.length;i+=1)o.set(r[i],`n${i}`);let s=[`direction: ${ws(n)}`];for(let i of r){let a=o.get(i);s.push(`${a}: "${xs(i)}"`)}for(let[i,a]of Br(t)){let c=o.get(i),u=o.get(a);!c||!u||s.push(`${c} -> ${u}`)}return s.join(`
15
- `)}function Ns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let o=t.indexOf("]",n+1);if(o<=n+1){e+="\\[";continue}let s=t.slice(n+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),e+=`[${s}]`,n=o;continue}e+=Ns(r)}return e+="$",new RegExp(e)}var Ss={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},As={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function St(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function ks(t){return t==="none"?As:t==="ansi"||t==null?Ss:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function Wr(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function Cs(t,e,n){for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);if(o<32||o===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function sn(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(L))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${L}' (path separator)`);if(t===te)throw new Error(`Graph "${e}": ${n} name "${te}" is reserved for meta companion paths`);Cs(t,e,n)}function Ms(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(L);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Ds(t,e){let n=!1;for(let o of t)if(!e.isMetaPassthrough(o[0])){n=!0;break}return n?t.filter(o=>e.isMetaPassthrough(o[0])):t}function Yr(t){for(let e of t._mounts.values())Yr(e);for(let e of t._nodes.values())try{e.down([[q]],{internal:!0})}catch{}}var ne=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(L))throw new Error(`Graph name must not contain '${L}' (got "${e}")`);if(e===te)throw new Error(`Graph name "${te}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??Te,this._traceRing=new ot(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=Ie(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,o=n?.name??r;if(o==null||o==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let s=o,i=n?.annotation;if(sn(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(s,e),this._nodeToName.set(e,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:Me()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof $&&n._applyVersioning(e)}remove(e){sn(e,this.name,"remove");let n=this._mounts.get(e);if(n){let s={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,c]of i)a.includes(`${L}${te}${L}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(e),s.mounts.push(...n._collectSubgraphs(`${e}${L}`)),this._mounts.delete(e),n._parent=void 0,Yr(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:s}),s}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[q]],{internal:!0});let o={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:o}),o}removeAll(e){let n=typeof e=="function"?e:(()=>{let s=Nt(e);return i=>s.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>n(s));for(let s of o){let i=this.remove(s);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let o=e[r++];return{value:[o,n.get(o)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(L))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let o=r?.internal===!0;this.node(e).down([[E,n]],{actor:r?.actor,internal:o,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);ce(()=>{for(let[o,s]of r)this.set(o,s,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[oe]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let o=r?.internal===!0;this.node(e).down([[C,n]],{actor:r?.actor,internal:o,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[P]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[c,u]of this._nodes)r.set(u,c);let a=[];for(let[c,u]of this._nodes)if(u instanceof $)for(let l of u._deps){let f=r.get(l.node);f!=null&&a.push([f,c])}return a.sort((c,u)=>c[0]<u[0]?-1:c[0]>u[0]?1:c[1]<u[1]?-1:c[1]>u[1]?1:0),a}let o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,c]of o)s.set(c,a);let i=[];for(let[a,c]of o)if(c instanceof $)for(let u of c._deps){let l=s.get(u.node);l!=null&&i.push([l,a])}return i.sort((a,c)=>a[0]<c[0]?-1:a[0]>c[0]?1:a[1]<c[1]?-1:a[1]>c[1]?1:0),i}mount(e,n){if(sn(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=Ms(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],o=n.slice(1);if(o.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let s=this._nodes.get(r);if(s&&o.length>0&&o[0]===te)return this._resolveMetaChainFromNode(s,o,n.join(L));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${o.join(L)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(o.join(L))}_resolveMetaChainFromNode(e,n,r){let o=e,s=0,i=[...n];for(;s<i.length;){if(i[s]!==te)throw new Error(`Graph "${this.name}": expected ${te} segment in meta path "${r}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${te} in "${r}"`);let a=i[s+1],c=o.meta[a];if(!c)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);o=c,s+=2}return o}signal(e,n){if(n?.internal!==!0){for(let o of e)if(this.config.messageTier(o[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,o){for(let c of this._mounts.values())c._signalDeliver(e,n,r,o);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=Ds(e,this.config);for(let c of[...this._nodes.keys()].sort()){let u=this._nodes.get(c);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(l){if(l instanceof Z)throw l;o.push(l)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,o)}}}_signalMetaSubtree(e,n,r,o,s){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,o)}catch(c){if(c instanceof Z)throw c;s.push(c)}this._signalMetaSubtree(a,n,r,o,s)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,o=vt(e?.detail,e?.fields),s=e?.format==="spec",i=s?vt("minimal"):o,a=[];this._collectObserveTargets("",a);let c=new Map;for(let[T,x]of a)c.set(x,T);let u=[];{let T=a.map(([,N])=>N),x=new Set(c.values()),O=0;for(;T.length>0;){let N=T.shift();if(N instanceof $)for(let M of N._deps){let S=M.node;if(c.has(S))continue;let k=S.name??"",A=k;if(!A||x.has(A))if(k){let F=2;for(;x.has(`${k}#${F}`);)F++;A=`${k}#${F}`}else for(A=`__internal__/${O++}`;x.has(A);)A=`__internal__/${O++}`;c.set(S,A),x.add(A),u.push([A,S]),T.push(S)}}}let l=[...a,...u],f={};for(let[T,x]of l){if(n!=null&&!x.allowsObserve(n))continue;let O=rn(x,i),N=x instanceof $?x._deps.map(A=>c.get(A.node)??A.node.name??""):[],{name:M,...S}=O,k={...S,deps:N};if(!s){let A=this._annotations.get(T);A!=null&&(k.annotation=A)}if(r!=null)if(typeof r=="function"){let A=r;if(!(A.length>=2?A(T,k):A(k)))continue}else{let A=!0;for(let[F,U]of Object.entries(r)){let re=F==="deps_includes"?"depsIncludes":F==="meta_has"?"metaHas":F;if(re==="depsIncludes"){if(!k.deps.includes(String(U))){A=!1;break}continue}if(re==="metaHas"){if(!Object.hasOwn(k.meta??{},String(U))){A=!1;break}continue}if(k[re]!==U){A=!1;break}}if(!A)continue}f[T]=k}let p=new Set(Object.keys(f)),h=[];for(let[T,x]of l)if(x instanceof $)for(let O of x._deps){let N=c.get(O.node);N!=null&&h.push([N,T])}h.sort((T,x)=>T[0]<x[0]?-1:T[0]>x[0]?1:T[1]<x[1]?-1:T[1]>x[1]?1:0);let d=h.map(([T,x])=>({from:T,to:x}));(n!=null||r!=null)&&(d=d.filter(T=>p.has(T.from)&&p.has(T.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(T=>{let x=`${T}${L}`;return[...p].some(O=>O===T||O.startsWith(x))}):g,v=this,_=e,b={name:this.name,nodes:f,edges:d,subgraphs:m,expand(T){let x={..._,format:void 0};return Array.isArray(T)?(x.fields=T,x.detail=void 0):(x.detail=T,x.fields=void 0),v.describe(x)}},y=e??{},w=y.format;return w==="json"?Ts(b,y):w==="pretty"?Es(b,y):w==="mermaid"?Kr(b,y):w==="mermaid-url"?Os(b,y):w==="d2"?Rs(b,y):w==="ascii"?Ir(b,y):b}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${r}`;n.push(o),n.push(...this._mounts.get(r)._collectSubgraphs(`${o}${L}`))}return n}resourceProfile(e){return jr(this,e)}reachable(e,n,r={}){return r.withDetail===!0?un(this.describe(),e,n,{...r,withDetail:!0}):un(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,c]of Object.entries(o.nodes))c.lastMutation!=null&&i.set(a,c.lastMutation);return Lr(o,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",o=0,s=V(o,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,c=!1,u=()=>{a||c||(a=!0,Qe(()=>{a=!1,!c&&(o+=1,s.emit(o))}))},l=i.onEvent(m=>{let v=m.type;v!=="data"&&v!=="error"&&v!=="complete"&&v!=="teardown"||u()}),f=[],p=new WeakSet,h=m=>{if(p.has(m)||c)return;p.add(m);let v=m.topology.subscribe(_=>{for(let b of _){if(b[0]!==E)continue;let y=b[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let w=m._mounts.get(y.name);w!=null&&h(w)}}});f.push(v);for(let _ of m._mounts.keys()){let b=m._mounts.get(_);b!=null&&h(b)}};h(this);let d;try{d=ie([s],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,v)=>m===v})}catch(m){l();for(let v of f)v();throw i.dispose(),m}let g=ge(d);return{node:d,dispose(){c=!0,l();for(let m of f)m();f.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let o=0,s=V(o,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,c=!1,u=i.onEvent(h=>{let d=h.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||c||(a=!0,Qe(()=>{a=!1,!c&&(o+=1,s.emit(o))}))}),l={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},f;try{f=ie([s],()=>this._explainStatic(e,n,l),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(h,d)=>h.found===d.found&&h.reason===d.reason&&h.steps.length===d.steps.length&&Gs(h.steps,d.steps)})}catch(h){throw u(),i.dispose(),h}let p=ge(f);return{node:f,dispose(){c=!0,u(),i.dispose(),p()}}}_pathsMatching(e){let n=Nt(e),r=[];return this._collectObserveTargets("",r),r.map(([o])=>o).filter(o=>n.test(o))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${L}${r}`;this._mounts.get(r)._collectObserveTargets(o,n)}for(let r of[...this._nodes.keys()].sort()){let o=this._nodes.get(r),s=e===""?r:`${e}${L}${r}`;n.push([s,o]),this._appendMetaObserveTargets(s,o,n)}}_appendMetaObserveTargets(e,n,r){for(let o of Object.keys(n.meta).sort()){let s=n.meta[o],i=`${e}${L}${te}${L}${o}`;r.push([i,s]),this._appendMetaObserveTargets(i,s,r)}}observe(e,n){let r=typeof e=="string",s=Wr(r?n:e),i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(r){let l=e,f=this.resolve(l);if(a!=null&&!f.allowsObserve(a))throw new Z({actor:a,action:"observe",nodeName:l});return i?this._buildStructuredObserver([[l,f]],s,"one"):{subscribe(p){return f.subscribe(p)},up(p){try{f.up?.(p)}catch(h){if(h instanceof Z)return;throw h}}}}let c=[];this._collectObserveTargets("",c),c.sort((l,f)=>l[0]<f[0]?-1:l[0]>f[0]?1:0);let u=a==null?c:c.filter(([,l])=>l.allowsObserve(a));return i?this._buildStructuredObserver(u,s,"all"):{subscribe:l=>{let f=u.map(([p,h])=>h.subscribe(d=>{l(p,d)}));return()=>{for(let p of f)p()}},up:(l,f)=>{try{this.resolve(l).up?.(f)}catch(p){if(p instanceof Z)return;throw p}}}}_buildStructuredObserver(e,n,r){let o=r==="one"?e[0]?.[0]:void 0,s=i=>{if(r==="one"&&o!=null){let l=this.resolve(o);return this._buildStructuredObserver([[o,l]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((l,f)=>l[0]<f[0]?-1:l[0]>f[0]?1:0);let c=i.actor,u=c==null?a:a.filter(([,l])=>l.allowsObserve(c));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,s)}_createObserveResult(e,n,r){let o=n.timeline===!0,s=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",c=this.config.inspectorEnabled,u=(s||i)&&c,l=n.maxEvents,f=l!=null&&l>0?new ot(l):null,p=[],h=new Set,d={},g=new Set,m=0,v=0,_=0,b=0,y=0,w=0,T=!1,x=!1,O=0,N=new Map,M=new Map,S=new Map,k=R=>{f?f.push(R):p.push(R);for(let G of h)G(R)},A=()=>o?{timestamp_ns:Me(),in_batch:at(),batch_id:O}:{},F=(R,G)=>{if(!(!u||!(R instanceof $)))return R._setInspectorHook(J=>{if(J.kind==="dep_message")N.set(R,J.depIndex);else if(J.kind==="run"){let We=J.batchData.map((D,z)=>D!=null&&D.length>0?D.at(-1):J.prevData[z]);M.set(R,We);let Q=J.batchData.map(D=>D!=null?[...D]:void 0);S.set(R,Q),i&&k({type:"derived",path:G,dep_values:We,dep_batches:Q,...A()})}})},U=R=>{let G=N.get(R),J=M.get(R);if(!s||J==null)return{};let Q=(G!=null&&G>=0&&R instanceof $?R._deps[G]:void 0)?.node,D=Q?.v,z=S.get(R);return{trigger_dep_index:G,trigger_dep_name:Q?.name,...D!=null?{trigger_version:{id:D.id,version:D.version}}:{},dep_values:[...J],...z!=null?{dep_batches:z}:{}}},re=[],ye=[];for(let[R,G]of e){let J=F(G,R);J&&re.push(J),ye.push(G.subscribe(We=>{O++;for(let Q of We){let D=Q[0],z=A();if(D===E){d[R]=Q[1];let It=G instanceof $?G.lastMutation?.actor??pe:pe;k({type:"data",path:R,data:Q[1],actor:It,...z,...U(G)})}else if(a)D===I?m++:D===B?v++:D===oe?_++:D===X?b++:D===se?y++:D===q?w++:D===P&&!g.has(R)?T=!0:D===C&&(x=!0,g.add(R));else if(D===I)m++,k({type:"dirty",path:R,...z});else if(D===B)v++,k({type:"resolved",path:R,...z,...U(G)});else if(D===oe)_++,k({type:"invalidate",path:R,...z});else if(D===X)b++,k({type:"pause",path:R,lockId:Q[1],...z});else if(D===se)y++,k({type:"resume",path:R,lockId:Q[1],...z});else if(D===P)g.has(R)||(T=!0),k({type:"complete",path:R,...z});else if(D===C){x=!0,g.add(R);let It=G instanceof $?G.lastMutation?.actor??pe:pe;k({type:"error",path:R,data:Q[1],actor:It,...z})}else D===q&&(w++,k({type:"teardown",path:R,...z}))}}))}let Mt=!1,Dt=()=>{if(!Mt){Mt=!0;for(let R of ye)R();for(let R of re)R();for(let R of it)R({value:void 0,done:!0});it.length=0}},Gt=[],it=[];h.add(R=>{let G=it.shift();G?G({value:R,done:!1}):Gt.push(R)});let Tn={get values(){return d},get dirtyCount(){return m},get resolvedCount(){return v},get invalidateCount(){return _},get pauseCount(){return b},get resumeCount(){return y},get teardownCount(){return w},get events(){return f?f.toArray():[...p]},get anyCompletedCleanly(){return T},get anyErrored(){return x},get completedWithoutErrors(){return T&&!x},onEvent(R){return h.add(R),()=>h.delete(R)},dispose:Dt,expand(R){Dt();let G={...n};return typeof R=="string"?G.detail=R:Object.assign(G,R),r(Wr(G))},[Symbol.asyncIterator](){return{next(){return Gt.length>0?Promise.resolve({value:Gt.shift(),done:!1}):Mt?Promise.resolve({value:void 0,done:!0}):new Promise(R=>it.push(R))},return(){return Dt(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Tn,n),Tn}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let o=n.logger??(d=>console.log(d)),s=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=s==null&&i==null?()=>!0:d=>(s==null||s.has(d))&&(i==null||!i.has(d)),c=ks(n.theme),u=r==="stage-log"?Me():0,l=d=>d==null?"":n.stageLabels?.[d]??d,f=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,p=d=>d.type==="data"||d.type==="error"?f(St(d.data),120):"",h=d=>{if(r==="stage-log"){let x=(Me()-u)/1e9,O=l(d.path).padEnd(9);if(d.type==="data"){let N=p(d);return`[${x.toFixed(3)}s] ${O} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=p(d);return`[${x.toFixed(3)}s] ${O} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${x.toFixed(3)}s] ${O} \u25A0 complete`:`[${x.toFixed(3)}s] ${O} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=c[d.type]??"",m=d.path?`${c.path}${d.path}${c.reset} `:"",v=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",b=v?` ${St(d.data)}`:_?` ${St(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,w=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",T=d.in_batch?" [batch]":"";return`${m}${g}${d.type.toUpperCase()}${c.reset}${b}${w}${T}`};e.onEvent(d=>{a(d.type)&&o(h(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){Vr(this._disposers,this.name),this.signal([[q]],{internal:!0}),Vr(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),o={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:c,guard:u,...l}=r.nodes[a];o[a]=l}let s=[...r.subgraphs].sort(),i={...r,version:1,nodes:o,subgraphs:s};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return Pn(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??Te,{codec:o,codecVersion:s,payload:i}=$n(e,r);return o.decode(i,s)}restore(e,n){if(qr(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(s=>Nt(s)),o=n?.includeProducers===!0;for(let s of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(s)))continue;let i=e.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let c=this.tryResolve(s)?.v;if(c!=null&&c.id===i.v.id&&c.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){n?.onError?.(s,a)}}}}}static fromSnapshot(e,n){qr(e);let r=typeof n=="function"?n:n?.build,o=typeof n=="function"?void 0:n?.factories,s=new t(e.name);if(r)return r(s),s.restore(e),s;for(let h of[...e.subgraphs].sort((d,g)=>{let m=d.split(L).length,v=g.split(L).length;return m!==v?m-v:d<g?-1:d>g?1:0})){let d=h.split(L),g=s;for(let m of d)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=o?Object.entries(o).map(([h,d])=>({re:Nt(h),factory:d})):[],a=h=>{for(let d of i)if(d.re.test(h))return d.factory},c=h=>{let d=h.split(L),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${h}"`);let m=s;for(let v of d){let _=m._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${h}"`);m=_}return[m,g]},u=Object.entries(e.nodes).filter(([h])=>!h.includes(`${L}${te}${L}`)).sort((h,d)=>h[0]<d[0]?-1:h[0]>d[0]?1:0),l=new Map(u),f=new Map,p=!0;for(;l.size>0&&p;){p=!1;for(let[h,d]of[...l.entries()]){let g=d?.deps??[];if(!g.every(w=>f.has(w)))continue;let[m,v]=c(h),_={...d?.meta??{}},b=a(h),y;if(d?.type==="state")y=V(d.value,{meta:_});else{if(b==null)continue;y=b(v,{path:h,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(w=>f.get(w))})}m.add(y,{name:v}),f.set(h,y),l.delete(h),p=!0}}if(l.size>0){let h=[...l.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${h}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return s.restore(e),s}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let o=(u,l)=>{if(u.disposed)return;let f=ys(l.nodes);if(u.lastSnapshot!=null&&f!==""&&f===u.lastFingerprint)return;let p=u.seq+1,h=he(),m=u.lastSnapshot==null||p%u.compactEvery===0?{mode:"full",snapshot:l,seq:p,timestamp_ns:h,format_version:Ne}:{mode:"diff",diff:Jr(u.lastSnapshot,l),seq:p,timestamp_ns:h,format_version:Ne};if(u.tier.filter&&!u.tier.filter(this.name,m))return;let v;try{v=u.tier.save(this.name,m)}catch(_){n.onError?.(_,u.tier);return}if(v&&typeof v.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>v,()=>v).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=l,u.lastFingerprint=f)},w=>{n.onError?.(w,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=l,u.lastFingerprint=f},s=(u,l)=>{try{o(u,l)}catch(f){n.onError?.(f,u.tier)}},i=(u,l)=>{if(!l.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(u);if(d==null)return;let g=rn(d,vt("standard"));if(!n.filter(u,g))return}let p,h=()=>(p==null&&(p=this.snapshot()),p);for(let d of r)d.disposed||(d.debounceMs===0?s(d,h()):(d.timer==null&&(d.timer=new _t),d.timer.start(d.debounceMs,()=>{d.disposed||s(d,this.snapshot())})))},a;if(n.paths!=null){let l=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(f=>{let p=this.tryResolve(f);return p==null?()=>{}:p.subscribe(h=>i(f,h))});a=()=>{for(let f of l)f()}}else a=this.observe().subscribe((u,l)=>i(u,l));let c=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(c)};return this._storageDisposers.add(c),{dispose:c}}async _cascadeRestore(e,n){for(let r of e){let o;try{o=await r.load(this.name)}catch(i){n?.(i,r);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===Ne&&s.nodes!=null)return this.restore(s),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let o of n){let s;try{s=await o.load(e)}catch(c){r?.onError?.(c,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===Ne&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(c){r?.onError?.(c,o)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let o={path:e,annotation:n,timestamp_ns:Me(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(o)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(o=>!e(o)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let o of n)this._traceRing.push(o);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),o=new Set(Object.keys(n.nodes)),s=[...o].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!o.has(_)).sort(),a=[],c=[];for(let _ of r){if(!o.has(_))continue;let b=e.nodes[_],y=n.nodes[_],w=b.v,T=y.v;w!=null&&T!=null&&w.id===T.id&&w.version!==T.version&&c.push({path:_,id:w.id,from:w.version,to:T.version});let x=w!=null&&T!=null&&w.id===T.id&&w.version===T.version;for(let O of["type","status","sentinel"]){let N=b[O],M=y[O];N!==M&&a.push({path:_,field:O,from:N,to:M})}if(!x)for(let O of["value","meta"]){let N=b[O],M=y[O];vs(N,M)||a.push({path:_,field:O,from:N,to:M})}}let u=_=>`${_.from} ${_.to}`,l=new Set(e.edges.map(u)),f=new Set(n.edges.map(u)),p=n.edges.filter(_=>!l.has(u(_))),h=e.edges.filter(_=>!f.has(u(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(_=>!d.has(_)).sort(),v=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:c,edgesAdded:p,edgesRemoved:h,subgraphsAdded:m,subgraphsRemoved:v}}};function Jr(t,e){let n=ne.diff(t,e),r={};for(let o of n.nodesAdded){let s=e.nodes[o];s!=null&&(r[o]=s)}return{...n,nodesAddedFull:r}}function un(t,e,n,r={}){let o={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?o:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=r.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return r.withDetail?o:[];let i=new Map,a=new Map,c=new Map,u=new Map,l=new Set;for(let[b,y]of Object.entries(t.nodes)){if(!b)continue;l.add(b);let w=y.deps??[];i.set(b,w);for(let T of w)T&&(l.add(T),a.has(T)||a.set(T,new Set),a.get(T).add(b))}for(let b of t.edges){if(b==null||typeof b!="object")continue;let y=typeof b.from=="string"?b.from:"",w=typeof b.to=="string"?b.to:"";!y||!w||(l.add(y),l.add(w),u.has(y)||u.set(y,new Set),u.get(y).add(w),c.has(w)||c.set(w,new Set),c.get(w).add(y))}if(!l.has(e))return r.withDetail?o:[];let f=r.both===!0,p=b=>{if(f){let x=i.get(b)??[],O=c.get(b),N=a.get(b),M=u.get(b),S=[...x];return O&&S.push(...O),N&&S.push(...N),M&&S.push(...M),S}if(n==="upstream"){let x=i.get(b)??[],O=c.get(b);return O?[...x,...O]:x}let y=a.get(b),w=u.get(b),T=y?[...y]:[];return w&&T.push(...w),T},h=new Set([e]),d=new Map,g=[{path:e,depth:0}],m=0,v=!1;for(;m<g.length;){let b=g[m++];if(s!=null&&b.depth>=s){p(b.path).length>0&&(v=!0);continue}for(let y of p(b.path))!y||h.has(y)||(h.add(y),d.set(y,b.depth+1),g.push({path:y,depth:b.depth+1}))}let _=[...d.keys()].sort((b,y)=>b<y?-1:b>y?1:0);return r.withDetail?{paths:_,depths:d,truncated:v}:_}function Gs(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.path!==o.path||r.type!==o.type||r.status!==o.status||r.hop!==o.hop||r.dep_index!==o.dep_index||r.annotation!==o.annotation||r.value!==o.value||r.lastMutation!==o.lastMutation)return!1;let s=r.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}we();Xe();De();Ue();De();Ge();de();we();W();de();var cn=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(e,n){if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=n,n!==void 0){if(this._buf=new Array(n),e&&e.length>0){let r=Math.min(e.length,n),o=e.length-r;for(let s=0;s<r;s++)this._buf[s]=e[o+s];this._size=r}}else this._buf=e?[...e]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._size+e;if(!(n<0||n>=this._size))return this._maxSize!==void 0?this._buf[(this._head+n)%this._maxSize]:this._buf[n]}append(e){this._rawAppend(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._maxSize!==void 0&&e.length>this._maxSize?e.length-this._maxSize:0;for(let r=n;r<e.length;r++)this._rawAppend(e[r]);this._version+=1}clear(){if(this._size===0)return 0;let e=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let n=0;n<e;n++)this._buf[(this._head+n)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,e}trimHead(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return 0;let n=Math.min(e,this._size);if(this._maxSize===void 0)this._buf.splice(0,n);else{for(let r=0;r<n;r++)this._buf[(this._head+r)%this._maxSize]=void 0;this._head=(this._head+n)%this._maxSize}return this._size-=n,this._version+=1,n}slice(e,n){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(n!==void 0&&(!Number.isInteger(n)||n<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${n})`);let r=n===void 0?this._size:Math.min(Math.max(n,0),this._size),o=Math.min(e,this._size);if(o>=r)return[];let s=r-o;if(this._maxSize===void 0)return this._buf.slice(o,r);let i=new Array(s);for(let a=0;a<s;a++)i[a]=this._buf[(this._head+o+a)%this._maxSize];return i}tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return[];let n=Math.min(e,this._size);return this.slice(this._size-n,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this._buf[(this._head+n)%this._maxSize];return e}_rawAppend(e){if(this._maxSize===void 0){this._buf.push(e),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=e,this._size+=1):(this._buf[this._head]=e,this._head=(this._head+1)%this._maxSize)}};function Qr(t){return t.subscribe(()=>{})}var Is=64;function Xr(t,e={}){let{name:n,maxSize:r,versioning:o,backend:s}=e,i=s??new cn(t,r),a=V(i.toArray(),{name:n,describeKind:"state",equals:(d,g)=>d===g,...o!=null?{versioning:o}:{}});function c(){let d=i.toArray();ce(()=>{a.down([[I]]),a.down([[E,d]])})}let u=new Map,l=new Map;function f(d,g){return`${d}:${g===void 0?"END":g}`}function p(d){if(d.size<Is)return;let g=d.keys().next();if(g.done)return;let m=d.get(g.value);m!==void 0&&m.dispose(),d.delete(g.value)}function h(d){let g=i.version;try{return d()}finally{i.version!==g&&c()}}return{entries:a,get size(){return i.size},at(d){return i.at(d)},append(d){h(()=>i.append(d))},appendMany(d){d.length!==0&&h(()=>i.appendMany(d))},clear(){h(()=>i.clear())},trimHead(d){h(()=>i.trimHead(d))},tail(d){if(!Number.isInteger(d)||d<0)throw new RangeError(`tail: n must be a non-negative integer (got ${d})`);let g=u.get(d);if(g!==void 0)return u.delete(d),u.set(d,g),g.node;p(u);let m=ie([a],([_])=>{let b=_;return d===0||b.length===0?[]:b.slice(Math.max(0,b.length-d))},{initial:i.tail(d),describeKind:"derived"}),v=Qr(m);return u.set(d,{node:m,dispose:v}),m},slice(d,g){if(!Number.isInteger(d)||d<0)throw new RangeError(`slice: start must be a non-negative integer (got ${d})`);if(g!==void 0&&(!Number.isInteger(g)||g<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${g})`);let m=f(d,g),v=l.get(m);if(v!==void 0)return l.delete(m),l.set(m,v),v.node;p(l);let _=ie([a],([y])=>{let w=y;return g===void 0?w.slice(d):w.slice(d,g)},{initial:i.slice(d,g),describeKind:"derived"}),b=Qr(_);return l.set(m,{node:_,dispose:b}),_},disposeTail(d){let g=u.get(d);return g===void 0?!1:(g.dispose(),u.delete(d),!0)},disposeSlice(d,g){let m=f(d,g),v=l.get(m);return v===void 0?!1:(v.dispose(),l.delete(m),!0)},disposeAllViews(){for(let d of u.values())d.dispose();u.clear();for(let d of l.values())d.dispose();l.clear()},dispose(){for(let d of u.values())d.dispose();u.clear();for(let d of l.values())d.dispose();l.clear()}}}gt();function Zr(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}var Ls=dt((t,e)=>{t("write"),t("signal"),e("observe")}),Ps=dt((t,e)=>{t("observe"),t("signal"),e("write")}),$s=dt((t,e)=>{t("observe"),t("signal"),e("write")});function At(t,e){return Zr("cqrs",t,e)}var dn=class extends ne{_eventLogs=new Map;_commandHandlers=new Map;_projections=new Set;_sagas=new Set;_keepaliveDisposers=[];_eventStore;_seq=0;constructor(e,n={}){super(e,n.graph)}destroy(){for(let e of this._keepaliveDisposers)e();this._keepaliveDisposers.length=0,super.destroy()}event(e){let n=this._eventLogs.get(e);if(n)return n.node;let r=Xr([],{name:e,versioning:0}),o=r.entries,s=ie([o],([i])=>i,{name:e,describeKind:"state",meta:At("event",{event_name:e}),guard:$s,initial:o.cache});return this.add(s,{name:e}),this._keepaliveDisposers.push(ge(s)),this._eventLogs.set(e,{log:r,node:s}),s}_appendEvent(e,n){let r=this._eventLogs.get(e);if(r||(this.event(e),r=this._eventLogs.get(e)),r.node.status==="completed"||r.node.status==="errored")throw new Error(`Cannot dispatch to terminated event stream "${e}" (status: ${r.node.status}).`);let o=r.log.entries.v,s={type:e,payload:n,timestampNs:he(),seq:++this._seq,...o!=null?{v0:{id:o.id,version:o.version}}:{}};r.log.append(s),this._eventStore&&this._eventStore.persist(s)}command(e,n){let r=V(void 0,{name:e,describeKind:"state",meta:{...At("command",{command_name:e}),error:null},guard:Ls});return this.add(r,{name:e}),this._commandHandlers.set(e,n),r}dispatch(e,n){let r=this._commandHandlers.get(e);if(!r)throw new Error(`Unknown command: "${e}". Register with .command() first.`);let o=this.resolve(e);ce(()=>{o.emit(n,{internal:!0});try{r(n,{emit:(s,i)=>this._appendEvent(s,i)}),o.meta.error.emit(null,{internal:!0})}catch(s){throw o.meta.error.emit(s,{internal:!0}),s}})}projection(e,n,r,o){let s=n.map(a=>(this._eventLogs.has(a)||this.event(a),this._eventLogs.get(a).node)),i=ie(s,a=>{let c=[];for(let u of a){let l=u;c.push(...l)}return c.sort((u,l)=>u.timestampNs-l.timestampNs||u.seq-l.seq),r(o,c)},{name:e,describeKind:"derived",meta:At("projection",{projection_name:e,source_events:n}),guard:Ps,initial:o});return this.add(i,{name:e}),this._keepaliveDisposers.push(ge(i)),this._projections.add(e),i}saga(e,n,r){let o=n.map(c=>(this._eventLogs.has(c)||this.event(c),this._eventLogs.get(c).node)),s=new Map,i={},a=Ee(o,(c,u)=>{let l=i.n.meta.error;for(let f=0;f<c.length;f++){let p=c[f];if(p==null||p.length===0)continue;let h=p.at(-1);if(!h)continue;let d=n[f],g=s.get(d)??0;if(h.length>g){let m=h.slice(g);for(let v of m)try{r(v),l.emit(null,{internal:!0})}catch(_){l.emit(_,{internal:!0})}s.set(d,h.length)}}},{name:e,describeKind:"effect",meta:{...At("saga",{saga_name:e,source_events:n}),error:null}});return i.n=a,this.add(a,{name:e}),this._keepaliveDisposers.push(ge(a)),this._sagas.add(e),a}useEventStore(e){this._eventStore=e}async rebuildProjection(e,n,r){if(!this._eventStore)throw new Error("No event store wired. Call useEventStore() first.");let o=[];for(let s of e){let i=await this._eventStore.loadEvents(s);o.push(...i.events)}return o.sort((s,i)=>s.timestampNs-i.timestampNs||s.seq-i.seq),n(r,o)}};function eo(t,e){return new dn(t,e)}var fn=class{constructor(e){this.graph=e}onModuleDestroy(){this.graph.destroy()}},pn=class{graph=new ne("request");onModuleDestroy(){this.graph.destroy()}},to,ln;to=[(0,st.Module)({})];var be=class be{static forRoot(e){let n=e??{},r=n.name??"root",o=[{provide:ee,useFactory:()=>{let s=new ne(r);return n.build&&n.build(s),n.snapshot&&s.restore(n.snapshot),s}},{provide:Symbol.for("graphrefly:root-lifecycle"),useFactory:s=>new fn(s),inject:[ee]},{provide:Re,useFactory:(s,i)=>new Re(s,i),inject:[ee,no.ModuleRef]}];if(n.nodes)for(let s of n.nodes)o.push({provide:ae(s),useFactory:i=>i.resolve(s),inject:[ee]});return n.requestScope&&o.push({provide:Symbol.for("graphrefly:request-lifecycle"),useFactory:()=>new pn,scope:st.Scope.REQUEST},{provide:Oe,useFactory:s=>s.graph,inject:[Symbol.for("graphrefly:request-lifecycle")],scope:st.Scope.REQUEST}),{module:be,global:!0,providers:o,exports:[ee,...(n.nodes??[]).map(ae),...n.requestScope?[Oe]:[]]}}static forFeature(e){let n=[{provide:K(e.name),useFactory:r=>{let o=new ne(e.name);return e.build&&e.build(o),e.snapshot&&o.restore(e.snapshot),r.mount(e.name,o),o},inject:[ee]}];if(e.nodes)for(let r of e.nodes)n.push({provide:ae(`${e.name}::${r}`),useFactory:o=>o.resolve(r),inject:[K(e.name)]});return{module:be,providers:n,exports:[K(e.name),...(e.nodes??[]).map(r=>ae(`${e.name}::${r}`))]}}static forCqrs(e){let n=[{provide:K(e.name),useFactory:r=>{let o=eo(e.name,e.cqrs);return e.eventStore&&o.useEventStore(e.eventStore),e.build&&e.build(o),r.mount(e.name,o),o},inject:[ee]}];if(e.nodes)for(let r of e.nodes)n.push({provide:ae(`${e.name}::${r}`),useFactory:o=>o.resolve(r),inject:[K(e.name)]});return{module:be,providers:n,exports:[K(e.name),...(e.nodes??[]).map(r=>ae(`${e.name}::${r}`))]}}};ln=An(null),be=Mn(ln,0,"GraphReflyModule",to,be),Cn(ln,1,be);var kt=be;var gn={};ue(gn,{useStore:()=>Hs,useSubscribe:()=>ro,useSubscribeRecord:()=>Fs});var le=require("react");W();function ro(t){return(0,le.useSyncExternalStore)(e=>{let n=!1,r=t.subscribe(()=>{n||e()});return()=>{n=!0,r()}},()=>t.cache,()=>t.cache)}function Hs(t){let e=ro(t),n=(0,le.useCallback)(r=>{t.down([[I],[E,r]])},[t]);return[e,n]}function Fs(t,e){let n=(0,le.useRef)(e);n.current=e;let r=(0,le.useMemo)(()=>{let o=()=>{let i={},a=t.cache??[];for(let c of a){let u=n.current(c),l={};for(let f of Object.keys(u))l[f]=u[f].cache;i[c]=l}return i},s=o();return{subscribe:i=>{let a=!1,c=[],u=()=>{for(let p of c)p();c=[]},l=p=>{u();for(let h of p){let d=n.current(h);for(let g of Object.keys(d)){let m=d[g].subscribe(()=>{s=o(),a||i()});c.push(m)}}s=o(),a||i()},f=t.subscribe(p=>{let h=p.some(d=>d[0]===E||d[0]===B);!a&&h&&l(t.cache??[])});return l(t.cache??[]),()=>{a=!0,f(),u()}},getSnapshot:()=>s}},[t]);return(0,le.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot)}var yn={};ue(yn,{Signal:()=>js});we();W();de();var qe=[];function Ct(t){let e=t.cache;return t.subscribe(r=>{for(let[o,s]of r)o===E&&(e=s)})(),e}var mn=class{_node;_equals;constructor(e,n){this._equals=n?.equals??Object.is,this._node=V(e,{...n,resubscribable:!0,resetOnTeardown:!0})}get(){let e=qe[qe.length-1];return e?(this._node.status==="sentinel"&&Ct(this._node),e(this._node)):this._node.status==="sentinel"?Ct(this._node):this._node.cache}set(e){this._equals(this.get(),e)||ce(()=>{this._node.down([[I],[E,e]])})}},bn=class{_node;constructor(e,n){this._node=Ze(r=>{qe.push(r);try{return e()}finally{qe.pop()}},{...n,describeKind:"derived",resubscribable:!0,resetOnTeardown:!0})}get(){let e=qe[qe.length-1];return e?(this._node.status==="sentinel"&&Ct(this._node),e(this._node)):this._node.status==="sentinel"?Ct(this._node):this._node.cache}},js={State:mn,Computed:bn,sub:(t,e)=>{let n=typeof e=="function"?{data:e,error:void 0,complete:void 0}:e,r=!0;return t._node.subscribe(o=>{for(let[s,i]of o){if(s===E){if(r){r=!1;continue}n.data?.(i)}s===C&&n.error?.(i),s===P&&n.complete?.()}})}};var vn={};ue(vn,{useStore:()=>Vs,useSubscribe:()=>oo,useSubscribeRecord:()=>qs});var fe=require("solid-js");W();function oo(t){let[e,n]=(0,fe.createSignal)(t.cache,{equals:!1}),r=t.subscribe(()=>{n(()=>t.cache)});return(0,fe.getOwner)()?(0,fe.onCleanup)(()=>r()):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribe called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."),e}function Vs(t){return[oo(t),r=>{t.down([[I],[E,r]])}]}function qs(t,e){let[n,r]=(0,fe.createSignal)({},{equals:!1}),o=[],s=()=>{for(let u of o)u();o=[]},i=()=>{let u={};for(let l of t.cache??[]){let f=e(l),p={};for(let h of Object.keys(f))p[h]=f[h].cache;u[l]=p}return u},a=u=>{s();for(let l of u){let f=e(l);for(let p of Object.keys(f)){let h=f[p].subscribe(()=>{r(()=>i())});o.push(h)}}r(()=>i())},c=t.subscribe(u=>{u.some(l=>l[0]===E||l[0]===B)&&a(t.cache??[])});return a(t.cache??[]),(0,fe.getOwner)()?(0,fe.onCleanup)(()=>{c(),s()}):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribeRecord called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."),n}var _n={};ue(_n,{useStore:()=>Bs,useSubscribe:()=>Ws,useSubscribeRecord:()=>zs});W();function Ws(t){return{subscribe(e){let n=t.subscribe(()=>{e(t.cache)});return e(t.cache),n}}}function Bs(t){return{subscribe(e){let n=t.subscribe(()=>{e(t.cache)});return e(t.cache),n},set(e){t.down([[I],[E,e]])},update(e){let n=e(t.cache);t.down([[I],[E,n]])}}}function zs(t,e){return{subscribe(n){let r=[],o=()=>{for(let c of r)c();r=[]},s=()=>{let c={};for(let u of t.cache??[]){let l=e(u),f={};for(let p of Object.keys(l))f[p]=l[p].cache;c[u]=f}return c},i=c=>{o();for(let u of c){let l=e(u);for(let f of Object.keys(l)){let p=l[f].subscribe(()=>{n(s())});r.push(p)}}n(s())},a=t.subscribe(c=>{c.some(u=>u[0]===E||u[0]===B)&&i(t.cache??[])});return i(t.cache??[]),()=>{a(),o()}}}}var xn={};ue(xn,{useStore:()=>Us,useSubscribe:()=>Ks,useSubscribeRecord:()=>Ys});var H=require("vue");W();function Ks(t){let e=(0,H.shallowRef)(t.cache),n=t.subscribe(()=>{e.value=t.cache});return(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>n()):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribe called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.readonly)(e)}function Us(t){let e=(0,H.shallowRef)(t.cache),n=t.subscribe(()=>{e.value=t.cache});return(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>n()):typeof console<"u"&&console.warn("[graphrefly-ts] useStore called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.computed)({get:()=>e.value,set:r=>{t.down([[I],[E,r]])}})}function Ys(t,e){let n=(0,H.shallowRef)({}),r=new Map;function o(){let a={};for(let[c,u]of r)a[c]={...u.values};n.value=a}function s(a){for(let u of r.values())for(let l of u.subs)l();r.clear();for(let u of a){let l=e(u),f=Object.keys(l),p={},h=[];for(let d of f){let g=l[d];p[d]=g.cache;let m=g.subscribe(()=>{p[d]=g.cache,o()});h.push(m)}r.set(u,{subs:h,values:p})}let c={};for(let[u,l]of r)c[u]={...l.values};n.value=c}return(0,H.watch)(()=>[...(typeof t=="function"?t():(0,H.isRef)(t)?t.value:t)??[]],a=>s(a??[]),{immediate:!0}),(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>{for(let a of r.values())for(let c of a.subs)c();r.clear()}):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribeRecord called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.readonly)(n)}var wn={};ue(wn,{create:()=>Qs});W();de();var Js=()=>!1;function Qs(t){let e=new ne("zustand"),n=V(void 0,{name:"state",equals:Js});e.add(n,{name:"state"});let r=()=>n.cache,o=(a,c)=>{let u=n.cache,l=typeof a=="function"?a(u):a;n.emit(c?l:{...u,...l})},s={getState:r,setState:o,getInitialState:()=>i,subscribe:a=>{let c=!0,u=n.cache;return n.subscribe(l=>{for(let[f,p]of l)if(f===E){if(c){c=!1;continue}a(p,u),u=p}})},destroy:e.destroy.bind(e)},i=t(o,r,s);return n.emit(i),Object.assign(e,s)}0&&(module.exports={jotai,nanostores,nestjs,react,signals,solid,svelte,vue,zustand});
15
+ `)}function Ns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let o=t.indexOf("]",n+1);if(o<=n+1){e+="\\[";continue}let s=t.slice(n+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),e+=`[${s}]`,n=o;continue}e+=Ns(r)}return e+="$",new RegExp(e)}var Ss={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},As={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function St(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function ks(t){return t==="none"?As:t==="ansi"||t==null?Ss:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function Wr(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function Cs(t,e,n){for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);if(o<32||o===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function sn(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(L))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${L}' (path separator)`);if(t===te)throw new Error(`Graph "${e}": ${n} name "${te}" is reserved for meta companion paths`);Cs(t,e,n)}function Ms(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(L);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Ds(t,e){let n=!1;for(let o of t)if(!e.isMetaPassthrough(o[0])){n=!0;break}return n?t.filter(o=>e.isMetaPassthrough(o[0])):t}function Yr(t){for(let e of t._mounts.values())Yr(e);for(let e of t._nodes.values())try{e.down([[q]],{internal:!0})}catch{}}var ne=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(L))throw new Error(`Graph name must not contain '${L}' (got "${e}")`);if(e===te)throw new Error(`Graph name "${te}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??Te,this._traceRing=new ot(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=Ie(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,o=n?.name??r;if(o==null||o==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let s=o,i=n?.annotation;if(sn(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(s,e),this._nodeToName.set(e,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:Me()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof $&&n._applyVersioning(e)}remove(e){sn(e,this.name,"remove");let n=this._mounts.get(e);if(n){let s={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,c]of i)a.includes(`${L}${te}${L}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(e),s.mounts.push(...n._collectSubgraphs(`${e}${L}`)),this._mounts.delete(e),n._parent=void 0,Yr(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:s}),s}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[q]],{internal:!0});let o={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:o}),o}removeAll(e){let n=typeof e=="function"?e:(()=>{let s=Nt(e);return i=>s.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>n(s));for(let s of o){let i=this.remove(s);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let o=e[r++];return{value:[o,n.get(o)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(L))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let o=r?.internal===!0;this.node(e).down([[E,n]],{actor:r?.actor,internal:o,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);ce(()=>{for(let[o,s]of r)this.set(o,s,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[oe]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let o=r?.internal===!0;this.node(e).down([[C,n]],{actor:r?.actor,internal:o,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[P]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[c,u]of this._nodes)r.set(u,c);let a=[];for(let[c,u]of this._nodes)if(u instanceof $)for(let l of u._deps){let f=r.get(l.node);f!=null&&a.push([f,c])}return a.sort((c,u)=>c[0]<u[0]?-1:c[0]>u[0]?1:c[1]<u[1]?-1:c[1]>u[1]?1:0),a}let o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,c]of o)s.set(c,a);let i=[];for(let[a,c]of o)if(c instanceof $)for(let u of c._deps){let l=s.get(u.node);l!=null&&i.push([l,a])}return i.sort((a,c)=>a[0]<c[0]?-1:a[0]>c[0]?1:a[1]<c[1]?-1:a[1]>c[1]?1:0),i}mount(e,n){if(sn(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=Ms(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],o=n.slice(1);if(o.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let s=this._nodes.get(r);if(s&&o.length>0&&o[0]===te)return this._resolveMetaChainFromNode(s,o,n.join(L));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${o.join(L)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(o.join(L))}_resolveMetaChainFromNode(e,n,r){let o=e,s=0,i=[...n];for(;s<i.length;){if(i[s]!==te)throw new Error(`Graph "${this.name}": expected ${te} segment in meta path "${r}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${te} in "${r}"`);let a=i[s+1],c=o.meta[a];if(!c)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);o=c,s+=2}return o}signal(e,n){if(n?.internal!==!0){for(let o of e)if(this.config.messageTier(o[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,o){for(let c of this._mounts.values())c._signalDeliver(e,n,r,o);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=Ds(e,this.config);for(let c of[...this._nodes.keys()].sort()){let u=this._nodes.get(c);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(l){if(l instanceof Z)throw l;o.push(l)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,o)}}}_signalMetaSubtree(e,n,r,o,s){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,o)}catch(c){if(c instanceof Z)throw c;s.push(c)}this._signalMetaSubtree(a,n,r,o,s)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,o=vt(e?.detail,e?.fields),s=e?.format==="spec",i=s?vt("minimal"):o,a=[];this._collectObserveTargets("",a);let c=new Map;for(let[T,x]of a)c.set(x,T);let u=[];{let T=a.map(([,N])=>N),x=new Set(c.values()),O=0;for(;T.length>0;){let N=T.shift();if(N instanceof $)for(let M of N._deps){let S=M.node;if(c.has(S))continue;let k=S.name??"",A=k;if(!A||x.has(A))if(k){let F=2;for(;x.has(`${k}#${F}`);)F++;A=`${k}#${F}`}else for(A=`__internal__/${O++}`;x.has(A);)A=`__internal__/${O++}`;c.set(S,A),x.add(A),u.push([A,S]),T.push(S)}}}let l=[...a,...u],f={};for(let[T,x]of l){if(n!=null&&!x.allowsObserve(n))continue;let O=rn(x,i),N=x instanceof $?x._deps.map(A=>c.get(A.node)??A.node.name??""):[],{name:M,...S}=O,k={...S,deps:N};if(!s){let A=this._annotations.get(T);A!=null&&(k.annotation=A)}if(r!=null)if(typeof r=="function"){let A=r;if(!(A.length>=2?A(T,k):A(k)))continue}else{let A=!0;for(let[F,U]of Object.entries(r)){let re=F==="deps_includes"?"depsIncludes":F==="meta_has"?"metaHas":F;if(re==="depsIncludes"){if(!k.deps.includes(String(U))){A=!1;break}continue}if(re==="metaHas"){if(!Object.hasOwn(k.meta??{},String(U))){A=!1;break}continue}if(k[re]!==U){A=!1;break}}if(!A)continue}f[T]=k}let p=new Set(Object.keys(f)),h=[];for(let[T,x]of l)if(x instanceof $)for(let O of x._deps){let N=c.get(O.node);N!=null&&h.push([N,T])}h.sort((T,x)=>T[0]<x[0]?-1:T[0]>x[0]?1:T[1]<x[1]?-1:T[1]>x[1]?1:0);let d=h.map(([T,x])=>({from:T,to:x}));(n!=null||r!=null)&&(d=d.filter(T=>p.has(T.from)&&p.has(T.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(T=>{let x=`${T}${L}`;return[...p].some(O=>O===T||O.startsWith(x))}):g,v=this,_=e,b={name:this.name,nodes:f,edges:d,subgraphs:m,expand(T){let x={..._,format:void 0};return Array.isArray(T)?(x.fields=T,x.detail=void 0):(x.detail=T,x.fields=void 0),v.describe(x)}},y=e??{},w=y.format;return w==="json"?Ts(b,y):w==="pretty"?Es(b,y):w==="mermaid"?Kr(b,y):w==="mermaid-url"?Os(b,y):w==="d2"?Rs(b,y):w==="ascii"?Ir(b,y):b}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${r}`;n.push(o),n.push(...this._mounts.get(r)._collectSubgraphs(`${o}${L}`))}return n}resourceProfile(e){return jr(this,e)}reachable(e,n,r={}){return r.withDetail===!0?un(this.describe(),e,n,{...r,withDetail:!0}):un(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,c]of Object.entries(o.nodes))c.lastMutation!=null&&i.set(a,c.lastMutation);return Lr(o,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",o=0,s=V(o,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,c=!1,u=()=>{a||c||(a=!0,Qe(()=>{a=!1,!c&&(o+=1,s.emit(o))}))},l=i.onEvent(m=>{let v=m.type;v!=="data"&&v!=="error"&&v!=="complete"&&v!=="teardown"||u()}),f=[],p=new WeakSet,h=m=>{if(p.has(m)||c)return;p.add(m);let v=m.topology.subscribe(_=>{for(let b of _){if(b[0]!==E)continue;let y=b[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let w=m._mounts.get(y.name);w!=null&&h(w)}}});f.push(v);for(let _ of m._mounts.keys()){let b=m._mounts.get(_);b!=null&&h(b)}};h(this);let d;try{d=ie([s],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,v)=>m===v})}catch(m){l();for(let v of f)v();throw i.dispose(),m}let g=ge(d);return{node:d,dispose(){c=!0,l();for(let m of f)m();f.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let o=0,s=V(o,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,c=!1,u=i.onEvent(h=>{let d=h.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||c||(a=!0,Qe(()=>{a=!1,!c&&(o+=1,s.emit(o))}))}),l={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},f;try{f=ie([s],()=>this._explainStatic(e,n,l),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(h,d)=>h.found===d.found&&h.reason===d.reason&&h.steps.length===d.steps.length&&Gs(h.steps,d.steps)})}catch(h){throw u(),i.dispose(),h}let p=ge(f);return{node:f,dispose(){c=!0,u(),i.dispose(),p()}}}_pathsMatching(e){let n=Nt(e),r=[];return this._collectObserveTargets("",r),r.map(([o])=>o).filter(o=>n.test(o))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${L}${r}`;this._mounts.get(r)._collectObserveTargets(o,n)}for(let r of[...this._nodes.keys()].sort()){let o=this._nodes.get(r),s=e===""?r:`${e}${L}${r}`;n.push([s,o]),this._appendMetaObserveTargets(s,o,n)}}_appendMetaObserveTargets(e,n,r){for(let o of Object.keys(n.meta).sort()){let s=n.meta[o],i=`${e}${L}${te}${L}${o}`;r.push([i,s]),this._appendMetaObserveTargets(i,s,r)}}observe(e,n){let r=typeof e=="string",s=Wr(r?n:e),i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(r){let l=e,f=this.resolve(l);if(a!=null&&!f.allowsObserve(a))throw new Z({actor:a,action:"observe",nodeName:l});return i?this._buildStructuredObserver([[l,f]],s,"one"):{subscribe(p){return f.subscribe(p)},up(p){try{f.up?.(p)}catch(h){if(h instanceof Z)return;throw h}}}}let c=[];this._collectObserveTargets("",c),c.sort((l,f)=>l[0]<f[0]?-1:l[0]>f[0]?1:0);let u=a==null?c:c.filter(([,l])=>l.allowsObserve(a));return i?this._buildStructuredObserver(u,s,"all"):{subscribe:l=>{let f=u.map(([p,h])=>h.subscribe(d=>{l(p,d)}));return()=>{for(let p of f)p()}},up:(l,f)=>{try{this.resolve(l).up?.(f)}catch(p){if(p instanceof Z)return;throw p}}}}_buildStructuredObserver(e,n,r){let o=r==="one"?e[0]?.[0]:void 0,s=i=>{if(r==="one"&&o!=null){let l=this.resolve(o);return this._buildStructuredObserver([[o,l]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((l,f)=>l[0]<f[0]?-1:l[0]>f[0]?1:0);let c=i.actor,u=c==null?a:a.filter(([,l])=>l.allowsObserve(c));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,s)}_createObserveResult(e,n,r){let o=n.timeline===!0,s=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",c=this.config.inspectorEnabled,u=(s||i)&&c,l=n.maxEvents,f=l!=null&&l>0?new ot(l):null,p=[],h=new Set,d={},g=new Set,m=0,v=0,_=0,b=0,y=0,w=0,T=!1,x=!1,O=0,N=new Map,M=new Map,S=new Map,k=R=>{f?f.push(R):p.push(R);for(let G of h)G(R)},A=()=>o?{timestamp_ns:Me(),in_batch:at(),batch_id:O}:{},F=(R,G)=>{if(!(!u||!(R instanceof $)))return R._setInspectorHook(J=>{if(J.kind==="dep_message")N.set(R,J.depIndex);else if(J.kind==="run"){let We=J.batchData.map((D,z)=>D!=null&&D.length>0?D.at(-1):J.prevData[z]);M.set(R,We);let Q=J.batchData.map(D=>D!=null?[...D]:void 0);S.set(R,Q),i&&k({type:"derived",path:G,dep_values:We,dep_batches:Q,...A()})}})},U=R=>{let G=N.get(R),J=M.get(R);if(!s||J==null)return{};let Q=(G!=null&&G>=0&&R instanceof $?R._deps[G]:void 0)?.node,D=Q?.v,z=S.get(R);return{trigger_dep_index:G,trigger_dep_name:Q?.name,...D!=null?{trigger_version:{id:D.id,version:D.version}}:{},dep_values:[...J],...z!=null?{dep_batches:z}:{}}},re=[],ye=[];for(let[R,G]of e){let J=F(G,R);J&&re.push(J),ye.push(G.subscribe(We=>{O++;for(let Q of We){let D=Q[0],z=A();if(D===E){d[R]=Q[1];let It=G instanceof $?G.lastMutation?.actor??pe:pe;k({type:"data",path:R,data:Q[1],actor:It,...z,...U(G)})}else if(a)D===I?m++:D===B?v++:D===oe?_++:D===X?b++:D===se?y++:D===q?w++:D===P&&!g.has(R)?T=!0:D===C&&(x=!0,g.add(R));else if(D===I)m++,k({type:"dirty",path:R,...z});else if(D===B)v++,k({type:"resolved",path:R,...z,...U(G)});else if(D===oe)_++,k({type:"invalidate",path:R,...z});else if(D===X)b++,k({type:"pause",path:R,lockId:Q[1],...z});else if(D===se)y++,k({type:"resume",path:R,lockId:Q[1],...z});else if(D===P)g.has(R)||(T=!0),k({type:"complete",path:R,...z});else if(D===C){x=!0,g.add(R);let It=G instanceof $?G.lastMutation?.actor??pe:pe;k({type:"error",path:R,data:Q[1],actor:It,...z})}else D===q&&(w++,k({type:"teardown",path:R,...z}))}}))}let Mt=!1,Dt=()=>{if(!Mt){Mt=!0;for(let R of ye)R();for(let R of re)R();for(let R of it)R({value:void 0,done:!0});it.length=0}},Gt=[],it=[];h.add(R=>{let G=it.shift();G?G({value:R,done:!1}):Gt.push(R)});let Tn={get values(){return d},get dirtyCount(){return m},get resolvedCount(){return v},get invalidateCount(){return _},get pauseCount(){return b},get resumeCount(){return y},get teardownCount(){return w},get events(){return f?f.toArray():[...p]},get anyCompletedCleanly(){return T},get anyErrored(){return x},get completedWithoutErrors(){return T&&!x},onEvent(R){return h.add(R),()=>h.delete(R)},dispose:Dt,expand(R){Dt();let G={...n};return typeof R=="string"?G.detail=R:Object.assign(G,R),r(Wr(G))},[Symbol.asyncIterator](){return{next(){return Gt.length>0?Promise.resolve({value:Gt.shift(),done:!1}):Mt?Promise.resolve({value:void 0,done:!0}):new Promise(R=>it.push(R))},return(){return Dt(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Tn,n),Tn}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let o=n.logger??(d=>console.log(d)),s=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=s==null&&i==null?()=>!0:d=>(s==null||s.has(d))&&(i==null||!i.has(d)),c=ks(n.theme),u=r==="stage-log"?Me():0,l=d=>d==null?"":n.stageLabels?.[d]??d,f=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,p=d=>d.type==="data"||d.type==="error"?f(St(d.data),120):"",h=d=>{if(r==="stage-log"){let x=(Me()-u)/1e9,O=l(d.path).padEnd(9);if(d.type==="data"){let N=p(d);return`[${x.toFixed(3)}s] ${O} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=p(d);return`[${x.toFixed(3)}s] ${O} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${x.toFixed(3)}s] ${O} \u25A0 complete`:`[${x.toFixed(3)}s] ${O} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=c[d.type]??"",m=d.path?`${c.path}${d.path}${c.reset} `:"",v=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",b=v?` ${St(d.data)}`:_?` ${St(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,w=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",T=d.in_batch?" [batch]":"";return`${m}${g}${d.type.toUpperCase()}${c.reset}${b}${w}${T}`};e.onEvent(d=>{a(d.type)&&o(h(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){Vr(this._disposers,this.name),this.signal([[q]],{internal:!0}),Vr(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),o={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:c,guard:u,...l}=r.nodes[a];o[a]=l}let s=[...r.subgraphs].sort(),i={...r,version:1,nodes:o,subgraphs:s};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return Pn(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??Te,{codec:o,codecVersion:s,payload:i}=$n(e,r);return o.decode(i,s)}restore(e,n){if(qr(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(s=>Nt(s)),o=n?.includeProducers===!0;for(let s of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(s)))continue;let i=e.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let c=this.tryResolve(s)?.v;if(c!=null&&c.id===i.v.id&&c.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){n?.onError?.(s,a)}}}}}static fromSnapshot(e,n){qr(e);let r=typeof n=="function"?n:n?.build,o=typeof n=="function"?void 0:n?.factories,s=new t(e.name);if(r)return r(s),s.restore(e),s;for(let h of[...e.subgraphs].sort((d,g)=>{let m=d.split(L).length,v=g.split(L).length;return m!==v?m-v:d<g?-1:d>g?1:0})){let d=h.split(L),g=s;for(let m of d)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=o?Object.entries(o).map(([h,d])=>({re:Nt(h),factory:d})):[],a=h=>{for(let d of i)if(d.re.test(h))return d.factory},c=h=>{let d=h.split(L),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${h}"`);let m=s;for(let v of d){let _=m._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${h}"`);m=_}return[m,g]},u=Object.entries(e.nodes).filter(([h])=>!h.includes(`${L}${te}${L}`)).sort((h,d)=>h[0]<d[0]?-1:h[0]>d[0]?1:0),l=new Map(u),f=new Map,p=!0;for(;l.size>0&&p;){p=!1;for(let[h,d]of[...l.entries()]){let g=d?.deps??[];if(!g.every(w=>f.has(w)))continue;let[m,v]=c(h),_={...d?.meta??{}},b=a(h),y;if(d?.type==="state")y=V(d.value,{meta:_});else{if(b==null)continue;y=b(v,{path:h,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(w=>f.get(w))})}m.add(y,{name:v}),f.set(h,y),l.delete(h),p=!0}}if(l.size>0){let h=[...l.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${h}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return s.restore(e),s}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let o=(u,l)=>{if(u.disposed)return;let f=ys(l.nodes);if(u.lastSnapshot!=null&&f!==""&&f===u.lastFingerprint)return;let p=u.seq+1,h=he(),m=u.lastSnapshot==null||p%u.compactEvery===0?{mode:"full",snapshot:l,seq:p,timestamp_ns:h,format_version:Ne}:{mode:"diff",diff:Jr(u.lastSnapshot,l),seq:p,timestamp_ns:h,format_version:Ne};if(u.tier.filter&&!u.tier.filter(this.name,m))return;let v;try{v=u.tier.save(this.name,m)}catch(_){n.onError?.(_,u.tier);return}if(v&&typeof v.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>v,()=>v).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=l,u.lastFingerprint=f)},w=>{n.onError?.(w,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=l,u.lastFingerprint=f},s=(u,l)=>{try{o(u,l)}catch(f){n.onError?.(f,u.tier)}},i=(u,l)=>{if(!l.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(u);if(d==null)return;let g=rn(d,vt("standard"));if(!n.filter(u,g))return}let p,h=()=>(p==null&&(p=this.snapshot()),p);for(let d of r)d.disposed||(d.debounceMs===0?s(d,h()):(d.timer==null&&(d.timer=new _t),d.timer.start(d.debounceMs,()=>{d.disposed||s(d,this.snapshot())})))},a;if(n.paths!=null){let l=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(f=>{let p=this.tryResolve(f);return p==null?()=>{}:p.subscribe(h=>i(f,h))});a=()=>{for(let f of l)f()}}else a=this.observe().subscribe((u,l)=>i(u,l));let c=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(c)};return this._storageDisposers.add(c),{dispose:c}}async _cascadeRestore(e,n){for(let r of e){let o;try{o=await r.load(this.name)}catch(i){n?.(i,r);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===Ne&&s.nodes!=null)return this.restore(s),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let o of n){let s;try{s=await o.load(e)}catch(c){r?.onError?.(c,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===Ne&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(c){r?.onError?.(c,o)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let o={path:e,annotation:n,timestamp_ns:Me(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(o)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(o=>!e(o)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let o of n)this._traceRing.push(o);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),o=new Set(Object.keys(n.nodes)),s=[...o].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!o.has(_)).sort(),a=[],c=[];for(let _ of r){if(!o.has(_))continue;let b=e.nodes[_],y=n.nodes[_],w=b.v,T=y.v;w!=null&&T!=null&&w.id===T.id&&w.version!==T.version&&c.push({path:_,id:w.id,from:w.version,to:T.version});let x=w!=null&&T!=null&&w.id===T.id&&w.version===T.version;for(let O of["type","status","sentinel"]){let N=b[O],M=y[O];N!==M&&a.push({path:_,field:O,from:N,to:M})}if(!x)for(let O of["value","meta"]){let N=b[O],M=y[O];vs(N,M)||a.push({path:_,field:O,from:N,to:M})}}let u=_=>`${_.from} ${_.to}`,l=new Set(e.edges.map(u)),f=new Set(n.edges.map(u)),p=n.edges.filter(_=>!l.has(u(_))),h=e.edges.filter(_=>!f.has(u(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(_=>!d.has(_)).sort(),v=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:c,edgesAdded:p,edgesRemoved:h,subgraphsAdded:m,subgraphsRemoved:v}}};function Jr(t,e){let n=ne.diff(t,e),r={};for(let o of n.nodesAdded){let s=e.nodes[o];s!=null&&(r[o]=s)}return{...n,nodesAddedFull:r}}function un(t,e,n,r={}){let o={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?o:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=r.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return r.withDetail?o:[];let i=new Map,a=new Map,c=new Map,u=new Map,l=new Set;for(let[b,y]of Object.entries(t.nodes)){if(!b)continue;l.add(b);let w=y.deps??[];i.set(b,w);for(let T of w)T&&(l.add(T),a.has(T)||a.set(T,new Set),a.get(T).add(b))}for(let b of t.edges){if(b==null||typeof b!="object")continue;let y=typeof b.from=="string"?b.from:"",w=typeof b.to=="string"?b.to:"";!y||!w||(l.add(y),l.add(w),u.has(y)||u.set(y,new Set),u.get(y).add(w),c.has(w)||c.set(w,new Set),c.get(w).add(y))}if(!l.has(e))return r.withDetail?o:[];let f=r.both===!0,p=b=>{if(f){let x=i.get(b)??[],O=c.get(b),N=a.get(b),M=u.get(b),S=[...x];return O&&S.push(...O),N&&S.push(...N),M&&S.push(...M),S}if(n==="upstream"){let x=i.get(b)??[],O=c.get(b);return O?[...x,...O]:x}let y=a.get(b),w=u.get(b),T=y?[...y]:[];return w&&T.push(...w),T},h=new Set([e]),d=new Map,g=[{path:e,depth:0}],m=0,v=!1;for(;m<g.length;){let b=g[m++];if(s!=null&&b.depth>=s){p(b.path).length>0&&(v=!0);continue}for(let y of p(b.path))!y||h.has(y)||(h.add(y),d.set(y,b.depth+1),g.push({path:y,depth:b.depth+1}))}let _=[...d.keys()].sort((b,y)=>b<y?-1:b>y?1:0);return r.withDetail?{paths:_,depths:d,truncated:v}:_}function Gs(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.path!==o.path||r.type!==o.type||r.status!==o.status||r.hop!==o.hop||r.dep_index!==o.dep_index||r.annotation!==o.annotation||r.value!==o.value||r.lastMutation!==o.lastMutation)return!1;let s=r.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}we();Xe();De();Ue();De();Ge();de();we();W();de();var cn=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(e,n){if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=n,n!==void 0){if(this._buf=new Array(n),e&&e.length>0){let r=Math.min(e.length,n),o=e.length-r;for(let s=0;s<r;s++)this._buf[s]=e[o+s];this._size=r}}else this._buf=e?[...e]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._size+e;if(!(n<0||n>=this._size))return this._maxSize!==void 0?this._buf[(this._head+n)%this._maxSize]:this._buf[n]}append(e){this._rawAppend(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._maxSize!==void 0&&e.length>this._maxSize?e.length-this._maxSize:0;for(let r=n;r<e.length;r++)this._rawAppend(e[r]);this._version+=1}clear(){if(this._size===0)return 0;let e=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let n=0;n<e;n++)this._buf[(this._head+n)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,e}trimHead(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return 0;let n=Math.min(e,this._size);if(this._maxSize===void 0)this._buf.splice(0,n);else{for(let r=0;r<n;r++)this._buf[(this._head+r)%this._maxSize]=void 0;this._head=(this._head+n)%this._maxSize}return this._size-=n,this._version+=1,n}slice(e,n){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(n!==void 0&&(!Number.isInteger(n)||n<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${n})`);let r=n===void 0?this._size:Math.min(Math.max(n,0),this._size),o=Math.min(e,this._size);if(o>=r)return[];let s=r-o;if(this._maxSize===void 0)return this._buf.slice(o,r);let i=new Array(s);for(let a=0;a<s;a++)i[a]=this._buf[(this._head+o+a)%this._maxSize];return i}tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return[];let n=Math.min(e,this._size);return this.slice(this._size-n,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this._buf[(this._head+n)%this._maxSize];return e}_rawAppend(e){if(this._maxSize===void 0){this._buf.push(e),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=e,this._size+=1):(this._buf[this._head]=e,this._head=(this._head+1)%this._maxSize)}};function Qr(t){return t.subscribe(()=>{})}var Is=64;function Xr(t,e={}){let{name:n,maxSize:r,versioning:o,backend:s}=e,i=s??new cn(t,r),a=V(i.toArray(),{name:n,describeKind:"state",equals:(d,g)=>d===g,...o!=null?{versioning:o}:{}});function c(){let d=i.toArray();ce(()=>{a.down([[I]]),a.down([[E,d]])})}let u=new Map,l=new Map;function f(d,g){return`${d}:${g===void 0?"END":g}`}function p(d){if(d.size<Is)return;let g=d.keys().next();if(g.done)return;let m=d.get(g.value);m!==void 0&&m.dispose(),d.delete(g.value)}function h(d){let g=i.version;try{return d()}finally{i.version!==g&&c()}}return{entries:a,get size(){return i.size},at(d){return i.at(d)},append(d){h(()=>i.append(d))},appendMany(d){d.length!==0&&h(()=>i.appendMany(d))},clear(){h(()=>i.clear())},trimHead(d){h(()=>i.trimHead(d))},tail(d){if(!Number.isInteger(d)||d<0)throw new RangeError(`tail: n must be a non-negative integer (got ${d})`);let g=u.get(d);if(g!==void 0)return u.delete(d),u.set(d,g),g.node;p(u);let m=ie([a],([_])=>{let b=_;return d===0||b.length===0?[]:b.slice(Math.max(0,b.length-d))},{initial:i.tail(d),describeKind:"derived"}),v=Qr(m);return u.set(d,{node:m,dispose:v}),m},slice(d,g){if(!Number.isInteger(d)||d<0)throw new RangeError(`slice: start must be a non-negative integer (got ${d})`);if(g!==void 0&&(!Number.isInteger(g)||g<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${g})`);let m=f(d,g),v=l.get(m);if(v!==void 0)return l.delete(m),l.set(m,v),v.node;p(l);let _=ie([a],([y])=>{let w=y;return g===void 0?w.slice(d):w.slice(d,g)},{initial:i.slice(d,g),describeKind:"derived"}),b=Qr(_);return l.set(m,{node:_,dispose:b}),_},disposeTail(d){let g=u.get(d);return g===void 0?!1:(g.dispose(),u.delete(d),!0)},disposeSlice(d,g){let m=f(d,g),v=l.get(m);return v===void 0?!1:(v.dispose(),l.delete(m),!0)},disposeAllViews(){for(let d of u.values())d.dispose();u.clear();for(let d of l.values())d.dispose();l.clear()},dispose(){for(let d of u.values())d.dispose();u.clear();for(let d of l.values())d.dispose();l.clear()}}}gt();function Zr(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}var Ls=dt((t,e)=>{t("write"),t("signal"),e("observe")}),Ps=dt((t,e)=>{t("observe"),t("signal"),e("write")}),$s=dt((t,e)=>{t("observe"),t("signal"),e("write")});function At(t,e){return Zr("cqrs",t,e)}var dn=class extends ne{_eventLogs=new Map;_commandHandlers=new Map;_projections=new Set;_sagas=new Set;_keepaliveDisposers=[];_eventStore;_seq=0;constructor(e,n={}){super(e,n.graph)}destroy(){for(let e of this._keepaliveDisposers)e();this._keepaliveDisposers.length=0,super.destroy()}event(e){let n=this._eventLogs.get(e);if(n)return n.node;let r=Xr([],{name:e,versioning:0}),o=r.entries,s=ie([o],([i])=>i,{name:e,describeKind:"state",meta:At("event",{event_name:e}),guard:$s,initial:o.cache});return this.add(s,{name:e}),this._keepaliveDisposers.push(ge(s)),this._eventLogs.set(e,{log:r,node:s}),s}_appendEvent(e,n){let r=this._eventLogs.get(e);if(r||(this.event(e),r=this._eventLogs.get(e)),r.node.status==="completed"||r.node.status==="errored")throw new Error(`Cannot dispatch to terminated event stream "${e}" (status: ${r.node.status}).`);let o=r.log.entries.v,s={type:e,payload:n,timestampNs:he(),seq:++this._seq,...o!=null?{v0:{id:o.id,version:o.version}}:{}};r.log.append(s),this._eventStore&&this._eventStore.persist(s)}command(e,n){let r=V(void 0,{name:e,describeKind:"state",meta:{...At("command",{command_name:e}),error:null},guard:Ls});return this.add(r,{name:e}),this._commandHandlers.set(e,n),r}dispatch(e,n){let r=this._commandHandlers.get(e);if(!r)throw new Error(`Unknown command: "${e}". Register with .command() first.`);let o=this.resolve(e);ce(()=>{o.emit(n,{internal:!0});try{r(n,{emit:(s,i)=>this._appendEvent(s,i)}),o.meta.error.emit(null,{internal:!0})}catch(s){throw o.meta.error.emit(s,{internal:!0}),s}})}projection(e,n,r,o){let s=n.map(a=>(this._eventLogs.has(a)||this.event(a),this._eventLogs.get(a).node)),i=ie(s,a=>{let c=[];for(let u of a){let l=u;c.push(...l)}return c.sort((u,l)=>u.timestampNs-l.timestampNs||u.seq-l.seq),r(o,c)},{name:e,describeKind:"derived",meta:At("projection",{projection_name:e,source_events:n}),guard:Ps,initial:o});return this.add(i,{name:e}),this._keepaliveDisposers.push(ge(i)),this._projections.add(e),i}saga(e,n,r){let o=n.map(c=>(this._eventLogs.has(c)||this.event(c),this._eventLogs.get(c).node)),s=new Map,i={},a=Ee(o,(c,u)=>{let l=i.n.meta.error;for(let f=0;f<c.length;f++){let p=c[f];if(p==null||p.length===0)continue;let h=p.at(-1);if(!h)continue;let d=n[f],g=s.get(d)??0;if(h.length>g){let m=h.slice(g);for(let v of m)try{r(v),l.emit(null,{internal:!0})}catch(_){l.emit(_,{internal:!0})}s.set(d,h.length)}}},{name:e,describeKind:"effect",meta:{...At("saga",{saga_name:e,source_events:n}),error:null}});return i.n=a,this.add(a,{name:e}),this._keepaliveDisposers.push(ge(a)),this._sagas.add(e),a}useEventStore(e){this._eventStore=e}async rebuildProjection(e,n,r){if(!this._eventStore)throw new Error("No event store wired. Call useEventStore() first.");let o=[];for(let s of e){let i=await this._eventStore.loadEvents(s);o.push(...i.events)}return o.sort((s,i)=>s.timestampNs-i.timestampNs||s.seq-i.seq),n(r,o)}};function eo(t,e){return new dn(t,e)}var fn=class{constructor(e){this.graph=e}onModuleDestroy(){this.graph.destroy()}},pn=class{graph=new ne("request");onModuleDestroy(){this.graph.destroy()}},to,ln;to=[(0,st.Module)({})];var be=class be{static forRoot(e){let n=e??{},r=n.name??"root",o=[{provide:ee,useFactory:()=>{let s=new ne(r);return n.build&&n.build(s),n.snapshot&&s.restore(n.snapshot),s}},{provide:Symbol.for("graphrefly:root-lifecycle"),useFactory:s=>new fn(s),inject:[ee]},{provide:Re,useFactory:(s,i)=>new Re(s,i),inject:[ee,no.ModuleRef]}];if(n.nodes)for(let s of n.nodes)o.push({provide:ae(s),useFactory:i=>i.resolve(s),inject:[ee]});return n.requestScope&&o.push({provide:Symbol.for("graphrefly:request-lifecycle"),useFactory:()=>new pn,scope:st.Scope.REQUEST},{provide:Oe,useFactory:s=>s.graph,inject:[Symbol.for("graphrefly:request-lifecycle")],scope:st.Scope.REQUEST}),{module:be,global:!0,providers:o,exports:[ee,...(n.nodes??[]).map(ae),...n.requestScope?[Oe]:[]]}}static forFeature(e){let n=[{provide:K(e.name),useFactory:r=>{let o=new ne(e.name);return e.build&&e.build(o),e.snapshot&&o.restore(e.snapshot),r.mount(e.name,o),o},inject:[ee]}];if(e.nodes)for(let r of e.nodes)n.push({provide:ae(`${e.name}::${r}`),useFactory:o=>o.resolve(r),inject:[K(e.name)]});return{module:be,providers:n,exports:[K(e.name),...(e.nodes??[]).map(r=>ae(`${e.name}::${r}`))]}}static forCqrs(e){let n=[{provide:K(e.name),useFactory:r=>{let o=eo(e.name,e.cqrs);return e.eventStore&&o.useEventStore(e.eventStore),e.build&&e.build(o),r.mount(e.name,o),o},inject:[ee]}];if(e.nodes)for(let r of e.nodes)n.push({provide:ae(`${e.name}::${r}`),useFactory:o=>o.resolve(r),inject:[K(e.name)]});return{module:be,providers:n,exports:[K(e.name),...(e.nodes??[]).map(r=>ae(`${e.name}::${r}`))]}}};ln=An(null),be=Mn(ln,0,"GraphReflyModule",to,be),Cn(ln,1,be);var kt=be;var gn={};ue(gn,{useStore:()=>Hs,useSubscribe:()=>ro,useSubscribeRecord:()=>Fs});var le=require("react");W();function ro(t){return(0,le.useSyncExternalStore)(e=>{let n=!1,r=t.subscribe(()=>{n||e()});return()=>{n=!0,r()}},()=>t.cache,()=>t.cache)}function Hs(t){let e=ro(t),n=(0,le.useCallback)(r=>{t.down([[I],[E,r]])},[t]);return[e,n]}function Fs(t,e){let n=(0,le.useRef)(e);n.current=e;let r=(0,le.useMemo)(()=>{let o=()=>{let i={},a=t.cache??[];for(let c of a){let u=n.current(c),l={};for(let f of Object.keys(u))l[f]=u[f].cache;i[c]=l}return i},s=o();return{subscribe:i=>{let a=!1,c=[],u=()=>{for(let p of c)p();c=[]},l=p=>{u();for(let h of p){let d=n.current(h);for(let g of Object.keys(d)){let m=d[g].subscribe(()=>{s=o(),a||i()});c.push(m)}}s=o(),a||i()},f=t.subscribe(p=>{let h=p.some(d=>d[0]===E||d[0]===B);!a&&h&&l(t.cache??[])});return l(t.cache??[]),()=>{a=!0,f(),u()}},getSnapshot:()=>s}},[t]);return(0,le.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot)}var yn={};ue(yn,{Signal:()=>js});we();W();de();var qe=[];function Ct(t){let e=t.cache;return t.subscribe(r=>{for(let[o,s]of r)o===E&&(e=s)})(),e}var mn=class{_node;_equals;constructor(e,n){this._equals=n?.equals??Object.is,this._node=V(e,{...n,resubscribable:!0,resetOnTeardown:!0})}get(){let e=qe[qe.length-1];return e?(this._node.status==="sentinel"&&Ct(this._node),e(this._node)):this._node.status==="sentinel"?Ct(this._node):this._node.cache}set(e){this._equals(this.get(),e)||ce(()=>{this._node.down([[I],[E,e]])})}},bn=class{_node;constructor(e,n){this._node=Ze(r=>{qe.push(r);try{return e()}finally{qe.pop()}},{...n,describeKind:"derived",resubscribable:!0,resetOnTeardown:!0})}get(){let e=qe[qe.length-1];return e?(this._node.status==="sentinel"&&Ct(this._node),e(this._node)):this._node.status==="sentinel"?Ct(this._node):this._node.cache}},js={State:mn,Computed:bn,sub:(t,e)=>{let n=typeof e=="function"?{data:e,error:void 0,complete:void 0}:e,r=!0;return t._node.subscribe(o=>{for(let[s,i]of o){if(s===E){if(r){r=!1;continue}n.data?.(i)}s===C&&n.error?.(i),s===P&&n.complete?.()}})}};var vn={};ue(vn,{useStore:()=>Vs,useSubscribe:()=>oo,useSubscribeRecord:()=>qs});var fe=require("solid-js");W();function oo(t){let[e,n]=(0,fe.createSignal)(t.cache,{equals:!1}),r=t.subscribe(()=>{n(()=>t.cache)});return(0,fe.getOwner)()?(0,fe.onCleanup)(()=>r()):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribe called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."),e}function Vs(t){return[oo(t),r=>{t.down([[I],[E,r]])}]}function qs(t,e){let[n,r]=(0,fe.createSignal)({},{equals:!1}),o=[],s=()=>{for(let u of o)u();o=[]},i=()=>{let u={};for(let l of t.cache??[]){let f=e(l),p={};for(let h of Object.keys(f))p[h]=f[h].cache;u[l]=p}return u},a=u=>{s();for(let l of u){let f=e(l);for(let p of Object.keys(f)){let h=f[p].subscribe(()=>{r(()=>i())});o.push(h)}}r(()=>i())},c=t.subscribe(u=>{u.some(l=>l[0]===E||l[0]===B)&&a(t.cache??[])});return a(t.cache??[]),(0,fe.getOwner)()?(0,fe.onCleanup)(()=>{c(),s()}):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribeRecord called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."),n}var _n={};ue(_n,{useStore:()=>Bs,useSubscribe:()=>Ws,useSubscribeRecord:()=>zs});W();function Ws(t){return{subscribe(e){let n=t.subscribe(()=>{e(t.cache)});return e(t.cache),n}}}function Bs(t){return{subscribe(e){let n=t.subscribe(()=>{e(t.cache)});return e(t.cache),n},set(e){t.down([[I],[E,e]])},update(e){let n=e(t.cache);t.down([[I],[E,n]])}}}function zs(t,e){return{subscribe(n){let r=[],o=()=>{for(let c of r)c();r=[]},s=()=>{let c={};for(let u of t.cache??[]){let l=e(u),f={};for(let p of Object.keys(l))f[p]=l[p].cache;c[u]=f}return c},i=c=>{o();for(let u of c){let l=e(u);for(let f of Object.keys(l)){let p=l[f].subscribe(()=>{n(s())});r.push(p)}}n(s())},a=t.subscribe(c=>{c.some(u=>u[0]===E||u[0]===B)&&i(t.cache??[])});return i(t.cache??[]),()=>{a(),o()}}}}var xn={};ue(xn,{useStore:()=>Us,useSubscribe:()=>Ks,useSubscribeRecord:()=>Ys});var H=require("vue");W();function Ks(t){let e=(0,H.shallowRef)(t.cache),n=t.subscribe(()=>{e.value=t.cache});return(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>n()):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribe called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.readonly)(e)}function Us(t){let e=(0,H.shallowRef)(t.cache),n=t.subscribe(()=>{e.value=t.cache});return(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>n()):typeof console<"u"&&console.warn("[graphrefly-ts] useStore called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.computed)({get:()=>e.value,set:r=>{t.down([[I],[E,r]])}})}function Ys(t,e){let n=(0,H.shallowRef)({}),r=new Map;function o(){let a={};for(let[c,u]of r)a[c]={...u.values};n.value=a}function s(a){for(let u of r.values())for(let l of u.subs)l();r.clear();for(let u of a){let l=e(u),f=Object.keys(l),p={},h=[];for(let d of f){let g=l[d];p[d]=g.cache;let m=g.subscribe(()=>{p[d]=g.cache,o()});h.push(m)}r.set(u,{subs:h,values:p})}let c={};for(let[u,l]of r)c[u]={...l.values};n.value=c}return(0,H.watch)(()=>[...(typeof t=="function"?t():(0,H.isRef)(t)?t.value:t)??[]],a=>s(a??[]),{immediate:!0}),(0,H.getCurrentScope)()?(0,H.onScopeDispose)(()=>{for(let a of r.values())for(let c of a.subs)c();r.clear()}):typeof console<"u"&&console.warn("[graphrefly-ts] useSubscribeRecord called outside a Vue scope \u2014 subscription will not be auto-disposed."),(0,H.readonly)(n)}var wn={};ue(wn,{create:()=>Qs});W();de();var Js=()=>!1;function Qs(t){let e=new ne("zustand"),n=V(void 0,{name:"state",equals:Js});e.add(n,{name:"state"});let r=()=>n.cache,o=(a,c)=>{let u=n.cache,l=typeof a=="function"?a(u):a;n.emit(c?l:{...u,...l})},s={getState:r,setState:o,getInitialState:()=>i,subscribe:a=>{let c=!0,u=n.cache;return n.subscribe(l=>{for(let[f,p]of l)if(f===E){if(c){c=!1;continue}a(p,u),u=p}})},destroy:e.destroy.bind(e)},i=t(o,r,s);return n.emit(i),Object.assign(e,s)}0&&(module.exports={jotai,nanostores,nestjs,react,signals,solid,svelte,vue,zustand});
@@ -1,19 +1,19 @@
1
1
  export { i as jotai } from '../index-BydMDMf7.cjs';
2
2
  export { i as nanostores } from '../index-CIXaiYDE.cjs';
3
- export { i as nestjs } from '../index-yIdWFo2b.cjs';
3
+ export { i as nestjs } from '../index-C4QTaDli.cjs';
4
4
  export { i as react } from '../index-D7XxY1Ff.cjs';
5
- export { a as signals } from '../index-DR3gf_DG.cjs';
5
+ export { a as signals } from '../index-LzCJ0kMT.cjs';
6
6
  export { i as solid } from '../index-FBqTfL_S.cjs';
7
7
  export { i as svelte } from '../index-CDK5RsV5.cjs';
8
8
  export { i as vue } from '../index-DDo-eqQ4.cjs';
9
- export { i as zustand } from '../index-CRAkoq-y.cjs';
9
+ export { i as zustand } from '../index-DY2QbdoP.cjs';
10
10
  import '../node-BVV7G1bq.cjs';
11
11
  import '../observable-BrUAPeH_.cjs';
12
12
  import 'rxjs';
13
13
  import '@nestjs/common';
14
14
  import '@nestjs/core';
15
- import '../graph-C4Uxwv0T.cjs';
15
+ import '../graph-CdJeX7O7.cjs';
16
16
  import '../meta-COtmHLwT.cjs';
17
17
  import '../extra/storage-core.cjs';
18
- import '../index-SSGqF8mI.cjs';
18
+ import '../index-aBqZUx3B.cjs';
19
19
  import 'vue';
@@ -1,19 +1,19 @@
1
1
  export { i as jotai } from '../index-ByPnK85n.js';
2
2
  export { i as nanostores } from '../index-wIx1Jisk.js';
3
- export { i as nestjs } from '../index-DGb1awva.js';
3
+ export { i as nestjs } from '../index-CZUzi6Dy.js';
4
4
  export { i as react } from '../index-D0C_USMR.js';
5
- export { a as signals } from '../index-RQg6lTrN.js';
5
+ export { a as signals } from '../index-MV2yGIAq.js';
6
6
  export { i as solid } from '../index-CrC7urhX.js';
7
7
  export { i as svelte } from '../index-BX22kvjh.js';
8
8
  export { i as vue } from '../index-Ip3q9T9x.js';
9
- export { i as zustand } from '../index-Bvi5uJxX.js';
9
+ export { i as zustand } from '../index-CmSjld-4.js';
10
10
  import '../node-BVV7G1bq.js';
11
11
  import '../observable-ITikPXz3.js';
12
12
  import 'rxjs';
13
13
  import '@nestjs/common';
14
14
  import '@nestjs/core';
15
- import '../graph-CWeI0aHd.js';
15
+ import '../graph-BOhEGJ6E.js';
16
16
  import '../meta-BMwx3ExI.js';
17
17
  import '../extra/storage-core.js';
18
- import '../index-IZ3l_vQ9.js';
18
+ import '../index-DD1czHj3.js';
19
19
  import 'vue';
@@ -1 +1 @@
1
- import{a as e}from"../chunk-WANIEEKV.js";import{d}from"../chunk-VJLMUKOI.js";import{d as f}from"../chunk-VIMF6LGM.js";import{d as g}from"../chunk-6QZNQS5B.js";import{d as h}from"../chunk-GPW2V3RE.js";import{b as i}from"../chunk-AV3PIDFQ.js";import{b as a}from"../chunk-BA5URFYW.js";import{i as b}from"../chunk-BZP5T4X6.js";import{G as c}from"../chunk-P7JXGKDO.js";import"../chunk-VIEUJSTT.js";import"../chunk-5Z4HDCO6.js";import"../chunk-GNCBXARM.js";import"../chunk-Y32RJO24.js";import"../chunk-5QDBSZBV.js";import"../chunk-MGKAO4EK.js";import"../chunk-ESMPEKEV.js";import"../chunk-TWMEGG45.js";import"../chunk-AUY2YKCO.js";import"../chunk-KASHOCF5.js";import"../chunk-W4TSQ6RJ.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as jotai,b as nanostores,c as nestjs,d as react,e as signals,f as solid,g as svelte,h as vue,i as zustand};
1
+ import{a as e}from"../chunk-7QS77X6G.js";import{d}from"../chunk-VJLMUKOI.js";import{d as f}from"../chunk-VIMF6LGM.js";import{d as g}from"../chunk-6QZNQS5B.js";import{d as h}from"../chunk-GPW2V3RE.js";import{b as i}from"../chunk-JYMNVEH6.js";import{b as a}from"../chunk-A4JT4SAD.js";import{i as b}from"../chunk-W6FQIFVE.js";import{G as c}from"../chunk-CNXUW2CU.js";import"../chunk-EIFHFDFD.js";import"../chunk-K54OKWNY.js";import"../chunk-CZVYLXFK.js";import"../chunk-MFNOZ5E6.js";import"../chunk-5QDBSZBV.js";import"../chunk-XRSHMHEG.js";import"../chunk-4JBKKUCJ.js";import"../chunk-SGS4OJGS.js";import"../chunk-ESMPEKEV.js";import"../chunk-N2KKISCE.js";import"../chunk-UMH3HSP7.js";import"../chunk-7AJKUA36.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as jotai,b as nanostores,c as nestjs,d as react,e as signals,f as solid,g as svelte,h as vue,i as zustand};