@graphrefly/graphrefly 0.44.0 → 0.46.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 (720) hide show
  1. package/README.md +22 -19
  2. package/dist/_internal-B23BagFd.d.cts +33 -0
  3. package/dist/_internal-B23BagFd.d.ts +33 -0
  4. package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
  5. package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
  6. package/dist/agents-C0Ji9ldU.d.cts +629 -0
  7. package/dist/agents-C9zexT7I.d.ts +629 -0
  8. package/dist/audit-BAXb3VOg.d.ts +246 -0
  9. package/dist/audit-C_bPfkqS.d.cts +246 -0
  10. package/dist/backoff-7KIK3WQW.js +24 -0
  11. package/dist/backoff-7KIK3WQW.js.map +1 -0
  12. package/dist/backoff-Bnb9OoPh.d.cts +6 -0
  13. package/dist/backoff-Bnb9OoPh.d.ts +6 -0
  14. package/dist/base/composition/index.cjs +811 -0
  15. package/dist/base/composition/index.cjs.map +1 -0
  16. package/dist/base/composition/index.d.cts +469 -0
  17. package/dist/base/composition/index.d.ts +469 -0
  18. package/dist/base/composition/index.js +40 -0
  19. package/dist/base/composition/index.js.map +1 -0
  20. package/dist/base/index.cjs +6336 -0
  21. package/dist/base/index.cjs.map +1 -0
  22. package/dist/base/index.d.cts +22 -0
  23. package/dist/base/index.d.ts +22 -0
  24. package/dist/base/index.js +259 -0
  25. package/dist/base/index.js.map +1 -0
  26. package/dist/base/io/index.cjs +3270 -0
  27. package/dist/base/io/index.cjs.map +1 -0
  28. package/dist/base/io/index.d.cts +2245 -0
  29. package/dist/base/io/index.d.ts +2245 -0
  30. package/dist/base/io/index.js +117 -0
  31. package/dist/base/io/index.js.map +1 -0
  32. package/dist/base/meta/index.cjs +43 -0
  33. package/dist/base/meta/index.cjs.map +1 -0
  34. package/dist/base/meta/index.d.cts +45 -0
  35. package/dist/base/meta/index.d.ts +45 -0
  36. package/dist/base/meta/index.js +13 -0
  37. package/dist/base/meta/index.js.map +1 -0
  38. package/dist/base/mutation/index.cjs +200 -0
  39. package/dist/base/mutation/index.cjs.map +1 -0
  40. package/dist/base/mutation/index.d.cts +177 -0
  41. package/dist/base/mutation/index.d.ts +177 -0
  42. package/dist/base/mutation/index.js +22 -0
  43. package/dist/base/mutation/index.js.map +1 -0
  44. package/dist/base/render/index.cjs +1120 -0
  45. package/dist/base/render/index.cjs.map +1 -0
  46. package/dist/{extra/render/index.d.ts → base/render/index.d.cts} +75 -31
  47. package/dist/{extra/render/index.d.cts → base/render/index.d.ts} +75 -31
  48. package/dist/base/render/index.js +24 -0
  49. package/dist/base/render/index.js.map +1 -0
  50. package/dist/base/sources/browser/index.cjs +172 -0
  51. package/dist/base/sources/browser/index.cjs.map +1 -0
  52. package/dist/base/sources/browser/index.d.cts +84 -0
  53. package/dist/base/sources/browser/index.d.ts +84 -0
  54. package/dist/base/sources/browser/index.js +151 -0
  55. package/dist/base/sources/browser/index.js.map +1 -0
  56. package/dist/base/sources/event/index.cjs +98 -0
  57. package/dist/base/sources/event/index.cjs.map +1 -0
  58. package/dist/base/sources/event/index.d.cts +91 -0
  59. package/dist/base/sources/event/index.d.ts +91 -0
  60. package/dist/base/sources/event/index.js +13 -0
  61. package/dist/base/sources/event/index.js.map +1 -0
  62. package/dist/base/sources/index.cjs +755 -0
  63. package/dist/base/sources/index.cjs.map +1 -0
  64. package/dist/{extra/sources.d.ts → base/sources/index.d.cts} +74 -301
  65. package/dist/{extra/sources.d.cts → base/sources/index.d.ts} +74 -301
  66. package/dist/base/sources/index.js +42 -0
  67. package/dist/base/sources/index.js.map +1 -0
  68. package/dist/base/sources/node/index.cjs +320 -0
  69. package/dist/base/sources/node/index.cjs.map +1 -0
  70. package/dist/{extra/node.d.ts → base/sources/node/index.d.cts} +35 -37
  71. package/dist/{extra/node.d.cts → base/sources/node/index.d.ts} +35 -37
  72. package/dist/base/sources/node/index.js +306 -0
  73. package/dist/base/sources/node/index.js.map +1 -0
  74. package/dist/base/utils/index.cjs +37 -0
  75. package/dist/base/utils/index.cjs.map +1 -0
  76. package/dist/base/utils/index.d.cts +37 -0
  77. package/dist/base/utils/index.d.ts +37 -0
  78. package/dist/base/utils/index.js +11 -0
  79. package/dist/base/utils/index.js.map +1 -0
  80. package/dist/base/worker/index.cjs +548 -0
  81. package/dist/base/worker/index.cjs.map +1 -0
  82. package/dist/base/worker/index.d.cts +207 -0
  83. package/dist/base/worker/index.d.ts +207 -0
  84. package/dist/base/worker/index.js +20 -0
  85. package/dist/base/worker/index.js.map +1 -0
  86. package/dist/breaker-C9skL3d8.d.ts +175 -0
  87. package/dist/breaker-ugSdq54q.d.cts +175 -0
  88. package/dist/{cascading-BglDkMdX.d.cts → cascading-CSSbKGrJ.d.ts} +3 -3
  89. package/dist/{cascading-MFgxu7Yo.d.ts → cascading-baGkiihI.d.cts} +3 -3
  90. package/dist/chunk-255UCBG4.js +58 -0
  91. package/dist/chunk-255UCBG4.js.map +1 -0
  92. package/dist/chunk-2LO3EL4W.js +1 -0
  93. package/dist/chunk-2LO3EL4W.js.map +1 -0
  94. package/dist/chunk-2OB3CEJS.js +1065 -0
  95. package/dist/chunk-2OB3CEJS.js.map +1 -0
  96. package/dist/chunk-36NMM65U.js +144 -0
  97. package/dist/chunk-36NMM65U.js.map +1 -0
  98. package/dist/chunk-3CEXCBN6.js +1 -0
  99. package/dist/chunk-3CEXCBN6.js.map +1 -0
  100. package/dist/chunk-3MUSLI6E.js +105 -0
  101. package/dist/chunk-3MUSLI6E.js.map +1 -0
  102. package/dist/chunk-3PSLNJDU.js +884 -0
  103. package/dist/chunk-3PSLNJDU.js.map +1 -0
  104. package/dist/chunk-3QZY5BI7.js +92 -0
  105. package/dist/chunk-3QZY5BI7.js.map +1 -0
  106. package/dist/chunk-42FQ27MQ.js +594 -0
  107. package/dist/chunk-42FQ27MQ.js.map +1 -0
  108. package/dist/chunk-4GYMCUDZ.js +1085 -0
  109. package/dist/chunk-4GYMCUDZ.js.map +1 -0
  110. package/dist/chunk-4S53H2KR.js +382 -0
  111. package/dist/chunk-4S53H2KR.js.map +1 -0
  112. package/dist/chunk-4XCHZRUJ.js +128 -0
  113. package/dist/chunk-4XCHZRUJ.js.map +1 -0
  114. package/dist/chunk-5THCXDWY.js +725 -0
  115. package/dist/chunk-5THCXDWY.js.map +1 -0
  116. package/dist/chunk-6XZYT4SW.js +256 -0
  117. package/dist/chunk-6XZYT4SW.js.map +1 -0
  118. package/dist/chunk-7EGRP2VX.js +76 -0
  119. package/dist/chunk-7EGRP2VX.js.map +1 -0
  120. package/dist/chunk-A7KV5UK4.js +150 -0
  121. package/dist/chunk-A7KV5UK4.js.map +1 -0
  122. package/dist/chunk-APY2SS5X.js +156 -0
  123. package/dist/chunk-APY2SS5X.js.map +1 -0
  124. package/dist/chunk-AZDQPQ3V.js +66 -0
  125. package/dist/chunk-AZDQPQ3V.js.map +1 -0
  126. package/dist/chunk-BU3SEFA5.js +90 -0
  127. package/dist/chunk-BU3SEFA5.js.map +1 -0
  128. package/dist/chunk-BXGZFGZ4.js +189 -0
  129. package/dist/chunk-BXGZFGZ4.js.map +1 -0
  130. package/dist/chunk-CGHORL6G.js +579 -0
  131. package/dist/chunk-CGHORL6G.js.map +1 -0
  132. package/dist/chunk-CXANAIZU.js +530 -0
  133. package/dist/chunk-CXANAIZU.js.map +1 -0
  134. package/dist/chunk-CZQHCKKG.js +1 -0
  135. package/dist/chunk-CZQHCKKG.js.map +1 -0
  136. package/dist/chunk-DKNHAICT.js +133 -0
  137. package/dist/chunk-DKNHAICT.js.map +1 -0
  138. package/dist/chunk-DM4OMPWK.js +584 -0
  139. package/dist/chunk-DM4OMPWK.js.map +1 -0
  140. package/dist/chunk-DMSNO6ZB.js +452 -0
  141. package/dist/chunk-DMSNO6ZB.js.map +1 -0
  142. package/dist/chunk-E5OZPDIW.js +229 -0
  143. package/dist/chunk-E5OZPDIW.js.map +1 -0
  144. package/dist/chunk-EVYY4X5A.js +509 -0
  145. package/dist/chunk-EVYY4X5A.js.map +1 -0
  146. package/dist/chunk-FDFD67UO.js +1 -0
  147. package/dist/chunk-FDFD67UO.js.map +1 -0
  148. package/dist/chunk-FMPF42Q4.js +13 -0
  149. package/dist/chunk-FMPF42Q4.js.map +1 -0
  150. package/dist/chunk-FR6RGA3B.js +1277 -0
  151. package/dist/chunk-FR6RGA3B.js.map +1 -0
  152. package/dist/chunk-FW23JYNQ.js +454 -0
  153. package/dist/chunk-FW23JYNQ.js.map +1 -0
  154. package/dist/chunk-GBCENOLN.js +1575 -0
  155. package/dist/chunk-GBCENOLN.js.map +1 -0
  156. package/dist/chunk-HL7HUJIX.js +1 -0
  157. package/dist/chunk-HL7HUJIX.js.map +1 -0
  158. package/dist/chunk-HULCUY35.js +2508 -0
  159. package/dist/chunk-HULCUY35.js.map +1 -0
  160. package/dist/chunk-IHTWQEDR.js +169 -0
  161. package/dist/chunk-IHTWQEDR.js.map +1 -0
  162. package/dist/chunk-IJRR6YAI.js +128 -0
  163. package/dist/chunk-IJRR6YAI.js.map +1 -0
  164. package/dist/chunk-JGFRAFDL.js +221 -0
  165. package/dist/chunk-JGFRAFDL.js.map +1 -0
  166. package/dist/chunk-KIIXR252.js +211 -0
  167. package/dist/chunk-KIIXR252.js.map +1 -0
  168. package/dist/chunk-KN3H5CNT.js +11 -0
  169. package/dist/chunk-KN3H5CNT.js.map +1 -0
  170. package/dist/chunk-KPG3DGLA.js +1 -0
  171. package/dist/chunk-KPG3DGLA.js.map +1 -0
  172. package/dist/chunk-KRNQ6RGQ.js +1 -0
  173. package/dist/chunk-KRNQ6RGQ.js.map +1 -0
  174. package/dist/chunk-LBAJK24K.js +1071 -0
  175. package/dist/chunk-LBAJK24K.js.map +1 -0
  176. package/dist/chunk-MLTPJMH6.js +417 -0
  177. package/dist/chunk-MLTPJMH6.js.map +1 -0
  178. package/dist/chunk-N3SZ7BMH.js +95 -0
  179. package/dist/chunk-N3SZ7BMH.js.map +1 -0
  180. package/dist/chunk-NDUD3IMO.js +540 -0
  181. package/dist/chunk-NDUD3IMO.js.map +1 -0
  182. package/dist/chunk-NY2PYHNC.js +873 -0
  183. package/dist/chunk-NY2PYHNC.js.map +1 -0
  184. package/dist/chunk-O3MT7DYI.js +225 -0
  185. package/dist/chunk-O3MT7DYI.js.map +1 -0
  186. package/dist/chunk-OCUDSN63.js +2386 -0
  187. package/dist/chunk-OCUDSN63.js.map +1 -0
  188. package/dist/chunk-OIWU3NYV.js +199 -0
  189. package/dist/chunk-OIWU3NYV.js.map +1 -0
  190. package/dist/chunk-OO5BM6CJ.js +1153 -0
  191. package/dist/chunk-OO5BM6CJ.js.map +1 -0
  192. package/dist/chunk-OQUIJT7A.js +1 -0
  193. package/dist/chunk-OQUIJT7A.js.map +1 -0
  194. package/dist/chunk-P5LBT622.js +105 -0
  195. package/dist/chunk-P5LBT622.js.map +1 -0
  196. package/dist/chunk-PKGQG5QQ.js +519 -0
  197. package/dist/chunk-PKGQG5QQ.js.map +1 -0
  198. package/dist/chunk-PKPO3JTZ.js +561 -0
  199. package/dist/chunk-PKPO3JTZ.js.map +1 -0
  200. package/dist/chunk-PL5UDIQ5.js +118 -0
  201. package/dist/chunk-PL5UDIQ5.js.map +1 -0
  202. package/dist/chunk-PZWISPIQ.js +432 -0
  203. package/dist/chunk-PZWISPIQ.js.map +1 -0
  204. package/dist/chunk-Q3EYOCZB.js +510 -0
  205. package/dist/chunk-Q3EYOCZB.js.map +1 -0
  206. package/dist/chunk-QMBYUVRL.js +15 -0
  207. package/dist/chunk-QMBYUVRL.js.map +1 -0
  208. package/dist/chunk-RAGGHLCV.js +200 -0
  209. package/dist/chunk-RAGGHLCV.js.map +1 -0
  210. package/dist/chunk-RGL53X5G.js +574 -0
  211. package/dist/chunk-RGL53X5G.js.map +1 -0
  212. package/dist/chunk-RJOG4IJU.js +1039 -0
  213. package/dist/chunk-RJOG4IJU.js.map +1 -0
  214. package/dist/chunk-SOOKUYVM.js +403 -0
  215. package/dist/chunk-SOOKUYVM.js.map +1 -0
  216. package/dist/chunk-T5BN5KG7.js +1 -0
  217. package/dist/chunk-T5BN5KG7.js.map +1 -0
  218. package/dist/chunk-TP7244Y6.js +207 -0
  219. package/dist/chunk-TP7244Y6.js.map +1 -0
  220. package/dist/chunk-TSBFTJKM.js +57 -0
  221. package/dist/chunk-TSBFTJKM.js.map +1 -0
  222. package/dist/chunk-URQ2CBBF.js +143 -0
  223. package/dist/chunk-URQ2CBBF.js.map +1 -0
  224. package/dist/chunk-W2BOPXTI.js +1 -0
  225. package/dist/chunk-W2BOPXTI.js.map +1 -0
  226. package/dist/chunk-WKSWLSCX.js +207 -0
  227. package/dist/chunk-WKSWLSCX.js.map +1 -0
  228. package/dist/chunk-Y52CS6YA.js +88 -0
  229. package/dist/chunk-Y52CS6YA.js.map +1 -0
  230. package/dist/chunk-YCBUWK77.js +92 -0
  231. package/dist/chunk-YCBUWK77.js.map +1 -0
  232. package/dist/chunk-YJ4U2D2C.js +314 -0
  233. package/dist/chunk-YJ4U2D2C.js.map +1 -0
  234. package/dist/chunk-Z4YXAUDN.js +239 -0
  235. package/dist/chunk-Z4YXAUDN.js.map +1 -0
  236. package/dist/chunk-Z6EGP5D7.js +92 -0
  237. package/dist/chunk-Z6EGP5D7.js.map +1 -0
  238. package/dist/compat/index.cjs +3100 -9
  239. package/dist/compat/index.cjs.map +1 -0
  240. package/dist/compat/index.d.cts +112 -18
  241. package/dist/compat/index.d.ts +112 -18
  242. package/dist/compat/index.js +176 -1
  243. package/dist/compat/index.js.map +1 -0
  244. package/dist/compat/jotai/index.cjs +149 -1
  245. package/dist/compat/jotai/index.cjs.map +1 -0
  246. package/dist/compat/jotai/index.d.cts +2 -2
  247. package/dist/compat/jotai/index.d.ts +2 -2
  248. package/dist/compat/jotai/index.js +8 -1
  249. package/dist/compat/jotai/index.js.map +1 -0
  250. package/dist/compat/nanostores/index.cjs +205 -1
  251. package/dist/compat/nanostores/index.cjs.map +1 -0
  252. package/dist/compat/nanostores/index.d.cts +2 -2
  253. package/dist/compat/nanostores/index.d.ts +2 -2
  254. package/dist/compat/nanostores/index.js +22 -1
  255. package/dist/compat/nanostores/index.js.map +1 -0
  256. package/dist/compat/nestjs/index.cjs +2241 -9
  257. package/dist/compat/nestjs/index.cjs.map +1 -0
  258. package/dist/compat/nestjs/index.d.cts +7 -10
  259. package/dist/compat/nestjs/index.d.ts +7 -10
  260. package/dist/compat/nestjs/index.js +78 -1
  261. package/dist/compat/nestjs/index.js.map +1 -0
  262. package/dist/compat/react/index.cjs +114 -1
  263. package/dist/compat/react/index.cjs.map +1 -0
  264. package/dist/compat/react/index.d.cts +2 -2
  265. package/dist/compat/react/index.d.ts +2 -2
  266. package/dist/compat/react/index.js +12 -1
  267. package/dist/compat/react/index.js.map +1 -0
  268. package/dist/compat/solid/index.cjs +101 -1
  269. package/dist/compat/solid/index.cjs.map +1 -0
  270. package/dist/compat/solid/index.d.cts +2 -2
  271. package/dist/compat/solid/index.d.ts +2 -2
  272. package/dist/compat/solid/index.js +12 -1
  273. package/dist/compat/solid/index.js.map +1 -0
  274. package/dist/compat/svelte/index.cjs +104 -1
  275. package/dist/compat/svelte/index.cjs.map +1 -0
  276. package/dist/compat/svelte/index.d.cts +2 -2
  277. package/dist/compat/svelte/index.d.ts +2 -2
  278. package/dist/compat/svelte/index.js +12 -1
  279. package/dist/compat/svelte/index.js.map +1 -0
  280. package/dist/compat/vue/index.cjs +119 -1
  281. package/dist/compat/vue/index.cjs.map +1 -0
  282. package/dist/compat/vue/index.d.cts +2 -2
  283. package/dist/compat/vue/index.d.ts +2 -2
  284. package/dist/compat/vue/index.js +12 -1
  285. package/dist/compat/vue/index.js.map +1 -0
  286. package/dist/compat/zustand/index.cjs +69 -3
  287. package/dist/compat/zustand/index.cjs.map +1 -0
  288. package/dist/compat/zustand/index.d.cts +2 -6
  289. package/dist/compat/zustand/index.d.ts +2 -6
  290. package/dist/compat/zustand/index.js +8 -1
  291. package/dist/compat/zustand/index.js.map +1 -0
  292. package/dist/distill-De6Rnn15.d.cts +48 -0
  293. package/dist/distill-De6Rnn15.d.ts +48 -0
  294. package/dist/external-register-CWyroXb_.d.cts +138 -0
  295. package/dist/external-register-CWyroXb_.d.ts +138 -0
  296. package/dist/{fallback-74oxi34l.d.cts → fallback-Bx46zqky.d.cts} +3 -10
  297. package/dist/{fallback-DUyyBTBK.d.ts → fallback-pIWW8A2d.d.ts} +3 -10
  298. package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
  299. package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
  300. package/dist/{index-CBGUK09R.d.ts → index-5SU_O78r.d.cts} +5 -5
  301. package/dist/{index-BmZXHqkE.d.ts → index-B6pxYJzO.d.cts} +1 -1
  302. package/dist/{index-hcDJ8PSI.d.cts → index-B6pxYJzO.d.ts} +1 -1
  303. package/dist/{index-C5stwKcw.d.cts → index-BFsng6v1.d.cts} +1 -1
  304. package/dist/{index-CdAlHFEt.d.ts → index-BFsng6v1.d.ts} +1 -1
  305. package/dist/{index-_6ODbuOu.d.cts → index-Bg-LwEt-.d.cts} +1 -1
  306. package/dist/{index-CviRnE4K.d.ts → index-Bg-LwEt-.d.ts} +1 -1
  307. package/dist/{index-CBBLl_rc.d.ts → index-Brp888t0.d.cts} +1 -1
  308. package/dist/{index-BQSKmbuG.d.cts → index-Brp888t0.d.ts} +1 -1
  309. package/dist/{index-sqkqlb1p.d.ts → index-CDfk6jHN.d.cts} +1 -1
  310. package/dist/{index-ZVQhLa2i.d.cts → index-CDfk6jHN.d.ts} +1 -1
  311. package/dist/{index-Climxqsu.d.cts → index-CEXCtYYJ.d.ts} +5 -5
  312. package/dist/index-DLAxYaN5.d.cts +169 -0
  313. package/dist/index-DLAxYaN5.d.ts +169 -0
  314. package/dist/{index-CK29LV56.d.cts → index-DeWbQzMe.d.cts} +1 -1
  315. package/dist/{index-CPQlGA29.d.ts → index-DeWbQzMe.d.ts} +1 -1
  316. package/dist/{index-BrPrLl4e.d.cts → index-dX9IzPqj.d.cts} +1 -1
  317. package/dist/{index-Dgl1HpPn.d.ts → index-dX9IzPqj.d.ts} +1 -1
  318. package/dist/index.cjs +25934 -191
  319. package/dist/index.cjs.map +1 -0
  320. package/dist/index.d.cts +58 -94
  321. package/dist/index.d.ts +58 -94
  322. package/dist/index.js +852 -1
  323. package/dist/index.js.map +1 -0
  324. package/dist/layout-types-B5aiHYgk.d.cts +72 -0
  325. package/dist/layout-types-B5aiHYgk.d.ts +72 -0
  326. package/dist/memory-composers-BryDrRBX.d.cts +529 -0
  327. package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
  328. package/dist/{observable-DWjNfLvC.d.ts → observable-BXQoW1P-.d.cts} +1 -1
  329. package/dist/{observable-e3eiPPFy.d.cts → observable-BXQoW1P-.d.ts} +1 -1
  330. package/dist/{pipeline-graph-Sgj0gCwn.d.ts → pipeline-graph-Ce47CB6Y.d.cts} +13 -10
  331. package/dist/{pipeline-graph-CIKhynsF.d.cts → pipeline-graph-DXCwY9vG.d.ts} +13 -10
  332. package/dist/presets/ai/index.cjs +4377 -0
  333. package/dist/presets/ai/index.cjs.map +1 -0
  334. package/dist/presets/ai/index.d.cts +98 -0
  335. package/dist/presets/ai/index.d.ts +98 -0
  336. package/dist/presets/ai/index.js +54 -0
  337. package/dist/presets/ai/index.js.map +1 -0
  338. package/dist/presets/harness/index.cjs +5929 -0
  339. package/dist/presets/harness/index.cjs.map +1 -0
  340. package/dist/presets/harness/index.d.cts +566 -0
  341. package/dist/presets/harness/index.d.ts +566 -0
  342. package/dist/presets/harness/index.js +71 -0
  343. package/dist/presets/harness/index.js.map +1 -0
  344. package/dist/presets/index.cjs +9782 -0
  345. package/dist/presets/index.cjs.map +1 -0
  346. package/dist/presets/index.d.cts +28 -0
  347. package/dist/presets/index.d.ts +28 -0
  348. package/dist/presets/index.js +129 -0
  349. package/dist/presets/index.js.map +1 -0
  350. package/dist/presets/inspect/index.cjs +1087 -0
  351. package/dist/presets/inspect/index.cjs.map +1 -0
  352. package/dist/presets/inspect/index.d.cts +172 -0
  353. package/dist/presets/inspect/index.d.ts +172 -0
  354. package/dist/presets/inspect/index.js +21 -0
  355. package/dist/presets/inspect/index.js.map +1 -0
  356. package/dist/presets/resilience/index.cjs +1593 -0
  357. package/dist/presets/resilience/index.cjs.map +1 -0
  358. package/dist/presets/resilience/index.d.cts +205 -0
  359. package/dist/presets/resilience/index.d.ts +205 -0
  360. package/dist/presets/resilience/index.js +18 -0
  361. package/dist/presets/resilience/index.js.map +1 -0
  362. package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
  363. package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
  364. package/dist/{reactive-layout-DOTs9P3X.d.ts → reactive-layout-fswlBUvX.d.cts} +19 -7
  365. package/dist/{reactive-layout-DgctbqZo.d.cts → reactive-layout-fswlBUvX.d.ts} +19 -7
  366. package/dist/retry-BDbRZ_gx.d.ts +125 -0
  367. package/dist/retry-DWuhjvsA.d.cts +125 -0
  368. package/dist/solutions/index.cjs +8200 -0
  369. package/dist/solutions/index.cjs.map +1 -0
  370. package/dist/solutions/index.d.cts +23 -0
  371. package/dist/solutions/index.d.ts +23 -0
  372. package/dist/solutions/index.js +55 -0
  373. package/dist/solutions/index.js.map +1 -0
  374. package/dist/spawnable-5mDY501F.d.cts +746 -0
  375. package/dist/spawnable-D3lR0oQu.d.ts +746 -0
  376. package/dist/status-U-rUI79b.d.cts +84 -0
  377. package/dist/status-U-rUI79b.d.ts +84 -0
  378. package/dist/timeout-U5O4ESK3.js +12 -0
  379. package/dist/timeout-U5O4ESK3.js.map +1 -0
  380. package/dist/{types-CWFysE9E.d.ts → types-BB5Lw-pB.d.cts} +3 -3
  381. package/dist/{types-C0_yquda.d.cts → types-BB5Lw-pB.d.ts} +3 -3
  382. package/dist/types-CJWIMJiZ.d.ts +548 -0
  383. package/dist/types-vCq7ShIm.d.cts +548 -0
  384. package/dist/utils/ai/browser.cjs +2169 -0
  385. package/dist/utils/ai/browser.cjs.map +1 -0
  386. package/dist/{patterns → utils}/ai/browser.d.cts +7 -5
  387. package/dist/{patterns → utils}/ai/browser.d.ts +7 -5
  388. package/dist/utils/ai/browser.js +255 -0
  389. package/dist/utils/ai/browser.js.map +1 -0
  390. package/dist/utils/ai/index.cjs +8468 -0
  391. package/dist/utils/ai/index.cjs.map +1 -0
  392. package/dist/{index-CR8QpwX8.d.ts → utils/ai/index.d.cts} +73 -976
  393. package/dist/{index-UPSiS-X7.d.cts → utils/ai/index.d.ts} +73 -976
  394. package/dist/utils/ai/index.js +173 -0
  395. package/dist/utils/ai/index.js.map +1 -0
  396. package/dist/utils/ai/node.cjs +648 -0
  397. package/dist/utils/ai/node.cjs.map +1 -0
  398. package/dist/{patterns → utils}/ai/node.d.cts +5 -7
  399. package/dist/{patterns → utils}/ai/node.d.ts +5 -7
  400. package/dist/utils/ai/node.js +84 -0
  401. package/dist/utils/ai/node.js.map +1 -0
  402. package/dist/utils/cqrs/index.cjs +1036 -0
  403. package/dist/utils/cqrs/index.cjs.map +1 -0
  404. package/dist/{index-CeFiHtAg.d.ts → utils/cqrs/index.d.cts} +7 -37
  405. package/dist/{index-B-_tFaqV.d.cts → utils/cqrs/index.d.ts} +7 -37
  406. package/dist/utils/cqrs/index.js +18 -0
  407. package/dist/utils/cqrs/index.js.map +1 -0
  408. package/dist/utils/demo-shell/index.cjs +865 -0
  409. package/dist/utils/demo-shell/index.cjs.map +1 -0
  410. package/dist/{index-B8YnZpIR.d.ts → utils/demo-shell/index.d.cts} +4 -16
  411. package/dist/{index-Cwv0KWcU.d.cts → utils/demo-shell/index.d.ts} +4 -16
  412. package/dist/utils/demo-shell/index.js +13 -0
  413. package/dist/utils/demo-shell/index.js.map +1 -0
  414. package/dist/utils/domain-templates/index.cjs +732 -0
  415. package/dist/utils/domain-templates/index.cjs.map +1 -0
  416. package/dist/{index-CzLVrjxn.d.ts → utils/domain-templates/index.d.cts} +3 -20
  417. package/dist/{index-BaQaY_IQ.d.cts → utils/domain-templates/index.d.ts} +3 -20
  418. package/dist/utils/domain-templates/index.js +17 -0
  419. package/dist/utils/domain-templates/index.js.map +1 -0
  420. package/dist/utils/graphspec/index.cjs +1174 -0
  421. package/dist/utils/graphspec/index.cjs.map +1 -0
  422. package/dist/{index-CMh5Rz1y.d.ts → utils/graphspec/index.d.cts} +106 -42
  423. package/dist/{index-CS0LTlB8.d.cts → utils/graphspec/index.d.ts} +106 -42
  424. package/dist/utils/graphspec/index.js +35 -0
  425. package/dist/utils/graphspec/index.js.map +1 -0
  426. package/dist/utils/harness/index.cjs +656 -0
  427. package/dist/utils/harness/index.cjs.map +1 -0
  428. package/dist/utils/harness/index.d.cts +542 -0
  429. package/dist/utils/harness/index.d.ts +542 -0
  430. package/dist/utils/harness/index.js +56 -0
  431. package/dist/utils/harness/index.js.map +1 -0
  432. package/dist/utils/index.cjs +17609 -0
  433. package/dist/utils/index.cjs.map +1 -0
  434. package/dist/utils/index.d.cts +96 -0
  435. package/dist/utils/index.d.ts +96 -0
  436. package/dist/utils/index.js +514 -0
  437. package/dist/utils/index.js.map +1 -0
  438. package/dist/utils/inspect/index.cjs +807 -0
  439. package/dist/utils/inspect/index.cjs.map +1 -0
  440. package/dist/utils/inspect/index.d.cts +123 -0
  441. package/dist/utils/inspect/index.d.ts +123 -0
  442. package/dist/utils/inspect/index.js +30 -0
  443. package/dist/utils/inspect/index.js.map +1 -0
  444. package/dist/utils/job-queue/index.cjs +717 -0
  445. package/dist/utils/job-queue/index.cjs.map +1 -0
  446. package/dist/{index-DisjX8a-.d.ts → utils/job-queue/index.d.cts} +5 -26
  447. package/dist/{index-DV_1YuVk.d.cts → utils/job-queue/index.d.ts} +5 -26
  448. package/dist/utils/job-queue/index.js +18 -0
  449. package/dist/utils/job-queue/index.js.map +1 -0
  450. package/dist/utils/memory/index.cjs +1451 -0
  451. package/dist/utils/memory/index.cjs.map +1 -0
  452. package/dist/{index-CZ3r5Rxp.d.ts → utils/memory/index.d.cts} +242 -34
  453. package/dist/{index-B17QddL1.d.cts → utils/memory/index.d.ts} +242 -34
  454. package/dist/utils/memory/index.js +19 -0
  455. package/dist/utils/memory/index.js.map +1 -0
  456. package/dist/utils/messaging/index.cjs +666 -0
  457. package/dist/utils/messaging/index.cjs.map +1 -0
  458. package/dist/utils/messaging/index.d.cts +562 -0
  459. package/dist/utils/messaging/index.d.ts +562 -0
  460. package/dist/utils/messaging/index.js +50 -0
  461. package/dist/utils/messaging/index.js.map +1 -0
  462. package/dist/utils/orchestration/index.cjs +876 -0
  463. package/dist/utils/orchestration/index.cjs.map +1 -0
  464. package/dist/utils/orchestration/index.d.cts +233 -0
  465. package/dist/utils/orchestration/index.d.ts +233 -0
  466. package/dist/utils/orchestration/index.js +19 -0
  467. package/dist/utils/orchestration/index.js.map +1 -0
  468. package/dist/utils/process/index.cjs +743 -0
  469. package/dist/utils/process/index.cjs.map +1 -0
  470. package/dist/{index-p09KSrTN.d.ts → utils/process/index.d.cts} +97 -44
  471. package/dist/{index-CasX6Pfq.d.cts → utils/process/index.d.ts} +97 -44
  472. package/dist/utils/process/index.js +14 -0
  473. package/dist/utils/process/index.js.map +1 -0
  474. package/dist/utils/reactive-layout/index.cjs +1607 -0
  475. package/dist/utils/reactive-layout/index.cjs.map +1 -0
  476. package/dist/{index-B5S8ULbU.d.ts → utils/reactive-layout/index.d.cts} +58 -81
  477. package/dist/{index-Dc4AYqrJ.d.cts → utils/reactive-layout/index.d.ts} +58 -81
  478. package/dist/utils/reactive-layout/index.js +52 -0
  479. package/dist/utils/reactive-layout/index.js.map +1 -0
  480. package/dist/utils/reduction/index.cjs +203 -0
  481. package/dist/utils/reduction/index.cjs.map +1 -0
  482. package/dist/{index-Byu-OpX_.d.ts → utils/reduction/index.d.cts} +6 -17
  483. package/dist/{index-tRCxuAXF.d.cts → utils/reduction/index.d.ts} +6 -17
  484. package/dist/utils/reduction/index.js +14 -0
  485. package/dist/utils/reduction/index.js.map +1 -0
  486. package/dist/utils/resilience/index.cjs +1617 -0
  487. package/dist/utils/resilience/index.cjs.map +1 -0
  488. package/dist/utils/resilience/index.d.cts +9 -0
  489. package/dist/utils/resilience/index.d.ts +9 -0
  490. package/dist/utils/resilience/index.js +44 -0
  491. package/dist/utils/resilience/index.js.map +1 -0
  492. package/dist/utils/surface/index.cjs +1070 -0
  493. package/dist/utils/surface/index.cjs.map +1 -0
  494. package/dist/{index-CYq8vAyV.d.ts → utils/surface/index.d.cts} +7 -58
  495. package/dist/{index-CSOmP7xT.d.cts → utils/surface/index.d.ts} +7 -58
  496. package/dist/utils/surface/index.js +30 -0
  497. package/dist/utils/surface/index.js.map +1 -0
  498. package/dist/utils/topology-view/index.cjs +620 -0
  499. package/dist/utils/topology-view/index.cjs.map +1 -0
  500. package/dist/utils/topology-view/index.d.cts +68 -0
  501. package/dist/utils/topology-view/index.d.ts +68 -0
  502. package/dist/utils/topology-view/index.js +11 -0
  503. package/dist/utils/topology-view/index.js.map +1 -0
  504. package/package.json +664 -584
  505. package/dist/backoff-HPZMEZNF.js +0 -1
  506. package/dist/chunk-2T7U5EU6.js +0 -1
  507. package/dist/chunk-3G5U5QNE.js +0 -5
  508. package/dist/chunk-4VVTGLXJ.js +0 -1
  509. package/dist/chunk-5M4CCMMD.js +0 -45
  510. package/dist/chunk-5QDBSZBV.js +0 -1
  511. package/dist/chunk-5XJ6B66J.js +0 -1
  512. package/dist/chunk-6QZNQS5B.js +0 -1
  513. package/dist/chunk-6X7AFUJV.js +0 -9
  514. package/dist/chunk-7K6PWTDQ.js +0 -1
  515. package/dist/chunk-7LIAPXJB.js +0 -1
  516. package/dist/chunk-7WPU3UHQ.js +0 -1
  517. package/dist/chunk-A5WCQ5NO.js +0 -1
  518. package/dist/chunk-APPIWSGD.js +0 -84
  519. package/dist/chunk-BEZWM2SY.js +0 -1
  520. package/dist/chunk-C72GO4IZ.js +0 -1
  521. package/dist/chunk-CB676TKJ.js +0 -1
  522. package/dist/chunk-CE6TI2TL.js +0 -1
  523. package/dist/chunk-CE72X3WO.js +0 -1
  524. package/dist/chunk-CK2E7BTU.js +0 -1
  525. package/dist/chunk-CLVB32RD.js +0 -1
  526. package/dist/chunk-CRVT7D2P.js +0 -1
  527. package/dist/chunk-D5RFJOZ2.js +0 -1
  528. package/dist/chunk-D7GPHKFH.js +0 -1
  529. package/dist/chunk-DHRX7JX4.js +0 -2
  530. package/dist/chunk-ESMPEKEV.js +0 -1
  531. package/dist/chunk-F672GV32.js +0 -1
  532. package/dist/chunk-FZMYDOWV.js +0 -1
  533. package/dist/chunk-GHBWHMRZ.js +0 -1
  534. package/dist/chunk-GLERH466.js +0 -1
  535. package/dist/chunk-GPW2V3RE.js +0 -1
  536. package/dist/chunk-HIDYF36O.js +0 -1
  537. package/dist/chunk-HITNVN6B.js +0 -3
  538. package/dist/chunk-HY4DJBA7.js +0 -5
  539. package/dist/chunk-KZIEYVXN.js +0 -1
  540. package/dist/chunk-L6NSJVJZ.js +0 -1
  541. package/dist/chunk-N4MQX6JU.js +0 -18
  542. package/dist/chunk-N7FHEL4D.js +0 -1
  543. package/dist/chunk-NTEURFZH.js +0 -1
  544. package/dist/chunk-OIVP6KFV.js +0 -1
  545. package/dist/chunk-OPHBU3LG.js +0 -1
  546. package/dist/chunk-OYQOZP2F.js +0 -5
  547. package/dist/chunk-PTZK576G.js +0 -1
  548. package/dist/chunk-QYADASLV.js +0 -1
  549. package/dist/chunk-ST7UXLWR.js +0 -1
  550. package/dist/chunk-SVY7VUYU.js +0 -1
  551. package/dist/chunk-TK3NWWD4.js +0 -1
  552. package/dist/chunk-TSOYJ743.js +0 -1
  553. package/dist/chunk-UNGSTR4X.js +0 -61
  554. package/dist/chunk-VIMF6LGM.js +0 -1
  555. package/dist/chunk-VJLMUKOI.js +0 -1
  556. package/dist/chunk-VN6RDSK2.js +0 -1
  557. package/dist/chunk-VV4N5P64.js +0 -1
  558. package/dist/chunk-W3I423PS.js +0 -1
  559. package/dist/chunk-WJR24TAG.js +0 -1
  560. package/dist/chunk-XTGKMHSW.js +0 -1
  561. package/dist/chunk-YBB7ZGTY.js +0 -1
  562. package/dist/chunk-Z4NPUARF.js +0 -1
  563. package/dist/chunk-ZGNQRPDT.js +0 -1
  564. package/dist/chunk-ZKPSFFKU.js +0 -1
  565. package/dist/chunk-ZLV5SQSX.js +0 -1
  566. package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
  567. package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
  568. package/dist/core/index.cjs +0 -1
  569. package/dist/core/index.d.cts +0 -3
  570. package/dist/core/index.d.ts +0 -3
  571. package/dist/core/index.js +0 -1
  572. package/dist/decay-BvOWTZ00.d.ts +0 -112
  573. package/dist/decay-CFlLvXUT.d.cts +0 -112
  574. package/dist/extra/browser.cjs +0 -1
  575. package/dist/extra/browser.d.cts +0 -4
  576. package/dist/extra/browser.d.ts +0 -4
  577. package/dist/extra/browser.js +0 -1
  578. package/dist/extra/index.cjs +0 -20
  579. package/dist/extra/index.d.cts +0 -17
  580. package/dist/extra/index.d.ts +0 -17
  581. package/dist/extra/index.js +0 -1
  582. package/dist/extra/node.cjs +0 -2
  583. package/dist/extra/node.js +0 -2
  584. package/dist/extra/operators.cjs +0 -1
  585. package/dist/extra/operators.d.cts +0 -958
  586. package/dist/extra/operators.d.ts +0 -958
  587. package/dist/extra/operators.js +0 -1
  588. package/dist/extra/reactive.cjs +0 -1
  589. package/dist/extra/reactive.d.cts +0 -353
  590. package/dist/extra/reactive.d.ts +0 -353
  591. package/dist/extra/reactive.js +0 -1
  592. package/dist/extra/render/index.cjs +0 -5
  593. package/dist/extra/render/index.js +0 -1
  594. package/dist/extra/sources.cjs +0 -3
  595. package/dist/extra/sources.js +0 -1
  596. package/dist/extra/storage-browser.cjs +0 -1
  597. package/dist/extra/storage-browser.d.cts +0 -37
  598. package/dist/extra/storage-browser.d.ts +0 -37
  599. package/dist/extra/storage-browser.js +0 -1
  600. package/dist/extra/storage-core.cjs +0 -1
  601. package/dist/extra/storage-core.d.cts +0 -28
  602. package/dist/extra/storage-core.d.ts +0 -28
  603. package/dist/extra/storage-core.js +0 -1
  604. package/dist/extra/storage-node.cjs +0 -1
  605. package/dist/extra/storage-node.d.cts +0 -2
  606. package/dist/extra/storage-node.d.ts +0 -2
  607. package/dist/extra/storage-node.js +0 -0
  608. package/dist/extra/storage-tiers-browser.cjs +0 -1
  609. package/dist/extra/storage-tiers-browser.d.cts +0 -120
  610. package/dist/extra/storage-tiers-browser.d.ts +0 -120
  611. package/dist/extra/storage-tiers-browser.js +0 -1
  612. package/dist/extra/storage-tiers-node.cjs +0 -1
  613. package/dist/extra/storage-tiers-node.d.cts +0 -210
  614. package/dist/extra/storage-tiers-node.d.ts +0 -210
  615. package/dist/extra/storage-tiers-node.js +0 -1
  616. package/dist/extra/storage-tiers.cjs +0 -1
  617. package/dist/extra/storage-tiers.d.cts +0 -412
  618. package/dist/extra/storage-tiers.d.ts +0 -412
  619. package/dist/extra/storage-tiers.js +0 -1
  620. package/dist/graph/index.cjs +0 -7
  621. package/dist/graph/index.d.cts +0 -7
  622. package/dist/graph/index.d.ts +0 -7
  623. package/dist/graph/index.js +0 -1
  624. package/dist/graph-CWvEUQAq.d.cts +0 -1861
  625. package/dist/graph-D9LFnda9.d.ts +0 -1861
  626. package/dist/index-5k1T6jl0.d.cts +0 -121
  627. package/dist/index-9770hRuQ.d.cts +0 -779
  628. package/dist/index-B1F8Enjf.d.ts +0 -704
  629. package/dist/index-BHskSB8v.d.ts +0 -3413
  630. package/dist/index-BIYAkbAi.d.cts +0 -26
  631. package/dist/index-BoJ5JHxI.d.ts +0 -557
  632. package/dist/index-BocU7pqs.d.ts +0 -779
  633. package/dist/index-BxNs2HB9.d.cts +0 -1858
  634. package/dist/index-C1T3d7V-.d.cts +0 -704
  635. package/dist/index-C5ri2Axc.d.cts +0 -301
  636. package/dist/index-C9l6OEBL.d.ts +0 -26
  637. package/dist/index-CC-AvFTy.d.cts +0 -557
  638. package/dist/index-CJF1URuX.d.ts +0 -121
  639. package/dist/index-CdTelp1M.d.ts +0 -202
  640. package/dist/index-Cj3WohTd.d.cts +0 -202
  641. package/dist/index-Co7uli2l.d.cts +0 -3413
  642. package/dist/index-D0aciIex.d.cts +0 -209
  643. package/dist/index-DHen9Klo.d.ts +0 -1858
  644. package/dist/index-Yq60JP3s.d.ts +0 -209
  645. package/dist/index-nozs3fFC.d.ts +0 -301
  646. package/dist/node-kK3CvTrR.d.cts +0 -1347
  647. package/dist/node-kK3CvTrR.d.ts +0 -1347
  648. package/dist/patterns/ai/browser.cjs +0 -8
  649. package/dist/patterns/ai/browser.js +0 -3
  650. package/dist/patterns/ai/index.cjs +0 -74
  651. package/dist/patterns/ai/index.d.cts +0 -20
  652. package/dist/patterns/ai/index.d.ts +0 -20
  653. package/dist/patterns/ai/index.js +0 -1
  654. package/dist/patterns/ai/node.cjs +0 -1
  655. package/dist/patterns/ai/node.js +0 -1
  656. package/dist/patterns/cqrs/index.cjs +0 -3
  657. package/dist/patterns/cqrs/index.d.cts +0 -8
  658. package/dist/patterns/cqrs/index.d.ts +0 -8
  659. package/dist/patterns/cqrs/index.js +0 -1
  660. package/dist/patterns/demo-shell/index.cjs +0 -5
  661. package/dist/patterns/demo-shell/index.d.cts +0 -7
  662. package/dist/patterns/demo-shell/index.d.ts +0 -7
  663. package/dist/patterns/demo-shell/index.js +0 -1
  664. package/dist/patterns/domain-templates/index.cjs +0 -3
  665. package/dist/patterns/domain-templates/index.d.cts +0 -6
  666. package/dist/patterns/domain-templates/index.d.ts +0 -6
  667. package/dist/patterns/domain-templates/index.js +0 -1
  668. package/dist/patterns/graphspec/index.cjs +0 -86
  669. package/dist/patterns/graphspec/index.d.cts +0 -8
  670. package/dist/patterns/graphspec/index.d.ts +0 -8
  671. package/dist/patterns/graphspec/index.js +0 -1
  672. package/dist/patterns/harness/index.cjs +0 -48
  673. package/dist/patterns/harness/index.d.cts +0 -13
  674. package/dist/patterns/harness/index.d.ts +0 -13
  675. package/dist/patterns/harness/index.js +0 -1
  676. package/dist/patterns/inspect/index.cjs +0 -3
  677. package/dist/patterns/inspect/index.d.cts +0 -9
  678. package/dist/patterns/inspect/index.d.ts +0 -9
  679. package/dist/patterns/inspect/index.js +0 -1
  680. package/dist/patterns/job-queue/index.cjs +0 -3
  681. package/dist/patterns/job-queue/index.d.cts +0 -9
  682. package/dist/patterns/job-queue/index.d.ts +0 -9
  683. package/dist/patterns/job-queue/index.js +0 -1
  684. package/dist/patterns/memory/index.cjs +0 -3
  685. package/dist/patterns/memory/index.d.cts +0 -8
  686. package/dist/patterns/memory/index.d.ts +0 -8
  687. package/dist/patterns/memory/index.js +0 -1
  688. package/dist/patterns/messaging/index.cjs +0 -3
  689. package/dist/patterns/messaging/index.d.cts +0 -7
  690. package/dist/patterns/messaging/index.d.ts +0 -7
  691. package/dist/patterns/messaging/index.js +0 -1
  692. package/dist/patterns/orchestration/index.cjs +0 -3
  693. package/dist/patterns/orchestration/index.d.cts +0 -8
  694. package/dist/patterns/orchestration/index.d.ts +0 -8
  695. package/dist/patterns/orchestration/index.js +0 -1
  696. package/dist/patterns/process/index.cjs +0 -3
  697. package/dist/patterns/process/index.d.cts +0 -10
  698. package/dist/patterns/process/index.d.ts +0 -10
  699. package/dist/patterns/process/index.js +0 -1
  700. package/dist/patterns/reactive-layout/index.cjs +0 -4
  701. package/dist/patterns/reactive-layout/index.d.cts +0 -7
  702. package/dist/patterns/reactive-layout/index.d.ts +0 -7
  703. package/dist/patterns/reactive-layout/index.js +0 -1
  704. package/dist/patterns/reduction/index.cjs +0 -3
  705. package/dist/patterns/reduction/index.d.cts +0 -6
  706. package/dist/patterns/reduction/index.d.ts +0 -6
  707. package/dist/patterns/reduction/index.js +0 -1
  708. package/dist/patterns/surface/index.cjs +0 -13
  709. package/dist/patterns/surface/index.d.cts +0 -9
  710. package/dist/patterns/surface/index.d.ts +0 -9
  711. package/dist/patterns/surface/index.js +0 -1
  712. package/dist/reactive-log-BKALbfal.d.ts +0 -223
  713. package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
  714. package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
  715. package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
  716. package/dist/resilience-6LYQJAC5.js +0 -1
  717. package/dist/sugar-DQjFmVqb.d.cts +0 -399
  718. package/dist/sugar-fhLIE7TT.d.ts +0 -399
  719. package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
  720. package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
@@ -1,5 +0,0 @@
1
- "use strict";var nt=Object.defineProperty;var vn=Object.getOwnPropertyDescriptor;var wn=Object.getOwnPropertyNames;var _n=Object.prototype.hasOwnProperty;var j=(r,e)=>()=>(r&&(e=r(r=0)),e);var xn=(r,e)=>{for(var t in e)nt(r,t,{get:e[t],enumerable:!0})},kn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of wn(e))!_n.call(r,s)&&s!==t&&nt(r,s,{get:()=>e[s],enumerable:!(n=vn(e,s))||n.enumerable});return r};var Tn=r=>kn(nt({},"__esModule",{value:!0}),r);function Le(){return me>0||Oe}function Tt(){return me>0}function ye(r){me>0?Se.push(r):r()}function Ee(r){me+=1;let e=!1;try{r()}catch(t){throw e=!0,t}finally{if(me-=1,me===0)if(e){if(!Oe){let t=Se.splice(0);for(let n of t)try{n()}catch{}fe.length=0,pe.length=0,be.length=0}}else Nn()}}function Nn(){let r=!Oe;r&&(Oe=!0);let e=[],t=0;try{for(;fe.length>0||pe.length>0||be.length>0||r&&Se.length>0;){if(r&&Se.length>0){let o=Se.splice(0);for(let i of o)try{i()}catch(a){e.push(a)}continue}if(t+=1,t>1e3)throw fe.length=0,pe.length=0,be.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let s=(fe.length>0?fe:pe.length>0?pe:be).splice(0);for(let o of s)try{o()}catch(i){e.push(i)}}}finally{r&&(Oe=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function $e(r,e,t){if(e.length===0)return;if(e.length===1){let d=t(e[0][0]);if(d<3||!Le()){r(e);return}(d>=5?be:d===4?pe:fe).push(()=>r(e));return}let n=e.length,s=n,o=n,i=n,a=0;for(;a<n&&t(e[a][0])<3;)a++;for(s=a;a<n&&t(e[a][0])===3;)a++;for(o=a;a<n&&t(e[a][0])===4;)a++;i=a;let u=Le();if(s>0){let d=e.slice(0,s);r(d)}if(o>s){let d=e.slice(s,o);u?fe.push(()=>r(d)):r(d)}if(i>o){let d=e.slice(o,i);u?pe.push(()=>r(d)):r(d)}if(n>i){let d=e.slice(i,n);u?be.push(()=>r(d)):r(d)}}var me,Oe,fe,pe,be,Se,Fe=j(()=>{"use strict";me=0,Oe=!1,fe=[],pe=[],be=[],Se=[]});function rt(r){let e=On.filter(t=>r({type:t,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(t=>t==="human"||t==="llm"||t==="system")?"both":e.length===1?e[0]:e.join("+")}var te,On,je=j(()=>{"use strict";te=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`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}},On=["human","llm","wallet","system"]});function Ot(r,e){let t=new TextEncoder().encode(r.name);if(t.length===0||t.length>255)throw new Error(`encodeEnvelope: codec name "${r.name}" encodes to ${t.length} bytes (must be 1\u2013255)`);let n=r.version;if(!Number.isInteger(n)||n<0||n>65535)throw new Error(`encodeEnvelope: codec.version ${n} out of u16 range (expected integer 0\u201365535)`);let s=2+t.length+2+e.length;if(s>4294967295)throw new Error(`encodeEnvelope: total envelope size ${s} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let o=new Uint8Array(s),i=0;return o[i++]=st,o[i++]=t.length,o.set(t,i),i+=t.length,o[i++]=n>>>8&255,o[i++]=n&255,o.set(e,i),o}function St(r,e){if(r.length<Nt)throw new Error(`decodeEnvelope: bytes too short (${r.length} < ${Nt})`);let t=0,n=r[t++];if(n!==st)throw new Error(`decodeEnvelope: unsupported envelope version ${n} (expected ${st})`);let s=r[t++];if(s===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(t+s+2>r.length)throw new Error(`decodeEnvelope: envelope truncated (need ${t+s+2} bytes, have ${r.length})`);let o=new TextDecoder().decode(r.subarray(t,t+s));t+=s;let i=(r[t]<<8|r[t+1])>>>0;t+=2;let a=r.subarray(t),u=e.lookupCodec(o);if(u==null)throw new Error(`decodeEnvelope: codec "${o}" not registered (envelope codec_v=${i})`);return{codec:u,codecVersion:i,payload:a}}function Et(r){r.registerCodec(Sn)}var Sn,st,Nt,ot=j(()=>{"use strict";Sn={name:"json",version:1,contentType:"application/json",encode(r){let e=JSON.stringify(r);return new TextEncoder().encode(e)},decode(r,e){let t=new TextDecoder().decode(r);return JSON.parse(t)}},st=1,Nt=4});function Be(r){if(r==null)return ve;let{type:e,id:t,...n}=r;return{type:e??"system",id:t??"",...n}}var ve,it=j(()=>{"use strict";ve={type:"system",id:""}});function ue(){return Math.trunc(performance.now()*1e6)}function He(){return Date.now()*1e6}var Ve=j(()=>{"use strict"});var we,K,ne,re,se,ie,de,q,J,I,_e,at,En,ut,Rn,An,dt,Rt,At,Dt,ct,Re=j(()=>{"use strict";we=Symbol.for("graphrefly/START"),K=Symbol.for("graphrefly/DATA"),ne=Symbol.for("graphrefly/DIRTY"),re=Symbol.for("graphrefly/RESOLVED"),se=Symbol.for("graphrefly/INVALIDATE"),ie=Symbol.for("graphrefly/PAUSE"),de=Symbol.for("graphrefly/RESUME"),q=Symbol.for("graphrefly/TEARDOWN"),J=Symbol.for("graphrefly/COMPLETE"),I=Symbol.for("graphrefly/ERROR"),_e=Object.freeze([ne]),at=Object.freeze([re]),En=Object.freeze([se]),ut=Object.freeze([we]),Rn=Object.freeze([J]),An=Object.freeze([q]),dt=Object.freeze([_e]),Rt=Object.freeze([at]),At=Object.freeze([En]),Dt=Object.freeze([Rn]),ct=Object.freeze([An])});function Ct(r){r.registerMessageType(we,{tier:0,wireCrossing:!1}),r.registerMessageType(ne,{tier:1,wireCrossing:!1}),r.registerMessageType(se,{tier:1,wireCrossing:!1,metaPassthrough:!1}),r.registerMessageType(ie,{tier:2,wireCrossing:!1}),r.registerMessageType(de,{tier:2,wireCrossing:!1}),r.registerMessageType(K,{tier:3,wireCrossing:!0}),r.registerMessageType(re,{tier:3,wireCrossing:!0}),r.registerMessageType(J,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(I,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(q,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var We,Mt=j(()=>{"use strict";Re();We=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let n=this._messageTypes.get(t);return n!=null?n.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.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 lt(r){if(r===void 0)return null;if(typeof r=="number"){if(!Number.isFinite(r))throw new TypeError(`Cannot hash non-finite number: ${r}`);if(Number.isInteger(r)&&!Number.isSafeInteger(r))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${r}. Cross-language cid parity is not guaranteed for unsafe integers.`);return r}if(typeof r=="string"||typeof r=="boolean"||r===null)return r;if(Array.isArray(r))return r.map(lt);if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r).sort())e[t]=lt(r[t]);return e}return null}function Mn(r){let e=Cn.encode(r),t=e.length,n=t*8,s=t+9+63&-64,o=new Uint8Array(s);o.set(e),o[t]=128;let i=new DataView(o.buffer);i.setUint32(s-4,n>>>0,!1),i.setUint32(s-8,Math.floor(n/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,f=1359893119,p=2600822924,h=528734635,l=1541459225,v=new Uint32Array(64),g=(m,y)=>m>>>y|m<<32-y;for(let m=0;m<s;m+=64){for(let S=0;S<16;S++)v[S]=i.getUint32(m+S*4,!1);for(let S=16;S<64;S++){let F=v[S-15],G=v[S-2],P=g(F,7)^g(F,18)^F>>>3,ae=g(G,17)^g(G,19)^G>>>10;v[S]=v[S-16]+P+v[S-7]+ae>>>0}let y=a,w=u,b=d,x=c,k=f,T=p,E=h,A=l;for(let S=0;S<64;S++){let F=g(k,6)^g(k,11)^g(k,25),G=k&T^~k&E,P=A+F+G+Dn[S]+v[S]>>>0,ae=g(y,2)^g(y,13)^g(y,22),Ne=y&w^y&b^w&b,N=ae+Ne>>>0;A=E,E=T,T=k,k=x+P>>>0,x=b,b=w,w=y,y=P+N>>>0}a=a+y>>>0,u=u+w>>>0,d=d+b>>>0,c=c+x>>>0,f=f+k>>>0,p=p+T>>>0,h=h+E>>>0,l=l+A>>>0}let _=m=>m.toString(16).padStart(8,"0");return _(a)+_(u)+_(d)+_(c)+_(f)+_(p)+_(h)+_(l)}function ft(r){let e=lt(r??null),t=JSON.stringify(e);return Mn(t).slice(0,16)}function Gn(){let r=globalThis.crypto;if(r?.randomUUID)return r.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function pt(r,e,t){let n=t?.id??Gn();if(r===0)return{id:n,version:0};let o=(t?.hash??ft)(e);return{id:n,version:0,cid:o,prev:null}}function Gt(r,e,t){r.version+=1,"cid"in r&&(r.prev=r.cid,r.cid=t(e))}var Dn,Cn,Pt=j(()=>{"use strict";Dn=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]),Cn=new TextEncoder});function $t(r){return{node:r,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function ht(r){r.prevData=void 0,r.dirty=!1,r.involvedThisWave=!1,r.dataBatch.length=0,r.terminal=void 0}function ze(r){return r.length===0?r:typeof r[0]=="symbol"?[r]:r}function Ae(r,e,t){let n=Ft(r)?r:[],s=typeof r=="function"?r:typeof e=="function"?e:void 0,o={};return Ft(r)?o=(gt(e)?e:t)??{}:gt(r)?o=r:o=(gt(e)?e:t)??{},new H(n,s,o)}var It,Lt,Pn,In,xe,H,Ft,gt,De=j(()=>{"use strict";ot();it();Fe();Ve();Mt();je();Re();Pt();It=()=>{},Lt=100;Pn=(r,e,t,n)=>{t.direction==="down-in"&&r._onDepMessage(t.depIndex,e)},In=(r,e,t,n)=>{let s=r;if(s._status==="completed"||s._status==="errored")return;let o=s._cached,i=o===void 0?[ut]:[ut,[K,o]];s._status==="dirty"&&i.push(_e),$e(e,i,s._config.tierOf)},xe=new We({onMessage:Pn,onSubscribe:In});Ct(xe);Et(xe);H=class r{_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,t,n){this._config=n.config??xe,this._config.onMessage,this._optsName=n.name,this._describeKind=n.describeKind,this._equals=n.equals??Object.is,this._resubscribable=n.resubscribable??!1,this._resetOnTeardown=n.resetOnTeardown??!1,this._autoComplete=n.completeWhenDepsComplete??!0,this._autoError=n.errorWhenDepsError??!0,this._pausable=n.pausable??!0,this._guard=n.guard,this._fn=t,this._partial=n.partial??!1,this._cached=n.initial!==void 0?n.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=n.versioningHash??this._config.defaultHashFn??ft;let s=n.versioning??this._config.defaultVersioning;this._versioningLevel=s,this._versioning=s!=null?pt(s,this._cached===void 0?void 0:this._cached,{id:n.versioningId,hash:this._hashFn}):void 0,this._deps=e.map($t);let o={};for(let[a,u]of Object.entries(n.meta??{})){let d={initial:u,name:`${n.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};n.guard!=null&&(d.guard=n.guard),n.resubscribable===!0&&(d.resubscribable=!0),o[a]=new r([],void 0,d)}Object.freeze(o),this.meta=o,this._hasMeta=Object.keys(o).length>0;let i=this;this._actions={emit(a){i._emit([[K,a]])},down(a){i._emit(ze(a))},up(a){i._emitUp(ze(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,t){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 n=this._versioningLevel;if(n!=null&&e<=n)return;let s=t?.hash??this._hashFn;s!==this._hashFn&&(this._hashFn=s);let o=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??t?.id,u=i?.version??0,d=pt(e,o,{id:a,hash:s});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=Be(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let n of this._extraGuards)if(!n(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,n=e?.actor!=null;if(!t&&!n)return;let s=Be(e?.actor),o=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(s,o))throw new te({actor:s,action:o,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(s,o))throw new te({actor:s,action:o,nodeName:this.name})}this._lastMutation={actor:s,timestamp_ns:He()}}down(e,t){let n=ze(e);n.length!==0&&(this._checkGuard(t),this._emit(n))}emit(e,t){this._checkGuard(t),this._emit([[K,e]])}up(e,t){if(this._deps.length===0)return;let n=ze(e);if(n.length===0)return;this._checkGuard(t);let s=t??{internal:!0};this._validateUpTiers(n);for(let o of this._deps)o.node.up?.(n,s)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let n of e){let s=t(n[0]);if(s===3||s===4)throw new Error(`Node "${this.name}": tier-${s} 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,t){if(t!=null&&this._guard!=null){let u=Be(t);if(!this._guard(u,"observe"))throw new te({actor:u,action:"observe",nodeName:this.name})}let s=this._isTerminal&&this._resubscribable;if(s){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)ht(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let o;try{o=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:s},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof o=="function")try{o()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof o=="function"&&o(),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[t]=this._sinks;this._sinks=t}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,t=0;try{for(let n=0;n<e;n++){let s=n,o=this._deps[n];o.unsub=It,o.unsub=o.node.subscribe(i=>{if(o.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of i)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:s},this._actions);u&&this._maybeRunFnOnSettlement()}),t++}}catch(n){this._deps[t].unsub=null;for(let s=0;s<t;s++){let o=this._deps[s];if(o.unsub!=null){let i=o.unsub;o.unsub=null;try{i()}catch{}ht(o)}}throw this._dirtyDepCount=0,n}}_addDep(e){for(let s=0;s<this._deps.length;s++)if(this._deps[s].node===e)return s;let t=this._deps.length,n=$t(e);if(this._deps.push(n),this._sinks==null)return t;n.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(dt),n.unsub=It;try{n.unsub=e.subscribe(s=>{if(n.unsub===null)return;let o=this._config.tierOf,i=!1;for(let a of s)o(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(s){throw n.unsub=null,this._deps.pop(),this._dirtyDepCount--,s}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(n){this._emit([[I,this._wrapFnError("cleanup threw",n)]])}else if(t!=null&&typeof t=="object"){let n=t.deactivate;if(typeof n=="function")try{n()}catch(s){this._emit([[I,this._wrapFnError("cleanup.deactivate threw",s)]])}}for(let n of this._deps){if(n.unsub!=null){let s=n.unsub;n.unsub=null;try{s()}catch{}}ht(n)}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,t){let n=this._deps[e],s=t[0];if(this._inspectorHooks!=null){let o={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(o)}if(s!==we){if(s===ne){this._depDirtied(n);return}if(s===se){if(this._depInvalidated(n),this._cached===void 0)return;this._emit(At);return}if(s===ie||s===de){this._emit([t]);return}if(s===q){this._emit(ct);return}if(s===K)this._depSettledAsData(n,t[1]);else if(s===re)this._depSettledAsResolved(n);else if(s===J)this._depSettledAsTerminal(n,!0);else if(s===I)this._depSettledAsTerminal(n,t[1]);else{this._emit([t]);return}if(!this._fn){(s===K||s===re)&&this._emit([t]),(s===J||s===I)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(dt))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,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 t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Rt),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[I,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Dt)}_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([[I,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([[I,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),n=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=t[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let s=this._deps.map(i=>i.terminal),o={prevData:n,terminalDeps:s,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:n};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,o);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([[I,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Lt?(this._rerunDepth=0,this._emit([[I,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Lt} \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,t){let n=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${n}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[_e,e[0]]:e;let n=!0,s=!1,o=!1,i=-1;for(let u of e){let d=t(u[0]);d<i&&(n=!1),d===3&&(s=!0),u[0]===ne&&(o=!0),i=d}let a=e;if(!n){let u=e.map((d,c)=>({m:d,i:c,tier:t(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(s&&!o&&this._status!=="dirty"){let u=0;for(;u<a.length&&t(a[u][0])===0;)u++;return u===0?[_e,...a]:[...a.slice(0,u),_e,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===I&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===q||u[0]===se);if(a.length===0)return;t=a}t=this._frameBatch(t);let s=null;for(let a=0;a<t.length;a++){let u=t[a],d=u[0];if(d!==ie&&d!==de){s?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===ie?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let f=u[1];if(d===ie)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))c=!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())}}c?s?.push(u):s==null&&(s=t.slice(0,a))}if(s!=null){if(s.length===0)return;t=s}if(this._hasMeta&&t.some(a=>a[0]===q))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(ct)}catch{}let{finalMessages:o,equalsError:i}=this._updateState(t);if(o.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:o})}catch{}}if(o.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of o)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(o);i!=null&&this._emit([[I,i]])}_updateState(e){let t=this._config.tierOf,n,s,o=-1,i=0;for(let c of e)t(c[0])===3&&i++;let a=i<=1,u=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===K){u=c;break}}for(let c=0;c<e.length;c++){let f=e[c],p=f[0];if(p===K){if(f.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,f[1])}catch(l){s=this._wrapFnError("equals threw",l),o=c;break}if(h){n==null&&(n=e.slice(0,c)),n.push(at),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(u<0||c===u)&&Gt(this._versioning,f[1],this._hashFn)}this._status="settled",n?.push(f)}else if(n?.push(f),p===ne)this._status="dirty";else if(p===re)this._status="resolved";else if(p===J){this._status="completed";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===I){this._status="errored";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===se){if(this._cached!==void 0){let l=this._config.rigorRecorder;if(l!=null)try{l.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let h=this._cleanup;if(typeof h=="function"){this._cleanup=void 0;try{h()}catch{}}else if(h!=null&&typeof h=="object"){let l=h.invalidate;if(typeof l=="function")try{l()}catch{}}}else p===q&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=o>=0?n??e.slice(0,o):n??e;return s!=null?{finalMessages:d,equalsError:s}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let n of t)n(e)};_dispatchOrAccumulate(e){if(Tt()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ye(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}$e(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);$e(this._deliverToSinks,t,this._config.tierOf)}},Ft=r=>Array.isArray(r),gt=r=>typeof r=="object"&&r!=null&&!Array.isArray(r)});function Ce(r,e){if(e!=null&&e.length>0)return new Set(e);switch(r){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;case"spec":return new Set(["type","deps","meta","value"]);default:return new Set(["type","deps"])}}function Ln(r){return r._describeKind!=null?r._describeKind:r._deps.length>0?"derived":r._fn!=null?"producer":"state"}function $n(r){let e={};for(let[t,n]of Object.entries(r.meta))try{e[t]=n.cache}catch{}return e}function Me(r,e,t){let n=e==null,s=!n&&e!=null?[...e].filter(c=>c.startsWith("meta.")).map(c=>c.slice(5)):null,o=n||e.has("meta")||s!=null&&s.length>0,i="state",a=[];r instanceof H&&(i=Ln(r),a=r._deps.map(c=>c.node.name??""));let u={type:i,deps:a};(n||e.has("status"))&&(u.status=r.status);let d=r instanceof H?r._guard:void 0;if(o){let c={...$n(r)};if(d!=null&&c.access===void 0&&(c.access=rt(d)),s!=null&&s.length>0&&!e.has("meta")){let f={};for(let p of s)p in c&&(f[p]=c[p]);u.meta=f}else u.meta=c}if(r.name!=null&&(u.name=r.name),(n||e.has("value"))&&(!t||i==="state")){r.status==="sentinel"&&(u.sentinel=!0);try{u.value=r.cache}catch{}}if((n||e.has("v"))&&r.v!=null){let c={id:r.v.id,version:r.v.version};"cid"in r.v&&(c.cid=r.v.cid,c.prev=r.v.prev),u.v=c}return(n||e.has("guard"))&&d!=null&&(u.guard=rt(d)),(n||e.has("lastMutation"))&&r.lastMutation!=null&&(u.lastMutation=r.lastMutation),u}var mt=j(()=>{"use strict";je();De()});function Y(r,e){return Ae([],{...e,initial:r})}function he(r,e){return Ae((n,s,o)=>r(s,o)??void 0,{describeKind:"producer",...e})}function V(r,e,t){return Ae(r,(s,o,i)=>{let a=s.map((u,d)=>u!=null&&u.length>0?u.at(-1):i.prevData[d]);o.emit(e(a,i))},{describeKind:"derived",...t})}function ke(r,e,t){return Ae(r,(s,o,i)=>{let a=s.map((u,d)=>u!=null&&u.length>0?u.at(-1):i.prevData[d]);return e(a,o,i)??void 0},{describeKind:"effect",...t})}var Ue=j(()=>{"use strict";De()});function jt(r){return r.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Bt(r){let e=new Set,t=[];function n(s,o){let i=`${s}\0${o}`;e.has(i)||(e.add(i),t.push([s,o]))}for(let[s,o]of Object.entries(r.nodes)){let i=o.deps;if(i)for(let a of i)n(a,s)}for(let s of r.edges)n(s.from,s.to);return t}function Ht(r){if(r===void 0)return"LR";if(r==="TD"||r==="LR"||r==="BT"||r==="RL")return r;throw new Error(`invalid diagram direction ${String(r)}; expected one of: TD, LR, BT, RL`)}var Vt=j(()=>{"use strict"});function Ke(r,e){let t=Ht(e?.direction),n=Object.keys(r.nodes).sort(),s=new Map;for(let i=0;i<n.length;i+=1)s.set(n[i],`n${i}`);let o=[`flowchart ${t}`];for(let i of n){let a=s.get(i);o.push(` ${a}["${jt(i)}"]`)}for(let[i,a]of Bt(r)){let u=s.get(i),d=s.get(a);!u||!d||o.push(` ${u} --> ${d}`)}return o.join(`
2
- `)}var Wt=j(()=>{"use strict";Vt()});var zt=j(()=>{"use strict";Wt()});function bt(r,e){if(Object.is(r,e))return!0;if(r==null||e==null||typeof r!="object"||typeof e!="object")return!1;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let o=0;o<r.length;o++)if(!bt(r[o],e[o]))return!1;return!0}if(Array.isArray(e))return!1;let t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;let s=new Set(n);for(let o of t)if(!s.has(o)||!bt(r[o],e[o]))return!1;return!0}function Ut(r,e){return`${r}\0${e}`}function yt(r,e){let t=[],n=new Set(r.subgraphs),s=new Set(e.subgraphs),o=[];for(let g of s)n.has(g)||o.push(g);o.sort();for(let g of o)t.push({type:"subgraph-mounted",path:g});let i=new Set(Object.keys(r.nodes)),a=new Set(Object.keys(e.nodes)),u=[];for(let g of a)i.has(g)||u.push(g);u.sort();for(let g of u)t.push({type:"node-added",path:g,node:{...e.nodes[g]}});let d=[];for(let g of a){if(!i.has(g))continue;let _=r.nodes[g]?.meta,m=e.nodes[g]?.meta;_==null&&m==null||bt(_??{},m??{})||d.push(g)}d.sort();for(let g of d)t.push({type:"node-meta-changed",path:g,prevMeta:r.nodes[g]?.meta??{},nextMeta:e.nodes[g]?.meta??{}});let c=new Map;for(let g of r.edges)c.set(Ut(g.from,g.to),g);let f=new Map;for(let g of e.edges)f.set(Ut(g.from,g.to),g);let p=[];for(let[g,_]of f)c.has(g)||p.push(_);p.sort((g,_)=>g.from<_.from?-1:g.from>_.from?1:g.to<_.to?-1:g.to>_.to?1:0);for(let g of p)t.push({type:"edge-added",from:g.from,to:g.to});let h=[];for(let[g,_]of c)f.has(g)||h.push(_);h.sort((g,_)=>g.from<_.from?-1:g.from>_.from?1:g.to<_.to?-1:g.to>_.to?1:0);for(let g of h)t.push({type:"edge-removed",from:g.from,to:g.to});let l=[];for(let g of i)a.has(g)||l.push(g);l.sort();for(let g of l)t.push({type:"node-removed",path:g});let v=[];for(let g of n)s.has(g)||v.push(g);v.sort();for(let g of v)t.push({type:"subgraph-unmounted",path:g});return{events:t,flushedAt_ns:ue()}}var Kt=j(()=>{"use strict";Ve()});function vt(r){return{describeKind:"producer",...r}}function qt(r,e){return he(t=>{let n=!1;try{for(let s of r){if(n)return;t.emit(s)}n||t.down([[J]])}catch(s){n||t.down([[I,s]])}return()=>{n=!0}},vt(e))}function Fn(r){return r!=null&&typeof r.then=="function"}function jn(r,e){let{signal:t,...n}=e??{};return he(s=>{let o=!1,i=()=>{o||(o=!0,s.down([[I,t.reason]]))};if(t?.aborted){i();return}return t?.addEventListener("abort",i,{once:!0}),Promise.resolve(r).then(a=>{o||(o=!0,t?.removeEventListener("abort",i),s.emit(a),s.down([[J]]))},a=>{o||(o=!0,t?.removeEventListener("abort",i),s.down([[I,a]]))}),()=>{o=!0,t?.removeEventListener("abort",i)}},vt(n))}function Bn(r,e){let{signal:t,...n}=e??{};return he(s=>{let o=new AbortController,i=()=>o.abort(t?.reason);t?.aborted?o.abort(t.reason):t?.addEventListener("abort",i,{once:!0});let a=t??o.signal,u=!1,d=r[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(f=>{if(!(u||a.aborted)){if(f.done){s.down([[J]]);return}s.emit(f.value),c()}},f=>{!u&&!a.aborted&&s.down([[I,f]])})};return c(),()=>{u=!0,t?.removeEventListener("abort",i),o.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},vt(n))}function Hn(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"}function Jt(r,e){if(Hn(r))return r;if(Fn(r))return jn(r,e);if(r!=null){let t=r;if(typeof t[Symbol.asyncIterator]=="function")return Bn(r,e);if(typeof t[Symbol.iterator]=="function")return qt(r,e)}return Vn(r)}function Vn(...r){return qt(r,void 0)}function qe(r){return r.subscribe(()=>{})}var Yt=j(()=>{"use strict";Re();Ue()});var Xt=j(()=>{"use strict";Yt()});var Je,Zt=j(()=>{"use strict";Je=class{_timer;_gen=0;start(e,t){this.cancel(),this._gen+=1;let n=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,n===this._gen&&t()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var Ge,Qt=j(()=>{"use strict";Ge=class{constructor(e){this.capacity=e;if(!Number.isInteger(e)||e<=0)throw new Error(`RingBuffer capacity must be a positive integer (got ${e})`);this.buf=new Array(e)}buf;head=0;_size=0;get size(){return this._size}get maxSize(){return this.capacity}push(e){let t=(this.head+this._size)%this.capacity;this.buf[t]=e,this._size<this.capacity?this._size++:this.head=(this.head+1)%this.capacity}shift(){if(this._size===0)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head=(this.head+1)%this.capacity,this._size--,e}at(e){if(this._size===0)return;let t=e<0?this._size+e:e;if(!(t<0||t>=this._size))return this.buf[(this.head+t)%this.capacity]}toArray(){let e=new Array(this._size);for(let t=0;t<this._size;t++)e[t]=this.buf[(this.head+t)%this.capacity];return e}clear(){for(let e=0;e<this._size;e++)this.buf[(this.head+e)%this.capacity]=void 0;this.head=0,this._size=0}}});function en(r,e,t,n={}){let s=e in r.nodes,o=t in r.nodes;if(!s)return Ye(e,t,"no-such-from");if(!o)return Ye(e,t,"no-such-to");let i=n.maxDepth;if(i!=null&&(!Number.isInteger(i)||i<0))throw new Error("explainPath: maxDepth must be an integer >= 0");if(e===t){if(n.findCycle===!0){let d=Wn(r,e,n);if(d!=null)return d}let u=Xe(e,r.nodes[e],0,n);return Ze(e,t,[u])}if(i===0)return Ye(e,t,"no-path");let a=tn(r,e,t,i);return a.found?Ze(e,t,nn(r,a.pathOrder,n)):Ye(e,t,a.truncated?"max-depth-exceeded":"no-path")}function tn(r,e,t,n){let s=new Map,o=[{path:t,depth:0}],i=new Set([t]),a=0,u=!1;for(;a<o.length;){let f=o[a++];if(f.path===e)break;if(n!=null&&f.depth>=n){let v=r.nodes[f.path];v?.deps&&v.deps.length>0&&(u=!0);continue}let p=r.nodes[f.path];if(p==null)continue;let h=p.deps??[],l=new Map;for(let v=0;v<h.length;v++){let g=h[v];if(!g)continue;let _=l.get(g);_==null&&(_=[],l.set(g,_)),_.push(v)}for(let[v,g]of l)i.has(v)||(i.add(v),s.set(v,{from:f.path,depIndices:g}),o.push({path:v,depth:f.depth+1}))}if(!s.has(e))return{found:!1,pathOrder:[],truncated:u};let d=[{path:e}],c=e;for(;c!==t;){let f=s.get(c);if(f==null)return{found:!1,pathOrder:[],truncated:!1};d[d.length-1].depIndices=f.depIndices,d.push({path:f.from}),c=f.from}return{found:!0,pathOrder:d,truncated:!1}}function Wn(r,e,t){let n=r.nodes[e];if(n==null)return null;let s=n.deps??[],o=[];for(let a=0;a<s.length;a++)s[a]===e&&o.push(a);if(o.length>0){let a=Xe(e,n,0,t);a.dep_index=o[0];let u=Xe(e,n,1,t);return Ze(e,e,[a,u])}let i=null;for(let a=0;a<s.length;a++){let u=s[a];if(!u||u===e)continue;let d=tn(r,u,e,t.maxDepth);d.found&&(i==null||d.pathOrder.length<i.pathOrder.length)&&(i=d,i={found:!0,pathOrder:[{path:e,depIndices:[a]},...d.pathOrder],truncated:!1})}return i==null?null:Ze(e,e,nn(r,i.pathOrder,t))}function nn(r,e,t){return e.map((n,s)=>{let o=r.nodes[n.path],i=Xe(n.path,o,s,t);return n.depIndices!=null&&n.depIndices.length>0&&(i.dep_index=n.depIndices[0],n.depIndices.length>1&&(i.dep_indices=[...n.depIndices])),i})}function Xe(r,e,t,n){let s={path:r,type:e.type,hop:t};e.status!==void 0&&(s.status=e.status),"value"in e&&(s.value=e.value),e.v!=null&&(s.v=e.v);let o=n.annotations?.get(r)??e.annotation;o!=null&&(s.annotation=o);let i=n.lastMutations?.get(r)??e.lastMutation;return i!=null&&(s.lastMutation=i),s}function Ze(r,e,t){return rn(r,e,!0,"ok",t)}function Ye(r,e,t){return rn(r,e,!1,t,[])}function rn(r,e,t,n,s){let o=zn(r,e,t,n,s);return{from:r,to:e,found:t,reason:n,steps:s,text:o,toJSON(){return{from:r,to:e,found:t,reason:n,steps:s}}}}function zn(r,e,t,n,s){if(!t)switch(n){case"no-such-from":return`explainPath: no node named "${r}"`;case"no-such-to":return`explainPath: no node named "${e}"`;case"max-depth-exceeded":return`explainPath: no path from "${r}" to "${e}" within maxDepth`;default:return`explainPath: no path from "${r}" to "${e}"`}let o=[`Causal path: ${r} \u2192 ${e} (${s.length} step(s))`];for(let i of s){let u=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(o.push(u),"value"in i&&o.push(` value: ${Un(i.value)}`),i.annotation!=null&&o.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let d=i.lastMutation.actor;o.push(` actor: ${d.type}${d.id?`:${d.id}`:""}`)}}return o.join(`
3
- `)}function Un(r){if(r===void 0)return"<sentinel>";if(r===null)return"null";if(typeof r=="string")return JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean"||typeof r=="bigint")return String(r);try{let e=JSON.stringify(r);return e.length>80?`${e.slice(0,77)}...`:e}catch{return String(r)}}var sn=j(()=>{"use strict"});function on(r){let e=new WeakSet,t=new WeakSet,n=[r],s=0;for(;n.length>0;){let o=n.pop();s+=qn(o,e,t,n)}return s}function qn(r,e,t,n){if(r==null)return 0;switch(typeof r){case"number":return W.number;case"boolean":return W.boolean;case"string":return W.string+r.length*2;case"bigint":return W.bigint+Jn(r);case"symbol":return W.symbol;case"function":return e.has(r)?0:(e.add(r),W.function);case"undefined":return 0}let o=r;if(e.has(o))return 0;e.add(o);let i=o[Kn];if(typeof i=="function")try{let d=i.call(o);if(typeof d=="number"&&Number.isFinite(d))return d}catch{}if(o instanceof Date)return W.date;if(o instanceof RegExp)return W.regexp+o.source.length*2;if(o instanceof Error){let d=o.message?o.message.length*2:0,c=o.stack?o.stack.length*2:0;return W.error+d+c}if(typeof URL<"u"&&o instanceof URL)return W.url+o.href.length*2;if(typeof Promise<"u"&&o instanceof Promise)return W.promise;if(o instanceof WeakMap)return W.weakmap;if(o instanceof WeakSet)return W.weakset;if(o instanceof Map){let d=W.map;for(let[c,f]of o)d+=W.mapEntry,n.push(c),n.push(f);return d}if(o instanceof Set){let d=W.set;for(let c of o)d+=W.setEntry,n.push(c);return d}if(Array.isArray(o)){let d=W.array+o.length*8;for(let c of o)n.push(c);return d}if(o instanceof ArrayBuffer)return t.has(o)?0:(t.add(o),o.byteLength);if(ArrayBuffer.isView(o)){let d=o;return t.has(d.buffer)?48:(t.add(d.buffer),d.buffer.byteLength+48)}let a=W.object,u=Object.keys(o);for(let d of u){a+=W.string+d.length*2;try{n.push(o[d])}catch{}}return a}function Jn(r){let e=r<0n?-r:r;if(e===0n)return 0;let t=e.toString(2).length;return Math.ceil(t/32)*8}var W,Kn,an=j(()=>{"use strict";W={object:56,array:64,string:40,number:8,boolean:4,null:0,undefined:0,symbol:40,bigint:16,function:120,map:72,set:72,mapEntry:40,setEntry:24,date:24,regexp:48,error:64,url:80,promise:48,weakmap:40,weakset:40},Kn=Symbol.for("sizeof")});function un(r,e){let t=e?.topN??10,n=r.describe({detail:"standard"}),s=[],o=r._collectObserveTargets;typeof o=="function"&&o.call(r,"",s);let i=new Map;for(let[p,h]of s)i.set(p,h);let a=[];for(let[p,h]of Object.entries(n.nodes)){let l=i.get(p),v=l instanceof H?l:null,g=v?on(v.cache):0,_=v?v._sinkCount:0,m=h.deps?.length??0,y=h.type==="effect"&&_===0,w=_===0?h.type==="effect"?"orphan-effect":h.type==="derived"?"idle-derived":h.type==="producer"?"idle-producer":null:null;a.push({path:p,type:h.type,status:h.status??"unknown",valueSizeBytes:g,subscriberCount:_,depCount:m,isOrphanEffect:y,orphanKind:w})}let u=a.reduce((p,h)=>p+h.valueSizeBytes,0),d=(p,h)=>[...a].sort(h??((l,v)=>v[p]-l[p])).slice(0,t),c=a.filter(p=>p.orphanKind!=null),f=a.filter(p=>p.isOrphanEffect);return{nodeCount:a.length,edgeCount:n.edges.length,subgraphCount:n.subgraphs.length,nodes:a,totalValueSizeBytes:u,hotspots:{byValueSize:d("valueSizeBytes"),bySubscriberCount:d("subscriberCount"),byDepCount:d("depCount")},orphans:c,orphanEffects:f}}var dn=j(()=>{"use strict";De();an()});function Qe(r,e){let t=Math.max(16,r.size*4),n=0;for(;r.size>0;){if(n++>=t){console.error(`[Graph "${e}".destroy] disposer drain exceeded cap (${t}); ${r.size} disposer(s) discarded`),r.clear();return}let s=r.values().next();if(s.done)return;let o=s.value;r.delete(o);try{o()}catch(i){console.error(`[Graph "${e}".destroy] disposer threw:`,i)}}}function gn(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"&&typeof r.down=="function"}function Yn(r){if(r!=null)return gn(r)?r.cache:r}function ge(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"&&typeof r.down=="function"}function ce(r){return ge(r)?r.cache??"":r}function cn(r){return ge(r)?r.cache??0:r}function ln(r){return ge(r)?r.cache??!1:r}function Xn(r){let e=[];for(let t of Object.keys(r).sort()){let n=r[t].v;n!=null&&e.push(`${t} ${n.id} ${n.version}`)}return e.join(`
4
- `)}function fn(r){if(r.version!==Te)throw new Error(`unsupported snapshot version ${String(r.version)} (expected ${Te})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in r))throw new Error(`snapshot missing required key "${e}"`);if(typeof r.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof r.nodes!="object"||r.nodes===null||Array.isArray(r.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(r.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(r.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function Zn(r,e){let t=new WeakMap,n=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=t.get(s);if(i==null&&(i=new WeakSet,t.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,u=o.constructor;if(a!==u)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let p=o;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++)if(!n(s[h],p[h]))return!1;return!0}if(s instanceof Map){let p=o;if(s.size!==p.size)return!1;for(let[h,l]of s)if(!p.has(h)||!n(l,p.get(h)))return!1;return!0}if(s instanceof Set){let p=o;if(s.size!==p.size)return!1;for(let h of s){let l=!1;for(let v of p)if(n(h,v)){l=!0;break}if(!l)return!1}return!0}if(ArrayBuffer.isView(s)){let p=s,h=o;if(p.length!==h.length)return!1;for(let l=0;l<p.length;l++)if(p[l]!==h[l])return!1;return!0}let d=Object.keys(s),c=Object.keys(o);if(d.length!==c.length)return!1;let f=new Set(c);for(let p of d)if(!f.has(p)||!n(s[p],o[p]))return!1;return!0};return n(r,e)}function Qn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function et(r){let e="^";for(let t=0;t<r.length;t+=1){let n=r[t];if(n==="*"){e+=".*";continue}if(n==="?"){e+=".";continue}if(n==="["){let s=r.indexOf("]",t+1);if(s<=t+1){e+="\\[";continue}let o=r.slice(t+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,t=s;continue}e+=Qn(n)}return e+="$",new RegExp(e)}function wt(r){if(typeof r=="string")return JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean"||r==null)return String(r);try{return JSON.stringify(r)}catch{return"[unserializable]"}}function nr(r){return r==="none"?tr:r==="ansi"||r==null?er:{data:r.data??"",dirty:r.dirty??"",resolved:r.resolved??"",invalidate:r.invalidate??"",pause:r.pause??"",resume:r.resume??"",complete:r.complete??"",error:r.error??"",teardown:r.teardown??"",derived:r.derived??"",path:r.path??"",reset:r.reset??""}}function pn(r){if(r==null)return{};let e=r.detail;return e==="full"?{...r,structured:r.structured??!0,timeline:r.timeline??!0,causal:r.causal??!0,derived:r.derived??!0}:e==="minimal"?{...r,structured:r.structured??!0}:r.format==="stage-log"?{...r,structured:r.structured??!0,timeline:r.timeline??!0}:r}function rr(r,e,t){for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<32||s===127)throw new Error(`Graph "${e}": ${t} "${r}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${n})`)}}function _t(r,e,t){if(r==="")throw new Error(`Graph "${e}": ${t} name must be non-empty`);if(r.includes($))throw new Error(`Graph "${e}": ${t} "${r}" must not contain '${$}' (path separator)`);if(r===oe)throw new Error(`Graph "${e}": ${t} name "${oe}" is reserved for meta companion paths`);rr(r,e,t)}function sr(r,e){if(r==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let t=r.split($);for(let n of t)if(n==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return t}function or(r,e){let t=!1;for(let s of r)if(!e.isMetaPassthrough(s[0])){t=!0;break}return t?r.filter(s=>e.isMetaPassthrough(s[0])):r}function mn(r){for(let e of r._mounts.values())mn(e);for(let e of r._nodes.values())try{e.down([[q]],{internal:!0})}catch{}}function ir(r,e){let t=Pe.diff(r,e),n={};for(let s of t.nodesAdded){let o=e.nodes[s];o!=null&&(n[s]=o)}return{...t,nodesAddedFull:n}}function hn(r,e,t,n={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return n.withDetail?s:[];if(!n.both&&t!=="upstream"&&t!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=n.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return n.withDetail?s:[];let i=new Map,a=new Map,u=new Map,d=new Map,c=new Set;for(let[y,w]of Object.entries(r.nodes)){if(!y)continue;c.add(y);let b=w.deps??[];i.set(y,b);for(let x of b)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(y))}for(let y of r.edges){if(y==null||typeof y!="object")continue;let w=typeof y.from=="string"?y.from:"",b=typeof y.to=="string"?y.to:"";!w||!b||(c.add(w),c.add(b),d.has(w)||d.set(w,new Set),d.get(w).add(b),u.has(b)||u.set(b,new Set),u.get(b).add(w))}if(!c.has(e))return n.withDetail?s:[];let f=n.both===!0,p=y=>{if(f){let k=i.get(y)??[],T=u.get(y),E=a.get(y),A=d.get(y),S=[...k];return T&&S.push(...T),E&&S.push(...E),A&&S.push(...A),S}if(t==="upstream"){let k=i.get(y)??[],T=u.get(y);return T?[...k,...T]:k}let w=a.get(y),b=d.get(y),x=w?[...w]:[];return b&&x.push(...b),x},h=new Set([e]),l=new Map,v=[{path:e,depth:0}],g=0,_=!1;for(;g<v.length;){let y=v[g++];if(o!=null&&y.depth>=o){p(y.path).length>0&&(_=!0);continue}for(let w of p(y.path))!w||h.has(w)||(h.add(w),l.set(w,y.depth+1),v.push({path:w,depth:y.depth+1}))}let m=[...l.keys()].sort((y,w)=>y<w?-1:y>w?1:0);return n.withDetail?{paths:m,depths:l,truncated:_}:m}function ar(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++){let n=r[t],s=e[t];if(n.path!==s.path||n.type!==s.type||n.status!==s.status||n.hop!==s.hop||n.dep_index!==s.dep_index||n.annotation!==s.annotation||n.value!==s.value||n.lastMutation!==s.lastMutation)return!1;let o=n.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}var $,oe,Te,er,tr,Pe,bn=j(()=>{"use strict";it();Fe();Ve();je();Re();mt();De();Ue();Kt();Xt();Zt();Qt();ot();sn();dn();$="::",oe="__meta__",Te=1;er={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"},tr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};Pe=class r{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;_factory;_factoryArgs;constructor(e,t){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes($))throw new Error(`Graph name must not contain '${$}' (got "${e}")`);if(e===oe)throw new Error(`Graph name "${oe}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...t??{}}),this.config=t?.config??xe,this._traceRing=new Ge(t?.traceCapacity??1e3),t?.versioning!=null&&this.setVersioning(t.versioning),typeof t?.factory=="string"&&(this._factory=t.factory,t.factoryArgs!==void 0&&(this._factoryArgs=t.factoryArgs))}tagFactory(e,t){return this._factory=e,this._factoryArgs=t,this}ancestors(e=!0){let t=[],n=e?this:this._parent;for(;n!=null;)t.push(n),n=n._parent;return t}get topology(){return this._topology==null&&(this._topology=he(e=>{let t=n=>{e.emit(n)};return this._topologyEmitters.add(t),()=>{this._topologyEmitters.delete(t)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let t of this._topologyEmitters)t(e)}nameOf(e){return this._nodeToName.get(e)}add(e,t){let n=e.name,s=t?.name??n;if(s==null||s==="")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 o=s,i=t?.annotation;if(_t(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" 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(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:ue()})),e}setVersioning(e){if(e!=null)for(let t of this._nodes.values())t instanceof H&&t._applyVersioning(e)}remove(e){_t(e,this.name,"remove");let t=this._mounts.get(e);if(t){let o={kind:"mount",nodes:[],mounts:[]},i=[];t._collectObserveTargets("",i);for(let[a,u]of i)a.includes(`${$}${oe}${$}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...t._collectSubgraphs(`${e}${$}`)),this._mounts.delete(e),t._parent=void 0,mn(t),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(n),n.down([[q]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let t=typeof e=="function"?e:(()=>{let o=et(e);return i=>o.test(i)})(),n={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>t(o));for(let o of s){let i=this.remove(o);n.nodes.push(...i.nodes),n.mounts.push(...i.mounts)}return n.nodes.sort(),n.mounts.sort(),n}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),t=this._nodes,n=0;return{[Symbol.iterator](){return this},next(){if(n>=e.length)return{value:void 0,done:!0};let s=e[n++];return{value:[s,t.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes($))return this.resolve(e);let t=this._nodes.get(e);if(!t)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return t}get(e){return this.node(e).cache}set(e,t,n){let s=n?.internal===!0;this.node(e).down([[K,t]],{actor:n?.actor,internal:s,delivery:"write"})}setAll(e,t){let n=Symbol.iterator in e?e:Object.entries(e);Ee(()=>{for(let[s,o]of n)this.set(s,o,t)})}invalidate(e,t){let n=t?.internal===!0;this.node(e).down([[se]],{actor:t?.actor,internal:n,delivery:"write"})}error(e,t,n){let s=n?.internal===!0;this.node(e).down([[I,t]],{actor:n?.actor,internal:s,delivery:"write"})}complete(e,t){let n=t?.internal===!0;this.node(e).down([[J]],{actor:t?.actor,internal:n,delivery:"write"})}_registerSelfPruningKeepalive(e){let t,n,s=()=>{t?.(),t=void 0,n?.(),n=void 0};t=e.subscribe(o=>{for(let i of o){let a=i[0];if(a===q||a===J||a===I){s();return}}}),n=this.addDisposer(s)}_wireSignalToRemove(e,t){if(t==null)return;let n=()=>{try{this.remove(e)}catch{}};if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0}),this.addDisposer(()=>t.removeEventListener("abort",n))}derived(e,t,n,s){let o=t.map(h=>this.resolve(h)),{keepAlive:i,annotation:a,equals:u,initial:d,meta:c,signal:f}=s??{},p=V(o,n,{name:e,...u!=null?{equals:u}:{},...d!==void 0?{initial:d}:{},...c!=null?{meta:c}:{}});return this.add(p,{name:e,...a!=null?{annotation:a}:{}}),i===!0&&this._registerSelfPruningKeepalive(p),this._wireSignalToRemove(e,f),p}effect(e,t,n,s){let o=t.map(c=>this.resolve(c)),{annotation:i,meta:a,signal:u}=s??{},d=ke(o,n,{name:e,...a!=null?{meta:a}:{}});return this.add(d,{name:e,...i!=null?{annotation:i}:{}}),this._wireSignalToRemove(e,u),d}produce(e,t,n){if(t===void 0)throw new Error(`Graph "${this.name}".produce("${e}", \u2026): source must not be \`undefined\` \u2014 undefined is the global SENTINEL (spec \xA71.1). Pass \`null\` for nullary DATA, or a Promise/AsyncIterable/Iterable for async sources.`);if(t!==null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function")throw new Error(`Graph "${this.name}".produce("${e}", \u2026): Node sources are rejected. For Node\u2192Node, use graph.derived(name, [path], ([v]) => v, { keepAlive: true }) \u2014 fromAny passes Nodes through verbatim and silently drops opts.`);let{annotation:s,meta:o,equals:i,signal:a}=n??{},u=Jt(t,{name:e,...o!=null?{meta:o}:{},...i!=null?{equals:i}:{},...a!=null?{signal:a}:{}});return this.add(u,{name:e,...s!=null?{annotation:s}:{}}),this._wireSignalToRemove(e,a),u}batch(e){Ee(e)}edges(e){let t=e?.recursive===!0,n=new Map;if(!t){for(let[u,d]of this._nodes)n.set(d,u);let a=[];for(let[u,d]of this._nodes)if(d instanceof H)for(let c of d._deps){let f=n.get(c.node);f!=null&&a.push([f,u])}return a.sort((u,d)=>u[0]<d[0]?-1:u[0]>d[0]?1:u[1]<d[1]?-1:u[1]>d[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,u]of s)o.set(u,a);let i=[];for(let[a,u]of s)if(u instanceof H)for(let d of u._deps){let c=o.get(d.node);c!=null&&i.push([c,a])}return i.sort((a,u)=>a[0]<u[0]?-1:a[0]>u[0]?1:a[1]<u[1]?-1:a[1]>u[1]?1:0),i}mount(e,t){if(t===void 0){let s=new r(e);return this.mount(e,s)}if(typeof t=="function"){let s=new r(e);return t(s),this.mount(e,s)}let n=t;if(_t(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 s=this;s!=null;s=s._parent)if(s===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 t=sr(e,this.name);return this._resolveFromSegments(t)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let t=e;if(t[0]===this.name&&(t=t.slice(1),t.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let n=t[0],s=t.slice(1);if(s.length===0){let a=this._nodes.get(n);if(a)return a;throw this._mounts.has(n)?new Error(`Graph "${this.name}": path ends at subgraph "${n}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${n}"`)}let o=this._nodes.get(n);if(o&&s.length>0&&s[0]===oe)return this._resolveMetaChainFromNode(o,s,t.join($));let i=this._mounts.get(n);if(!i)throw this._nodes.has(n)?new Error(`Graph "${this.name}": "${n}" is a node; trailing path "${s.join($)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${n}"`);return i.resolve(s.join($))}_resolveMetaChainFromNode(e,t,n){let s=e,o=0,i=[...t];for(;o<i.length;){if(i[o]!==oe)throw new Error(`Graph "${this.name}": expected ${oe} segment in meta path "${n}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${oe} in "${n}"`);let a=i[o+1],u=s.meta[a];if(!u)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${n}"`);s=u,o+=2}return s}signal(e,t){if(t?.internal!==!0){for(let s of e)if(this.config.messageTier(s[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 n=[];if(this._signalDeliver(e,t??{},new Set,n),n.length>0)throw n[0]}_signalDeliver(e,t,n,s){for(let u of this._mounts.values())u._signalDeliver(e,t,n,s);let i=t.internal===!0?{internal:!0}:{actor:t.actor,delivery:"signal"},a=or(e,this.config);for(let u of[...this._nodes.keys()].sort()){let d=this._nodes.get(u);if(!n.has(d)){n.add(d);try{d.down(e,i)}catch(c){if(c instanceof te)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(d,a,n,i,s)}}}_signalMetaSubtree(e,t,n,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!n.has(a)){n.add(a);try{a.down(t,s)}catch(u){if(u instanceof te)throw u;o.push(u)}this._signalMetaSubtree(a,t,n,s,o)}}}describe(e){if(e?.reactive==="diff")return this._describeReactiveDiff(e);if(e?.reactive===!0)return this._describeReactive(e);let t=Yn(e?.actor),n=e?.filter;if(e?.detail!=null&&e?.fields!=null)throw new TypeError("Graph.describe(): pass either `detail` or `fields`, not both. `detail: 'spec'` is the canonical spec projection; use `fields` only when you need a custom subset.");let s=Ce(e?.detail,e?.fields),o=e?.detail==="spec",i=s,a=[];this._collectObserveTargets("",a);let u=new Map;for(let[w,b]of a)u.set(b,w);let d=[];{let w=a.map(([,k])=>k),b=new Set(u.values()),x=0;for(;w.length>0;){let k=w.shift();if(k instanceof H)for(let T of k._deps){let E=T.node;if(u.has(E))continue;let A=E.name??"",S=A;if(!S||b.has(S))if(A){let F=2;for(;b.has(`${A}#${F}`);)F++;S=`${A}#${F}`}else for(S=`__internal__/${x++}`;b.has(S);)S=`__internal__/${x++}`;u.set(E,S),b.add(S),d.push([S,E]),w.push(E)}}}let c=[...a,...d],f={};for(let[w,b]of c){if(t!=null&&!b.allowsObserve(t))continue;let x=Me(b,i,o),k=b instanceof H?b._deps.map(S=>u.get(S.node)??S.node.name??""):[],{name:T,...E}=x,A={...E,deps:k};if(!o){let S=this._annotations.get(w);S!=null&&(A.annotation=S)}if(n!=null)if(typeof n=="function"){let S=n;if(!(S.length>=2?S(w,A):S(A)))continue}else{let S=!0;for(let[F,G]of Object.entries(n)){let P=F==="deps_includes"?"depsIncludes":F==="meta_has"?"metaHas":F;if(P==="depsIncludes"){if(!A.deps.includes(String(G))){S=!1;break}continue}if(P==="metaHas"){if(!Object.hasOwn(A.meta??{},String(G))){S=!1;break}continue}if(A[P]!==G){S=!1;break}}if(!S)continue}f[w]=A}let p=new Set(Object.keys(f)),h=[];for(let[w,b]of c)if(b instanceof H)for(let x of b._deps){let k=u.get(x.node);k!=null&&h.push([k,w])}h.sort((w,b)=>w[0]<b[0]?-1:w[0]>b[0]?1:w[1]<b[1]?-1:w[1]>b[1]?1:0);let l=h.map(([w,b])=>({from:w,to:b}));(t!=null||n!=null)&&(l=l.filter(w=>p.has(w.from)&&p.has(w.to)));let v=this._collectSubgraphs(""),g=t!=null||n!=null?v.filter(w=>{let b=`${w}${$}`;return[...p].some(x=>x===w||x.startsWith(b))}):v,_=this,m=e;return{name:this.name,nodes:f,edges:l,subgraphs:g,...this._factory!==void 0?{factory:this._factory}:{},...this._factoryArgs!==void 0?{factoryArgs:this._factoryArgs}:{},expand(w){let b={...m};return Array.isArray(w)?(b.fields=w,b.detail=void 0):(b.detail=w,b.fields=void 0),_.describe(b)}}}_collectSubgraphs(e){let t=[];for(let n of[...this._mounts.keys()].sort()){let s=e===""?n:`${e}${n}`;t.push(s),t.push(...this._mounts.get(n)._collectSubgraphs(`${s}${$}`))}return t}resourceProfile(e){return un(this,e)}reachable(e,t,n={}){return n.withDetail===!0?hn(this.describe(),e,t,{...n,withDetail:!0}):hn(this.describe(),e,t,n)}explain(e,t,n){return n?.reactive===!0?this._explainReactive(e,t,n):this._explainStatic(ce(e),ce(t),{...n?.maxDepth!==void 0?{maxDepth:cn(n.maxDepth)}:{},...n?.findCycle!==void 0?{findCycle:ln(n.findCycle)}:{}})}_explainStatic(e,t,n){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,u]of Object.entries(s.nodes))u.lastMutation!=null&&i.set(a,u.lastMutation);return en(s,e,t,{...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let t={...e,reactive:!1},n=e.reactiveName??"describe",s=0,o=Y(s,{name:`${n}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ye(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},c=i.onEvent(m=>{let y=m.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||d()}),f=[],p=new WeakSet,h=m=>{if(p.has(m)||u)return;p.add(m);let y=m.topology.subscribe(w=>{for(let b of w){if(b[0]!==K)continue;let x=b[1];if(d(),x.kind==="added"&&x.nodeKind==="mount"){let k=m._mounts.get(x.name);k!=null&&h(k)}}});f.push(y);for(let w of m._mounts.keys()){let b=m._mounts.get(w);b!=null&&h(b)}};h(this);let l,v=e.actor;gn(v)&&(l=v.subscribe(m=>{let y=!1,w=!1;for(let b of m){let x=b[0];x===K?y=!0:(x===J||x===I||x===q)&&(w=!0)}y&&d(),w&&(l?.(),l=void 0,d())}));let g;try{g=V([o],()=>this.describe(t),{name:n,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,y)=>m===y})}catch(m){c(),l?.();for(let y of f)y();throw i.dispose(),m}let _=qe(g);return{node:g,dispose(){u=!0,c(),l?.();for(let m of f)m();f.length=0,i.dispose(),_()}}}_describeReactiveDiff(e){let t={...e,reactive:!1},n=e.reactiveName??"describe-diff",s={name:this.name,nodes:{},edges:[],subgraphs:[]},o=this.describe(t),i=yt(s,o),a=Y(i,{name:n,meta:{domain:"audit",kind:"describe-diff"},equals:(p,h)=>p===h}),u=this._describeReactive({...e,reactiveName:void 0}),d=!1,c=u.node.subscribe(p=>{if(!d)for(let h of p){if(h[0]!==K)continue;let l=h[1],v=yt(o,l);o=l,v.events.length!==0&&a.emit(v)}}),f=qe(a);return{node:a,dispose(){d=!0,c(),u.dispose(),a.down([[q,"describe-diff disposed"]]),f()}}}_explainReactive(e,t,n){let s=0,o=Y(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ye(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},c=i.onEvent(m=>{let y=m.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||d()}),f=[];e!=null&&ge(e)&&f.push(e),t!=null&&ge(t)&&f.push(t),n?.maxDepth!=null&&ge(n.maxDepth)&&f.push(n.maxDepth),n?.findCycle!=null&&ge(n.findCycle)&&f.push(n.findCycle);let p=()=>{for(let m of f)if(m.cache===void 0)return!1;return!0},h=()=>{let m=ce(e),y=ce(t);return{from:m,to:y,found:!1,reason:"pending",steps:[],text:"(awaiting reactive args)",toJSON:()=>({from:m,to:y,found:!1,reason:"pending",steps:[]})}},l;try{l=V([o],()=>{if(!p())return h();let m=ce(e),y=ce(t),w={...n?.maxDepth!==void 0?{maxDepth:cn(n.maxDepth)}:{},...n?.findCycle!==void 0?{findCycle:ln(n.findCycle)}:{}};return this._explainStatic(m,y,w)},{name:n?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:ce(e),to:ce(t)},equals:(m,y)=>m.found===y.found&&m.reason===y.reason&&m.steps.length===y.steps.length&&ar(m.steps,y.steps)})}catch(m){throw c(),i.dispose(),m}let v=qe(l),g=[],_=m=>{let y;return y=m.subscribe(w=>{let b=!1,x=!1;for(let k of w){let T=k[0];T===K?b=!0:(T===J||T===I||T===q)&&(x=!0)}(b||x)&&d(),x&&y&&(y(),y=void 0)}),()=>{y&&(y(),y=void 0)}};for(let m of f)g.push(_(m));return{node:l,dispose(){u=!0,c();for(let m of g)m?.();g.length=0,i.dispose(),v()}}}_pathsMatching(e){let t=et(e),n=[];return this._collectObserveTargets("",n),n.map(([s])=>s).filter(s=>t.test(s))}_collectObserveTargets(e,t){for(let n of[...this._mounts.keys()].sort()){let s=e===""?n:`${e}${$}${n}`;this._mounts.get(n)._collectObserveTargets(s,t)}for(let n of[...this._nodes.keys()].sort()){let s=this._nodes.get(n),o=e===""?n:`${e}${$}${n}`;t.push([o,s]),this._appendMetaObserveTargets(o,s,t)}}_appendMetaObserveTargets(e,t,n){for(let s of Object.keys(t.meta).sort()){let o=t.meta[s],i=`${e}${$}${oe}${$}${s}`;n.push([i,o]),this._appendMetaObserveTargets(i,o,n)}}observe(e,t){let n=typeof e=="string",o=pn(n?t:e);if(o.reactive===!0)return this._observeReactive(n?e:void 0,o);let i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(n){let c=e,f=this.resolve(c);if(a!=null&&!f.allowsObserve(a))throw new te({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,f]],o,"one"):{subscribe(p){return f.subscribe(p)},up(p){try{f.up?.(p)}catch(h){if(h instanceof te)return;throw h}}}}let u=[];this._collectObserveTargets("",u),u.sort((c,f)=>c[0]<f[0]?-1:c[0]>f[0]?1:0);let d=a==null?u:u.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(d,o,"all"):{subscribe:c=>{let f=d.map(([p,h])=>h.subscribe(l=>{c(p,l)}));return()=>{for(let p of f)p()}},up:(c,f)=>{try{this.resolve(c).up?.(f)}catch(p){if(p instanceof te)return;throw p}}}}_observeReactive(e,t){let n=t.tiers,s=n!=null?new Set(n):null,o=t.reactiveName??"observe";return he(i=>{let a=[],u=!1,d=!1,c=()=>{if(a.length===0||d)return;let v={events:a.slice(),flushedAt_ns:ue()};a.length=0,i.emit(v)},f={...t,reactive:!1,structured:!0,timeline:!0},p=e!=null?this.observe(e,f):this.observe(f),h=v=>{d||(a.push(v),!u&&(u=!0,ye(()=>{u=!1,c()})))};for(let v of p.events)h(v);let l=p.onEvent(h);return()=>{d=!0,l(),p.dispose()}},{name:o,meta:{domain:"audit",kind:"observe-reactive"}})}_buildStructuredObserver(e,t,n){let s=n==="one"?e[0]?.[0]:void 0,o=i=>{if(n==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,f)=>c[0]<f[0]?-1:c[0]>f[0]?1:0);let u=i.actor,d=u==null?a:a.filter(([,c])=>c.allowsObserve(u));return this._buildStructuredObserver(d,i,"all")};return this._createObserveResult(e,t,o)}_createObserveResult(e,t,n){let s=t.timeline===!0,o=t.causal===!0,i=t.derived===!0,a=t.detail==="minimal",u=this.config.inspectorEnabled,d=(o||i)&&u,c=t.maxEvents,f=c!=null&&c>0?new Ge(c):null,p=[],h=new Set,l=t.tiers!=null?new Set(t.tiers):null,v={},g=new Set,_=0,m=0,y=0,w=0,b=0,x=0,k=!1,T=!1,E=0,A=new Map,S=new Map,F=new Map,G=O=>{if(!(l!=null&&!l.has(O.type))){f?f.push(O):p.push(O);for(let C of h)C(O)}},P=O=>l==null||l.has(O),ae=()=>s?{timestamp_ns:ue(),in_batch:Le(),batch_id:E}:{},Ne=(O,C)=>{if(!(!d||!(O instanceof H)))return O._setInspectorHook(U=>{if(U.kind==="dep_message")A.set(O,U.depIndex);else if(U.kind==="run"){let le=U.batchData.map((M,Q)=>M!=null&&M.length>0?M.at(-1):U.prevData[Q]);S.set(O,le);let Z=U.batchData.map(M=>M!=null?[...M]:void 0);F.set(O,Z),i&&G({type:"derived",path:C,dep_values:le,dep_batches:Z,...ae()})}})},N=O=>{let C=A.get(O),U=S.get(O);if(!o||U==null)return{};let Z=(C!=null&&C>=0&&O instanceof H?O._deps[C]:void 0)?.node,M=Z?.v,Q=F.get(O);return{trigger_dep_index:C,trigger_dep_name:Z?.name,...M!=null?{trigger_version:{id:M.id,version:M.version}}:{},dep_values:[...U],...Q!=null?{dep_batches:Q}:{}}},D=[],R=[];for(let[O,C]of e){let U=Ne(C,O);U&&D.push(U),R.push(C.subscribe(le=>{E++;for(let Z of le){let M=Z[0],Q=ae();if(M===K){v[O]=Z[1];let tt=C instanceof H?C.lastMutation?.actor??ve:ve;G({type:"data",path:O,data:Z[1],actor:tt,...Q,...N(C)})}else if(a)M===ne?P("dirty")&&_++:M===re?P("resolved")&&m++:M===se?P("invalidate")&&y++:M===ie?P("pause")&&w++:M===de?P("resume")&&b++:M===q?P("teardown")&&x++:M===J&&!g.has(O)?P("complete")&&(k=!0):M===I&&P("error")&&(T=!0,g.add(O));else if(M===ne)P("dirty")&&_++,G({type:"dirty",path:O,...Q});else if(M===re)P("resolved")&&m++,G({type:"resolved",path:O,...Q,...N(C)});else if(M===se)P("invalidate")&&y++,G({type:"invalidate",path:O,...Q});else if(M===ie)P("pause")&&w++,G({type:"pause",path:O,lockId:Z[1],...Q});else if(M===de)P("resume")&&b++,G({type:"resume",path:O,lockId:Z[1],...Q});else if(M===J)P("complete")&&!g.has(O)&&(k=!0),G({type:"complete",path:O,...Q});else if(M===I){P("error")&&(T=!0,g.add(O));let tt=C instanceof H?C.lastMutation?.actor??ve:ve;G({type:"error",path:O,data:Z[1],actor:tt,...Q})}else M===q&&(P("teardown")&&x++,G({type:"teardown",path:O,...Q}))}}))}let X=!1,L=()=>{if(!X){X=!0;for(let O of R)O();for(let O of D)O();for(let O of z)O({value:void 0,done:!0});z.length=0}},B=[],z=[];h.add(O=>{let C=z.shift();C?C({value:O,done:!1}):B.push(O)});let ee={get values(){return v},get dirtyCount(){return _},get resolvedCount(){return m},get invalidateCount(){return y},get pauseCount(){return w},get resumeCount(){return b},get teardownCount(){return x},get events(){return f?f.toArray():[...p]},get anyCompletedCleanly(){return k},get anyErrored(){return T},get completedWithoutErrors(){return k&&!T},onEvent(O){return h.add(O),()=>h.delete(O)},dispose:L,expand(O){L();let C={...t};return typeof O=="string"?C.detail=O:Object.assign(C,O),n(pn(C))},[Symbol.asyncIterator](){return{next(){return B.length>0?Promise.resolve({value:B.shift(),done:!1}):X?Promise.resolve({value:void 0,done:!0}):new Promise(O=>z.push(O))},return(){return L(),Promise.resolve({value:void 0,done:!0})}}}};return t.format!=null&&this._attachFormatLogger(ee,t),ee}_attachFormatLogger(e,t){let n=t.format;if(n==null)return;let s=t.logger??(l=>console.log(l)),o=t.includeTypes?new Set(t.includeTypes):null,i=t.excludeTypes?new Set(t.excludeTypes):null,a=o==null&&i==null?()=>!0:l=>(o==null||o.has(l))&&(i==null||!i.has(l)),u=nr(t.theme),d=n==="stage-log"?ue():0,c=l=>l==null?"":t.stageLabels?.[l]??l,f=(l,v)=>l.length>v?`${l.slice(0,v-1)}\u2026`:l,p=l=>l.type==="data"||l.type==="error"?f(wt(l.data),120):"",h=l=>{if(n==="stage-log"){let k=(ue()-d)/1e9,T=c(l.path).padEnd(9);if(l.type==="data"){let E=p(l);return`[${k.toFixed(3)}s] ${T} \u2190${E?` ${E}`:""}`}if(l.type==="error"){let E=p(l);return`[${k.toFixed(3)}s] ${T} \u2717${E?` ${E}`:""}`}return l.type==="complete"?`[${k.toFixed(3)}s] ${T} \u25A0 complete`:`[${k.toFixed(3)}s] ${T} ${l.type}`}if(n==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let v=u[l.type]??"",g=l.path?`${u.path}${l.path}${u.reset} `:"",_=l.type==="data"||l.type==="error",m=l.type==="pause"||l.type==="resume",y=_?` ${wt(l.data)}`:m?` ${wt(l.lockId)}`:"",w=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,b=w?.trigger_dep_name!=null?` <- ${w.trigger_dep_name}`:w?.trigger_dep_index!=null?` <- #${w.trigger_dep_index}`:"",x=l.in_batch?" [batch]":"";return`${g}${v}${l.type.toUpperCase()}${u.reset}${y}${b}${x}`};e.onEvent(l=>{a(l.type)&&s(h(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){Qe(this._disposers,this.name),this.signal([[q]],{internal:!0}),Qe(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(){Qe(this._disposers,this.name),Qe(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}snapshot(e){let{expand:t,...n}=this.describe({detail:"full"}),s={};for(let a of Object.keys(n.nodes).sort()){let{lastMutation:u,guard:d,...c}=n.nodes[a];s[a]=c}let o=[...n.subgraphs].sort(),i={...n,version:1,nodes:s,subgraphs:o};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 Ot(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,t){let n=t?.config??xe,{codec:s,codecVersion:o,payload:i}=St(e,n);return s.decode(i,o)}restore(e,t){if(fn(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let n=t?.only==null?null:(Array.isArray(t.only)?t.only:[t.only]).map(o=>et(o)),s=t?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(n!==null&&!n.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&t?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let u=this.tryResolve(o)?.v;if(u!=null&&u.id===i.v.id&&u.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){t?.onError?.(o,a)}}}}}static fromSnapshot(e,t){fn(e);let n=typeof t=="function"?t:t?.build,s=typeof t=="function"?void 0:t?.factories,o=new r(e.name);if(n)return n(o),o.restore(e),o;for(let h of[...e.subgraphs].sort((l,v)=>{let g=l.split($).length,_=v.split($).length;return g!==_?g-_:l<v?-1:l>v?1:0})){let l=h.split($),v=o;for(let g of l)v._mounts.has(g)||v.mount(g,new r(g)),v=v._mounts.get(g)}let i=s?Object.entries(s).map(([h,l])=>({re:et(h),factory:l})):[],a=h=>{for(let l of i)if(l.re.test(h))return l.factory},u=h=>{let l=h.split($),v=l.pop();if(v==null||v.length===0)throw new Error(`invalid snapshot path "${h}"`);let g=o;for(let _ of l){let m=g._mounts.get(_);if(!m)throw new Error(`unknown mount "${_}" in path "${h}"`);g=m}return[g,v]},d=Object.entries(e.nodes).filter(([h])=>!h.includes(`${$}${oe}${$}`)).sort((h,l)=>h[0]<l[0]?-1:h[0]>l[0]?1:0),c=new Map(d),f=new Map,p=!0;for(;c.size>0&&p;){p=!1;for(let[h,l]of[...c.entries()]){let v=l?.deps??[];if(!v.every(b=>f.has(b)))continue;let[g,_]=u(h),m={...l?.meta??{}},y=a(h),w;if(l?.type==="state")w=Y(l.value,{meta:m});else{if(y==null)continue;w=y(_,{path:h,type:l.type,value:l.value,meta:m,deps:v,resolvedDeps:v.map(b=>f.get(b))})}g.add(w,{name:_}),f.set(h,w),c.delete(h),p=!0}}if(c.size>0){let h=[...c.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 o.restore(e),o}toJSON(){return this.snapshot()}attachSnapshotStorage(e,t={}){let n=e.map(d=>({tier:d,debounceMs:Math.max(0,d.debounceMs??0),compactEvery:Math.max(1,d.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));t.autoRestore===!0&&this._cascadeRestore(e,t.onError);let s=(d,c)=>{if(d.disposed)return;let f=Xn(c.nodes);if(d.lastSnapshot!=null&&f!==""&&f===d.lastFingerprint)return;let p=d.seq+1,h=He(),g=d.lastSnapshot==null||p%d.compactEvery===0?{name:this.name,mode:"full",snapshot:c,seq:p,timestamp_ns:h,format_version:Te}:{name:this.name,mode:"diff",diff:ir(d.lastSnapshot,c),seq:p,timestamp_ns:h,format_version:Te};if(d.tier.filter&&!d.tier.filter(g))return;let _;try{_=d.tier.save(g)}catch(m){t.onError?.(m,d.tier);return}if(_&&typeof _.then=="function"){let w=(d.savePending??Promise.resolve()).then(()=>_,()=>_).then(()=>{d.disposed||(d.seq=p,d.lastSnapshot=c,d.lastFingerprint=f)},b=>{t.onError?.(b,d.tier)});d.savePending=w.finally(()=>{d.savePending===w&&(d.savePending=void 0)})}else d.seq=p,d.lastSnapshot=c,d.lastFingerprint=f},o=(d,c)=>{try{s(d,c)}catch(f){t.onError?.(f,d.tier)}},i=(d,c)=>{if(!c.some(l=>{let v=this.config.messageTier(l[0]);return v>=3&&v<5}))return;if(t.filter){let l=this.tryResolve(d);if(l==null)return;let v=Me(l,Ce("standard"));if(!t.filter(d,v))return}let p,h=()=>(p==null&&(p=this.snapshot()),p);for(let l of n)l.disposed||(l.debounceMs===0?o(l,h()):(l.timer==null&&(l.timer=new Je),l.timer.start(l.debounceMs,()=>{l.disposed||o(l,this.snapshot())})))},a;if(t.paths!=null){let c=(typeof t.paths=="string"?this._pathsMatching(t.paths):t.paths).map(f=>{let p=this.tryResolve(f);return p==null?()=>{}:p.subscribe(h=>i(f,h))});a=()=>{for(let f of c)f()}}else a=this.observe().subscribe((d,c)=>i(d,c));let u=()=>{a();for(let d of n)d.disposed=!0,d.timer?.cancel();this._storageDisposers.delete(u)};return this._storageDisposers.add(u),{dispose:u}}async _cascadeRestore(e,t){for(let n of e){let s;try{s=await n.load?.()}catch(i){t?.(i,n);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===Te&&o.nodes!=null)return this.restore(o),!0}catch(i){t?.(i,n)}}return!1}static async fromStorage(e,t,n){for(let s of t){let o;try{o=await s.load?.()}catch(u){n?.onError?.(u,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===Te&&i.nodes!=null?i:void 0;if(a!=null)try{return r.fromSnapshot(a,n)}catch(u){n?.onError?.(u,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${t.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,t,n){if(e!=null&&t!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,t),this.config.inspectorEnabled){let s={path:e,annotation:t,timestamp_ns:ue(),...n?.actor!=null?{actor:n.actor}:{}};this._traceRing.push(s)}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 t=this._traceRing.toArray().filter(s=>!e(s)),n=this._traceRing.size-t.length;this._traceRing.clear();for(let s of t)this._traceRing.push(s);return n}static diff(e,t){let n=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(t.nodes)),o=[...s].filter(m=>!n.has(m)).sort(),i=[...n].filter(m=>!s.has(m)).sort(),a=[],u=[];for(let m of n){if(!s.has(m))continue;let y=e.nodes[m],w=t.nodes[m],b=y.v,x=w.v;b!=null&&x!=null&&b.id===x.id&&b.version!==x.version&&u.push({path:m,id:b.id,from:b.version,to:x.version});let k=b!=null&&x!=null&&b.id===x.id&&b.version===x.version;for(let T of["type","status","sentinel"]){let E=y[T],A=w[T];E!==A&&a.push({path:m,field:T,from:E,to:A})}if(!k)for(let T of["value","meta"]){let E=y[T],A=w[T];Zn(E,A)||a.push({path:m,field:T,from:E,to:A})}}let d=m=>`${m.from} ${m.to}`,c=new Set(e.edges.map(d)),f=new Set(t.edges.map(d)),p=t.edges.filter(m=>!c.has(d(m))),h=e.edges.filter(m=>!f.has(d(m))),l=new Set(e.subgraphs),v=new Set(t.subgraphs),g=[...v].filter(m=>!l.has(m)).sort(),_=[...l].filter(m=>!v.has(m)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:u,edgesAdded:p,edgesRemoved:h,subgraphsAdded:g,subgraphsRemoved:_}}}});var pr={};xn(pr,{demoShell:()=>fr});module.exports=Tn(pr);Fe();mt();Ue();zt();bn();function ur(r){for(let e of r){let t=e.codePointAt(0);if(t>=19968&&t<=40959||t>=13312&&t<=19903||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519)return!0}return!1}var yn=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011"]),dr=new Set([".",",","!","?",":",";",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]);function cr(r){return r.replace(/[\t\n\r\f ]+/g," ").replace(/^ | $/g,"")}function lr(r){let e=new Intl.Segmenter(void 0,{granularity:"word"}),t=[];for(let n of e.segment(r)){let s=n.segment,o=n.isWordLike??!1,i=[],a=[],u=[],d="",c=null;for(let f of s){let p;f===" "?p="space":f==="\u200B"?p="zero-width-break":f==="\xAD"?p="soft-hyphen":f===`
5
- `?p="hard-break":p="text",c!==null&&p===c?d+=f:(c!==null&&(i.push(d),a.push(c==="text"&&o),u.push(c)),d=f,c=p)}c!==null&&(i.push(d),a.push(c==="text"&&o),u.push(c)),t.push({texts:i,isWordLike:a,kinds:u})}return t}function xt(r,e,t,n,s){let o=cr(r);if(o.length===0)return[];let i=lr(o),a=new Intl.Segmenter(void 0,{granularity:"grapheme"}),u=[],d=[],c=[];for(let _ of i)for(let m=0;m<_.texts.length;m++)u.push(_.texts[m]),d.push(_.kinds[m]),c.push(_.isWordLike[m]);let f=[],p=[],h=[];for(let _=0;_<u.length;_++){let m=u[_],y=d[_],w=c[_];if(y==="text"&&!w&&f.length>0&&p[p.length-1]==="text"&&m.length===1&&(dr.has(m)||yn.has(m))){f[f.length-1]+=m;continue}if(m==="-"&&f.length>0&&p[p.length-1]==="text"&&h[h.length-1]){f[f.length-1]+=m;continue}f.push(m),p.push(y),h.push(w)}let l=n.get(e);l||(l=new Map,n.set(e,l));function v(_){let m=l.get(_);if(m===void 0){s&&(s.misses+=1);let y=t.measureSegment(_,e).width;m=Number.isFinite(y)&&y>=0?y:0,l.set(_,m)}else s&&(s.hits+=1);return m}let g=[];for(let _=0;_<f.length;_++){let m=f[_],y=p[_];if(y!=="text"){g.push({text:m,width:y==="space"?v(" ")*m.length:0,kind:y,graphemeWidths:null});continue}if(ur(m)){let x="";for(let k of a.segment(m)){let T=k.segment;if(x.length>0&&yn.has(T)){x+=T;continue}if(x.length>0){let E=v(x);g.push({text:x,width:E,kind:"text",graphemeWidths:null})}x=T}if(x.length>0){let k=v(x);g.push({text:x,width:k,kind:"text",graphemeWidths:null})}continue}let w=v(m),b=null;if(h[_]&&m.length>1){let x=[];for(let k of a.segment(m))x.push(v(k.segment));x.length>1&&(b=x)}g.push({text:m,width:w,kind:"text",graphemeWidths:b})}return g}function kt(r,e,t,n,s){if(r.length===0)return{lines:[],lineCount:0};let o=[],i=0,a=!1,u=0,d=0,c=0,f=0,p=-1,h=0,l=s.get(n);l||(l=new Map,s.set(n,l));let v=l.get("-");v===void 0&&(v=t.measureSegment("-",n).width,l.set("-",v));function g(b=c,x=f,k=i){let T="";for(let E=u;E<b;E++){let A=r[E];if(!(A.kind==="soft-hyphen"||A.kind==="hard-break"))if(E===u&&d>0&&A.graphemeWidths){let F=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(A.text)].map(G=>G.segment);T+=F.slice(d).join("")}else T+=A.text}if(x>0&&b<r.length){let E=r[b],S=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(E.text)].map(G=>G.segment),F=u===b?d:0;T+=S.slice(F,x).join("")}b>0&&r[b-1]?.kind==="soft-hyphen"&&!(u===b&&d>0)&&(T+="-"),o.push({text:T,width:k,startSegment:u,startGrapheme:d,endSegment:b,endGrapheme:x}),i=0,a=!1,p=-1,h=0}function _(b){return b==="space"||b==="zero-width-break"||b==="soft-hyphen"}function m(b,x,k){a=!0,u=b,d=x,c=b+1,f=0,i=k}function y(b,x,k){a=!0,u=b,d=x,c=b,f=x+1,i=k}for(let b=0;b<r.length;b++){let x=r[b];if(x.kind==="hard-break"){a?g():o.push({text:"",width:0,startSegment:b,startGrapheme:0,endSegment:b,endGrapheme:0}),u=b+1,d=0;continue}let k=x.width;if(!a){k>e&&x.graphemeWidths?w(b,0,x.graphemeWidths):m(b,0,k),_(x.kind)&&(p=b+1,h=x.kind==="space"?i-k:i);continue}let T=i+k;if(T>e+.005){if(_(x.kind)){i+=k,c=b+1,f=0,g(b+1,0,x.kind==="space"?i-k:i);continue}if(p>=0){g(p,0,h),b--;continue}if(k>e&&x.graphemeWidths){g(),w(b,0,x.graphemeWidths);continue}g(),b--;continue}i=T,c=b+1,f=0,_(x.kind)&&(p=b+1,h=x.kind==="space"?i-k:i)}return a&&g(),{lines:o,lineCount:o.length};function w(b,x,k){for(let T=x;T<k.length;T++){let E=k[T];if(!a){y(b,T,E);continue}i+E>e+.005?(g(),y(b,T,E)):(i+=E,c=b,f=T+1)}a&&c===b&&f===k.length&&(c=b+1,f=0)}}function Ie(r){return Math.max(0,Math.min(1,r))}function fr(r){let e=Ie(r?.mainRatio??.65),t=Ie(r?.sideSplit??.5),n=Math.max(0,r?.viewportWidth??1280),s=r?.nodeRegistry??new Map,o=r?.adapter??null,i=r?.layoutFont??"14px monospace",a=r?.onHighlight,u=new Pe("demo-shell"),d=Y(e,{name:"pane/main-ratio"}),c=Y(t,{name:"pane/side-split"}),f=Y(null,{name:"pane/fullscreen"}),p=Y(n,{name:"viewport/width"});u.add(d,{name:"pane/main-ratio"}),u.add(c,{name:"pane/side-split"}),u.add(f,{name:"pane/fullscreen"}),u.add(p,{name:"viewport/width"});let h=V([d,p,f],([N,D,R])=>{let X=N,L=D,B=R;return B==="main"?L:B==="graph"||B==="code"?0:Math.round(L*X)},{name:"pane/main-width"}),l=V([h,p,f],([N,D,R])=>{let X=R,L=D;return X==="main"?0:X==="graph"||X==="code"?L:L-N},{name:"pane/side-width"}),v=V([c,f],([N,D])=>{let R=D;return R==="graph"?1:R==="code"||R==="main"?0:Ie(N)},{name:"pane/graph-height-ratio"}),g=V([v,f],([N,D])=>{let R=D;return R==="code"?1:R==="graph"||R==="main"?0:1-N},{name:"pane/code-height-ratio"});u.add(h,{name:"pane/main-width"}),u.add(l,{name:"pane/side-width"}),u.add(v,{name:"pane/graph-height-ratio"}),u.add(g,{name:"pane/code-height-ratio"});let _=Y(null,{name:"demo/graph-ref"}),m=Y(0,{name:"demo/graph-tick"});u.add(_,{name:"demo/graph-ref"}),u.add(m,{name:"demo/graph-tick"});let y=V([_,m],([N,D])=>{let R=N;return R?Ke(R.describe()):""},{name:"graph/mermaid"}),w=V([_,m],([N,D])=>{let R=N;if(!R)return null;let{expand:X,...L}=R.describe({detail:"standard"});return L},{name:"graph/describe"});u.add(y,{name:"graph/mermaid"}),u.add(w,{name:"graph/describe"});let b=Y(null,{name:"hover/target"});u.add(b,{name:"hover/target"});let x=V([b],([N])=>{let D=N;if(!D)return null;let R=s.get(D.id);return R?R.codeLine:null},{name:"highlight/code-scroll"}),k=V([b],([N])=>{let D=N;if(!D)return null;let R=s.get(D.id);return R?R.visualSelector:null},{name:"highlight/visual"}),T=V([b],([N])=>{let D=N;return D?D.id:null},{name:"highlight/graph"});if(u.add(x,{name:"highlight/code-scroll"}),u.add(k,{name:"highlight/visual"}),u.add(T,{name:"highlight/graph"}),a?.codeScroll){let N=a.codeScroll,D=ke([x],([R])=>{N(R)});u.add(D,{name:"highlight/apply-code-scroll"})}if(a?.visual){let N=a.visual,D=ke([k],([R])=>{N(R)});u.add(D,{name:"highlight/apply-visual"})}if(a?.graph){let N=a.graph,D=ke([T],([R])=>{N(R)});u.add(D,{name:"highlight/apply-graph"})}let E=Y(null,{name:"inspect/selected-node"});u.add(E,{name:"inspect/selected-node"});let A=Ce("standard"),S=V([E,_,m],([N,D,R])=>{let X=D,L=N;if(!X||!L)return null;try{let B=X.resolve(L),z=Me(B,A);return{path:L,...z,value:B.cache}}catch{return null}},{name:"inspect/node-detail"}),F=V([_,m],([N,D])=>{let R=N;return R?R.trace():[]},{name:"inspect/trace-log"});u.add(S,{name:"inspect/node-detail"}),u.add(F,{name:"inspect/trace-log"});let G=Y(!1,{name:"meta/debug"});u.add(G,{name:"meta/debug"});let P=V([G,m],([N,D])=>N?Ke(u.describe()):"",{name:"meta/shell-mermaid"});u.add(P,{name:"meta/shell-mermaid"});let ae=Y("",{name:"layout/code-text"});if(u.add(ae,{name:"layout/code-text"}),o){let N=new Map,D=V([w],([L])=>{let B=L;if(!B)return new Map;let z=new Map;for(let[ee]of Object.entries(B.nodes)){let O=xt(ee,i,o,N),C=kt(O,1/0,o,i,N),U=C.lines.reduce((Z,M)=>Math.max(Z,M.width),0),le=C.lineCount*20;z.set(ee,{width:U,height:le})}return z},{name:"layout/graph-labels",equals:(L,B)=>{if(L===B)return!0;let z=L,ee=B;if(z.size!==ee.size)return!1;for(let[O,C]of z){let U=ee.get(O);if(!U||U.width!==C.width||U.height!==C.height)return!1}return!0}}),R=V([ae,l],([L,B])=>{let z=L;if(!z)return{lineCount:0,lines:[]};let ee=xt(z,i,o,N),O=B-40;return kt(ee,Math.max(100,O),o,i,N)},{name:"layout/code-lines"}),X=V([D],([L])=>{let B=L;if(B.size===0)return 200;let z=0;for(let{width:ee}of B.values())ee>z&&(z=ee);return Math.max(200,Math.round(z+80))},{name:"layout/side-width-hint"});u.add(D,{name:"layout/graph-labels"}),u.add(R,{name:"layout/code-lines"}),u.add(X,{name:"layout/side-width-hint"})}let Ne=0;return{graph:u,setMainRatio(N){u.set("pane/main-ratio",Ie(N))},setSideSplit(N){u.set("pane/side-split",Ie(N))},setFullscreen(N){u.set("pane/fullscreen",N)},setViewportWidth(N){u.set("viewport/width",Math.max(0,N))},setHoverTarget(N){u.set("hover/target",N)},setDemoGraph(N){u.set("demo/graph-ref",N)},bumpGraphTick(){u.set("demo/graph-tick",++Ne)},selectNode(N){u.set("inspect/selected-node",N)},setMetaDebug(N){u.set("meta/debug",N)},setCodeText(N){u.set("layout/code-text",N)},batch(N){Ee(N)},destroy(){u.destroy()}}}0&&(module.exports={demoShell});
@@ -1,7 +0,0 @@
1
- import '../../graph-CWvEUQAq.cjs';
2
- import '../../reactive-layout-DgctbqZo.cjs';
3
- export { D as DemoShellHandle, a as DemoShellOptions, F as FullscreenPane, G as GraphLabelSize, H as HighlightCallbacks, b as HoverPaneType, c as HoverTarget, N as NodeRegistry, d as demoShell } from '../../index-Cwv0KWcU.cjs';
4
- import '../../node-kK3CvTrR.cjs';
5
- import '../../sugar-DQjFmVqb.cjs';
6
- import '../../extra/storage-core.cjs';
7
- import '../../extra/storage-tiers.cjs';
@@ -1,7 +0,0 @@
1
- import '../../graph-D9LFnda9.js';
2
- import '../../reactive-layout-DOTs9P3X.js';
3
- export { D as DemoShellHandle, a as DemoShellOptions, F as FullscreenPane, G as GraphLabelSize, H as HighlightCallbacks, b as HoverPaneType, c as HoverTarget, N as NodeRegistry, d as demoShell } from '../../index-B8YnZpIR.js';
4
- import '../../node-kK3CvTrR.js';
5
- import '../../sugar-fhLIE7TT.js';
6
- import '../../extra/storage-core.js';
7
- import '../../extra/storage-tiers.js';
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-ZLV5SQSX.js";import"../../chunk-DHRX7JX4.js";import"../../chunk-7LIAPXJB.js";import"../../chunk-3G5U5QNE.js";import"../../chunk-C72GO4IZ.js";import"../../chunk-HITNVN6B.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-GHBWHMRZ.js";import"../../chunk-CRVT7D2P.js";import"../../chunk-NTEURFZH.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{a as demoShell};
@@ -1,3 +0,0 @@
1
- "use strict";var tt=Object.defineProperty;var Tn=Object.getOwnPropertyDescriptor;var kn=Object.getOwnPropertyNames;var Nn=Object.prototype.hasOwnProperty;var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var xn=(r,e)=>{for(var t in e)tt(r,t,{get:e[t],enumerable:!0})},On=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kn(e))!Nn.call(r,s)&&s!==t&&tt(r,s,{get:()=>e[s],enumerable:!(n=Tn(e,s))||n.enumerable});return r};var Rn=r=>On(tt({},"__esModule",{value:!0}),r);function $e(){return me>0||Re}function Dt(){return me>0}function ye(r){me>0?Ee.push(r):r()}function re(r){me+=1;let e=!1;try{r()}catch(t){throw e=!0,t}finally{if(me-=1,me===0)if(e){if(!Re){let t=Ee.splice(0);for(let n of t)try{n()}catch{}le.length=0,fe.length=0,be.length=0}}else En()}}function En(){let r=!Re;r&&(Re=!0);let e=[],t=0;try{for(;le.length>0||fe.length>0||be.length>0||r&&Ee.length>0;){if(r&&Ee.length>0){let o=Ee.splice(0);for(let i of o)try{i()}catch(a){e.push(a)}continue}if(t+=1,t>1e3)throw le.length=0,fe.length=0,be.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let s=(le.length>0?le:fe.length>0?fe:be).splice(0);for(let o of s)try{o()}catch(i){e.push(i)}}}finally{r&&(Re=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function Fe(r,e,t){if(e.length===0)return;if(e.length===1){let d=t(e[0][0]);if(d<3||!$e()){r(e);return}(d>=5?be:d===4?fe:le).push(()=>r(e));return}let n=e.length,s=n,o=n,i=n,a=0;for(;a<n&&t(e[a][0])<3;)a++;for(s=a;a<n&&t(e[a][0])===3;)a++;for(o=a;a<n&&t(e[a][0])===4;)a++;i=a;let u=$e();if(s>0){let d=e.slice(0,s);r(d)}if(o>s){let d=e.slice(s,o);u?le.push(()=>r(d)):r(d)}if(i>o){let d=e.slice(o,i);u?fe.push(()=>r(d)):r(d)}if(n>i){let d=e.slice(i,n);u?be.push(()=>r(d)):r(d)}}var me,Re,le,fe,be,Ee,ve=z(()=>{"use strict";me=0,Re=!1,le=[],fe=[],be=[],Ee=[]});function Ct(r,e){let t=new TextEncoder().encode(r.name);if(t.length===0||t.length>255)throw new Error(`encodeEnvelope: codec name "${r.name}" encodes to ${t.length} bytes (must be 1\u2013255)`);let n=r.version;if(!Number.isInteger(n)||n<0||n>65535)throw new Error(`encodeEnvelope: codec.version ${n} out of u16 range (expected integer 0\u201365535)`);let s=2+t.length+2+e.length;if(s>4294967295)throw new Error(`encodeEnvelope: total envelope size ${s} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let o=new Uint8Array(s),i=0;return o[i++]=nt,o[i++]=t.length,o.set(t,i),i+=t.length,o[i++]=n>>>8&255,o[i++]=n&255,o.set(e,i),o}function Gt(r,e){if(r.length<Mt)throw new Error(`decodeEnvelope: bytes too short (${r.length} < ${Mt})`);let t=0,n=r[t++];if(n!==nt)throw new Error(`decodeEnvelope: unsupported envelope version ${n} (expected ${nt})`);let s=r[t++];if(s===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(t+s+2>r.length)throw new Error(`decodeEnvelope: envelope truncated (need ${t+s+2} bytes, have ${r.length})`);let o=new TextDecoder().decode(r.subarray(t,t+s));t+=s;let i=(r[t]<<8|r[t+1])>>>0;t+=2;let a=r.subarray(t),u=e.lookupCodec(o);if(u==null)throw new Error(`decodeEnvelope: codec "${o}" not registered (envelope codec_v=${i})`);return{codec:u,codecVersion:i,payload:a}}function $t(r){r.registerCodec(An)}var An,nt,Mt,rt=z(()=>{"use strict";An={name:"json",version:1,contentType:"application/json",encode(r){let e=JSON.stringify(r);return new TextEncoder().encode(e)},decode(r,e){let t=new TextDecoder().decode(r);return JSON.parse(t)}},nt=1,Mt=4});function Pe(r){if(r==null)return _e;let{type:e,id:t,...n}=r;return{type:e??"system",id:t??"",...n}}var _e,st=z(()=>{"use strict";_e={type:"system",id:""}});function se(){return Math.trunc(performance.now()*1e6)}function Ie(){return Date.now()*1e6}var Le=z(()=>{"use strict"});var we,G,U,W,Q,ee,ue,j,V,M,Te,ot,Sn,it,Dn,Mn,at,Ft,Pt,It,ut,oe=z(()=>{"use strict";we=Symbol.for("graphrefly/START"),G=Symbol.for("graphrefly/DATA"),U=Symbol.for("graphrefly/DIRTY"),W=Symbol.for("graphrefly/RESOLVED"),Q=Symbol.for("graphrefly/INVALIDATE"),ee=Symbol.for("graphrefly/PAUSE"),ue=Symbol.for("graphrefly/RESUME"),j=Symbol.for("graphrefly/TEARDOWN"),V=Symbol.for("graphrefly/COMPLETE"),M=Symbol.for("graphrefly/ERROR"),Te=Object.freeze([U]),ot=Object.freeze([W]),Sn=Object.freeze([Q]),it=Object.freeze([we]),Dn=Object.freeze([V]),Mn=Object.freeze([j]),at=Object.freeze([Te]),Ft=Object.freeze([ot]),Pt=Object.freeze([Sn]),It=Object.freeze([Dn]),ut=Object.freeze([Mn])});function Lt(r){r.registerMessageType(we,{tier:0,wireCrossing:!1}),r.registerMessageType(U,{tier:1,wireCrossing:!1}),r.registerMessageType(Q,{tier:1,wireCrossing:!1,metaPassthrough:!1}),r.registerMessageType(ee,{tier:2,wireCrossing:!1}),r.registerMessageType(ue,{tier:2,wireCrossing:!1}),r.registerMessageType(G,{tier:3,wireCrossing:!0}),r.registerMessageType(W,{tier:3,wireCrossing:!0}),r.registerMessageType(V,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(M,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(j,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var Ve,Vt=z(()=>{"use strict";oe();Ve=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let n=this._messageTypes.get(t);return n!=null?n.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.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 zt(r){return Array.isArray(r)?[...r]:[r]}function Cn(r,e){return r.has(e)||r.has("*")}function jt(r){let e=[];return r((s,o)=>{e.push({kind:"allow",actions:new Set(zt(s)),where:o?.where??(()=>!0)})},(s,o)=>{e.push({kind:"deny",actions:new Set(zt(s)),where:o?.where??(()=>!0)})}),(s,o)=>{let i=!1,a=!1;for(let u of e)Cn(u.actions,o)&&u.where(s)&&(u.kind==="deny"?i=!0:a=!0);return i?!1:a}}function dt(r){let e=Gn.filter(t=>r({type:t,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(t=>t==="human"||t==="llm"||t==="system")?"both":e.length===1?e[0]:e.join("+")}var J,Gn,Ae=z(()=>{"use strict";J=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`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}};Gn=["human","llm","wallet","system"]});function ct(r){if(r===void 0)return null;if(typeof r=="number"){if(!Number.isFinite(r))throw new TypeError(`Cannot hash non-finite number: ${r}`);if(Number.isInteger(r)&&!Number.isSafeInteger(r))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${r}. Cross-language cid parity is not guaranteed for unsafe integers.`);return r}if(typeof r=="string"||typeof r=="boolean"||r===null)return r;if(Array.isArray(r))return r.map(ct);if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r).sort())e[t]=ct(r[t]);return e}return null}function Pn(r){let e=Fn.encode(r),t=e.length,n=t*8,s=t+9+63&-64,o=new Uint8Array(s);o.set(e),o[t]=128;let i=new DataView(o.buffer);i.setUint32(s-4,n>>>0,!1),i.setUint32(s-8,Math.floor(n/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,h=1359893119,g=2600822924,m=528734635,l=1541459225,y=new Uint32Array(64),f=(v,b)=>v>>>b|v<<32-b;for(let v=0;v<s;v+=64){for(let N=0;N<16;N++)y[N]=i.getUint32(v+N*4,!1);for(let N=16;N<64;N++){let A=y[N-15],C=y[N-2],D=f(A,7)^f(A,18)^A>>>3,ae=f(C,17)^f(C,19)^C>>>10;y[N]=y[N-16]+D+y[N-7]+ae>>>0}let b=a,p=u,w=d,x=c,_=h,k=g,O=m,E=l;for(let N=0;N<64;N++){let A=f(_,6)^f(_,11)^f(_,25),C=_&k^~_&O,D=E+A+C+$n[N]+y[N]>>>0,ae=f(b,2)^f(b,13)^f(b,22),ne=b&p^b&w^p&w,Ce=ae+ne>>>0;E=O,O=k,k=_,_=x+D>>>0,x=w,w=p,p=b,b=D+Ce>>>0}a=a+b>>>0,u=u+p>>>0,d=d+w>>>0,c=c+x>>>0,h=h+_>>>0,g=g+k>>>0,m=m+O>>>0,l=l+E>>>0}let T=v=>v.toString(16).padStart(8,"0");return T(a)+T(u)+T(d)+T(c)+T(h)+T(g)+T(m)+T(l)}function lt(r){let e=ct(r??null),t=JSON.stringify(e);return Pn(t).slice(0,16)}function In(){let r=globalThis.crypto;if(r?.randomUUID)return r.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function ft(r,e,t){let n=t?.id??In();if(r===0)return{id:n,version:0};let o=(t?.hash??lt)(e);return{id:n,version:0,cid:o,prev:null}}function Bt(r,e,t){r.version+=1,"cid"in r&&(r.prev=r.cid,r.cid=t(e))}var $n,Fn,Ht=z(()=>{"use strict";$n=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]),Fn=new TextEncoder});function qt(r){return{node:r,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function pt(r){r.prevData=void 0,r.dirty=!1,r.involvedThisWave=!1,r.dataBatch.length=0,r.terminal=void 0}function ze(r){return r.length===0?r:typeof r[0]=="symbol"?[r]:r}function X(r,e,t){let n=Kt(r)?r:[],s=typeof r=="function"?r:typeof e=="function"?e:void 0,o={};return Kt(r)?o=(ht(e)?e:t)??{}:ht(r)?o=r:o=(ht(e)?e:t)??{},new B(n,s,o)}var Ut,Wt,Ln,Vn,ke,B,Kt,ht,de=z(()=>{"use strict";rt();st();ve();Le();Vt();Ae();oe();Ht();Ut=()=>{},Wt=100;Ln=(r,e,t,n)=>{t.direction==="down-in"&&r._onDepMessage(t.depIndex,e)},Vn=(r,e,t,n)=>{let s=r;if(s._status==="completed"||s._status==="errored")return;let o=s._cached,i=o===void 0?[it]:[it,[G,o]];s._status==="dirty"&&i.push(Te),Fe(e,i,s._config.tierOf)},ke=new Ve({onMessage:Ln,onSubscribe:Vn});Lt(ke);$t(ke);B=class r{_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,t,n){this._config=n.config??ke,this._config.onMessage,this._optsName=n.name,this._describeKind=n.describeKind,this._equals=n.equals??Object.is,this._resubscribable=n.resubscribable??!1,this._resetOnTeardown=n.resetOnTeardown??!1,this._autoComplete=n.completeWhenDepsComplete??!0,this._autoError=n.errorWhenDepsError??!0,this._pausable=n.pausable??!0,this._guard=n.guard,this._fn=t,this._partial=n.partial??!1,this._cached=n.initial!==void 0?n.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=n.versioningHash??this._config.defaultHashFn??lt;let s=n.versioning??this._config.defaultVersioning;this._versioningLevel=s,this._versioning=s!=null?ft(s,this._cached===void 0?void 0:this._cached,{id:n.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(qt);let o={};for(let[a,u]of Object.entries(n.meta??{})){let d={initial:u,name:`${n.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};n.guard!=null&&(d.guard=n.guard),n.resubscribable===!0&&(d.resubscribable=!0),o[a]=new r([],void 0,d)}Object.freeze(o),this.meta=o,this._hasMeta=Object.keys(o).length>0;let i=this;this._actions={emit(a){i._emit([[G,a]])},down(a){i._emit(ze(a))},up(a){i._emitUp(ze(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,t){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 n=this._versioningLevel;if(n!=null&&e<=n)return;let s=t?.hash??this._hashFn;s!==this._hashFn&&(this._hashFn=s);let o=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??t?.id,u=i?.version??0,d=ft(e,o,{id:a,hash:s});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=Pe(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let n of this._extraGuards)if(!n(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,n=e?.actor!=null;if(!t&&!n)return;let s=Pe(e?.actor),o=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(s,o))throw new J({actor:s,action:o,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(s,o))throw new J({actor:s,action:o,nodeName:this.name})}this._lastMutation={actor:s,timestamp_ns:Ie()}}down(e,t){let n=ze(e);n.length!==0&&(this._checkGuard(t),this._emit(n))}emit(e,t){this._checkGuard(t),this._emit([[G,e]])}up(e,t){if(this._deps.length===0)return;let n=ze(e);if(n.length===0)return;this._checkGuard(t);let s=t??{internal:!0};this._validateUpTiers(n);for(let o of this._deps)o.node.up?.(n,s)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let n of e){let s=t(n[0]);if(s===3||s===4)throw new Error(`Node "${this.name}": tier-${s} 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,t){if(t!=null&&this._guard!=null){let u=Pe(t);if(!this._guard(u,"observe"))throw new J({actor:u,action:"observe",nodeName:this.name})}let s=this._isTerminal&&this._resubscribable;if(s){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)pt(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let o;try{o=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:s},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof o=="function")try{o()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof o=="function"&&o(),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[t]=this._sinks;this._sinks=t}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,t=0;try{for(let n=0;n<e;n++){let s=n,o=this._deps[n];o.unsub=Ut,o.unsub=o.node.subscribe(i=>{if(o.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of i)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:s},this._actions);u&&this._maybeRunFnOnSettlement()}),t++}}catch(n){this._deps[t].unsub=null;for(let s=0;s<t;s++){let o=this._deps[s];if(o.unsub!=null){let i=o.unsub;o.unsub=null;try{i()}catch{}pt(o)}}throw this._dirtyDepCount=0,n}}_addDep(e){for(let s=0;s<this._deps.length;s++)if(this._deps[s].node===e)return s;let t=this._deps.length,n=qt(e);if(this._deps.push(n),this._sinks==null)return t;n.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(at),n.unsub=Ut;try{n.unsub=e.subscribe(s=>{if(n.unsub===null)return;let o=this._config.tierOf,i=!1;for(let a of s)o(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(s){throw n.unsub=null,this._deps.pop(),this._dirtyDepCount--,s}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(n){this._emit([[M,this._wrapFnError("cleanup threw",n)]])}else if(t!=null&&typeof t=="object"){let n=t.deactivate;if(typeof n=="function")try{n()}catch(s){this._emit([[M,this._wrapFnError("cleanup.deactivate threw",s)]])}}for(let n of this._deps){if(n.unsub!=null){let s=n.unsub;n.unsub=null;try{s()}catch{}}pt(n)}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,t){let n=this._deps[e],s=t[0];if(this._inspectorHooks!=null){let o={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(o)}if(s!==we){if(s===U){this._depDirtied(n);return}if(s===Q){if(this._depInvalidated(n),this._cached===void 0)return;this._emit(Pt);return}if(s===ee||s===ue){this._emit([t]);return}if(s===j){this._emit(ut);return}if(s===G)this._depSettledAsData(n,t[1]);else if(s===W)this._depSettledAsResolved(n);else if(s===V)this._depSettledAsTerminal(n,!0);else if(s===M)this._depSettledAsTerminal(n,t[1]);else{this._emit([t]);return}if(!this._fn){(s===G||s===W)&&this._emit([t]),(s===V||s===M)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(at))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,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 t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Ft),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[M,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(It)}_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([[M,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([[M,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),n=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=t[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let s=this._deps.map(i=>i.terminal),o={prevData:n,terminalDeps:s,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:n};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,o);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([[M,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Wt?(this._rerunDepth=0,this._emit([[M,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Wt} \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,t){let n=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${n}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[Te,e[0]]:e;let n=!0,s=!1,o=!1,i=-1;for(let u of e){let d=t(u[0]);d<i&&(n=!1),d===3&&(s=!0),u[0]===U&&(o=!0),i=d}let a=e;if(!n){let u=e.map((d,c)=>({m:d,i:c,tier:t(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(s&&!o&&this._status!=="dirty"){let u=0;for(;u<a.length&&t(a[u][0])===0;)u++;return u===0?[Te,...a]:[...a.slice(0,u),Te,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===M&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===j||u[0]===Q);if(a.length===0)return;t=a}t=this._frameBatch(t);let s=null;for(let a=0;a<t.length;a++){let u=t[a],d=u[0];if(d!==ee&&d!==ue){s?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===ee?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let h=u[1];if(d===ee)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(h),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(h))c=!1;else if(this._pauseLocks.delete(h),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let g=this._pauseBuffer;this._pauseBuffer=[],this._emit(g)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?s?.push(u):s==null&&(s=t.slice(0,a))}if(s!=null){if(s.length===0)return;t=s}if(this._hasMeta&&t.some(a=>a[0]===j))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(ut)}catch{}let{finalMessages:o,equalsError:i}=this._updateState(t);if(o.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:o})}catch{}}if(o.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of o)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(o);i!=null&&this._emit([[M,i]])}_updateState(e){let t=this._config.tierOf,n,s,o=-1,i=0;for(let c of e)t(c[0])===3&&i++;let a=i<=1,u=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===G){u=c;break}}for(let c=0;c<e.length;c++){let h=e[c],g=h[0];if(g===G){if(h.length>=2){let m=!1;if(a&&this._cached!==void 0)try{m=this._equals(this._cached,h[1])}catch(l){s=this._wrapFnError("equals threw",l),o=c;break}if(m){n==null&&(n=e.slice(0,c)),n.push(ot),this._status="resolved";continue}this._cached=h[1],this._versioning!=null&&(u<0||c===u)&&Bt(this._versioning,h[1],this._hashFn)}this._status="settled",n?.push(h)}else if(n?.push(h),g===U)this._status="dirty";else if(g===W)this._status="resolved";else if(g===V){this._status="completed";{let m=this._config.rigorRecorder;if(m!=null)try{m.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(g===M){this._status="errored";{let m=this._config.rigorRecorder;if(m!=null)try{m.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(g===Q){if(this._cached!==void 0){let l=this._config.rigorRecorder;if(l!=null)try{l.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let m=this._cleanup;if(typeof m=="function"){this._cleanup=void 0;try{m()}catch{}}else if(m!=null&&typeof m=="object"){let l=m.invalidate;if(typeof l=="function")try{l()}catch{}}}else g===j&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=o>=0?n??e.slice(0,o):n??e;return s!=null?{finalMessages:d,equalsError:s}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let n of t)n(e)};_dispatchOrAccumulate(e){if(Dt()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ye(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}Fe(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);Fe(this._deliverToSinks,t,this._config.tierOf)}},Kt=r=>Array.isArray(r),ht=r=>typeof r=="object"&&r!=null&&!Array.isArray(r)});function F(r,e){return X([],{...e,initial:r})}function pe(r,e){return X((n,s,o)=>r(s,o)??void 0,{describeKind:"producer",...e})}function S(r,e,t){return X(r,(s,o,i)=>{let a=s.map((u,d)=>u!=null&&u.length>0?u.at(-1):i.prevData[d]);o.emit(e(a,i))},{describeKind:"derived",...t})}function Ne(r,e,t){return X(r,(s,o,i)=>{let a=s.map((u,d)=>u!=null&&u.length>0?u.at(-1):i.prevData[d]);return e(a,o,i)??void 0},{describeKind:"effect",...t})}var he=z(()=>{"use strict";de()});function gt(r){return{describeKind:"producer",...r}}function Yt(r,e){return pe(t=>{let n=!1;try{for(let s of r){if(n)return;t.emit(s)}n||t.down([[V]])}catch(s){n||t.down([[M,s]])}return()=>{n=!0}},gt(e))}function zn(r){return r!=null&&typeof r.then=="function"}function jn(r,e){let{signal:t,...n}=e??{};return pe(s=>{let o=!1,i=()=>{o||(o=!0,s.down([[M,t.reason]]))};if(t?.aborted){i();return}return t?.addEventListener("abort",i,{once:!0}),Promise.resolve(r).then(a=>{o||(o=!0,t?.removeEventListener("abort",i),s.emit(a),s.down([[V]]))},a=>{o||(o=!0,t?.removeEventListener("abort",i),s.down([[M,a]]))}),()=>{o=!0,t?.removeEventListener("abort",i)}},gt(n))}function Bn(r,e){let{signal:t,...n}=e??{};return pe(s=>{let o=new AbortController,i=()=>o.abort(t?.reason);t?.aborted?o.abort(t.reason):t?.addEventListener("abort",i,{once:!0});let a=t??o.signal,u=!1,d=r[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(h=>{if(!(u||a.aborted)){if(h.done){s.down([[V]]);return}s.emit(h.value),c()}},h=>{!u&&!a.aborted&&s.down([[M,h]])})};return c(),()=>{u=!0,t?.removeEventListener("abort",i),o.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},gt(n))}function Hn(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"}function Jt(r,e){if(Hn(r))return r;if(zn(r))return jn(r,e);if(r!=null){let t=r;if(typeof t[Symbol.asyncIterator]=="function")return Bn(r,e);if(typeof t[Symbol.iterator]=="function")return Yt(r,e)}return Un(r)}function Un(...r){return Yt(r,void 0)}function ie(r){return r.subscribe(()=>{})}var Qt=z(()=>{"use strict";oe();he()});var je=z(()=>{"use strict";Qt()});function bt(r,e){if(e!=null&&e.length>0)return new Set(e);switch(r){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;case"spec":return new Set(["type","deps","meta","value"]);default:return new Set(["type","deps"])}}function qn(r){return r._describeKind!=null?r._describeKind:r._deps.length>0?"derived":r._fn!=null?"producer":"state"}function Kn(r){let e={};for(let[t,n]of Object.entries(r.meta))try{e[t]=n.cache}catch{}return e}function yt(r,e,t){let n=e==null,s=!n&&e!=null?[...e].filter(c=>c.startsWith("meta.")).map(c=>c.slice(5)):null,o=n||e.has("meta")||s!=null&&s.length>0,i="state",a=[];r instanceof B&&(i=qn(r),a=r._deps.map(c=>c.node.name??""));let u={type:i,deps:a};(n||e.has("status"))&&(u.status=r.status);let d=r instanceof B?r._guard:void 0;if(o){let c={...Kn(r)};if(d!=null&&c.access===void 0&&(c.access=dt(d)),s!=null&&s.length>0&&!e.has("meta")){let h={};for(let g of s)g in c&&(h[g]=c[g]);u.meta=h}else u.meta=c}if(r.name!=null&&(u.name=r.name),(n||e.has("value"))&&(!t||i==="state")){r.status==="sentinel"&&(u.sentinel=!0);try{u.value=r.cache}catch{}}if((n||e.has("v"))&&r.v!=null){let c={id:r.v.id,version:r.v.version};"cid"in r.v&&(c.cid=r.v.cid,c.prev=r.v.prev),u.v=c}return(n||e.has("guard"))&&d!=null&&(u.guard=dt(d)),(n||e.has("lastMutation"))&&r.lastMutation!=null&&(u.lastMutation=r.lastMutation),u}var Zt=z(()=>{"use strict";Ae();de()});function vt(r,e){if(Object.is(r,e))return!0;if(r==null||e==null||typeof r!="object"||typeof e!="object")return!1;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let o=0;o<r.length;o++)if(!vt(r[o],e[o]))return!1;return!0}if(Array.isArray(e))return!1;let t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;let s=new Set(n);for(let o of t)if(!s.has(o)||!vt(r[o],e[o]))return!1;return!0}function en(r,e){return`${r}\0${e}`}function _t(r,e){let t=[],n=new Set(r.subgraphs),s=new Set(e.subgraphs),o=[];for(let f of s)n.has(f)||o.push(f);o.sort();for(let f of o)t.push({type:"subgraph-mounted",path:f});let i=new Set(Object.keys(r.nodes)),a=new Set(Object.keys(e.nodes)),u=[];for(let f of a)i.has(f)||u.push(f);u.sort();for(let f of u)t.push({type:"node-added",path:f,node:{...e.nodes[f]}});let d=[];for(let f of a){if(!i.has(f))continue;let T=r.nodes[f]?.meta,v=e.nodes[f]?.meta;T==null&&v==null||vt(T??{},v??{})||d.push(f)}d.sort();for(let f of d)t.push({type:"node-meta-changed",path:f,prevMeta:r.nodes[f]?.meta??{},nextMeta:e.nodes[f]?.meta??{}});let c=new Map;for(let f of r.edges)c.set(en(f.from,f.to),f);let h=new Map;for(let f of e.edges)h.set(en(f.from,f.to),f);let g=[];for(let[f,T]of h)c.has(f)||g.push(T);g.sort((f,T)=>f.from<T.from?-1:f.from>T.from?1:f.to<T.to?-1:f.to>T.to?1:0);for(let f of g)t.push({type:"edge-added",from:f.from,to:f.to});let m=[];for(let[f,T]of c)h.has(f)||m.push(T);m.sort((f,T)=>f.from<T.from?-1:f.from>T.from?1:f.to<T.to?-1:f.to>T.to?1:0);for(let f of m)t.push({type:"edge-removed",from:f.from,to:f.to});let l=[];for(let f of i)a.has(f)||l.push(f);l.sort();for(let f of l)t.push({type:"node-removed",path:f});let y=[];for(let f of n)s.has(f)||y.push(f);y.sort();for(let f of y)t.push({type:"subgraph-unmounted",path:f});return{events:t,flushedAt_ns:se()}}var tn=z(()=>{"use strict";Le()});var Be,nn=z(()=>{"use strict";Be=class{_timer;_gen=0;start(e,t){this.cancel(),this._gen+=1;let n=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,n===this._gen&&t()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var De,rn=z(()=>{"use strict";De=class{constructor(e){this.capacity=e;if(!Number.isInteger(e)||e<=0)throw new Error(`RingBuffer capacity must be a positive integer (got ${e})`);this.buf=new Array(e)}buf;head=0;_size=0;get size(){return this._size}get maxSize(){return this.capacity}push(e){let t=(this.head+this._size)%this.capacity;this.buf[t]=e,this._size<this.capacity?this._size++:this.head=(this.head+1)%this.capacity}shift(){if(this._size===0)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head=(this.head+1)%this.capacity,this._size--,e}at(e){if(this._size===0)return;let t=e<0?this._size+e:e;if(!(t<0||t>=this._size))return this.buf[(this.head+t)%this.capacity]}toArray(){let e=new Array(this._size);for(let t=0;t<this._size;t++)e[t]=this.buf[(this.head+t)%this.capacity];return e}clear(){for(let e=0;e<this._size;e++)this.buf[(this.head+e)%this.capacity]=void 0;this.head=0,this._size=0}}});function sn(r,e,t,n={}){let s=e in r.nodes,o=t in r.nodes;if(!s)return He(e,t,"no-such-from");if(!o)return He(e,t,"no-such-to");let i=n.maxDepth;if(i!=null&&(!Number.isInteger(i)||i<0))throw new Error("explainPath: maxDepth must be an integer >= 0");if(e===t){if(n.findCycle===!0){let d=Yn(r,e,n);if(d!=null)return d}let u=Ue(e,r.nodes[e],0,n);return We(e,t,[u])}if(i===0)return He(e,t,"no-path");let a=on(r,e,t,i);return a.found?We(e,t,an(r,a.pathOrder,n)):He(e,t,a.truncated?"max-depth-exceeded":"no-path")}function on(r,e,t,n){let s=new Map,o=[{path:t,depth:0}],i=new Set([t]),a=0,u=!1;for(;a<o.length;){let h=o[a++];if(h.path===e)break;if(n!=null&&h.depth>=n){let y=r.nodes[h.path];y?.deps&&y.deps.length>0&&(u=!0);continue}let g=r.nodes[h.path];if(g==null)continue;let m=g.deps??[],l=new Map;for(let y=0;y<m.length;y++){let f=m[y];if(!f)continue;let T=l.get(f);T==null&&(T=[],l.set(f,T)),T.push(y)}for(let[y,f]of l)i.has(y)||(i.add(y),s.set(y,{from:h.path,depIndices:f}),o.push({path:y,depth:h.depth+1}))}if(!s.has(e))return{found:!1,pathOrder:[],truncated:u};let d=[{path:e}],c=e;for(;c!==t;){let h=s.get(c);if(h==null)return{found:!1,pathOrder:[],truncated:!1};d[d.length-1].depIndices=h.depIndices,d.push({path:h.from}),c=h.from}return{found:!0,pathOrder:d,truncated:!1}}function Yn(r,e,t){let n=r.nodes[e];if(n==null)return null;let s=n.deps??[],o=[];for(let a=0;a<s.length;a++)s[a]===e&&o.push(a);if(o.length>0){let a=Ue(e,n,0,t);a.dep_index=o[0];let u=Ue(e,n,1,t);return We(e,e,[a,u])}let i=null;for(let a=0;a<s.length;a++){let u=s[a];if(!u||u===e)continue;let d=on(r,u,e,t.maxDepth);d.found&&(i==null||d.pathOrder.length<i.pathOrder.length)&&(i=d,i={found:!0,pathOrder:[{path:e,depIndices:[a]},...d.pathOrder],truncated:!1})}return i==null?null:We(e,e,an(r,i.pathOrder,t))}function an(r,e,t){return e.map((n,s)=>{let o=r.nodes[n.path],i=Ue(n.path,o,s,t);return n.depIndices!=null&&n.depIndices.length>0&&(i.dep_index=n.depIndices[0],n.depIndices.length>1&&(i.dep_indices=[...n.depIndices])),i})}function Ue(r,e,t,n){let s={path:r,type:e.type,hop:t};e.status!==void 0&&(s.status=e.status),"value"in e&&(s.value=e.value),e.v!=null&&(s.v=e.v);let o=n.annotations?.get(r)??e.annotation;o!=null&&(s.annotation=o);let i=n.lastMutations?.get(r)??e.lastMutation;return i!=null&&(s.lastMutation=i),s}function We(r,e,t){return un(r,e,!0,"ok",t)}function He(r,e,t){return un(r,e,!1,t,[])}function un(r,e,t,n,s){let o=Jn(r,e,t,n,s);return{from:r,to:e,found:t,reason:n,steps:s,text:o,toJSON(){return{from:r,to:e,found:t,reason:n,steps:s}}}}function Jn(r,e,t,n,s){if(!t)switch(n){case"no-such-from":return`explainPath: no node named "${r}"`;case"no-such-to":return`explainPath: no node named "${e}"`;case"max-depth-exceeded":return`explainPath: no path from "${r}" to "${e}" within maxDepth`;default:return`explainPath: no path from "${r}" to "${e}"`}let o=[`Causal path: ${r} \u2192 ${e} (${s.length} step(s))`];for(let i of s){let u=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(o.push(u),"value"in i&&o.push(` value: ${Qn(i.value)}`),i.annotation!=null&&o.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let d=i.lastMutation.actor;o.push(` actor: ${d.type}${d.id?`:${d.id}`:""}`)}}return o.join(`
2
- `)}function Qn(r){if(r===void 0)return"<sentinel>";if(r===null)return"null";if(typeof r=="string")return JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean"||typeof r=="bigint")return String(r);try{let e=JSON.stringify(r);return e.length>80?`${e.slice(0,77)}...`:e}catch{return String(r)}}var dn=z(()=>{"use strict"});function cn(r){let e=new WeakSet,t=new WeakSet,n=[r],s=0;for(;n.length>0;){let o=n.pop();s+=Zn(o,e,t,n)}return s}function Zn(r,e,t,n){if(r==null)return 0;switch(typeof r){case"number":return H.number;case"boolean":return H.boolean;case"string":return H.string+r.length*2;case"bigint":return H.bigint+er(r);case"symbol":return H.symbol;case"function":return e.has(r)?0:(e.add(r),H.function);case"undefined":return 0}let o=r;if(e.has(o))return 0;e.add(o);let i=o[Xn];if(typeof i=="function")try{let d=i.call(o);if(typeof d=="number"&&Number.isFinite(d))return d}catch{}if(o instanceof Date)return H.date;if(o instanceof RegExp)return H.regexp+o.source.length*2;if(o instanceof Error){let d=o.message?o.message.length*2:0,c=o.stack?o.stack.length*2:0;return H.error+d+c}if(typeof URL<"u"&&o instanceof URL)return H.url+o.href.length*2;if(typeof Promise<"u"&&o instanceof Promise)return H.promise;if(o instanceof WeakMap)return H.weakmap;if(o instanceof WeakSet)return H.weakset;if(o instanceof Map){let d=H.map;for(let[c,h]of o)d+=H.mapEntry,n.push(c),n.push(h);return d}if(o instanceof Set){let d=H.set;for(let c of o)d+=H.setEntry,n.push(c);return d}if(Array.isArray(o)){let d=H.array+o.length*8;for(let c of o)n.push(c);return d}if(o instanceof ArrayBuffer)return t.has(o)?0:(t.add(o),o.byteLength);if(ArrayBuffer.isView(o)){let d=o;return t.has(d.buffer)?48:(t.add(d.buffer),d.buffer.byteLength+48)}let a=H.object,u=Object.keys(o);for(let d of u){a+=H.string+d.length*2;try{n.push(o[d])}catch{}}return a}function er(r){let e=r<0n?-r:r;if(e===0n)return 0;let t=e.toString(2).length;return Math.ceil(t/32)*8}var H,Xn,ln=z(()=>{"use strict";H={object:56,array:64,string:40,number:8,boolean:4,null:0,undefined:0,symbol:40,bigint:16,function:120,map:72,set:72,mapEntry:40,setEntry:24,date:24,regexp:48,error:64,url:80,promise:48,weakmap:40,weakset:40},Xn=Symbol.for("sizeof")});function fn(r,e){let t=e?.topN??10,n=r.describe({detail:"standard"}),s=[],o=r._collectObserveTargets;typeof o=="function"&&o.call(r,"",s);let i=new Map;for(let[g,m]of s)i.set(g,m);let a=[];for(let[g,m]of Object.entries(n.nodes)){let l=i.get(g),y=l instanceof B?l:null,f=y?cn(y.cache):0,T=y?y._sinkCount:0,v=m.deps?.length??0,b=m.type==="effect"&&T===0,p=T===0?m.type==="effect"?"orphan-effect":m.type==="derived"?"idle-derived":m.type==="producer"?"idle-producer":null:null;a.push({path:g,type:m.type,status:m.status??"unknown",valueSizeBytes:f,subscriberCount:T,depCount:v,isOrphanEffect:b,orphanKind:p})}let u=a.reduce((g,m)=>g+m.valueSizeBytes,0),d=(g,m)=>[...a].sort(m??((l,y)=>y[g]-l[g])).slice(0,t),c=a.filter(g=>g.orphanKind!=null),h=a.filter(g=>g.isOrphanEffect);return{nodeCount:a.length,edgeCount:n.edges.length,subgraphCount:n.subgraphs.length,nodes:a,totalValueSizeBytes:u,hotspots:{byValueSize:d("valueSizeBytes"),bySubscriberCount:d("subscriberCount"),byDepCount:d("depCount")},orphans:c,orphanEffects:h}}var pn=z(()=>{"use strict";de();ln()});function qe(r,e){let t=Math.max(16,r.size*4),n=0;for(;r.size>0;){if(n++>=t){console.error(`[Graph "${e}".destroy] disposer drain exceeded cap (${t}); ${r.size} disposer(s) discarded`),r.clear();return}let s=r.values().next();if(s.done)return;let o=s.value;r.delete(o);try{o()}catch(i){console.error(`[Graph "${e}".destroy] disposer threw:`,i)}}}function vn(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"&&typeof r.down=="function"}function tr(r){if(r!=null)return vn(r)?r.cache:r}function ge(r){return r!=null&&typeof r=="object"&&"cache"in r&&typeof r.subscribe=="function"&&typeof r.down=="function"}function ce(r){return ge(r)?r.cache??"":r}function hn(r){return ge(r)?r.cache??0:r}function gn(r){return ge(r)?r.cache??!1:r}function nr(r){let e=[];for(let t of Object.keys(r).sort()){let n=r[t].v;n!=null&&e.push(`${t} ${n.id} ${n.version}`)}return e.join(`
3
- `)}function mn(r){if(r.version!==xe)throw new Error(`unsupported snapshot version ${String(r.version)} (expected ${xe})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in r))throw new Error(`snapshot missing required key "${e}"`);if(typeof r.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof r.nodes!="object"||r.nodes===null||Array.isArray(r.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(r.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(r.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function rr(r,e){let t=new WeakMap,n=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=t.get(s);if(i==null&&(i=new WeakSet,t.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,u=o.constructor;if(a!==u)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let g=o;if(s.length!==g.length)return!1;for(let m=0;m<s.length;m++)if(!n(s[m],g[m]))return!1;return!0}if(s instanceof Map){let g=o;if(s.size!==g.size)return!1;for(let[m,l]of s)if(!g.has(m)||!n(l,g.get(m)))return!1;return!0}if(s instanceof Set){let g=o;if(s.size!==g.size)return!1;for(let m of s){let l=!1;for(let y of g)if(n(m,y)){l=!0;break}if(!l)return!1}return!0}if(ArrayBuffer.isView(s)){let g=s,m=o;if(g.length!==m.length)return!1;for(let l=0;l<g.length;l++)if(g[l]!==m[l])return!1;return!0}let d=Object.keys(s),c=Object.keys(o);if(d.length!==c.length)return!1;let h=new Set(c);for(let g of d)if(!h.has(g)||!n(s[g],o[g]))return!1;return!0};return n(r,e)}function sr(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ke(r){let e="^";for(let t=0;t<r.length;t+=1){let n=r[t];if(n==="*"){e+=".*";continue}if(n==="?"){e+=".";continue}if(n==="["){let s=r.indexOf("]",t+1);if(s<=t+1){e+="\\[";continue}let o=r.slice(t+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,t=s;continue}e+=sr(n)}return e+="$",new RegExp(e)}function wt(r){if(typeof r=="string")return JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean"||r==null)return String(r);try{return JSON.stringify(r)}catch{return"[unserializable]"}}function ar(r){return r==="none"?ir:r==="ansi"||r==null?or:{data:r.data??"",dirty:r.dirty??"",resolved:r.resolved??"",invalidate:r.invalidate??"",pause:r.pause??"",resume:r.resume??"",complete:r.complete??"",error:r.error??"",teardown:r.teardown??"",derived:r.derived??"",path:r.path??"",reset:r.reset??""}}function bn(r){if(r==null)return{};let e=r.detail;return e==="full"?{...r,structured:r.structured??!0,timeline:r.timeline??!0,causal:r.causal??!0,derived:r.derived??!0}:e==="minimal"?{...r,structured:r.structured??!0}:r.format==="stage-log"?{...r,structured:r.structured??!0,timeline:r.timeline??!0}:r}function ur(r,e,t){for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<32||s===127)throw new Error(`Graph "${e}": ${t} "${r}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${n})`)}}function Tt(r,e,t){if(r==="")throw new Error(`Graph "${e}": ${t} name must be non-empty`);if(r.includes(L))throw new Error(`Graph "${e}": ${t} "${r}" must not contain '${L}' (path separator)`);if(r===Z)throw new Error(`Graph "${e}": ${t} name "${Z}" is reserved for meta companion paths`);ur(r,e,t)}function dr(r,e){if(r==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let t=r.split(L);for(let n of t)if(n==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return t}function cr(r,e){let t=!1;for(let s of r)if(!e.isMetaPassthrough(s[0])){t=!0;break}return t?r.filter(s=>e.isMetaPassthrough(s[0])):r}function _n(r){for(let e of r._mounts.values())_n(e);for(let e of r._nodes.values())try{e.down([[j]],{internal:!0})}catch{}}function lr(r,e){let t=te.diff(r,e),n={};for(let s of t.nodesAdded){let o=e.nodes[s];o!=null&&(n[s]=o)}return{...t,nodesAddedFull:n}}function yn(r,e,t,n={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return n.withDetail?s:[];if(!n.both&&t!=="upstream"&&t!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=n.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return n.withDetail?s:[];let i=new Map,a=new Map,u=new Map,d=new Map,c=new Set;for(let[b,p]of Object.entries(r.nodes)){if(!b)continue;c.add(b);let w=p.deps??[];i.set(b,w);for(let x of w)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(b))}for(let b of r.edges){if(b==null||typeof b!="object")continue;let p=typeof b.from=="string"?b.from:"",w=typeof b.to=="string"?b.to:"";!p||!w||(c.add(p),c.add(w),d.has(p)||d.set(p,new Set),d.get(p).add(w),u.has(w)||u.set(w,new Set),u.get(w).add(p))}if(!c.has(e))return n.withDetail?s:[];let h=n.both===!0,g=b=>{if(h){let _=i.get(b)??[],k=u.get(b),O=a.get(b),E=d.get(b),N=[..._];return k&&N.push(...k),O&&N.push(...O),E&&N.push(...E),N}if(t==="upstream"){let _=i.get(b)??[],k=u.get(b);return k?[..._,...k]:_}let p=a.get(b),w=d.get(b),x=p?[...p]:[];return w&&x.push(...w),x},m=new Set([e]),l=new Map,y=[{path:e,depth:0}],f=0,T=!1;for(;f<y.length;){let b=y[f++];if(o!=null&&b.depth>=o){g(b.path).length>0&&(T=!0);continue}for(let p of g(b.path))!p||m.has(p)||(m.add(p),l.set(p,b.depth+1),y.push({path:p,depth:b.depth+1}))}let v=[...l.keys()].sort((b,p)=>b<p?-1:b>p?1:0);return n.withDetail?{paths:v,depths:l,truncated:T}:v}function fr(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++){let n=r[t],s=e[t];if(n.path!==s.path||n.type!==s.type||n.status!==s.status||n.hop!==s.hop||n.dep_index!==s.dep_index||n.annotation!==s.annotation||n.value!==s.value||n.lastMutation!==s.lastMutation)return!1;let o=n.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}var L,Z,xe,or,ir,te,kt=z(()=>{"use strict";st();ve();Le();Ae();oe();Zt();de();he();tn();je();nn();rn();rt();dn();pn();L="::",Z="__meta__",xe=1;or={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"},ir={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};te=class r{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;_factory;_factoryArgs;constructor(e,t){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===Z)throw new Error(`Graph name "${Z}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...t??{}}),this.config=t?.config??ke,this._traceRing=new De(t?.traceCapacity??1e3),t?.versioning!=null&&this.setVersioning(t.versioning),typeof t?.factory=="string"&&(this._factory=t.factory,t.factoryArgs!==void 0&&(this._factoryArgs=t.factoryArgs))}tagFactory(e,t){return this._factory=e,this._factoryArgs=t,this}ancestors(e=!0){let t=[],n=e?this:this._parent;for(;n!=null;)t.push(n),n=n._parent;return t}get topology(){return this._topology==null&&(this._topology=pe(e=>{let t=n=>{e.emit(n)};return this._topologyEmitters.add(t),()=>{this._topologyEmitters.delete(t)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let t of this._topologyEmitters)t(e)}nameOf(e){return this._nodeToName.get(e)}add(e,t){let n=e.name,s=t?.name??n;if(s==null||s==="")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 o=s,i=t?.annotation;if(Tt(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" 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(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:se()})),e}setVersioning(e){if(e!=null)for(let t of this._nodes.values())t instanceof B&&t._applyVersioning(e)}remove(e){Tt(e,this.name,"remove");let t=this._mounts.get(e);if(t){let o={kind:"mount",nodes:[],mounts:[]},i=[];t._collectObserveTargets("",i);for(let[a,u]of i)a.includes(`${L}${Z}${L}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...t._collectSubgraphs(`${e}${L}`)),this._mounts.delete(e),t._parent=void 0,_n(t),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(n),n.down([[j]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let t=typeof e=="function"?e:(()=>{let o=Ke(e);return i=>o.test(i)})(),n={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>t(o));for(let o of s){let i=this.remove(o);n.nodes.push(...i.nodes),n.mounts.push(...i.mounts)}return n.nodes.sort(),n.mounts.sort(),n}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),t=this._nodes,n=0;return{[Symbol.iterator](){return this},next(){if(n>=e.length)return{value:void 0,done:!0};let s=e[n++];return{value:[s,t.get(s)],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 t=this._nodes.get(e);if(!t)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return t}get(e){return this.node(e).cache}set(e,t,n){let s=n?.internal===!0;this.node(e).down([[G,t]],{actor:n?.actor,internal:s,delivery:"write"})}setAll(e,t){let n=Symbol.iterator in e?e:Object.entries(e);re(()=>{for(let[s,o]of n)this.set(s,o,t)})}invalidate(e,t){let n=t?.internal===!0;this.node(e).down([[Q]],{actor:t?.actor,internal:n,delivery:"write"})}error(e,t,n){let s=n?.internal===!0;this.node(e).down([[M,t]],{actor:n?.actor,internal:s,delivery:"write"})}complete(e,t){let n=t?.internal===!0;this.node(e).down([[V]],{actor:t?.actor,internal:n,delivery:"write"})}_registerSelfPruningKeepalive(e){let t,n,s=()=>{t?.(),t=void 0,n?.(),n=void 0};t=e.subscribe(o=>{for(let i of o){let a=i[0];if(a===j||a===V||a===M){s();return}}}),n=this.addDisposer(s)}_wireSignalToRemove(e,t){if(t==null)return;let n=()=>{try{this.remove(e)}catch{}};if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0}),this.addDisposer(()=>t.removeEventListener("abort",n))}derived(e,t,n,s){let o=t.map(m=>this.resolve(m)),{keepAlive:i,annotation:a,equals:u,initial:d,meta:c,signal:h}=s??{},g=S(o,n,{name:e,...u!=null?{equals:u}:{},...d!==void 0?{initial:d}:{},...c!=null?{meta:c}:{}});return this.add(g,{name:e,...a!=null?{annotation:a}:{}}),i===!0&&this._registerSelfPruningKeepalive(g),this._wireSignalToRemove(e,h),g}effect(e,t,n,s){let o=t.map(c=>this.resolve(c)),{annotation:i,meta:a,signal:u}=s??{},d=Ne(o,n,{name:e,...a!=null?{meta:a}:{}});return this.add(d,{name:e,...i!=null?{annotation:i}:{}}),this._wireSignalToRemove(e,u),d}produce(e,t,n){if(t===void 0)throw new Error(`Graph "${this.name}".produce("${e}", \u2026): source must not be \`undefined\` \u2014 undefined is the global SENTINEL (spec \xA71.1). Pass \`null\` for nullary DATA, or a Promise/AsyncIterable/Iterable for async sources.`);if(t!==null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function")throw new Error(`Graph "${this.name}".produce("${e}", \u2026): Node sources are rejected. For Node\u2192Node, use graph.derived(name, [path], ([v]) => v, { keepAlive: true }) \u2014 fromAny passes Nodes through verbatim and silently drops opts.`);let{annotation:s,meta:o,equals:i,signal:a}=n??{},u=Jt(t,{name:e,...o!=null?{meta:o}:{},...i!=null?{equals:i}:{},...a!=null?{signal:a}:{}});return this.add(u,{name:e,...s!=null?{annotation:s}:{}}),this._wireSignalToRemove(e,a),u}batch(e){re(e)}edges(e){let t=e?.recursive===!0,n=new Map;if(!t){for(let[u,d]of this._nodes)n.set(d,u);let a=[];for(let[u,d]of this._nodes)if(d instanceof B)for(let c of d._deps){let h=n.get(c.node);h!=null&&a.push([h,u])}return a.sort((u,d)=>u[0]<d[0]?-1:u[0]>d[0]?1:u[1]<d[1]?-1:u[1]>d[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,u]of s)o.set(u,a);let i=[];for(let[a,u]of s)if(u instanceof B)for(let d of u._deps){let c=o.get(d.node);c!=null&&i.push([c,a])}return i.sort((a,u)=>a[0]<u[0]?-1:a[0]>u[0]?1:a[1]<u[1]?-1:a[1]>u[1]?1:0),i}mount(e,t){if(t===void 0){let s=new r(e);return this.mount(e,s)}if(typeof t=="function"){let s=new r(e);return t(s),this.mount(e,s)}let n=t;if(Tt(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 s=this;s!=null;s=s._parent)if(s===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 t=dr(e,this.name);return this._resolveFromSegments(t)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let t=e;if(t[0]===this.name&&(t=t.slice(1),t.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let n=t[0],s=t.slice(1);if(s.length===0){let a=this._nodes.get(n);if(a)return a;throw this._mounts.has(n)?new Error(`Graph "${this.name}": path ends at subgraph "${n}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${n}"`)}let o=this._nodes.get(n);if(o&&s.length>0&&s[0]===Z)return this._resolveMetaChainFromNode(o,s,t.join(L));let i=this._mounts.get(n);if(!i)throw this._nodes.has(n)?new Error(`Graph "${this.name}": "${n}" is a node; trailing path "${s.join(L)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${n}"`);return i.resolve(s.join(L))}_resolveMetaChainFromNode(e,t,n){let s=e,o=0,i=[...t];for(;o<i.length;){if(i[o]!==Z)throw new Error(`Graph "${this.name}": expected ${Z} segment in meta path "${n}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${Z} in "${n}"`);let a=i[o+1],u=s.meta[a];if(!u)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${n}"`);s=u,o+=2}return s}signal(e,t){if(t?.internal!==!0){for(let s of e)if(this.config.messageTier(s[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 n=[];if(this._signalDeliver(e,t??{},new Set,n),n.length>0)throw n[0]}_signalDeliver(e,t,n,s){for(let u of this._mounts.values())u._signalDeliver(e,t,n,s);let i=t.internal===!0?{internal:!0}:{actor:t.actor,delivery:"signal"},a=cr(e,this.config);for(let u of[...this._nodes.keys()].sort()){let d=this._nodes.get(u);if(!n.has(d)){n.add(d);try{d.down(e,i)}catch(c){if(c instanceof J)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(d,a,n,i,s)}}}_signalMetaSubtree(e,t,n,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!n.has(a)){n.add(a);try{a.down(t,s)}catch(u){if(u instanceof J)throw u;o.push(u)}this._signalMetaSubtree(a,t,n,s,o)}}}describe(e){if(e?.reactive==="diff")return this._describeReactiveDiff(e);if(e?.reactive===!0)return this._describeReactive(e);let t=tr(e?.actor),n=e?.filter;if(e?.detail!=null&&e?.fields!=null)throw new TypeError("Graph.describe(): pass either `detail` or `fields`, not both. `detail: 'spec'` is the canonical spec projection; use `fields` only when you need a custom subset.");let s=bt(e?.detail,e?.fields),o=e?.detail==="spec",i=s,a=[];this._collectObserveTargets("",a);let u=new Map;for(let[p,w]of a)u.set(w,p);let d=[];{let p=a.map(([,_])=>_),w=new Set(u.values()),x=0;for(;p.length>0;){let _=p.shift();if(_ instanceof B)for(let k of _._deps){let O=k.node;if(u.has(O))continue;let E=O.name??"",N=E;if(!N||w.has(N))if(E){let A=2;for(;w.has(`${E}#${A}`);)A++;N=`${E}#${A}`}else for(N=`__internal__/${x++}`;w.has(N);)N=`__internal__/${x++}`;u.set(O,N),w.add(N),d.push([N,O]),p.push(O)}}}let c=[...a,...d],h={};for(let[p,w]of c){if(t!=null&&!w.allowsObserve(t))continue;let x=yt(w,i,o),_=w instanceof B?w._deps.map(N=>u.get(N.node)??N.node.name??""):[],{name:k,...O}=x,E={...O,deps:_};if(!o){let N=this._annotations.get(p);N!=null&&(E.annotation=N)}if(n!=null)if(typeof n=="function"){let N=n;if(!(N.length>=2?N(p,E):N(E)))continue}else{let N=!0;for(let[A,C]of Object.entries(n)){let D=A==="deps_includes"?"depsIncludes":A==="meta_has"?"metaHas":A;if(D==="depsIncludes"){if(!E.deps.includes(String(C))){N=!1;break}continue}if(D==="metaHas"){if(!Object.hasOwn(E.meta??{},String(C))){N=!1;break}continue}if(E[D]!==C){N=!1;break}}if(!N)continue}h[p]=E}let g=new Set(Object.keys(h)),m=[];for(let[p,w]of c)if(w instanceof B)for(let x of w._deps){let _=u.get(x.node);_!=null&&m.push([_,p])}m.sort((p,w)=>p[0]<w[0]?-1:p[0]>w[0]?1:p[1]<w[1]?-1:p[1]>w[1]?1:0);let l=m.map(([p,w])=>({from:p,to:w}));(t!=null||n!=null)&&(l=l.filter(p=>g.has(p.from)&&g.has(p.to)));let y=this._collectSubgraphs(""),f=t!=null||n!=null?y.filter(p=>{let w=`${p}${L}`;return[...g].some(x=>x===p||x.startsWith(w))}):y,T=this,v=e;return{name:this.name,nodes:h,edges:l,subgraphs:f,...this._factory!==void 0?{factory:this._factory}:{},...this._factoryArgs!==void 0?{factoryArgs:this._factoryArgs}:{},expand(p){let w={...v};return Array.isArray(p)?(w.fields=p,w.detail=void 0):(w.detail=p,w.fields=void 0),T.describe(w)}}}_collectSubgraphs(e){let t=[];for(let n of[...this._mounts.keys()].sort()){let s=e===""?n:`${e}${n}`;t.push(s),t.push(...this._mounts.get(n)._collectSubgraphs(`${s}${L}`))}return t}resourceProfile(e){return fn(this,e)}reachable(e,t,n={}){return n.withDetail===!0?yn(this.describe(),e,t,{...n,withDetail:!0}):yn(this.describe(),e,t,n)}explain(e,t,n){return n?.reactive===!0?this._explainReactive(e,t,n):this._explainStatic(ce(e),ce(t),{...n?.maxDepth!==void 0?{maxDepth:hn(n.maxDepth)}:{},...n?.findCycle!==void 0?{findCycle:gn(n.findCycle)}:{}})}_explainStatic(e,t,n){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,u]of Object.entries(s.nodes))u.lastMutation!=null&&i.set(a,u.lastMutation);return sn(s,e,t,{...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let t={...e,reactive:!1},n=e.reactiveName??"describe",s=0,o=F(s,{name:`${n}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ye(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},c=i.onEvent(v=>{let b=v.type;b!=="data"&&b!=="error"&&b!=="complete"&&b!=="teardown"||d()}),h=[],g=new WeakSet,m=v=>{if(g.has(v)||u)return;g.add(v);let b=v.topology.subscribe(p=>{for(let w of p){if(w[0]!==G)continue;let x=w[1];if(d(),x.kind==="added"&&x.nodeKind==="mount"){let _=v._mounts.get(x.name);_!=null&&m(_)}}});h.push(b);for(let p of v._mounts.keys()){let w=v._mounts.get(p);w!=null&&m(w)}};m(this);let l,y=e.actor;vn(y)&&(l=y.subscribe(v=>{let b=!1,p=!1;for(let w of v){let x=w[0];x===G?b=!0:(x===V||x===M||x===j)&&(p=!0)}b&&d(),p&&(l?.(),l=void 0,d())}));let f;try{f=S([o],()=>this.describe(t),{name:n,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(v,b)=>v===b})}catch(v){c(),l?.();for(let b of h)b();throw i.dispose(),v}let T=ie(f);return{node:f,dispose(){u=!0,c(),l?.();for(let v of h)v();h.length=0,i.dispose(),T()}}}_describeReactiveDiff(e){let t={...e,reactive:!1},n=e.reactiveName??"describe-diff",s={name:this.name,nodes:{},edges:[],subgraphs:[]},o=this.describe(t),i=_t(s,o),a=F(i,{name:n,meta:{domain:"audit",kind:"describe-diff"},equals:(g,m)=>g===m}),u=this._describeReactive({...e,reactiveName:void 0}),d=!1,c=u.node.subscribe(g=>{if(!d)for(let m of g){if(m[0]!==G)continue;let l=m[1],y=_t(o,l);o=l,y.events.length!==0&&a.emit(y)}}),h=ie(a);return{node:a,dispose(){d=!0,c(),u.dispose(),a.down([[j,"describe-diff disposed"]]),h()}}}_explainReactive(e,t,n){let s=0,o=F(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ye(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},c=i.onEvent(v=>{let b=v.type;b!=="data"&&b!=="error"&&b!=="complete"&&b!=="teardown"||d()}),h=[];e!=null&&ge(e)&&h.push(e),t!=null&&ge(t)&&h.push(t),n?.maxDepth!=null&&ge(n.maxDepth)&&h.push(n.maxDepth),n?.findCycle!=null&&ge(n.findCycle)&&h.push(n.findCycle);let g=()=>{for(let v of h)if(v.cache===void 0)return!1;return!0},m=()=>{let v=ce(e),b=ce(t);return{from:v,to:b,found:!1,reason:"pending",steps:[],text:"(awaiting reactive args)",toJSON:()=>({from:v,to:b,found:!1,reason:"pending",steps:[]})}},l;try{l=S([o],()=>{if(!g())return m();let v=ce(e),b=ce(t),p={...n?.maxDepth!==void 0?{maxDepth:hn(n.maxDepth)}:{},...n?.findCycle!==void 0?{findCycle:gn(n.findCycle)}:{}};return this._explainStatic(v,b,p)},{name:n?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:ce(e),to:ce(t)},equals:(v,b)=>v.found===b.found&&v.reason===b.reason&&v.steps.length===b.steps.length&&fr(v.steps,b.steps)})}catch(v){throw c(),i.dispose(),v}let y=ie(l),f=[],T=v=>{let b;return b=v.subscribe(p=>{let w=!1,x=!1;for(let _ of p){let k=_[0];k===G?w=!0:(k===V||k===M||k===j)&&(x=!0)}(w||x)&&d(),x&&b&&(b(),b=void 0)}),()=>{b&&(b(),b=void 0)}};for(let v of h)f.push(T(v));return{node:l,dispose(){u=!0,c();for(let v of f)v?.();f.length=0,i.dispose(),y()}}}_pathsMatching(e){let t=Ke(e),n=[];return this._collectObserveTargets("",n),n.map(([s])=>s).filter(s=>t.test(s))}_collectObserveTargets(e,t){for(let n of[...this._mounts.keys()].sort()){let s=e===""?n:`${e}${L}${n}`;this._mounts.get(n)._collectObserveTargets(s,t)}for(let n of[...this._nodes.keys()].sort()){let s=this._nodes.get(n),o=e===""?n:`${e}${L}${n}`;t.push([o,s]),this._appendMetaObserveTargets(o,s,t)}}_appendMetaObserveTargets(e,t,n){for(let s of Object.keys(t.meta).sort()){let o=t.meta[s],i=`${e}${L}${Z}${L}${s}`;n.push([i,o]),this._appendMetaObserveTargets(i,o,n)}}observe(e,t){let n=typeof e=="string",o=bn(n?t:e);if(o.reactive===!0)return this._observeReactive(n?e:void 0,o);let i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(n){let c=e,h=this.resolve(c);if(a!=null&&!h.allowsObserve(a))throw new J({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,h]],o,"one"):{subscribe(g){return h.subscribe(g)},up(g){try{h.up?.(g)}catch(m){if(m instanceof J)return;throw m}}}}let u=[];this._collectObserveTargets("",u),u.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let d=a==null?u:u.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(d,o,"all"):{subscribe:c=>{let h=d.map(([g,m])=>m.subscribe(l=>{c(g,l)}));return()=>{for(let g of h)g()}},up:(c,h)=>{try{this.resolve(c).up?.(h)}catch(g){if(g instanceof J)return;throw g}}}}_observeReactive(e,t){let n=t.tiers,s=n!=null?new Set(n):null,o=t.reactiveName??"observe";return pe(i=>{let a=[],u=!1,d=!1,c=()=>{if(a.length===0||d)return;let y={events:a.slice(),flushedAt_ns:se()};a.length=0,i.emit(y)},h={...t,reactive:!1,structured:!0,timeline:!0},g=e!=null?this.observe(e,h):this.observe(h),m=y=>{d||(a.push(y),!u&&(u=!0,ye(()=>{u=!1,c()})))};for(let y of g.events)m(y);let l=g.onEvent(m);return()=>{d=!0,l(),g.dispose()}},{name:o,meta:{domain:"audit",kind:"observe-reactive"}})}_buildStructuredObserver(e,t,n){let s=n==="one"?e[0]?.[0]:void 0,o=i=>{if(n==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let u=i.actor,d=u==null?a:a.filter(([,c])=>c.allowsObserve(u));return this._buildStructuredObserver(d,i,"all")};return this._createObserveResult(e,t,o)}_createObserveResult(e,t,n){let s=t.timeline===!0,o=t.causal===!0,i=t.derived===!0,a=t.detail==="minimal",u=this.config.inspectorEnabled,d=(o||i)&&u,c=t.maxEvents,h=c!=null&&c>0?new De(c):null,g=[],m=new Set,l=t.tiers!=null?new Set(t.tiers):null,y={},f=new Set,T=0,v=0,b=0,p=0,w=0,x=0,_=!1,k=!1,O=0,E=new Map,N=new Map,A=new Map,C=R=>{if(!(l!=null&&!l.has(R.type))){h?h.push(R):g.push(R);for(let I of m)I(R)}},D=R=>l==null||l.has(R),ae=()=>s?{timestamp_ns:se(),in_batch:$e(),batch_id:O}:{},ne=(R,I)=>{if(!(!d||!(R instanceof B)))return R._setInspectorHook(K=>{if(K.kind==="dep_message")E.set(R,K.depIndex);else if(K.kind==="run"){let Oe=K.batchData.map(($,q)=>$!=null&&$.length>0?$.at(-1):K.prevData[q]);N.set(R,Oe);let Y=K.batchData.map($=>$!=null?[...$]:void 0);A.set(R,Y),i&&C({type:"derived",path:I,dep_values:Oe,dep_batches:Y,...ae()})}})},Ce=R=>{let I=E.get(R),K=N.get(R);if(!o||K==null)return{};let Y=(I!=null&&I>=0&&R instanceof B?R._deps[I]:void 0)?.node,$=Y?.v,q=A.get(R);return{trigger_dep_index:I,trigger_dep_name:Y?.name,...$!=null?{trigger_version:{id:$.id,version:$.version}}:{},dep_values:[...K],...q!=null?{dep_batches:q}:{}}},Et=[],At=[];for(let[R,I]of e){let K=ne(I,R);K&&Et.push(K),At.push(I.subscribe(Oe=>{O++;for(let Y of Oe){let $=Y[0],q=ae();if($===G){y[R]=Y[1];let et=I instanceof B?I.lastMutation?.actor??_e:_e;C({type:"data",path:R,data:Y[1],actor:et,...q,...Ce(I)})}else if(a)$===U?D("dirty")&&T++:$===W?D("resolved")&&v++:$===Q?D("invalidate")&&b++:$===ee?D("pause")&&p++:$===ue?D("resume")&&w++:$===j?D("teardown")&&x++:$===V&&!f.has(R)?D("complete")&&(_=!0):$===M&&D("error")&&(k=!0,f.add(R));else if($===U)D("dirty")&&T++,C({type:"dirty",path:R,...q});else if($===W)D("resolved")&&v++,C({type:"resolved",path:R,...q,...Ce(I)});else if($===Q)D("invalidate")&&b++,C({type:"invalidate",path:R,...q});else if($===ee)D("pause")&&p++,C({type:"pause",path:R,lockId:Y[1],...q});else if($===ue)D("resume")&&w++,C({type:"resume",path:R,lockId:Y[1],...q});else if($===V)D("complete")&&!f.has(R)&&(_=!0),C({type:"complete",path:R,...q});else if($===M){D("error")&&(k=!0,f.add(R));let et=I instanceof B?I.lastMutation?.actor??_e:_e;C({type:"error",path:R,data:Y[1],actor:et,...q})}else $===j&&(D("teardown")&&x++,C({type:"teardown",path:R,...q}))}}))}let Qe=!1,Xe=()=>{if(!Qe){Qe=!0;for(let R of At)R();for(let R of Et)R();for(let R of Ge)R({value:void 0,done:!0});Ge.length=0}},Ze=[],Ge=[];m.add(R=>{let I=Ge.shift();I?I({value:R,done:!1}):Ze.push(R)});let St={get values(){return y},get dirtyCount(){return T},get resolvedCount(){return v},get invalidateCount(){return b},get pauseCount(){return p},get resumeCount(){return w},get teardownCount(){return x},get events(){return h?h.toArray():[...g]},get anyCompletedCleanly(){return _},get anyErrored(){return k},get completedWithoutErrors(){return _&&!k},onEvent(R){return m.add(R),()=>m.delete(R)},dispose:Xe,expand(R){Xe();let I={...t};return typeof R=="string"?I.detail=R:Object.assign(I,R),n(bn(I))},[Symbol.asyncIterator](){return{next(){return Ze.length>0?Promise.resolve({value:Ze.shift(),done:!1}):Qe?Promise.resolve({value:void 0,done:!0}):new Promise(R=>Ge.push(R))},return(){return Xe(),Promise.resolve({value:void 0,done:!0})}}}};return t.format!=null&&this._attachFormatLogger(St,t),St}_attachFormatLogger(e,t){let n=t.format;if(n==null)return;let s=t.logger??(l=>console.log(l)),o=t.includeTypes?new Set(t.includeTypes):null,i=t.excludeTypes?new Set(t.excludeTypes):null,a=o==null&&i==null?()=>!0:l=>(o==null||o.has(l))&&(i==null||!i.has(l)),u=ar(t.theme),d=n==="stage-log"?se():0,c=l=>l==null?"":t.stageLabels?.[l]??l,h=(l,y)=>l.length>y?`${l.slice(0,y-1)}\u2026`:l,g=l=>l.type==="data"||l.type==="error"?h(wt(l.data),120):"",m=l=>{if(n==="stage-log"){let _=(se()-d)/1e9,k=c(l.path).padEnd(9);if(l.type==="data"){let O=g(l);return`[${_.toFixed(3)}s] ${k} \u2190${O?` ${O}`:""}`}if(l.type==="error"){let O=g(l);return`[${_.toFixed(3)}s] ${k} \u2717${O?` ${O}`:""}`}return l.type==="complete"?`[${_.toFixed(3)}s] ${k} \u25A0 complete`:`[${_.toFixed(3)}s] ${k} ${l.type}`}if(n==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let y=u[l.type]??"",f=l.path?`${u.path}${l.path}${u.reset} `:"",T=l.type==="data"||l.type==="error",v=l.type==="pause"||l.type==="resume",b=T?` ${wt(l.data)}`:v?` ${wt(l.lockId)}`:"",p=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,w=p?.trigger_dep_name!=null?` <- ${p.trigger_dep_name}`:p?.trigger_dep_index!=null?` <- #${p.trigger_dep_index}`:"",x=l.in_batch?" [batch]":"";return`${f}${y}${l.type.toUpperCase()}${u.reset}${b}${w}${x}`};e.onEvent(l=>{a(l.type)&&s(m(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){qe(this._disposers,this.name),this.signal([[j]],{internal:!0}),qe(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(){qe(this._disposers,this.name),qe(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}snapshot(e){let{expand:t,...n}=this.describe({detail:"full"}),s={};for(let a of Object.keys(n.nodes).sort()){let{lastMutation:u,guard:d,...c}=n.nodes[a];s[a]=c}let o=[...n.subgraphs].sort(),i={...n,version:1,nodes:s,subgraphs:o};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 Ct(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,t){let n=t?.config??ke,{codec:s,codecVersion:o,payload:i}=Gt(e,n);return s.decode(i,o)}restore(e,t){if(mn(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let n=t?.only==null?null:(Array.isArray(t.only)?t.only:[t.only]).map(o=>Ke(o)),s=t?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(n!==null&&!n.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&t?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let u=this.tryResolve(o)?.v;if(u!=null&&u.id===i.v.id&&u.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){t?.onError?.(o,a)}}}}}static fromSnapshot(e,t){mn(e);let n=typeof t=="function"?t:t?.build,s=typeof t=="function"?void 0:t?.factories,o=new r(e.name);if(n)return n(o),o.restore(e),o;for(let m of[...e.subgraphs].sort((l,y)=>{let f=l.split(L).length,T=y.split(L).length;return f!==T?f-T:l<y?-1:l>y?1:0})){let l=m.split(L),y=o;for(let f of l)y._mounts.has(f)||y.mount(f,new r(f)),y=y._mounts.get(f)}let i=s?Object.entries(s).map(([m,l])=>({re:Ke(m),factory:l})):[],a=m=>{for(let l of i)if(l.re.test(m))return l.factory},u=m=>{let l=m.split(L),y=l.pop();if(y==null||y.length===0)throw new Error(`invalid snapshot path "${m}"`);let f=o;for(let T of l){let v=f._mounts.get(T);if(!v)throw new Error(`unknown mount "${T}" in path "${m}"`);f=v}return[f,y]},d=Object.entries(e.nodes).filter(([m])=>!m.includes(`${L}${Z}${L}`)).sort((m,l)=>m[0]<l[0]?-1:m[0]>l[0]?1:0),c=new Map(d),h=new Map,g=!0;for(;c.size>0&&g;){g=!1;for(let[m,l]of[...c.entries()]){let y=l?.deps??[];if(!y.every(w=>h.has(w)))continue;let[f,T]=u(m),v={...l?.meta??{}},b=a(m),p;if(l?.type==="state")p=F(l.value,{meta:v});else{if(b==null)continue;p=b(T,{path:m,type:l.type,value:l.value,meta:v,deps:y,resolvedDeps:y.map(w=>h.get(w))})}f.add(p,{name:T}),h.set(m,p),c.delete(m),g=!0}}if(c.size>0){let m=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${m}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachSnapshotStorage(e,t={}){let n=e.map(d=>({tier:d,debounceMs:Math.max(0,d.debounceMs??0),compactEvery:Math.max(1,d.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));t.autoRestore===!0&&this._cascadeRestore(e,t.onError);let s=(d,c)=>{if(d.disposed)return;let h=nr(c.nodes);if(d.lastSnapshot!=null&&h!==""&&h===d.lastFingerprint)return;let g=d.seq+1,m=Ie(),f=d.lastSnapshot==null||g%d.compactEvery===0?{name:this.name,mode:"full",snapshot:c,seq:g,timestamp_ns:m,format_version:xe}:{name:this.name,mode:"diff",diff:lr(d.lastSnapshot,c),seq:g,timestamp_ns:m,format_version:xe};if(d.tier.filter&&!d.tier.filter(f))return;let T;try{T=d.tier.save(f)}catch(v){t.onError?.(v,d.tier);return}if(T&&typeof T.then=="function"){let p=(d.savePending??Promise.resolve()).then(()=>T,()=>T).then(()=>{d.disposed||(d.seq=g,d.lastSnapshot=c,d.lastFingerprint=h)},w=>{t.onError?.(w,d.tier)});d.savePending=p.finally(()=>{d.savePending===p&&(d.savePending=void 0)})}else d.seq=g,d.lastSnapshot=c,d.lastFingerprint=h},o=(d,c)=>{try{s(d,c)}catch(h){t.onError?.(h,d.tier)}},i=(d,c)=>{if(!c.some(l=>{let y=this.config.messageTier(l[0]);return y>=3&&y<5}))return;if(t.filter){let l=this.tryResolve(d);if(l==null)return;let y=yt(l,bt("standard"));if(!t.filter(d,y))return}let g,m=()=>(g==null&&(g=this.snapshot()),g);for(let l of n)l.disposed||(l.debounceMs===0?o(l,m()):(l.timer==null&&(l.timer=new Be),l.timer.start(l.debounceMs,()=>{l.disposed||o(l,this.snapshot())})))},a;if(t.paths!=null){let c=(typeof t.paths=="string"?this._pathsMatching(t.paths):t.paths).map(h=>{let g=this.tryResolve(h);return g==null?()=>{}:g.subscribe(m=>i(h,m))});a=()=>{for(let h of c)h()}}else a=this.observe().subscribe((d,c)=>i(d,c));let u=()=>{a();for(let d of n)d.disposed=!0,d.timer?.cancel();this._storageDisposers.delete(u)};return this._storageDisposers.add(u),{dispose:u}}async _cascadeRestore(e,t){for(let n of e){let s;try{s=await n.load?.()}catch(i){t?.(i,n);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===xe&&o.nodes!=null)return this.restore(o),!0}catch(i){t?.(i,n)}}return!1}static async fromStorage(e,t,n){for(let s of t){let o;try{o=await s.load?.()}catch(u){n?.onError?.(u,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===xe&&i.nodes!=null?i:void 0;if(a!=null)try{return r.fromSnapshot(a,n)}catch(u){n?.onError?.(u,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${t.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,t,n){if(e!=null&&t!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,t),this.config.inspectorEnabled){let s={path:e,annotation:t,timestamp_ns:se(),...n?.actor!=null?{actor:n.actor}:{}};this._traceRing.push(s)}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 t=this._traceRing.toArray().filter(s=>!e(s)),n=this._traceRing.size-t.length;this._traceRing.clear();for(let s of t)this._traceRing.push(s);return n}static diff(e,t){let n=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(t.nodes)),o=[...s].filter(v=>!n.has(v)).sort(),i=[...n].filter(v=>!s.has(v)).sort(),a=[],u=[];for(let v of n){if(!s.has(v))continue;let b=e.nodes[v],p=t.nodes[v],w=b.v,x=p.v;w!=null&&x!=null&&w.id===x.id&&w.version!==x.version&&u.push({path:v,id:w.id,from:w.version,to:x.version});let _=w!=null&&x!=null&&w.id===x.id&&w.version===x.version;for(let k of["type","status","sentinel"]){let O=b[k],E=p[k];O!==E&&a.push({path:v,field:k,from:O,to:E})}if(!_)for(let k of["value","meta"]){let O=b[k],E=p[k];rr(O,E)||a.push({path:v,field:k,from:O,to:E})}}let d=v=>`${v.from} ${v.to}`,c=new Set(e.edges.map(d)),h=new Set(t.edges.map(d)),g=t.edges.filter(v=>!c.has(d(v))),m=e.edges.filter(v=>!h.has(d(v))),l=new Set(e.subgraphs),y=new Set(t.subgraphs),f=[...y].filter(v=>!l.has(v)).sort(),T=[...l].filter(v=>!y.has(v)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:u,edgesAdded:g,edgesRemoved:m,subgraphsAdded:f,subgraphsRemoved:T}}}});function Ye(r,e,t){return{[r]:!0,[`${r}_type`]:e,...t??{}}}var xt=z(()=>{"use strict"});var yr={};xn(yr,{contentModerationGraph:()=>mr,dataQualityGraph:()=>br,issueTrackerGraph:()=>gr,observabilityGraph:()=>hr});module.exports=Rn(yr);ve();he();ve();oe();de();he();var mt=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(e,t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=t,t!==void 0){if(this._buf=new Array(t),e&&e.length>0){let n=Math.min(e.length,t),s=e.length-n;for(let o=0;o<n;o++)this._buf[o]=e[s+o];this._size=n}}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 t=e>=0?e:this._size+e;if(!(t<0||t>=this._size))return this._maxSize!==void 0?this._buf[(this._head+t)%this._maxSize]:this._buf[t]}append(e){this._rawAppend(e),this._version+=1}appendMany(e){if(e.length===0)return;let t=this._maxSize!==void 0&&e.length>this._maxSize?e.length-this._maxSize:0;for(let n=t;n<e.length;n++)this._rawAppend(e[n]);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 t=0;t<e;t++)this._buf[(this._head+t)%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 t=Math.min(e,this._size);if(this._maxSize===void 0)this._buf.splice(0,t);else{for(let n=0;n<t;n++)this._buf[(this._head+n)%this._maxSize]=void 0;this._head=(this._head+t)%this._maxSize}return this._size-=t,this._version+=1,t}slice(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let n=t===void 0?this._size:Math.min(Math.max(t,0),this._size),s=Math.min(e,this._size);if(s>=n)return[];let o=n-s;if(this._maxSize===void 0)return this._buf.slice(s,n);let i=new Array(o);for(let a=0;a<o;a++)i[a]=this._buf[(this._head+s+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 t=Math.min(e,this._size);return this.slice(this._size-t,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let e=new Array(this._size);for(let t=0;t<this._size;t++)e[t]=this._buf[(this._head+t)%this._maxSize];return e}snapshot(){return this.toArray()}restore(e){if(this._maxSize===void 0){this._buf.length=0;for(let t=0;t<e.length;t++)this._buf.push(e[t]);this._size=this._buf.length}else{let t=this._maxSize;for(let o=0;o<t;o++)this._buf[o]=void 0;this._head=0;let n=Math.min(e.length,t),s=e.length-n;for(let o=0;o<n;o++)this._buf[o]=e[s+o];this._size=n}this._version+=1}_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 Se(r){return r.subscribe(()=>{})}var Wn=64;function Xt(r,e={}){let{name:t,maxSize:n,versioning:s,guard:o,backend:i}=e,a=i??new mt(r,n),u=F(a.toArray(),{name:t,describeKind:"state",equals:(_,k)=>_===k,...s!=null?{versioning:s}:{},...o!=null?{guard:o}:{}});function d(){let _=a.toArray();re(()=>{u.down([[U]],{internal:!0}),u.down([[G,_]],{internal:!0})})}let c=new Map,h=new Map,g=new Map;function m(_,k){return`${_}:${k===void 0?"END":k}`}function l(_){if(_.size<Wn)return;let k=_.keys().next();if(k.done)return;let O=_.get(k.value);O!==void 0&&O.dispose(),_.delete(k.value)}function y(_){let k=a.version;try{return _()}finally{a.version!==k&&d()}}function f(_){if(!Number.isInteger(_)||_<0)throw new RangeError(`tail: n must be a non-negative integer (got ${_})`);let k=c.get(_);if(k!==void 0)return c.delete(_),c.set(_,k),k.node;l(c);let O=S([u],([N])=>{let A=N;return _===0||A.length===0?[]:A.slice(Math.max(0,A.length-_))},{initial:a.tail(_),describeKind:"derived"}),E=Se(O);return c.set(_,{node:O,dispose:E}),O}function T(_,k){if(!Number.isInteger(_)||_<0)throw new RangeError(`slice: start must be a non-negative integer (got ${_})`);if(k!==void 0&&(!Number.isInteger(k)||k<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${k})`);let O=m(_,k),E=h.get(O);if(E!==void 0)return h.delete(O),h.set(O,E),E.node;l(h);let N=S([u],([C])=>{let D=C;return k===void 0?D.slice(_):D.slice(_,k)},{initial:a.slice(_,k),describeKind:"derived"}),A=Se(N);return h.set(O,{node:N,dispose:A}),N}function v(_){let k=g.get(_);if(k!==void 0)return k.node;let O=S([u,_],([N,A])=>{let C=N,D=Math.max(0,Math.trunc(A??0));return C.slice(D)},{initial:[],describeKind:"derived"}),E=Se(O);return g.set(_,{node:O,dispose:E}),O}let b,p;function w(){b===void 0&&(b=X([u],(_,k,O)=>{let E=_[0],A=E!=null&&E.length>0?E.at(-1):O.prevData[0];if(A==null||A.length===0){k.down([[W]]);return}k.emit(A[A.length-1])},{name:t!=null?`${t}::lastValue`:"lastValue",describeKind:"derived",initial:a.size===0?void 0:a.at(a.size-1)}),p=S([u],([_])=>_.length>0,{name:t!=null?`${t}::hasLatest`:"hasLatest",describeKind:"derived",initial:a.size>0}),Se(b),Se(p))}let x={entries:u,get size(){return a.size},at(_){return a.at(_)},append(_){y(()=>a.append(_))},appendMany(_){_.length!==0&&y(()=>a.appendMany(_))},clear(){y(()=>a.clear())},trimHead(_){y(()=>a.trimHead(_))},withLatest(){return w(),u},get lastValue(){return w(),b},get hasLatest(){return w(),p},view(_){switch(_.kind){case"tail":return f(_.n);case"slice":return T(_.start,_.stop);case"fromCursor":return v(_.cursor)}},attach(_){let k=_.subscribe(O=>{for(let E of O)E[0]===G&&x.append(E[1])});return()=>k()},attachStorage(_){if(_.length===0)return()=>{};let k=new Map;for(let E of _)k.set(E,a.size);(async()=>{for(let E of _)if(typeof E.loadEntries=="function")try{let N=await Promise.resolve(E.loadEntries());N.entries.length>0&&a.size===0&&(a.restore(N.entries),k.set(E,N.entries.length),d());break}catch{}})();let O=u.subscribe(E=>{for(let N of E){if(N[0]!==G)continue;let A=N[1];for(let C of _){let D=k.get(C)??0;if(A.length<D){try{let ne=C.appendEntries(A);ne instanceof Promise&&ne.catch(()=>{})}catch{}k.set(C,A.length);continue}if(A.length===D)continue;let ae=A.slice(D);k.set(C,A.length);try{let ne=C.appendEntries(ae);ne instanceof Promise&&ne.catch(()=>{})}catch{}}}});return()=>O()},disposeAllViews(){for(let _ of c.values())_.dispose();c.clear();for(let _ of h.values())_.dispose();h.clear();for(let _ of g.values())_.dispose();g.clear()},dispose(){for(let _ of c.values())_.dispose();c.clear();for(let _ of h.values())_.dispose();h.clear();for(let _ of g.values())_.dispose();g.clear()}};return x}oe();de();he();kt();function Nt(r,e,t,n){let s=new te(r,n);s.add(e,{name:"source"});let o=F(t,{meta:{kind:"stratify_rules"}});s.add(o,{name:"rules"});for(let i of t)pr(s,e,o,i);return s}function pr(r,e,t,n){let s=`branch/${n.name}`,o=Symbol("noValue"),i=!1,a=!1,u=!1,d=o,c=!1,h=t.cache??[];function g(y){if(u){u=!1;let f=d;if(d=o,f!==o){let T=h.find(b=>b.name===n.name),v=!1;try{v=T?.classify(f)??!1}catch{v=!1}v?(c=!1,y.emit(f)):c&&(c=!1,y.down([[U],[W]]))}else c?(c=!1,y.down([[U],[W]])):y.down([[W]])}}let m=X([],(y,f)=>{let T=e.subscribe(b=>{for(let p of b)l(p,0,f)}),v=t.subscribe(b=>{for(let p of b)l(p,1,f)});return()=>{T(),v()}},{describeKind:"derived",meta:{kind:"stratify_branch",branch:n.name},completeWhenDepsComplete:!1});function l(y,f,T){let v=y[0];return v===U?(f===0?(i=!0,c=!0):a=!0,!0):v===G||v===W?(f===0?(i=!1,u=!0,d=v===G?y[1]:o):(v===G&&(h=y[1]),a=!1),i||a||g(T),!0):v===V||v===M||v===j?(i=!1,a=!1,u=!1,d=o,c=!1,f===0&&T.down([y]),!0):f===1}if(r.add(m,{name:s}),n.ops){let y=n.ops(m),f=`branch/${n.name}/out`;r.add(y,{name:f})}}kt();ve();oe();de();he();xt();Ae();oe();function wn(r,e){let t=r.cache??0;return t>=e?!1:(r.down([[U],[G,t+1]]),!0)}var Ms=jt((r,e)=>{r("observe"),r("signal"),e("write")});je();function Ot(r,e){return Ye("reduction",r,e)}function Me(r,e,t,n){let s=n?.maxIterations??10,o=`__feedback_${e}`,i=F(0,{meta:Ot("feedback_counter",{maxIterations:s,feedbackFrom:e,feedbackTo:t})});r.add(i,{name:o});let a=r.resolve(e),u=r.resolve(t),d=`__feedback_effect_${e}`,c=X([],(h,g)=>{let m=a.subscribe(l=>{for(let y of l){let f=y[0];if(f===G){let T=y[1];if(T==null)return;re(()=>{wn(i,s)&&u.emit(T)})}else if(f===V||f===M){let T=f===M&&y.length>1?[M,y[1]]:[f];i.down([T])}}});return()=>m()},{name:d,describeKind:"effect",meta:{...Ot("feedback_effect",{feedbackFrom:e,feedbackTo:t}),_internal:!0}});return r.add(c,{name:d}),r.addDisposer(ie(c)),r}function Je(r,e,t){if(r.length===0)throw new RangeError("scorer requires at least one source");if(r.length!==e.length)throw new RangeError("scorer requires the same number of sources and weights");let n=[...r,...e],s=r.length,o=t?.scoreFns;return S(n,i=>{let a=i.slice(0,s),u=i.slice(s),d=[],c=0;for(let h=0;h<s;h++){let g=a[h]??0,m=u[h]??0,y=(o?.[h]?o[h](g):g)*m;d.push(y),c+=y}return{value:a,score:c,breakdown:d}},{...t?{equals:t.equals,resubscribable:t.resubscribable,resetOnTeardown:t.resetOnTeardown}:{},describeKind:"derived",meta:Ot("scorer",t?.meta)})}xt();je();function P(r,e){return Ye("domain_template",r,e)}function hr(r,e){let t=new te(r,e);t.add(e.source,{name:"source"});let n=[{name:"errors",classify:p=>Rt(p,"error")},{name:"traces",classify:p=>Rt(p,"trace")},{name:"metrics",classify:p=>Rt(p,"metric")}],s=e.branches??n,o=s.map(p=>({name:p.name,classify:p.classify})),i=Nt("stratify",e.source,o);t.mount("stratify",i);let a=s.map(p=>{try{let w=t.resolve(`stratify::branch/${p.name}`);return S([w],([x])=>x,{initial:null})}catch{return F(null)}}),u=e.correlate??(p=>p),d=S(a,p=>u(p),{meta:P("observability",{stage:"correlate"})});t.add(d,{name:"correlate"});let c=e.sloCheck??(()=>({pass:!0})),h=S([d],p=>p[0],{meta:P("observability",{stage:"slo_value"})}),g=S([h],p=>c(p[0]),{meta:P("observability",{stage:"slo_verified"})});t.add(h,{name:"slo_value"}),t.add(g,{name:"slo_verified"});let m=e.weights??s.map(()=>1),l=a.map(p=>S([p],w=>w[0]!=null?1:0)),y=m.map(p=>F(p));for(let p=0;p<l.length;p++)t.add(l[p],{name:`__signal_${p}`}),t.add(y[p],{name:`__weight_${p}`});let f=Je(l,y);t.add(f,{name:"alerts"});let T=S([f,g],p=>({scored:p[0],slo:p[1]}),{meta:P("observability",{stage:"output"})});t.add(T,{name:"output"});let v=F(null,{meta:P("observability",{stage:"feedback_reentry"})});t.add(v,{name:"feedback_reentry"});let b=S([g],p=>{let w=p[0];return w&&w.pass===!1?w:null},{meta:P("observability",{stage:"feedback_condition"})});return t.add(b,{name:"feedback_condition"}),Me(t,"feedback_condition","feedback_reentry",{maxIterations:e.maxFeedbackIterations??5}),t}function gr(r,e){let t=new te(r,e);t.add(e.source,{name:"source"});let n=0,s=p=>({id:`issue-${++n}`,title:String(p),severity:1,source:"unknown",raw:p}),o=e.extract??s,i=S([e.source],p=>o(p[0]),{meta:P("issue_tracker",{stage:"extract"})});t.add(i,{name:"extract"});let a=e.verify??(()=>({valid:!0})),u=S([i],p=>{let w=p[0];return{issue:w,verification:a(w)}},{meta:P("issue_tracker",{stage:"verify"})});t.add(u,{name:"verify"});let d=F([],{meta:P("issue_tracker",{stage:"known_patterns"})});t.add(d,{name:"known_patterns"});let c=e.detectRegression??(()=>({regression:!1})),h=S([i,d],p=>{let w=p[0],x=p[1];return{issue:w,regression:c(w,x)}},{meta:P("issue_tracker",{stage:"regression"})});t.add(h,{name:"regression"});let g=S([i],p=>p[0]?.severity??0),m=S([h],p=>p[0]?.regression?2:0);t.add(g,{name:"__severity_signal"}),t.add(m,{name:"__regression_signal"});let l=F(1),y=F(1.5);t.add(l,{name:"__severity_weight"}),t.add(y,{name:"__regression_weight"});let f=Je([g,m],[l,y]);t.add(f,{name:"priority"});let T=S([u,h,f],p=>({verified:p[0],regression:p[1],priority:p[2]}),{meta:P("issue_tracker",{stage:"output"})});t.add(T,{name:"output"});let v=F(null,{meta:P("issue_tracker",{stage:"feedback_reentry"})});t.add(v,{name:"feedback_reentry"});let b=S([u],p=>{let w=p[0];if(w){let x=w.verification;if(x&&x.valid===!1)return w}return null},{meta:P("issue_tracker",{stage:"feedback_condition"})});return t.add(b,{name:"feedback_condition"}),Me(t,"feedback_condition","feedback_reentry",{maxIterations:e.maxFeedbackIterations??3}),t}function mr(r,e){let t=new te(r,e);t.add(e.source,{name:"source"});let n=b=>({label:"review",confidence:.5,original:b}),s=e.classify??n,o=S([e.source],b=>s(b[0]),{meta:P("content_moderation",{stage:"classify"})});t.add(o,{name:"classify"});let i=Nt("stratify",o,[{name:"safe",classify:b=>b.label==="safe"},{name:"review",classify:b=>b.label==="review"},{name:"block",classify:b=>b.label==="block"}]);t.mount("stratify",i);let a=Xt([],{name:"review_queue",maxSize:e.maxQueueSize});t.add(a.entries,{name:"review_queue"});let u;try{u=t.resolve("stratify::branch/review")}catch{u=F(null),t.add(u,{name:"__review_fallback"})}let d=Ne([u],b=>{let p=b[0];p&&a.append(p)});t.add(d,{name:"__review_accumulator"}),t.addDisposer(ie(d));let c=F({},{meta:P("content_moderation",{stage:"policy",access:"both",description:"Moderation policy rules \u2014 updated via feedback"})});t.add(c,{name:"policy"});let h=e.weights??[.1,1,2],g=S([o],b=>b[0]?.confidence??0),m=S([o],b=>{let p=b[0];return p?p.label==="block"?h[2]:p.label==="review"?h[1]:h[0]:0});t.add(g,{name:"__confidence_signal"}),t.add(m,{name:"__severity_signal"});let l=F(1),y=F(1);t.add(l,{name:"__w_confidence"}),t.add(y,{name:"__w_severity"});let f=Je([g,m],[l,y]);t.add(f,{name:"priority"});let T=S([o,f],b=>({classification:b[0],priority:b[1]}),{meta:P("content_moderation",{stage:"output"})});t.add(T,{name:"output"});let v=S([a.entries,c],b=>{let p=b[0];if(p&&p.length>0){let w=p[p.length-1];if(w&&w.falsePositive)return w}return null},{meta:P("content_moderation",{stage:"feedback_condition"})});return t.add(v,{name:"feedback_condition"}),Me(t,"feedback_condition","policy",{maxIterations:e.maxFeedbackIterations??5}),t}function br(r,e){let t=new te(r,e);t.add(e.source,{name:"source"});let n=e.validate??(f=>({valid:!0,errors:[],record:f})),s=S([e.source],f=>f[0]!=null?n(f[0]):void 0,{meta:P("data_quality",{stage:"validate"})});t.add(s,{name:"validate"});let o=e.detectAnomaly??(f=>({anomaly:!1,score:0,record:f})),i=S([e.source],f=>f[0]!=null?o(f[0]):void 0,{meta:P("data_quality",{stage:"anomaly"})});t.add(i,{name:"anomaly"});let a=F(null,{meta:P("data_quality",{stage:"baseline",description:"Rolling baseline for drift detection"})});t.add(a,{name:"baseline"});let u=Ne([s],f=>{let T=f[0];T?.valid&&re(()=>{a.emit(T.record)})});t.add(u,{name:"__baseline_updater"}),ie(u);let d=e.detectDrift??(()=>({drift:!1})),c=S([e.source,a],f=>d(f[0],f[1]),{meta:P("data_quality",{stage:"drift"})});t.add(c,{name:"drift"});let h=e.suggest??(()=>null),g=S([s,i],f=>h({validation:f[0],anomaly:f[1]}),{meta:P("data_quality",{stage:"remediate"})});t.add(g,{name:"remediate"});let m=S([s,i,c,g],f=>({validation:f[0],anomaly:f[1],drift:f[2],remediation:f[3]}),{meta:P("data_quality",{stage:"output"})});t.add(m,{name:"output"});let l=F([],{meta:P("data_quality",{stage:"validation_rules"})});t.add(l,{name:"validation_rules"});let y=S([i],f=>{let T=f[0];return T?.anomaly?T:null},{meta:P("data_quality",{stage:"feedback_condition"})});return t.add(y,{name:"feedback_condition"}),Me(t,"feedback_condition","validation_rules",{maxIterations:e.maxFeedbackIterations??3}),t}function Rt(r,e){if(r==null||typeof r!="object")return!1;let t=r;return t.type===e||t.kind===e}0&&(module.exports={contentModerationGraph,dataQualityGraph,issueTrackerGraph,observabilityGraph});
@@ -1,6 +0,0 @@
1
- import '../../node-kK3CvTrR.cjs';
2
- import '../../graph-CWvEUQAq.cjs';
3
- export { A as AnomalyResult, C as ContentModerationGraphOptions, D as DataQualityGraphOptions, E as ExtractedIssue, I as IssueTrackerGraphOptions, M as ModerationResult, O as ObservabilityBranch, a as ObservabilityGraphOptions, V as ValidationResult, c as contentModerationGraph, d as dataQualityGraph, b as issueTrackerGraph, o as observabilityGraph } from '../../index-BaQaY_IQ.cjs';
4
- import '../../sugar-DQjFmVqb.cjs';
5
- import '../../extra/storage-core.cjs';
6
- import '../../extra/storage-tiers.cjs';
@@ -1,6 +0,0 @@
1
- import '../../node-kK3CvTrR.js';
2
- import '../../graph-D9LFnda9.js';
3
- export { A as AnomalyResult, C as ContentModerationGraphOptions, D as DataQualityGraphOptions, E as ExtractedIssue, I as IssueTrackerGraphOptions, M as ModerationResult, O as ObservabilityBranch, a as ObservabilityGraphOptions, V as ValidationResult, c as contentModerationGraph, d as dataQualityGraph, b as issueTrackerGraph, o as observabilityGraph } from '../../index-CzLVrjxn.js';
4
- import '../../sugar-fhLIE7TT.js';
5
- import '../../extra/storage-core.js';
6
- import '../../extra/storage-tiers.js';
@@ -1 +0,0 @@
1
- import{a,b,c,d}from"../../chunk-5XJ6B66J.js";import"../../chunk-Z4NPUARF.js";import"../../chunk-N7FHEL4D.js";import"../../chunk-W3I423PS.js";import"../../chunk-L6NSJVJZ.js";import"../../chunk-HITNVN6B.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-CLVB32RD.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-GHBWHMRZ.js";import"../../chunk-YBB7ZGTY.js";import"../../chunk-CRVT7D2P.js";import"../../chunk-NTEURFZH.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{c as contentModerationGraph,d as dataQualityGraph,b as issueTrackerGraph,a as observabilityGraph};