@blac/core 2.0.13 → 2.0.15

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 (379) hide show
  1. package/README.md +85 -3
  2. package/dist/Cubit-9jal5zdZ.cjs +1 -1
  3. package/dist/Cubit-BAUPiUF7.cjs +359 -286
  4. package/dist/Cubit-BBKF3PIg.js +269 -230
  5. package/dist/Cubit-BC70gaiA.js +453 -0
  6. package/dist/Cubit-BC70gaiA.js.map +1 -0
  7. package/dist/Cubit-BOgUZva7.js +342 -266
  8. package/dist/Cubit-BOxMvpfc.js +273 -232
  9. package/dist/Cubit-BTznt8zg.js +1 -1
  10. package/dist/Cubit-BogJXkLm.js +260 -225
  11. package/dist/Cubit-C-8R_8db.cjs +475 -0
  12. package/dist/Cubit-C-8R_8db.cjs.map +1 -0
  13. package/dist/Cubit-C3Mw3EoO.cjs +401 -0
  14. package/dist/Cubit-C3Mw3EoO.cjs.map +1 -0
  15. package/dist/Cubit-CO8Fr72L.cjs +447 -0
  16. package/dist/Cubit-CO8Fr72L.cjs.map +1 -0
  17. package/dist/Cubit-COfHT1Bm.cjs +300 -259
  18. package/dist/Cubit-CROWjjs9.js +481 -0
  19. package/dist/Cubit-CROWjjs9.js.map +1 -0
  20. package/dist/Cubit-CWP8Ddzx.cjs +510 -0
  21. package/dist/Cubit-CWP8Ddzx.cjs.map +1 -0
  22. package/dist/Cubit-CXxh9iol.js +284 -242
  23. package/dist/Cubit-CYOWfzQt.cjs +297 -254
  24. package/dist/Cubit-CZaf_fp4.cjs +1 -1
  25. package/dist/Cubit-C_dUEUdd.cjs +359 -286
  26. package/dist/Cubit-C_rxRCTN.cjs +523 -0
  27. package/dist/Cubit-C_rxRCTN.cjs.map +1 -0
  28. package/dist/Cubit-CcKgMEBO.js +281 -239
  29. package/dist/Cubit-CfT6Y1jl.js +328 -280
  30. package/dist/Cubit-CynJruuO.js +369 -0
  31. package/dist/Cubit-CynJruuO.js.map +1 -0
  32. package/dist/Cubit-D2vQ6nMb.js +342 -266
  33. package/dist/Cubit-D7jOZCoZ.js +342 -266
  34. package/dist/Cubit-D9j3IGPc.cjs +523 -0
  35. package/dist/Cubit-D9j3IGPc.cjs.map +1 -0
  36. package/dist/Cubit-DKEY9WYq.cjs +276 -240
  37. package/dist/Cubit-DMV_0TCp.js +481 -0
  38. package/dist/Cubit-DMV_0TCp.js.map +1 -0
  39. package/dist/Cubit-DP5DXPUK.js +342 -266
  40. package/dist/Cubit-DRFkzD2h.js +426 -0
  41. package/dist/Cubit-DRFkzD2h.js.map +1 -0
  42. package/dist/Cubit-DbnhTUaZ.cjs +359 -286
  43. package/dist/Cubit-DrqG3SP3.cjs +349 -300
  44. package/dist/Cubit-DsDkCo42.cjs +292 -250
  45. package/dist/Cubit-DwRw1E9D.cjs +289 -247
  46. package/dist/Cubit-Dw_kFBgc.js +1 -1
  47. package/dist/Cubit-KiXZCubP.cjs +1 -1
  48. package/dist/Cubit-Ksj7G4uR.js +342 -266
  49. package/dist/Cubit-MkjbpcPf.cjs +359 -286
  50. package/dist/Cubit-NRhvdDQ6.js +279 -239
  51. package/dist/Cubit-PMTXxI_u.js +1 -1
  52. package/dist/Cubit-VJuu2tt9.js +481 -0
  53. package/dist/Cubit-VJuu2tt9.js.map +1 -0
  54. package/dist/Cubit-jz922NKf.cjs +300 -257
  55. package/dist/Cubit-kU5_4jgC.cjs +359 -286
  56. package/dist/StateContainerRegistry-B4yVMYbx.cjs +1057 -0
  57. package/dist/StateContainerRegistry-B4yVMYbx.cjs.map +1 -0
  58. package/dist/StateContainerRegistry-BAcxouCu.js +683 -615
  59. package/dist/StateContainerRegistry-BK57H92E.js +701 -630
  60. package/dist/StateContainerRegistry-BRBATSrx.cjs +1030 -0
  61. package/dist/StateContainerRegistry-BRBATSrx.cjs.map +1 -0
  62. package/dist/StateContainerRegistry-BgBIKcQF.js +956 -0
  63. package/dist/StateContainerRegistry-BgBIKcQF.js.map +1 -0
  64. package/dist/StateContainerRegistry-BglEhqdA.js +669 -606
  65. package/dist/StateContainerRegistry-BhcnG0DF.js +625 -562
  66. package/dist/StateContainerRegistry-BpO5t-0i.js +642 -580
  67. package/dist/StateContainerRegistry-BqS-wpb_.js +957 -0
  68. package/dist/StateContainerRegistry-BqS-wpb_.js.map +1 -0
  69. package/dist/StateContainerRegistry-BrEGYPZT.cjs +1029 -0
  70. package/dist/StateContainerRegistry-BrEGYPZT.cjs.map +1 -0
  71. package/dist/StateContainerRegistry-Bxfne4A7.cjs +908 -0
  72. package/dist/StateContainerRegistry-Bxfne4A7.cjs.map +1 -0
  73. package/dist/StateContainerRegistry-C0E7vsgy.js +758 -0
  74. package/dist/StateContainerRegistry-C0E7vsgy.js.map +1 -0
  75. package/dist/StateContainerRegistry-C0I77Ndz.cjs +920 -0
  76. package/dist/StateContainerRegistry-C0I77Ndz.cjs.map +1 -0
  77. package/dist/StateContainerRegistry-CDH9mnQS.cjs +668 -614
  78. package/dist/StateContainerRegistry-CTOXUf75.cjs +695 -640
  79. package/dist/StateContainerRegistry-CX2CBOmv.cjs +739 -679
  80. package/dist/StateContainerRegistry-CXnnf2-l.js +867 -0
  81. package/dist/StateContainerRegistry-CXnnf2-l.js.map +1 -0
  82. package/dist/StateContainerRegistry-CehuIpK_.cjs +811 -0
  83. package/dist/StateContainerRegistry-CehuIpK_.cjs.map +1 -0
  84. package/dist/StateContainerRegistry-Ci0ajc5g.js +680 -612
  85. package/dist/StateContainerRegistry-Ck2-XmT_.js +587 -527
  86. package/dist/StateContainerRegistry-D1lVJFGL.cjs +706 -646
  87. package/dist/StateContainerRegistry-DC4N73O6.js +632 -569
  88. package/dist/StateContainerRegistry-DOuGI-l5.js +645 -582
  89. package/dist/StateContainerRegistry-DT66lr3I.cjs +651 -596
  90. package/dist/StateContainerRegistry-DmmzYa7S.js +974 -0
  91. package/dist/StateContainerRegistry-DmmzYa7S.js.map +1 -0
  92. package/dist/StateContainerRegistry-Upsrlg9G.cjs +709 -649
  93. package/dist/StateContainerRegistry-WznfcA-Q.js +855 -0
  94. package/dist/StateContainerRegistry-WznfcA-Q.js.map +1 -0
  95. package/dist/StateContainerRegistry-Yph6UCA_.js +637 -569
  96. package/dist/StateContainerRegistry-mseeTqSA.cjs +671 -616
  97. package/dist/StateContainerRegistry-pRNxHNFD.cjs +658 -603
  98. package/dist/StateContainerRegistry-vXMWtG7J.cjs +613 -561
  99. package/dist/StateContainerRegistry-v_prqMcI.cjs +663 -603
  100. package/dist/branded-BSeA_mZO.cjs.map +1 -1
  101. package/dist/branded-DCqi3De1.cjs +11 -11
  102. package/dist/branded-DwtzSsg0.js.map +1 -1
  103. package/dist/branded-Max3xOTA.js +6 -6
  104. package/dist/config-0ZD9i3wy.js +16 -0
  105. package/dist/config-0ZD9i3wy.js.map +1 -0
  106. package/dist/config-B3NIwDQv.cjs +20 -20
  107. package/dist/config-BKGHop0V.js +5 -5
  108. package/dist/config-BKoaAlmb.js +5 -5
  109. package/dist/config-BPj08-8h.cjs +32 -0
  110. package/dist/config-BPj08-8h.cjs.map +1 -0
  111. package/dist/config-BR0Xy-Tn.cjs +20 -20
  112. package/dist/config-B_4xXpvK.cjs +32 -0
  113. package/dist/config-B_4xXpvK.cjs.map +1 -0
  114. package/dist/config-BflrQM4_.cjs +32 -0
  115. package/dist/config-BflrQM4_.cjs.map +1 -0
  116. package/dist/config-BzObBsk2.cjs +32 -0
  117. package/dist/config-BzObBsk2.cjs.map +1 -0
  118. package/dist/config-C0yumL1H.cjs +32 -0
  119. package/dist/config-C0yumL1H.cjs.map +1 -0
  120. package/dist/config-C8xqVHTf.js +16 -0
  121. package/dist/config-C8xqVHTf.js.map +1 -0
  122. package/dist/config-CCUhIYIF.js +5 -5
  123. package/dist/config-CGo__MAt.js +16 -0
  124. package/dist/config-CGo__MAt.js.map +1 -0
  125. package/dist/config-CQH9fTY-.cjs +20 -20
  126. package/dist/config-CR_Bz7RD.js +5 -5
  127. package/dist/config-CTOa-yPN.cjs +20 -20
  128. package/dist/config-Cd7Q-B4g.js +16 -0
  129. package/dist/config-Cd7Q-B4g.js.map +1 -0
  130. package/dist/config-CmDEX-1o.js +16 -0
  131. package/dist/config-CmDEX-1o.js.map +1 -0
  132. package/dist/config-CoNMTnMA.cjs +32 -0
  133. package/dist/config-CoNMTnMA.cjs.map +1 -0
  134. package/dist/config-Cwj8-C1J.js +5 -5
  135. package/dist/config-D3jisfdj.cjs +20 -20
  136. package/dist/config-D4GifZQ4.js +5 -5
  137. package/dist/config-DDrSQGpQ.cjs +20 -20
  138. package/dist/config-DEcslxan.cjs +20 -20
  139. package/dist/config-DMNZ2YLV.cjs +20 -20
  140. package/dist/config-De9oQ6Ki.js +5 -5
  141. package/dist/config-DoHx0Xsl.js +16 -0
  142. package/dist/config-DoHx0Xsl.js.map +1 -0
  143. package/dist/config-DokTzpr8.cjs +20 -20
  144. package/dist/config-DslYBm4Z.js +5 -5
  145. package/dist/config-H6FAqbW4.cjs +20 -20
  146. package/dist/config-Yp645dGK.js +5 -5
  147. package/dist/config-ispAzOZV.js +5 -5
  148. package/dist/config.d.cts +72 -0
  149. package/dist/config.d.ts +72 -0
  150. package/dist/constants.d.cts +13 -0
  151. package/dist/constants.d.ts +13 -0
  152. package/dist/core/Cubit.d.ts +14 -4
  153. package/dist/core/StateContainer.d.ts +111 -11
  154. package/dist/core/StateContainerRegistry.d.ts +55 -11
  155. package/dist/core/symbols.d.ts +26 -0
  156. package/dist/debug.cjs +3 -3
  157. package/dist/debug.js +3 -3
  158. package/dist/decorators/blac.d.ts +17 -0
  159. package/dist/ensure-9VEq5H0L.js +3 -3
  160. package/dist/ensure-BB6xHQAF.cjs +14 -0
  161. package/dist/ensure-BB6xHQAF.cjs.map +1 -0
  162. package/dist/ensure-BNDfTzqg.cjs +8 -8
  163. package/dist/ensure-BVCnjU7r.js +343 -267
  164. package/dist/ensure-BbzGXjep.cjs +8 -8
  165. package/dist/ensure-BlIaQai6.js +9 -0
  166. package/dist/ensure-BlIaQai6.js.map +1 -0
  167. package/dist/ensure-Bm3oHxga.js +9 -0
  168. package/dist/ensure-Bm3oHxga.js.map +1 -0
  169. package/dist/ensure-C3eIRs6e.cjs +8 -8
  170. package/dist/ensure-CJZL7bcA.cjs +365 -292
  171. package/dist/ensure-CN6unBOe.cjs +8 -8
  172. package/dist/ensure-CU-B1ywv.js +3 -3
  173. package/dist/ensure-CWKzeno7.js +3 -3
  174. package/dist/ensure-CkENsuQ9.js +9 -0
  175. package/dist/ensure-CkENsuQ9.js.map +1 -0
  176. package/dist/ensure-Cm-4_LSh.cjs +14 -0
  177. package/dist/ensure-Cm-4_LSh.cjs.map +1 -0
  178. package/dist/ensure-Cqex5r1P.cjs +14 -0
  179. package/dist/ensure-Cqex5r1P.cjs.map +1 -0
  180. package/dist/ensure-Cv5AbNGZ.js +9 -0
  181. package/dist/ensure-Cv5AbNGZ.js.map +1 -0
  182. package/dist/ensure-D63lEMUK.cjs +8 -8
  183. package/dist/ensure-DGEtPU9A.cjs +8 -8
  184. package/dist/ensure-DM3qb336.cjs +14 -0
  185. package/dist/ensure-DM3qb336.cjs.map +1 -0
  186. package/dist/ensure-DME-_T0j.cjs +8 -8
  187. package/dist/ensure-DWd0GCYB.js +3 -3
  188. package/dist/ensure-DamKOP6q.cjs +8 -8
  189. package/dist/ensure-Dcfptl-A.js +9 -0
  190. package/dist/ensure-Dcfptl-A.js.map +1 -0
  191. package/dist/ensure-Def-EBWG.js +3 -3
  192. package/dist/ensure-DnHL5QiQ.cjs +14 -0
  193. package/dist/ensure-DnHL5QiQ.cjs.map +1 -0
  194. package/dist/ensure-Dr7I78Ku.cjs +8 -8
  195. package/dist/ensure-SLVdGd5b.js +3 -3
  196. package/dist/ensure-Sb92MCXu.js +3 -3
  197. package/dist/ensure-gFlvevGm.cjs +14 -0
  198. package/dist/ensure-gFlvevGm.cjs.map +1 -0
  199. package/dist/ensure-l2-H7S5W.js +3 -3
  200. package/dist/ensure-mkL-3qh8.js +9 -0
  201. package/dist/ensure-mkL-3qh8.js.map +1 -0
  202. package/dist/ensure-n80crSlX.js +3 -3
  203. package/dist/ensure-nCxg7MCN.js +3 -3
  204. package/dist/ensure-vS71MV4q.cjs +8 -8
  205. package/dist/index.cjs +37 -14
  206. package/dist/index.cjs.map +1 -1
  207. package/dist/index.d.cts +14 -4
  208. package/dist/index.d.ts +14 -4
  209. package/dist/index.js +23 -10
  210. package/dist/index.js.map +1 -1
  211. package/dist/management-6oQbmf0z.js +41 -0
  212. package/dist/management-6oQbmf0z.js.map +1 -0
  213. package/dist/management-B46QwA9Y.js +20 -11
  214. package/dist/management-B9yrRpeg.js +41 -0
  215. package/dist/management-B9yrRpeg.js.map +1 -0
  216. package/dist/management-BCKTEZ8Q.js +20 -11
  217. package/dist/management-BbMzdXbT.js +41 -0
  218. package/dist/management-BbMzdXbT.js.map +1 -0
  219. package/dist/management-Bg652agq.js +20 -11
  220. package/dist/management-BnedF5ZD.cjs +50 -50
  221. package/dist/management-BoUa99eB.cjs +79 -0
  222. package/dist/management-BoUa99eB.cjs.map +1 -0
  223. package/dist/management-C4SHcrJm.cjs +79 -0
  224. package/dist/management-C4SHcrJm.cjs.map +1 -0
  225. package/dist/management-CK-GL3wY.js +20 -11
  226. package/dist/management-CPhgY8OE.js +41 -0
  227. package/dist/management-CPhgY8OE.js.map +1 -0
  228. package/dist/management-CU_V3LIP.js +20 -11
  229. package/dist/management-CUwXDSi9.cjs +79 -0
  230. package/dist/management-CUwXDSi9.cjs.map +1 -0
  231. package/dist/management-CaqiyNzB.js +20 -11
  232. package/dist/management-Cin-JvYe.js +20 -11
  233. package/dist/management-ClaXym0F.cjs +50 -50
  234. package/dist/management-DL0Uzsoz.js +20 -11
  235. package/dist/management-DLdAQfqk.cjs +79 -0
  236. package/dist/management-DLdAQfqk.cjs.map +1 -0
  237. package/dist/management-DMZ8qpwr.cjs +50 -50
  238. package/dist/management-DTzcC6aD.cjs +79 -0
  239. package/dist/management-DTzcC6aD.cjs.map +1 -0
  240. package/dist/management-DYLNyj9p.cjs +50 -50
  241. package/dist/management-Dag9u4t6.cjs +50 -50
  242. package/dist/management-DbMRdDBo.cjs +50 -50
  243. package/dist/management-DfnDAKmP.js +41 -0
  244. package/dist/management-DfnDAKmP.js.map +1 -0
  245. package/dist/management-DjBU1gtb.cjs +50 -50
  246. package/dist/management-DwCozsY8.js +20 -11
  247. package/dist/management-H4m3ciJO.js +32 -0
  248. package/dist/management-H4m3ciJO.js.map +1 -0
  249. package/dist/management-Xo3A6Za3.cjs +79 -0
  250. package/dist/management-Xo3A6Za3.cjs.map +1 -0
  251. package/dist/management-ZU2YzOkr.js +18 -10
  252. package/dist/management-baPDwA9n.cjs +50 -50
  253. package/dist/management-jQGCvZNN.cjs +44 -44
  254. package/dist/management-ry_KteFK.cjs +50 -50
  255. package/dist/plugin/BlacPlugin.d.ts +89 -15
  256. package/dist/plugin/PluginManager.d.ts +65 -5
  257. package/dist/plugins.cjs +1 -1
  258. package/dist/plugins.d.cts +2 -2
  259. package/dist/plugins.d.ts +2 -2
  260. package/dist/plugins.js +1 -1
  261. package/dist/registry/acquire.d.ts +9 -2
  262. package/dist/registry/ensure.d.ts +2 -2
  263. package/dist/registry/index.d.ts +1 -1
  264. package/dist/resolve-dependencies-B2QggQAi.js +641 -558
  265. package/dist/resolve-dependencies-B6JDXvpr.js +651 -566
  266. package/dist/resolve-dependencies-BAKAoD0U.js +878 -0
  267. package/dist/resolve-dependencies-BAKAoD0U.js.map +1 -0
  268. package/dist/resolve-dependencies-BFZQq60Y.cjs +724 -666
  269. package/dist/resolve-dependencies-BGafS3Ww.js +643 -561
  270. package/dist/resolve-dependencies-BHd34gS3.cjs +724 -666
  271. package/dist/resolve-dependencies-BNeayhbQ.cjs +732 -671
  272. package/dist/resolve-dependencies-BWEMpuDy.js +641 -558
  273. package/dist/resolve-dependencies-BiWkW2eS.js +643 -561
  274. package/dist/resolve-dependencies-BjxCztYD.js +739 -0
  275. package/dist/resolve-dependencies-BjxCztYD.js.map +1 -0
  276. package/dist/resolve-dependencies-BlyBV0hB.cjs +969 -0
  277. package/dist/resolve-dependencies-BlyBV0hB.cjs.map +1 -0
  278. package/dist/resolve-dependencies-By26rT_i.js +651 -566
  279. package/dist/resolve-dependencies-C9Kf7AzY.cjs +724 -666
  280. package/dist/resolve-dependencies-CTzV1txG.js +643 -561
  281. package/dist/resolve-dependencies-CWjuGHiF.cjs +969 -0
  282. package/dist/resolve-dependencies-CWjuGHiF.cjs.map +1 -0
  283. package/dist/resolve-dependencies-ClSsP0DJ.cjs +722 -663
  284. package/dist/resolve-dependencies-D0vTzZgs.js +643 -561
  285. package/dist/resolve-dependencies-D2WnZMF-.cjs +724 -666
  286. package/dist/resolve-dependencies-DCBLTeza.cjs +969 -0
  287. package/dist/resolve-dependencies-DCBLTeza.cjs.map +1 -0
  288. package/dist/resolve-dependencies-DMlqYJR2.js +643 -561
  289. package/dist/resolve-dependencies-DP6U1EYB.cjs +840 -0
  290. package/dist/resolve-dependencies-DP6U1EYB.cjs.map +1 -0
  291. package/dist/resolve-dependencies-DSQNXvnV.cjs +724 -666
  292. package/dist/resolve-dependencies-DV3HO_uH.js +878 -0
  293. package/dist/resolve-dependencies-DV3HO_uH.js.map +1 -0
  294. package/dist/resolve-dependencies-DXwMhP0Y.js +878 -0
  295. package/dist/resolve-dependencies-DXwMhP0Y.js.map +1 -0
  296. package/dist/resolve-dependencies-DbRWlt9u.js +878 -0
  297. package/dist/resolve-dependencies-DbRWlt9u.js.map +1 -0
  298. package/dist/resolve-dependencies-DcUUva2P.cjs +724 -666
  299. package/dist/resolve-dependencies-Dd8T6TLt.cjs +724 -666
  300. package/dist/resolve-dependencies-Dfdp_DZd.cjs +732 -671
  301. package/dist/resolve-dependencies-GJ8PNyNB.cjs +969 -0
  302. package/dist/resolve-dependencies-GJ8PNyNB.cjs.map +1 -0
  303. package/dist/resolve-dependencies-KSpTt4jy.cjs +722 -663
  304. package/dist/resolve-dependencies-Nvjp4CwS.js +643 -561
  305. package/dist/resolve-dependencies-f-QUqYiL.js +643 -561
  306. package/dist/testing.cjs +27 -20
  307. package/dist/testing.cjs.map +1 -1
  308. package/dist/testing.d.cts +22 -1
  309. package/dist/testing.d.ts +22 -1
  310. package/dist/testing.js +27 -21
  311. package/dist/testing.js.map +1 -1
  312. package/dist/tracked-B77j2g9M.js +171 -151
  313. package/dist/tracked-BDVi2LKM.cjs +196 -175
  314. package/dist/tracked-BFdJCzL0.cjs +242 -0
  315. package/dist/tracked-BFdJCzL0.cjs.map +1 -0
  316. package/dist/tracked-BH-gX4T1.cjs +196 -175
  317. package/dist/tracked-BTHok3Dl.cjs +196 -175
  318. package/dist/tracked-BTbFkFeM.js +186 -166
  319. package/dist/tracked-BU_OBWqM.cjs +242 -0
  320. package/dist/tracked-BU_OBWqM.cjs.map +1 -0
  321. package/dist/tracked-BfctH2es.cjs +242 -0
  322. package/dist/tracked-BfctH2es.cjs.map +1 -0
  323. package/dist/tracked-BhQtzUhZ.js +186 -166
  324. package/dist/tracked-BnqrYXiO.js +212 -0
  325. package/dist/tracked-BnqrYXiO.js.map +1 -0
  326. package/dist/tracked-BtgFOGup.js +212 -0
  327. package/dist/tracked-BtgFOGup.js.map +1 -0
  328. package/dist/tracked-C3nIS4J7.cjs +242 -0
  329. package/dist/tracked-C3nIS4J7.cjs.map +1 -0
  330. package/dist/tracked-C52awNV9.js +171 -151
  331. package/dist/tracked-CGzduF2m.js +186 -166
  332. package/dist/tracked-CK_-ixtX.cjs +196 -175
  333. package/dist/tracked-CLlvURln.js +186 -166
  334. package/dist/tracked-CgHWmuGC.cjs +211 -190
  335. package/dist/tracked-CoAlC8fs.js +171 -151
  336. package/dist/tracked-D3Xjm1H1.cjs +211 -190
  337. package/dist/tracked-DB6yMV5F.js +212 -0
  338. package/dist/tracked-DB6yMV5F.js.map +1 -0
  339. package/dist/tracked-DBn-bs_G.js +171 -151
  340. package/dist/tracked-DMBTDF0P.js +171 -151
  341. package/dist/tracked-DN3h3Rp1.js +171 -151
  342. package/dist/tracked-DOGh1Q5Z.cjs +242 -0
  343. package/dist/tracked-DOGh1Q5Z.cjs.map +1 -0
  344. package/dist/tracked-DUkp4zve.cjs +196 -175
  345. package/dist/tracked-D_ou7mYG.js +212 -0
  346. package/dist/tracked-D_ou7mYG.js.map +1 -0
  347. package/dist/tracked-Dcu6EATB.js +171 -151
  348. package/dist/tracked-GvAJQVAI.cjs +227 -196
  349. package/dist/tracked-O2lv-kJV.cjs +211 -190
  350. package/dist/tracked-WF6aXuAo.js +186 -162
  351. package/dist/tracked-d_sQWU3c.cjs +196 -175
  352. package/dist/tracked-n9TMK-30.cjs +196 -175
  353. package/dist/tracked-njU-_pVa.cjs +211 -190
  354. package/dist/tracked-zAgmKIlC.js +212 -0
  355. package/dist/tracked-zAgmKIlC.js.map +1 -0
  356. package/dist/tracking/dependency-manager.d.ts +33 -29
  357. package/dist/tracking/index.d.ts +16 -1
  358. package/dist/tracking/iteration-perf.bench.d.ts +1 -0
  359. package/dist/tracking/path-utils.d.ts +18 -1
  360. package/dist/tracking/resolve-dependencies.d.ts +3 -1
  361. package/dist/tracking/tracked.d.ts +37 -34
  362. package/dist/tracking/tracking-proxy.d.ts +94 -47
  363. package/dist/tracking.cjs +12 -9
  364. package/dist/tracking.js +32 -2
  365. package/dist/types/utilities.d.ts +15 -3
  366. package/dist/types.cjs +1 -1
  367. package/dist/types.js +1 -1
  368. package/dist/utils/static-props.d.ts +14 -0
  369. package/dist/utils/structural-key.d.ts +14 -0
  370. package/dist/watch/watch.d.ts +1 -1
  371. package/dist/watch-BpwaUL8r.cjs +68 -0
  372. package/dist/watch-BpwaUL8r.cjs.map +1 -0
  373. package/dist/watch-DWCqXllW.js +57 -0
  374. package/dist/watch-DWCqXllW.js.map +1 -0
  375. package/dist/watch-entry.cjs +3 -6
  376. package/dist/watch-entry.d.cts +1 -3
  377. package/dist/watch-entry.d.ts +1 -3
  378. package/dist/watch-entry.js +2 -2
  379. package/package.json +4 -14
@@ -1,646 +1,729 @@
1
- import { a as BLAC_DEFAULTS, o as BLAC_ERROR_PREFIX } from "./StateContainerRegistry-Ci0ajc5g.js";
2
- import { t as getRegistry } from "./config-Cwj8-C1J.js";
1
+ import {
2
+ a as BLAC_DEFAULTS,
3
+ o as BLAC_ERROR_PREFIX,
4
+ } from './StateContainerRegistry-Ci0ajc5g.js';
5
+ import { t as getRegistry } from './config-Cwj8-C1J.js';
3
6
  //#region src/tracking/path-utils.ts
4
7
  /**
5
- * Path utilities for dependency tracking
6
- *
7
- * Provides utilities for parsing property paths and extracting values
8
- * from nested objects using path strings.
9
- *
10
- * @internal
11
- */
12
- /**
13
- * Parse a property path string into an array of segments
14
- *
15
- * @internal
16
- *
17
- * Handles both dot notation (a.b.c) and bracket notation (a[0].b)
18
- *
19
- * @example
20
- * ```ts
21
- * parsePath('user.name') // ['user', 'name']
22
- * parsePath('items[0].name') // ['items', '0', 'name']
23
- * parsePath('data.users[2].address.city') // ['data', 'users', '2', 'address', 'city']
24
- * ```
25
- */
8
+ * Path utilities for dependency tracking
9
+ *
10
+ * Provides utilities for parsing property paths and extracting values
11
+ * from nested objects using path strings.
12
+ *
13
+ * @internal
14
+ */
15
+ /**
16
+ * Parse a property path string into an array of segments
17
+ *
18
+ * @internal
19
+ *
20
+ * Handles both dot notation (a.b.c) and bracket notation (a[0].b)
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * parsePath('user.name') // ['user', 'name']
25
+ * parsePath('items[0].name') // ['items', '0', 'name']
26
+ * parsePath('data.users[2].address.city') // ['data', 'users', '2', 'address', 'city']
27
+ * ```
28
+ */
26
29
  function parsePath(path) {
27
- const segments = [];
28
- let current = "";
29
- let i = 0;
30
- while (i < path.length) {
31
- const char = path[i];
32
- if (char === ".") {
33
- if (current) segments.push(current);
34
- current = "";
35
- } else if (char === "[") {
36
- if (current) segments.push(current);
37
- current = "";
38
- i++;
39
- while (i < path.length && path[i] !== "]") current += path[i++];
40
- if (current) segments.push(current);
41
- current = "";
42
- } else current += char;
43
- i++;
44
- }
45
- if (current) segments.push(current);
46
- return segments;
47
- }
48
- /**
49
- * Get a value from an object using a path of segments
50
- *
51
- * @example
52
- * ```ts
53
- * const obj = { user: { name: 'Alice', age: 30 } }
54
- * getValueAtPath(obj, ['user', 'name']) // 'Alice'
55
- * getValueAtPath(obj, ['user', 'age']) // 30
56
- * getValueAtPath(obj, ['user', 'missing']) // undefined
57
- * ```
58
- *
59
- * @internal
60
- */
30
+ const segments = [];
31
+ let current = '';
32
+ let i = 0;
33
+ while (i < path.length) {
34
+ const char = path[i];
35
+ if (char === '.') {
36
+ if (current) segments.push(current);
37
+ current = '';
38
+ } else if (char === '[') {
39
+ if (current) segments.push(current);
40
+ current = '';
41
+ i++;
42
+ while (i < path.length && path[i] !== ']') current += path[i++];
43
+ if (current) segments.push(current);
44
+ current = '';
45
+ } else current += char;
46
+ i++;
47
+ }
48
+ if (current) segments.push(current);
49
+ return segments;
50
+ }
51
+ /**
52
+ * Get a value from an object using a path of segments
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const obj = { user: { name: 'Alice', age: 30 } }
57
+ * getValueAtPath(obj, ['user', 'name']) // 'Alice'
58
+ * getValueAtPath(obj, ['user', 'age']) // 30
59
+ * getValueAtPath(obj, ['user', 'missing']) // undefined
60
+ * ```
61
+ *
62
+ * @internal
63
+ */
61
64
  function getValueAtPath(obj, segments) {
62
- if (obj == null) return void 0;
63
- let current = obj;
64
- for (let i = 0; i < segments.length; i++) {
65
- current = current[segments[i]];
66
- if (current == null) return void 0;
67
- }
68
- return current;
69
- }
70
- /**
71
- * Shallow equality comparison for arrays
72
- *
73
- * Compares two arrays element-by-element using Object.is
74
- *
75
- * @example
76
- * ```ts
77
- * shallowEqual([1, 2, 3], [1, 2, 3]) // true
78
- * shallowEqual([1, 2, 3], [1, 2, 4]) // false
79
- * shallowEqual([1, 2], [1, 2, 3]) // false
80
- * ```
81
- *
82
- * @internal
83
- */
65
+ if (obj == null) return void 0;
66
+ let current = obj;
67
+ for (let i = 0; i < segments.length; i++) {
68
+ current = current[segments[i]];
69
+ if (current == null) return void 0;
70
+ }
71
+ return current;
72
+ }
73
+ /**
74
+ * Shallow equality comparison for arrays
75
+ *
76
+ * Compares two arrays element-by-element using Object.is
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * shallowEqual([1, 2, 3], [1, 2, 3]) // true
81
+ * shallowEqual([1, 2, 3], [1, 2, 4]) // false
82
+ * shallowEqual([1, 2], [1, 2, 3]) // false
83
+ * ```
84
+ *
85
+ * @internal
86
+ */
84
87
  function shallowEqual(arr1, arr2) {
85
- if (arr1.length !== arr2.length) return false;
86
- for (let i = 0; i < arr1.length; i++) if (!Object.is(arr1[i], arr2[i])) return false;
87
- return true;
88
+ if (arr1.length !== arr2.length) return false;
89
+ for (let i = 0; i < arr1.length; i++)
90
+ if (!Object.is(arr1[i], arr2[i])) return false;
91
+ return true;
88
92
  }
89
93
  //#endregion
90
94
  //#region src/tracking/tracking-proxy.ts
91
95
  /**
92
- * Consolidated Tracking System
93
- *
94
- * This module provides all dependency and getter tracking functionality:
95
- * - Proxy creation for automatic property access tracking
96
- * - Dependency path tracking and change detection
97
- * - Getter execution tracking for computed properties
98
- * - Combined tracking proxy for watch/waitUntil use cases
99
- */
100
- /**
101
- * Check if a value can be proxied
102
- * Returns true for plain objects and arrays only.
103
- * @internal
104
- */
96
+ * Consolidated Tracking System
97
+ *
98
+ * This module provides all dependency and getter tracking functionality:
99
+ * - Proxy creation for automatic property access tracking
100
+ * - Dependency path tracking and change detection
101
+ * - Getter execution tracking for computed properties
102
+ * - Combined tracking proxy for watch/waitUntil use cases
103
+ */
104
+ /**
105
+ * Check if a value can be proxied
106
+ * Returns true for plain objects and arrays only.
107
+ * @internal
108
+ */
105
109
  function isProxyable(value) {
106
- if (typeof value !== "object" || value === null) return false;
107
- const proto = Object.getPrototypeOf(value);
108
- return proto === Object.prototype || proto === Array.prototype;
110
+ if (typeof value !== 'object' || value === null) return false;
111
+ const proto = Object.getPrototypeOf(value);
112
+ return proto === Object.prototype || proto === Array.prototype;
109
113
  }
110
114
  /**
111
- * Create a new proxy tracker state
112
- * @internal
113
- */
115
+ * Create a new proxy tracker state
116
+ * @internal
117
+ */
114
118
  function createProxyState() {
115
- return {
116
- trackedPaths: /* @__PURE__ */ new Set(),
117
- isTracking: false,
118
- proxyCache: /* @__PURE__ */ new WeakMap(),
119
- boundFunctionsCache: null,
120
- lastProxiedState: null,
121
- lastProxy: null,
122
- maxDepth: 10
123
- };
124
- }
125
- /**
126
- * Start tracking property accesses
127
- * @internal
128
- */
119
+ return {
120
+ trackedPaths: /* @__PURE__ */ new Set(),
121
+ isTracking: false,
122
+ proxyCache: /* @__PURE__ */ new WeakMap(),
123
+ boundFunctionsCache: null,
124
+ lastProxiedState: null,
125
+ lastProxy: null,
126
+ maxDepth: 10,
127
+ };
128
+ }
129
+ /**
130
+ * Start tracking property accesses
131
+ * @internal
132
+ */
129
133
  function startProxy(state) {
130
- state.isTracking = true;
131
- state.trackedPaths.clear();
134
+ state.isTracking = true;
135
+ state.trackedPaths.clear();
132
136
  }
133
137
  /**
134
- * Stop tracking and return the tracked paths
135
- * @internal
136
- */
138
+ * Stop tracking and return the tracked paths
139
+ * @internal
140
+ */
137
141
  function stopProxy(state) {
138
- state.isTracking = false;
139
- return new Set(state.trackedPaths);
142
+ state.isTracking = false;
143
+ return new Set(state.trackedPaths);
140
144
  }
141
145
  /**
142
- * Create a proxy for an array with property access tracking
143
- * @internal
144
- */
146
+ * Create a proxy for an array with property access tracking
147
+ * @internal
148
+ */
145
149
  function createArrayProxy(state, target, path, depth = 0) {
146
- const proxy = new Proxy(target, { get: (arr, prop) => {
147
- if (typeof prop === "symbol") return Reflect.get(arr, prop);
148
- const value = Reflect.get(arr, prop);
149
- if (typeof value === "function") {
150
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
151
- const cached = state.boundFunctionsCache.get(value);
152
- if (cached) return cached;
153
- const bound = value.bind(arr);
154
- state.boundFunctionsCache.set(value, bound);
155
- return bound;
156
- }
157
- if (prop === "length") {
158
- if (state.isTracking) {
159
- const fullPath = path ? `${path}.length` : "length";
160
- state.trackedPaths.add(fullPath);
161
- }
162
- return value;
163
- }
164
- let fullPath;
165
- if (typeof prop === "string") {
166
- const index = Number(prop);
167
- if (!isNaN(index) && index >= 0) fullPath = path ? `${path}[${index}]` : `[${index}]`;
168
- else fullPath = path ? `${path}.${prop}` : prop;
169
- } else return value;
170
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
171
- if (state.isTracking) state.trackedPaths.add(fullPath);
172
- return value;
173
- } });
174
- state.proxyCache.set(target, proxy);
175
- return proxy;
176
- }
177
- /**
178
- * Create a proxy for an object with property access tracking
179
- * @internal
180
- */
181
- function createInternal(state, target, path = "", depth = 0) {
182
- if (!state.isTracking || !isProxyable(target)) return target;
183
- if (depth >= state.maxDepth) {
184
- console.warn(`${BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`);
185
- return target;
186
- }
187
- if (state.proxyCache.has(target)) return state.proxyCache.get(target);
188
- if (Array.isArray(target)) return createArrayProxy(state, target, path, depth);
189
- const proxy = new Proxy(target, {
190
- get: (obj, prop) => {
191
- if (typeof prop === "symbol") return Reflect.get(obj, prop);
192
- const value = Reflect.get(obj, prop);
193
- if (typeof value === "function") {
194
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
195
- const cached = state.boundFunctionsCache.get(value);
196
- if (cached) return cached;
197
- const bound = value.bind(obj);
198
- state.boundFunctionsCache.set(value, bound);
199
- return bound;
200
- }
201
- const fullPath = path ? `${path}.${String(prop)}` : String(prop);
202
- if (typeof prop === "string" && state.isTracking) {
203
- if (!prop.startsWith("_") && !prop.startsWith("$$")) state.trackedPaths.add(fullPath);
204
- }
205
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
206
- return value;
207
- },
208
- has: (obj, prop) => {
209
- if (typeof prop === "string" && state.isTracking) {
210
- const fullPath = path ? `${path}.${prop}` : prop;
211
- state.trackedPaths.add(fullPath);
212
- }
213
- return Reflect.has(obj, prop);
214
- },
215
- ownKeys: (obj) => {
216
- if (state.isTracking && path) state.trackedPaths.add(path);
217
- return Reflect.ownKeys(obj);
218
- }
219
- });
220
- state.proxyCache.set(target, proxy);
221
- return proxy;
222
- }
223
- /**
224
- * Create a proxy for a target with caching
225
- * @internal
226
- */
150
+ const proxy = new Proxy(target, {
151
+ get: (arr, prop) => {
152
+ if (typeof prop === 'symbol') return Reflect.get(arr, prop);
153
+ const value = Reflect.get(arr, prop);
154
+ if (typeof value === 'function') {
155
+ if (!state.boundFunctionsCache)
156
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
157
+ const cached = state.boundFunctionsCache.get(value);
158
+ if (cached) return cached;
159
+ const bound = value.bind(arr);
160
+ state.boundFunctionsCache.set(value, bound);
161
+ return bound;
162
+ }
163
+ if (prop === 'length') {
164
+ if (state.isTracking) {
165
+ const fullPath = path ? `${path}.length` : 'length';
166
+ state.trackedPaths.add(fullPath);
167
+ }
168
+ return value;
169
+ }
170
+ let fullPath;
171
+ if (typeof prop === 'string') {
172
+ const index = Number(prop);
173
+ if (!isNaN(index) && index >= 0)
174
+ fullPath = path ? `${path}[${index}]` : `[${index}]`;
175
+ else fullPath = path ? `${path}.${prop}` : prop;
176
+ } else return value;
177
+ if (isProxyable(value))
178
+ return createInternal(state, value, fullPath, depth + 1);
179
+ if (state.isTracking) state.trackedPaths.add(fullPath);
180
+ return value;
181
+ },
182
+ });
183
+ state.proxyCache.set(target, proxy);
184
+ return proxy;
185
+ }
186
+ /**
187
+ * Create a proxy for an object with property access tracking
188
+ * @internal
189
+ */
190
+ function createInternal(state, target, path = '', depth = 0) {
191
+ if (!state.isTracking || !isProxyable(target)) return target;
192
+ if (depth >= state.maxDepth) {
193
+ console.warn(
194
+ `${BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`,
195
+ );
196
+ return target;
197
+ }
198
+ if (state.proxyCache.has(target)) return state.proxyCache.get(target);
199
+ if (Array.isArray(target))
200
+ return createArrayProxy(state, target, path, depth);
201
+ const proxy = new Proxy(target, {
202
+ get: (obj, prop) => {
203
+ if (typeof prop === 'symbol') return Reflect.get(obj, prop);
204
+ const value = Reflect.get(obj, prop);
205
+ if (typeof value === 'function') {
206
+ if (!state.boundFunctionsCache)
207
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
208
+ const cached = state.boundFunctionsCache.get(value);
209
+ if (cached) return cached;
210
+ const bound = value.bind(obj);
211
+ state.boundFunctionsCache.set(value, bound);
212
+ return bound;
213
+ }
214
+ const fullPath = path ? `${path}.${String(prop)}` : String(prop);
215
+ if (typeof prop === 'string' && state.isTracking) {
216
+ if (!prop.startsWith('_') && !prop.startsWith('$$'))
217
+ state.trackedPaths.add(fullPath);
218
+ }
219
+ if (isProxyable(value))
220
+ return createInternal(state, value, fullPath, depth + 1);
221
+ return value;
222
+ },
223
+ has: (obj, prop) => {
224
+ if (typeof prop === 'string' && state.isTracking) {
225
+ const fullPath = path ? `${path}.${prop}` : prop;
226
+ state.trackedPaths.add(fullPath);
227
+ }
228
+ return Reflect.has(obj, prop);
229
+ },
230
+ ownKeys: (obj) => {
231
+ if (state.isTracking && path) state.trackedPaths.add(path);
232
+ return Reflect.ownKeys(obj);
233
+ },
234
+ });
235
+ state.proxyCache.set(target, proxy);
236
+ return proxy;
237
+ }
238
+ /**
239
+ * Create a proxy for a target with caching
240
+ * @internal
241
+ */
227
242
  function createForTarget(state, target) {
228
- if (state.lastProxiedState === target && state.lastProxy) return state.lastProxy;
229
- state.proxyCache = /* @__PURE__ */ new WeakMap();
230
- state.boundFunctionsCache = null;
231
- const proxy = createInternal(state, target, "", 0);
232
- state.lastProxiedState = target;
233
- state.lastProxy = proxy;
234
- return proxy;
243
+ if (state.lastProxiedState === target && state.lastProxy)
244
+ return state.lastProxy;
245
+ state.proxyCache = /* @__PURE__ */ new WeakMap();
246
+ state.boundFunctionsCache = null;
247
+ const proxy = createInternal(state, target, '', 0);
248
+ state.lastProxiedState = target;
249
+ state.lastProxy = proxy;
250
+ return proxy;
235
251
  }
236
252
  function isChildPath(child, parent) {
237
- if (child === parent) return false;
238
- return child.startsWith(parent + ".") || child.startsWith(parent + "[");
253
+ if (child === parent) return false;
254
+ return child.startsWith(parent + '.') || child.startsWith(parent + '[');
239
255
  }
240
256
  function getArrayParentPath(path) {
241
- if (path.endsWith(".length")) return path.slice(0, -7);
242
- const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
243
- if (arrayIndexMatch) return arrayIndexMatch[1];
244
- return null;
257
+ if (path.endsWith('.length')) return path.slice(0, -7);
258
+ const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
259
+ if (arrayIndexMatch) return arrayIndexMatch[1];
260
+ return null;
245
261
  }
246
262
  /**
247
- * @internal
248
- */
263
+ * @internal
264
+ */
249
265
  function optimizeTrackedPaths(paths) {
250
- if (paths.size <= 1) return new Set(paths);
251
- const sortedPaths = Array.from(paths).sort((a, b) => a > b ? -1 : a < b ? 1 : 0);
252
- const optimized = /* @__PURE__ */ new Set();
253
- let lastKept;
254
- for (const path of sortedPaths) {
255
- if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
256
- optimized.add(path);
257
- lastKept = path;
258
- }
259
- const arrayParents = /* @__PURE__ */ new Set();
260
- for (const path of optimized) {
261
- const arrayParent = getArrayParentPath(path);
262
- if (arrayParent) arrayParents.add(arrayParent);
263
- }
264
- for (const arrayParent of arrayParents) optimized.add(arrayParent);
265
- return optimized;
266
- }
267
- /**
268
- * @internal
269
- */
266
+ if (paths.size <= 1) return new Set(paths);
267
+ const sortedPaths = Array.from(paths).sort((a, b) =>
268
+ a > b ? -1 : a < b ? 1 : 0,
269
+ );
270
+ const optimized = /* @__PURE__ */ new Set();
271
+ let lastKept;
272
+ for (const path of sortedPaths) {
273
+ if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
274
+ optimized.add(path);
275
+ lastKept = path;
276
+ }
277
+ const arrayParents = /* @__PURE__ */ new Set();
278
+ for (const path of optimized) {
279
+ const arrayParent = getArrayParentPath(path);
280
+ if (arrayParent) arrayParents.add(arrayParent);
281
+ }
282
+ for (const arrayParent of arrayParents) optimized.add(arrayParent);
283
+ return optimized;
284
+ }
285
+ /**
286
+ * @internal
287
+ */
270
288
  function createDependencyState() {
271
- return {
272
- proxyState: createProxyState(),
273
- previousRenderPaths: /* @__PURE__ */ new Set(),
274
- currentRenderPaths: /* @__PURE__ */ new Set(),
275
- pathCache: /* @__PURE__ */ new Map(),
276
- lastCheckedState: null,
277
- lastCheckedValues: /* @__PURE__ */ new Map()
278
- };
279
- }
280
- /**
281
- * @internal
282
- */
289
+ return {
290
+ proxyState: createProxyState(),
291
+ previousRenderPaths: /* @__PURE__ */ new Set(),
292
+ currentRenderPaths: /* @__PURE__ */ new Set(),
293
+ pathCache: /* @__PURE__ */ new Map(),
294
+ lastCheckedState: null,
295
+ lastCheckedValues: /* @__PURE__ */ new Map(),
296
+ };
297
+ }
298
+ /**
299
+ * @internal
300
+ */
283
301
  function startDependency(tracker) {
284
- startProxy(tracker.proxyState);
302
+ startProxy(tracker.proxyState);
285
303
  }
286
304
  /**
287
- * @internal
288
- */
305
+ * @internal
306
+ */
289
307
  function createDependencyProxy(tracker, state) {
290
- return createForTarget(tracker.proxyState, state);
308
+ return createForTarget(tracker.proxyState, state);
291
309
  }
292
310
  /**
293
- * @internal
294
- */
311
+ * @internal
312
+ */
295
313
  function capturePaths(tracker, state) {
296
- tracker.previousRenderPaths = tracker.currentRenderPaths;
297
- tracker.currentRenderPaths = optimizeTrackedPaths(stopProxy(tracker.proxyState));
298
- if (tracker.previousRenderPaths.size === 0 && tracker.currentRenderPaths.size === 0) return;
299
- const trackedPathsUnion = new Set(tracker.previousRenderPaths);
300
- for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
301
- const canReuseCache = tracker.lastCheckedState === state;
302
- for (const path of trackedPathsUnion) if (!tracker.pathCache.has(path)) {
303
- const segments = parsePath(path);
304
- const value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, segments);
305
- tracker.pathCache.set(path, {
306
- segments,
307
- value
308
- });
309
- } else {
310
- const info = tracker.pathCache.get(path);
311
- if (!info) continue;
312
- info.value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, info.segments);
313
- }
314
- tracker.lastCheckedValues.clear();
315
- }
316
- /**
317
- * @internal
318
- */
314
+ tracker.previousRenderPaths = tracker.currentRenderPaths;
315
+ tracker.currentRenderPaths = optimizeTrackedPaths(
316
+ stopProxy(tracker.proxyState),
317
+ );
318
+ if (
319
+ tracker.previousRenderPaths.size === 0 &&
320
+ tracker.currentRenderPaths.size === 0
321
+ )
322
+ return;
323
+ const trackedPathsUnion = new Set(tracker.previousRenderPaths);
324
+ for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
325
+ const canReuseCache = tracker.lastCheckedState === state;
326
+ for (const path of trackedPathsUnion)
327
+ if (!tracker.pathCache.has(path)) {
328
+ const segments = parsePath(path);
329
+ const value =
330
+ canReuseCache && tracker.lastCheckedValues.has(path)
331
+ ? tracker.lastCheckedValues.get(path)
332
+ : getValueAtPath(state, segments);
333
+ tracker.pathCache.set(path, {
334
+ segments,
335
+ value,
336
+ });
337
+ } else {
338
+ const info = tracker.pathCache.get(path);
339
+ if (!info) continue;
340
+ info.value =
341
+ canReuseCache && tracker.lastCheckedValues.has(path)
342
+ ? tracker.lastCheckedValues.get(path)
343
+ : getValueAtPath(state, info.segments);
344
+ }
345
+ tracker.lastCheckedValues.clear();
346
+ }
347
+ /**
348
+ * @internal
349
+ */
319
350
  function hasDependencyChanges(tracker, state) {
320
- if (tracker.pathCache.size === 0) return true;
321
- tracker.lastCheckedValues.clear();
322
- for (const [path, info] of tracker.pathCache.entries()) {
323
- const currentValue = getValueAtPath(state, info.segments);
324
- tracker.lastCheckedValues.set(path, currentValue);
325
- if (!Object.is(currentValue, info.value)) {
326
- tracker.lastCheckedState = state;
327
- return true;
328
- }
329
- }
330
- tracker.lastCheckedState = state;
331
- return false;
332
- }
333
- /**
334
- * @internal
335
- */
351
+ if (tracker.pathCache.size === 0) return true;
352
+ tracker.lastCheckedValues.clear();
353
+ for (const [path, info] of tracker.pathCache.entries()) {
354
+ const currentValue = getValueAtPath(state, info.segments);
355
+ tracker.lastCheckedValues.set(path, currentValue);
356
+ if (!Object.is(currentValue, info.value)) {
357
+ tracker.lastCheckedState = state;
358
+ return true;
359
+ }
360
+ }
361
+ tracker.lastCheckedState = state;
362
+ return false;
363
+ }
364
+ /**
365
+ * @internal
366
+ */
336
367
  function hasTrackedData(tracker) {
337
- return tracker.proxyState.trackedPaths.size > 0 || tracker.pathCache.size > 0 || tracker.previousRenderPaths.size > 0;
368
+ return (
369
+ tracker.proxyState.trackedPaths.size > 0 ||
370
+ tracker.pathCache.size > 0 ||
371
+ tracker.previousRenderPaths.size > 0
372
+ );
338
373
  }
339
374
  const descriptorCache = /* @__PURE__ */ new WeakMap();
340
375
  const blocProxyCache = /* @__PURE__ */ new WeakMap();
341
376
  const activeTrackerMap = /* @__PURE__ */ new WeakMap();
342
377
  const MAX_GETTER_DEPTH = BLAC_DEFAULTS.MAX_GETTER_DEPTH;
343
378
  /**
344
- * @internal
345
- */
379
+ * @internal
380
+ */
346
381
  function getDescriptor(obj, prop) {
347
- const constructor = obj.constructor;
348
- let constructorCache = descriptorCache.get(constructor);
349
- if (constructorCache?.has(prop)) return constructorCache.get(prop);
350
- let current = obj;
351
- let descriptor;
352
- while (current && current !== Object.prototype) {
353
- descriptor = Object.getOwnPropertyDescriptor(current, prop);
354
- if (descriptor) break;
355
- current = Object.getPrototypeOf(current);
356
- }
357
- if (!constructorCache) {
358
- constructorCache = /* @__PURE__ */ new Map();
359
- descriptorCache.set(constructor, constructorCache);
360
- }
361
- constructorCache.set(prop, descriptor);
362
- return descriptor;
363
- }
364
- /**
365
- * @internal
366
- */
382
+ const constructor = obj.constructor;
383
+ let constructorCache = descriptorCache.get(constructor);
384
+ if (constructorCache?.has(prop)) return constructorCache.get(prop);
385
+ let current = obj;
386
+ let descriptor;
387
+ while (current && current !== Object.prototype) {
388
+ descriptor = Object.getOwnPropertyDescriptor(current, prop);
389
+ if (descriptor) break;
390
+ current = Object.getPrototypeOf(current);
391
+ }
392
+ if (!constructorCache) {
393
+ constructorCache = /* @__PURE__ */ new Map();
394
+ descriptorCache.set(constructor, constructorCache);
395
+ }
396
+ constructorCache.set(prop, descriptor);
397
+ return descriptor;
398
+ }
399
+ /**
400
+ * @internal
401
+ */
367
402
  function isGetter(obj, prop) {
368
- return getDescriptor(obj, prop)?.get !== void 0;
403
+ return getDescriptor(obj, prop)?.get !== void 0;
369
404
  }
370
405
  /**
371
- * @internal
372
- */
406
+ * @internal
407
+ */
373
408
  function createGetterState() {
374
- return {
375
- trackedValues: /* @__PURE__ */ new Map(),
376
- currentlyAccessing: /* @__PURE__ */ new Set(),
377
- trackedGetters: /* @__PURE__ */ new Set(),
378
- isTracking: false,
379
- renderCache: /* @__PURE__ */ new Map(),
380
- cacheValid: false,
381
- depth: 0,
382
- visitedBlocs: /* @__PURE__ */ new Set()
383
- };
384
- }
385
- /**
386
- * @internal
387
- */
409
+ return {
410
+ trackedValues: /* @__PURE__ */ new Map(),
411
+ currentlyAccessing: /* @__PURE__ */ new Set(),
412
+ trackedGetters: /* @__PURE__ */ new Set(),
413
+ isTracking: false,
414
+ renderCache: /* @__PURE__ */ new Map(),
415
+ cacheValid: false,
416
+ depth: 0,
417
+ visitedBlocs: /* @__PURE__ */ new Set(),
418
+ };
419
+ }
420
+ /**
421
+ * @internal
422
+ */
388
423
  function setActiveTracker(bloc, tracker) {
389
- activeTrackerMap.set(bloc, tracker);
424
+ activeTrackerMap.set(bloc, tracker);
390
425
  }
391
426
  /**
392
- * @internal
393
- */
427
+ * @internal
428
+ */
394
429
  function clearActiveTracker(bloc) {
395
- activeTrackerMap.delete(bloc);
430
+ activeTrackerMap.delete(bloc);
396
431
  }
397
432
  /**
398
- * @internal
399
- */
433
+ * @internal
434
+ */
400
435
  function commitTrackedGetters(tracker) {
401
- if (tracker.currentlyAccessing.size > 0) tracker.trackedGetters = new Set(tracker.currentlyAccessing);
402
- tracker.currentlyAccessing.clear();
436
+ if (tracker.currentlyAccessing.size > 0)
437
+ tracker.trackedGetters = new Set(tracker.currentlyAccessing);
438
+ tracker.currentlyAccessing.clear();
403
439
  }
404
440
  /**
405
- * Execute a tracked getter with depth/circular dependency checks and context management.
406
- * @internal
407
- */
441
+ * Execute a tracked getter with depth/circular dependency checks and context management.
442
+ * @internal
443
+ */
408
444
  function executeTrackedGetter(target, prop, tracker) {
409
- tracker.currentlyAccessing.add(prop);
410
- if (tracker.cacheValid && tracker.renderCache.has(prop)) {
411
- const cachedValue = tracker.renderCache.get(prop);
412
- tracker.trackedValues.set(prop, cachedValue);
413
- return cachedValue;
414
- }
415
- if (tracker.depth >= MAX_GETTER_DEPTH) throw new Error(`${BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`);
416
- if (tracker.visitedBlocs.has(target)) throw new Error(`${BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`);
417
- const prevDepth = tracker.depth;
418
- const prevVisited = new Set(tracker.visitedBlocs);
419
- tracker.depth++;
420
- tracker.visitedBlocs.add(target);
421
- try {
422
- const descriptor = getDescriptor(target, prop);
423
- if (!descriptor?.get) return target[prop];
424
- const value = descriptor.get.call(target);
425
- tracker.trackedValues.set(prop, value);
426
- return value;
427
- } catch (error) {
428
- tracker.currentlyAccessing.delete(prop);
429
- throw error;
430
- } finally {
431
- tracker.depth = prevDepth;
432
- tracker.visitedBlocs = prevVisited;
433
- }
434
- }
435
- /**
436
- * @internal
437
- */
445
+ tracker.currentlyAccessing.add(prop);
446
+ if (tracker.cacheValid && tracker.renderCache.has(prop)) {
447
+ const cachedValue = tracker.renderCache.get(prop);
448
+ tracker.trackedValues.set(prop, cachedValue);
449
+ return cachedValue;
450
+ }
451
+ if (tracker.depth >= MAX_GETTER_DEPTH)
452
+ throw new Error(
453
+ `${BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`,
454
+ );
455
+ if (tracker.visitedBlocs.has(target))
456
+ throw new Error(
457
+ `${BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`,
458
+ );
459
+ const prevDepth = tracker.depth;
460
+ const prevVisited = new Set(tracker.visitedBlocs);
461
+ tracker.depth++;
462
+ tracker.visitedBlocs.add(target);
463
+ try {
464
+ const descriptor = getDescriptor(target, prop);
465
+ if (!descriptor?.get) return target[prop];
466
+ const value = descriptor.get.call(target);
467
+ tracker.trackedValues.set(prop, value);
468
+ return value;
469
+ } catch (error) {
470
+ tracker.currentlyAccessing.delete(prop);
471
+ throw error;
472
+ } finally {
473
+ tracker.depth = prevDepth;
474
+ tracker.visitedBlocs = prevVisited;
475
+ }
476
+ }
477
+ /**
478
+ * @internal
479
+ */
438
480
  function createBlocProxy(bloc) {
439
- const cached = blocProxyCache.get(bloc);
440
- if (cached) return cached;
441
- const proxy = new Proxy(bloc, { get(target, prop, receiver) {
442
- const tracker = activeTrackerMap.get(target);
443
- if (tracker?.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker);
444
- return Reflect.get(target, prop, receiver);
445
- } });
446
- blocProxyCache.set(bloc, proxy);
447
- return proxy;
448
- }
449
- /**
450
- * @internal
451
- */
481
+ const cached = blocProxyCache.get(bloc);
482
+ if (cached) return cached;
483
+ const proxy = new Proxy(bloc, {
484
+ get(target, prop, receiver) {
485
+ const tracker = activeTrackerMap.get(target);
486
+ if (tracker?.isTracking && isGetter(target, prop))
487
+ return executeTrackedGetter(target, prop, tracker);
488
+ return Reflect.get(target, prop, receiver);
489
+ },
490
+ });
491
+ blocProxyCache.set(bloc, proxy);
492
+ return proxy;
493
+ }
494
+ /**
495
+ * @internal
496
+ */
452
497
  function hasGetterChanges(bloc, tracker) {
453
- if (!tracker || tracker.trackedGetters.size === 0) return false;
454
- tracker.renderCache.clear();
455
- let hasAnyChange = false;
456
- for (const prop of tracker.trackedGetters) try {
457
- const descriptor = getDescriptor(bloc, prop);
458
- if (!descriptor?.get) continue;
459
- const newValue = descriptor.get.call(bloc);
460
- const oldValue = tracker.trackedValues.get(prop);
461
- tracker.renderCache.set(prop, newValue);
462
- tracker.trackedValues.set(prop, newValue);
463
- if (!Object.is(newValue, oldValue)) hasAnyChange = true;
464
- } catch (error) {
465
- console.warn(`${BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`, error);
466
- tracker.trackedGetters.delete(prop);
467
- tracker.trackedValues.delete(prop);
468
- tracker.cacheValid = false;
469
- return true;
470
- }
471
- tracker.cacheValid = true;
472
- return hasAnyChange;
473
- }
474
- /**
475
- * @internal
476
- */
498
+ if (!tracker || tracker.trackedGetters.size === 0) return false;
499
+ tracker.renderCache.clear();
500
+ let hasAnyChange = false;
501
+ for (const prop of tracker.trackedGetters)
502
+ try {
503
+ const descriptor = getDescriptor(bloc, prop);
504
+ if (!descriptor?.get) continue;
505
+ const newValue = descriptor.get.call(bloc);
506
+ const oldValue = tracker.trackedValues.get(prop);
507
+ tracker.renderCache.set(prop, newValue);
508
+ tracker.trackedValues.set(prop, newValue);
509
+ if (!Object.is(newValue, oldValue)) hasAnyChange = true;
510
+ } catch (error) {
511
+ console.warn(
512
+ `${BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`,
513
+ error,
514
+ );
515
+ tracker.trackedGetters.delete(prop);
516
+ tracker.trackedValues.delete(prop);
517
+ tracker.cacheValid = false;
518
+ return true;
519
+ }
520
+ tracker.cacheValid = true;
521
+ return hasAnyChange;
522
+ }
523
+ /**
524
+ * @internal
525
+ */
477
526
  function invalidateRenderCache(tracker) {
478
- tracker.cacheValid = false;
527
+ tracker.cacheValid = false;
479
528
  }
480
529
  /**
481
- * Create a new tracking proxy state.
482
- */
530
+ * Create a new tracking proxy state.
531
+ */
483
532
  function createState() {
484
- return {
485
- dependencyState: createDependencyState(),
486
- getterState: createGetterState(),
487
- dependencies: /* @__PURE__ */ new Set(),
488
- isTracking: false
489
- };
533
+ return {
534
+ dependencyState: createDependencyState(),
535
+ getterState: createGetterState(),
536
+ dependencies: /* @__PURE__ */ new Set(),
537
+ isTracking: false,
538
+ };
490
539
  }
491
540
  /**
492
- * Start tracking on a tracking proxy.
493
- */
541
+ * Start tracking on a tracking proxy.
542
+ */
494
543
  function startTracking(tracker) {
495
- tracker.isTracking = true;
496
- tracker.dependencies.clear();
497
- tracker.getterState.isTracking = true;
498
- startDependency(tracker.dependencyState);
544
+ tracker.isTracking = true;
545
+ tracker.dependencies.clear();
546
+ tracker.getterState.isTracking = true;
547
+ startDependency(tracker.dependencyState);
499
548
  }
500
549
  /**
501
- * Stop tracking and collect all dependencies.
502
- */
550
+ * Stop tracking and collect all dependencies.
551
+ */
503
552
  function stopTracking(tracker, bloc) {
504
- tracker.isTracking = false;
505
- tracker.getterState.isTracking = false;
506
- capturePaths(tracker.dependencyState, bloc.state);
507
- commitTrackedGetters(tracker.getterState);
508
- return new Set(tracker.dependencies);
553
+ tracker.isTracking = false;
554
+ tracker.getterState.isTracking = false;
555
+ capturePaths(tracker.dependencyState, bloc.state);
556
+ commitTrackedGetters(tracker.getterState);
557
+ return new Set(tracker.dependencies);
509
558
  }
510
559
  /**
511
- * Check if tracked state or getters have changed.
512
- */
560
+ * Check if tracked state or getters have changed.
561
+ */
513
562
  function hasChanges(tracker, bloc) {
514
- invalidateRenderCache(tracker.getterState);
515
- const stateChanged = hasDependencyChanges(tracker.dependencyState, bloc.state);
516
- const getterChanged = hasGetterChanges(bloc, tracker.getterState);
517
- return stateChanged || getterChanged;
518
- }
519
- /**
520
- * Create a tracking proxy for a bloc instance.
521
- * Tracks both state property access and getter access.
522
- */
563
+ invalidateRenderCache(tracker.getterState);
564
+ const stateChanged = hasDependencyChanges(
565
+ tracker.dependencyState,
566
+ bloc.state,
567
+ );
568
+ const getterChanged = hasGetterChanges(bloc, tracker.getterState);
569
+ return stateChanged || getterChanged;
570
+ }
571
+ /**
572
+ * Create a tracking proxy for a bloc instance.
573
+ * Tracks both state property access and getter access.
574
+ */
523
575
  function createTrackingProxy(bloc, tracker) {
524
- tracker.dependencies.add(bloc);
525
- const stateProxyCache = /* @__PURE__ */ new WeakMap();
526
- return new Proxy(bloc, { get(target, prop, receiver) {
527
- if (prop === "state") {
528
- if (!tracker.isTracking) return target.state;
529
- const rawState = target.state;
530
- if (rawState === null || typeof rawState !== "object") return rawState;
531
- if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
532
- const stateProxy = createDependencyProxy(tracker.dependencyState, rawState);
533
- stateProxyCache.set(rawState, stateProxy);
534
- return stateProxy;
535
- }
536
- if (typeof prop === "symbol") return Reflect.get(target, prop, receiver);
537
- const value = Reflect.get(target, prop, receiver);
538
- if (typeof value === "function") return value.bind(target);
539
- if (tracker.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker.getterState);
540
- return value;
541
- } });
576
+ tracker.dependencies.add(bloc);
577
+ const stateProxyCache = /* @__PURE__ */ new WeakMap();
578
+ return new Proxy(bloc, {
579
+ get(target, prop, receiver) {
580
+ if (prop === 'state') {
581
+ if (!tracker.isTracking) return target.state;
582
+ const rawState = target.state;
583
+ if (rawState === null || typeof rawState !== 'object') return rawState;
584
+ if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
585
+ const stateProxy = createDependencyProxy(
586
+ tracker.dependencyState,
587
+ rawState,
588
+ );
589
+ stateProxyCache.set(rawState, stateProxy);
590
+ return stateProxy;
591
+ }
592
+ if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);
593
+ const value = Reflect.get(target, prop, receiver);
594
+ if (typeof value === 'function') return value.bind(target);
595
+ if (tracker.isTracking && isGetter(target, prop))
596
+ return executeTrackedGetter(target, prop, tracker.getterState);
597
+ return value;
598
+ },
599
+ });
542
600
  }
543
601
  //#endregion
544
602
  //#region src/tracking/dependency-manager.ts
545
603
  /**
546
- * Manages subscriptions to state container dependencies.
547
- * Provides efficient sync mechanism to add/remove subscriptions
548
- * as dependencies change between callback invocations.
549
- */
604
+ * Manages subscriptions to state container dependencies.
605
+ * Provides efficient sync mechanism to add/remove subscriptions
606
+ * as dependencies change between callback invocations.
607
+ */
550
608
  var DependencyManager = class {
551
- constructor() {
552
- this.subscriptions = /* @__PURE__ */ new Map();
553
- this.currentDeps = /* @__PURE__ */ new Set();
554
- }
555
- /**
556
- * Sync subscriptions with a new set of dependencies.
557
- * Adds subscriptions for new deps, removes subscriptions for stale deps.
558
- *
559
- * @param newDeps - The new set of dependencies to subscribe to
560
- * @param onChange - Callback to invoke when any dependency changes
561
- * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
562
- * @returns true if the dependency set changed, false if unchanged
563
- */
564
- sync(newDeps, onChange, exclude) {
565
- const filteredNewDeps = /* @__PURE__ */ new Set();
566
- for (const dep of newDeps) if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
567
- if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
568
- for (const dep of this.currentDeps) if (!filteredNewDeps.has(dep)) {
569
- const unsub = this.subscriptions.get(dep);
570
- if (unsub) {
571
- unsub();
572
- this.subscriptions.delete(dep);
573
- }
574
- }
575
- for (const dep of filteredNewDeps) if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
576
- const unsub = dep.subscribe(onChange);
577
- this.subscriptions.set(dep, unsub);
578
- }
579
- this.currentDeps = filteredNewDeps;
580
- return true;
581
- }
582
- /**
583
- * Add a single dependency subscription.
584
- */
585
- add(dep, onChange) {
586
- if (this.subscriptions.has(dep) || dep.isDisposed) return;
587
- const unsub = dep.subscribe(onChange);
588
- this.subscriptions.set(dep, unsub);
589
- this.currentDeps.add(dep);
590
- }
591
- /**
592
- * Check if a dependency is currently subscribed.
593
- */
594
- has(dep) {
595
- return this.currentDeps.has(dep);
596
- }
597
- /**
598
- * Get the current set of dependencies.
599
- */
600
- getDependencies() {
601
- return new Set(this.currentDeps);
602
- }
603
- /**
604
- * Clean up all active subscriptions.
605
- */
606
- cleanup() {
607
- for (const unsub of this.subscriptions.values()) unsub();
608
- this.subscriptions.clear();
609
- this.currentDeps.clear();
610
- }
611
- areSetsEqual(a, b) {
612
- if (a.size !== b.size) return false;
613
- for (const item of a) if (!b.has(item)) return false;
614
- return true;
615
- }
609
+ constructor() {
610
+ this.subscriptions = /* @__PURE__ */ new Map();
611
+ this.currentDeps = /* @__PURE__ */ new Set();
612
+ }
613
+ /**
614
+ * Sync subscriptions with a new set of dependencies.
615
+ * Adds subscriptions for new deps, removes subscriptions for stale deps.
616
+ *
617
+ * @param newDeps - The new set of dependencies to subscribe to
618
+ * @param onChange - Callback to invoke when any dependency changes
619
+ * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
620
+ * @returns true if the dependency set changed, false if unchanged
621
+ */
622
+ sync(newDeps, onChange, exclude) {
623
+ const filteredNewDeps = /* @__PURE__ */ new Set();
624
+ for (const dep of newDeps)
625
+ if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
626
+ if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
627
+ for (const dep of this.currentDeps)
628
+ if (!filteredNewDeps.has(dep)) {
629
+ const unsub = this.subscriptions.get(dep);
630
+ if (unsub) {
631
+ unsub();
632
+ this.subscriptions.delete(dep);
633
+ }
634
+ }
635
+ for (const dep of filteredNewDeps)
636
+ if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
637
+ const unsub = dep.subscribe(onChange);
638
+ this.subscriptions.set(dep, unsub);
639
+ }
640
+ this.currentDeps = filteredNewDeps;
641
+ return true;
642
+ }
643
+ /**
644
+ * Add a single dependency subscription.
645
+ */
646
+ add(dep, onChange) {
647
+ if (this.subscriptions.has(dep) || dep.isDisposed) return;
648
+ const unsub = dep.subscribe(onChange);
649
+ this.subscriptions.set(dep, unsub);
650
+ this.currentDeps.add(dep);
651
+ }
652
+ /**
653
+ * Check if a dependency is currently subscribed.
654
+ */
655
+ has(dep) {
656
+ return this.currentDeps.has(dep);
657
+ }
658
+ /**
659
+ * Get the current set of dependencies.
660
+ */
661
+ getDependencies() {
662
+ return new Set(this.currentDeps);
663
+ }
664
+ /**
665
+ * Clean up all active subscriptions.
666
+ */
667
+ cleanup() {
668
+ for (const unsub of this.subscriptions.values()) unsub();
669
+ this.subscriptions.clear();
670
+ this.currentDeps.clear();
671
+ }
672
+ areSetsEqual(a, b) {
673
+ if (a.size !== b.size) return false;
674
+ for (const item of a) if (!b.has(item)) return false;
675
+ return true;
676
+ }
616
677
  };
617
678
  //#endregion
618
679
  //#region src/tracking/resolve-dependencies.ts
619
680
  /**
620
- * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
621
- * Uses cycle detection to avoid infinite loops.
622
- * @internal
623
- */
681
+ * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
682
+ * Uses cycle detection to avoid infinite loops.
683
+ * @internal
684
+ */
624
685
  function resolveDependencies(bloc) {
625
- const result = /* @__PURE__ */ new Set();
626
- const visited = /* @__PURE__ */ new Set();
627
- const queue = [bloc];
628
- let head = 0;
629
- while (head < queue.length) {
630
- const current = queue[head++];
631
- for (const [Type, key] of current.dependencies) {
632
- const visitKey = `${Type.name}::${key}`;
633
- if (visited.has(visitKey)) continue;
634
- visited.add(visitKey);
635
- const dep = getRegistry().ensure(Type, key);
636
- result.add(dep);
637
- if (dep.dependencies.size > 0) queue.push(dep);
638
- }
639
- }
640
- result.delete(bloc);
641
- return result;
686
+ const result = /* @__PURE__ */ new Set();
687
+ const visited = /* @__PURE__ */ new Set();
688
+ const queue = [bloc];
689
+ let head = 0;
690
+ while (head < queue.length) {
691
+ const current = queue[head++];
692
+ for (const [Type, key] of current.dependencies) {
693
+ const visitKey = `${Type.name}::${key}`;
694
+ if (visited.has(visitKey)) continue;
695
+ visited.add(visitKey);
696
+ const dep = getRegistry().ensure(Type, key);
697
+ result.add(dep);
698
+ if (dep.dependencies.size > 0) queue.push(dep);
699
+ }
700
+ }
701
+ result.delete(bloc);
702
+ return result;
642
703
  }
643
704
  //#endregion
644
- export { setActiveTracker as _, commitTrackedGetters as a, stopTracking as b, createDependencyState as c, createTrackingProxy as d, hasChanges as f, invalidateRenderCache as g, hasTrackedData as h, clearActiveTracker as i, createGetterState as l, hasGetterChanges as m, DependencyManager as n, createBlocProxy as o, hasDependencyChanges as p, capturePaths as r, createDependencyProxy as s, resolveDependencies as t, createState as u, startDependency as v, shallowEqual as x, startTracking as y };
705
+ export {
706
+ setActiveTracker as _,
707
+ commitTrackedGetters as a,
708
+ stopTracking as b,
709
+ createDependencyState as c,
710
+ createTrackingProxy as d,
711
+ hasChanges as f,
712
+ invalidateRenderCache as g,
713
+ hasTrackedData as h,
714
+ clearActiveTracker as i,
715
+ createGetterState as l,
716
+ hasGetterChanges as m,
717
+ DependencyManager as n,
718
+ createBlocProxy as o,
719
+ hasDependencyChanges as p,
720
+ capturePaths as r,
721
+ createDependencyProxy as s,
722
+ resolveDependencies as t,
723
+ createState as u,
724
+ startDependency as v,
725
+ shallowEqual as x,
726
+ startTracking as y,
727
+ };
645
728
 
646
- //# sourceMappingURL=resolve-dependencies-BWEMpuDy.js.map
729
+ //# sourceMappingURL=resolve-dependencies-BWEMpuDy.js.map