@blac/core 2.0.11 → 2.0.13

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 (364) hide show
  1. package/dist/Cubit-9jal5zdZ.cjs +390 -0
  2. package/dist/Cubit-9jal5zdZ.cjs.map +1 -0
  3. package/dist/Cubit-BAUPiUF7.cjs +307 -0
  4. package/dist/Cubit-BAUPiUF7.cjs.map +1 -0
  5. package/dist/Cubit-BBKF3PIg.js +248 -0
  6. package/dist/Cubit-BBKF3PIg.js.map +1 -0
  7. package/dist/Cubit-BOgUZva7.js +284 -0
  8. package/dist/Cubit-BOgUZva7.js.map +1 -0
  9. package/dist/Cubit-BOxMvpfc.js +250 -0
  10. package/dist/Cubit-BOxMvpfc.js.map +1 -0
  11. package/dist/Cubit-BTznt8zg.js +370 -0
  12. package/dist/Cubit-BTznt8zg.js.map +1 -0
  13. package/dist/Cubit-BogJXkLm.js +243 -0
  14. package/dist/Cubit-BogJXkLm.js.map +1 -0
  15. package/dist/Cubit-COfHT1Bm.cjs +280 -0
  16. package/dist/Cubit-COfHT1Bm.cjs.map +1 -0
  17. package/dist/Cubit-CXxh9iol.js +260 -0
  18. package/dist/Cubit-CXxh9iol.js.map +1 -0
  19. package/dist/Cubit-CYOWfzQt.cjs +274 -0
  20. package/dist/Cubit-CYOWfzQt.cjs.map +1 -0
  21. package/dist/Cubit-CZaf_fp4.cjs +367 -292
  22. package/dist/Cubit-C_dUEUdd.cjs +307 -0
  23. package/dist/Cubit-C_dUEUdd.cjs.map +1 -0
  24. package/dist/Cubit-CcKgMEBO.js +257 -0
  25. package/dist/Cubit-CcKgMEBO.js.map +1 -0
  26. package/dist/Cubit-CfT6Y1jl.js +298 -0
  27. package/dist/Cubit-CfT6Y1jl.js.map +1 -0
  28. package/dist/Cubit-D2vQ6nMb.js +284 -0
  29. package/dist/Cubit-D2vQ6nMb.js.map +1 -0
  30. package/dist/Cubit-D7jOZCoZ.js +284 -0
  31. package/dist/Cubit-D7jOZCoZ.js.map +1 -0
  32. package/dist/Cubit-DKEY9WYq.cjs +260 -0
  33. package/dist/Cubit-DKEY9WYq.cjs.map +1 -0
  34. package/dist/Cubit-DP5DXPUK.js +284 -0
  35. package/dist/Cubit-DP5DXPUK.js.map +1 -0
  36. package/dist/Cubit-DbnhTUaZ.cjs +307 -0
  37. package/dist/Cubit-DbnhTUaZ.cjs.map +1 -0
  38. package/dist/Cubit-DrqG3SP3.cjs +321 -0
  39. package/dist/Cubit-DrqG3SP3.cjs.map +1 -0
  40. package/dist/Cubit-DsDkCo42.cjs +271 -0
  41. package/dist/Cubit-DsDkCo42.cjs.map +1 -0
  42. package/dist/Cubit-DwRw1E9D.cjs +267 -0
  43. package/dist/Cubit-DwRw1E9D.cjs.map +1 -0
  44. package/dist/Cubit-Dw_kFBgc.js +372 -0
  45. package/dist/Cubit-Dw_kFBgc.js.map +1 -0
  46. package/dist/Cubit-KiXZCubP.cjs +392 -0
  47. package/dist/Cubit-KiXZCubP.cjs.map +1 -0
  48. package/dist/Cubit-Ksj7G4uR.js +284 -0
  49. package/dist/Cubit-Ksj7G4uR.js.map +1 -0
  50. package/dist/Cubit-MkjbpcPf.cjs +307 -0
  51. package/dist/Cubit-MkjbpcPf.cjs.map +1 -0
  52. package/dist/Cubit-NRhvdDQ6.js +257 -0
  53. package/dist/Cubit-NRhvdDQ6.js.map +1 -0
  54. package/dist/Cubit-PMTXxI_u.js +350 -272
  55. package/dist/Cubit-jz922NKf.cjs +277 -0
  56. package/dist/Cubit-jz922NKf.cjs.map +1 -0
  57. package/dist/Cubit-kU5_4jgC.cjs +307 -0
  58. package/dist/Cubit-kU5_4jgC.cjs.map +1 -0
  59. package/dist/StateContainerRegistry-BAcxouCu.js +655 -0
  60. package/dist/StateContainerRegistry-BAcxouCu.js.map +1 -0
  61. package/dist/StateContainerRegistry-BK57H92E.js +676 -0
  62. package/dist/StateContainerRegistry-BK57H92E.js.map +1 -0
  63. package/dist/StateContainerRegistry-BglEhqdA.js +646 -0
  64. package/dist/StateContainerRegistry-BglEhqdA.js.map +1 -0
  65. package/dist/StateContainerRegistry-BhcnG0DF.js +602 -0
  66. package/dist/StateContainerRegistry-BhcnG0DF.js.map +1 -0
  67. package/dist/StateContainerRegistry-BpO5t-0i.js +620 -0
  68. package/dist/StateContainerRegistry-BpO5t-0i.js.map +1 -0
  69. package/dist/StateContainerRegistry-BsMIpllP.cjs +612 -560
  70. package/dist/StateContainerRegistry-CDH9mnQS.cjs +661 -0
  71. package/dist/StateContainerRegistry-CDH9mnQS.cjs.map +1 -0
  72. package/dist/StateContainerRegistry-CTOXUf75.cjs +687 -0
  73. package/dist/StateContainerRegistry-CTOXUf75.cjs.map +1 -0
  74. package/dist/StateContainerRegistry-CX2CBOmv.cjs +735 -0
  75. package/dist/StateContainerRegistry-CX2CBOmv.cjs.map +1 -0
  76. package/dist/StateContainerRegistry-Ci0ajc5g.js +652 -0
  77. package/dist/StateContainerRegistry-Ci0ajc5g.js.map +1 -0
  78. package/dist/StateContainerRegistry-Ck2-XmT_.js +567 -0
  79. package/dist/StateContainerRegistry-Ck2-XmT_.js.map +1 -0
  80. package/dist/StateContainerRegistry-D1lVJFGL.cjs +693 -0
  81. package/dist/StateContainerRegistry-D1lVJFGL.cjs.map +1 -0
  82. package/dist/StateContainerRegistry-DC4N73O6.js +609 -0
  83. package/dist/StateContainerRegistry-DC4N73O6.js.map +1 -0
  84. package/dist/StateContainerRegistry-DOkDGng-.js +586 -526
  85. package/dist/StateContainerRegistry-DOuGI-l5.js +622 -0
  86. package/dist/StateContainerRegistry-DOuGI-l5.js.map +1 -0
  87. package/dist/StateContainerRegistry-DT66lr3I.cjs +643 -0
  88. package/dist/StateContainerRegistry-DT66lr3I.cjs.map +1 -0
  89. package/dist/StateContainerRegistry-Upsrlg9G.cjs +696 -0
  90. package/dist/StateContainerRegistry-Upsrlg9G.cjs.map +1 -0
  91. package/dist/StateContainerRegistry-Yph6UCA_.js +610 -0
  92. package/dist/StateContainerRegistry-Yph6UCA_.js.map +1 -0
  93. package/dist/StateContainerRegistry-mseeTqSA.cjs +663 -0
  94. package/dist/StateContainerRegistry-mseeTqSA.cjs.map +1 -0
  95. package/dist/StateContainerRegistry-pRNxHNFD.cjs +650 -0
  96. package/dist/StateContainerRegistry-pRNxHNFD.cjs.map +1 -0
  97. package/dist/StateContainerRegistry-vXMWtG7J.cjs +608 -0
  98. package/dist/StateContainerRegistry-vXMWtG7J.cjs.map +1 -0
  99. package/dist/StateContainerRegistry-v_prqMcI.cjs +651 -0
  100. package/dist/StateContainerRegistry-v_prqMcI.cjs.map +1 -0
  101. package/dist/branded-BSeA_mZO.cjs +18 -0
  102. package/dist/branded-BSeA_mZO.cjs.map +1 -0
  103. package/dist/branded-DwtzSsg0.js +13 -0
  104. package/dist/branded-DwtzSsg0.js.map +1 -0
  105. package/dist/config-B3NIwDQv.cjs +32 -0
  106. package/dist/config-B3NIwDQv.cjs.map +1 -0
  107. package/dist/config-BKGHop0V.js +16 -0
  108. package/dist/config-BKGHop0V.js.map +1 -0
  109. package/dist/config-BKoaAlmb.js +16 -0
  110. package/dist/config-BKoaAlmb.js.map +1 -0
  111. package/dist/config-BR0Xy-Tn.cjs +32 -0
  112. package/dist/config-BR0Xy-Tn.cjs.map +1 -0
  113. package/dist/config-CCUhIYIF.js +16 -0
  114. package/dist/config-CCUhIYIF.js.map +1 -0
  115. package/dist/config-CQH9fTY-.cjs +32 -0
  116. package/dist/config-CQH9fTY-.cjs.map +1 -0
  117. package/dist/config-CR_Bz7RD.js +16 -0
  118. package/dist/config-CR_Bz7RD.js.map +1 -0
  119. package/dist/config-CTOa-yPN.cjs +32 -0
  120. package/dist/config-CTOa-yPN.cjs.map +1 -0
  121. package/dist/config-Cwj8-C1J.js +16 -0
  122. package/dist/config-Cwj8-C1J.js.map +1 -0
  123. package/dist/config-D3jisfdj.cjs +32 -0
  124. package/dist/config-D3jisfdj.cjs.map +1 -0
  125. package/dist/config-D4GifZQ4.js +16 -0
  126. package/dist/config-D4GifZQ4.js.map +1 -0
  127. package/dist/config-DDrSQGpQ.cjs +32 -0
  128. package/dist/config-DDrSQGpQ.cjs.map +1 -0
  129. package/dist/config-DEcslxan.cjs +32 -0
  130. package/dist/config-DEcslxan.cjs.map +1 -0
  131. package/dist/config-DLzmy2rZ.cjs +20 -20
  132. package/dist/config-DMNZ2YLV.cjs +32 -0
  133. package/dist/config-DMNZ2YLV.cjs.map +1 -0
  134. package/dist/config-De9oQ6Ki.js +16 -0
  135. package/dist/config-De9oQ6Ki.js.map +1 -0
  136. package/dist/config-DokTzpr8.cjs +32 -0
  137. package/dist/config-DokTzpr8.cjs.map +1 -0
  138. package/dist/config-DslYBm4Z.js +16 -0
  139. package/dist/config-DslYBm4Z.js.map +1 -0
  140. package/dist/config-H6FAqbW4.cjs +32 -0
  141. package/dist/config-H6FAqbW4.cjs.map +1 -0
  142. package/dist/config-XQua95Xz.js +5 -5
  143. package/dist/config-Yp645dGK.js +16 -0
  144. package/dist/config-Yp645dGK.js.map +1 -0
  145. package/dist/config-ispAzOZV.js +16 -0
  146. package/dist/config-ispAzOZV.js.map +1 -0
  147. package/dist/constants.d.cts +5 -28
  148. package/dist/constants.d.ts +5 -28
  149. package/dist/core/Cubit.d.ts +0 -1
  150. package/dist/core/StateContainer.d.ts +4 -7
  151. package/dist/core/StateContainerRegistry.d.ts +46 -19
  152. package/dist/core/symbols.d.ts +0 -1
  153. package/dist/debug.cjs +4 -3
  154. package/dist/debug.d.cts +5 -6
  155. package/dist/debug.d.ts +5 -6
  156. package/dist/debug.js +4 -4
  157. package/dist/ensure-9VEq5H0L.js +9 -0
  158. package/dist/ensure-9VEq5H0L.js.map +1 -0
  159. package/dist/ensure-BNDfTzqg.cjs +14 -0
  160. package/dist/ensure-BNDfTzqg.cjs.map +1 -0
  161. package/dist/ensure-BVCnjU7r.js +289 -0
  162. package/dist/ensure-BVCnjU7r.js.map +1 -0
  163. package/dist/ensure-BbzGXjep.cjs +14 -0
  164. package/dist/ensure-BbzGXjep.cjs.map +1 -0
  165. package/dist/ensure-C3eIRs6e.cjs +14 -0
  166. package/dist/ensure-C3eIRs6e.cjs.map +1 -0
  167. package/dist/ensure-C5I1xp2C.js +3 -3
  168. package/dist/ensure-CJZL7bcA.cjs +318 -0
  169. package/dist/ensure-CJZL7bcA.cjs.map +1 -0
  170. package/dist/ensure-CN6unBOe.cjs +14 -0
  171. package/dist/ensure-CN6unBOe.cjs.map +1 -0
  172. package/dist/ensure-CSHYjIeH.cjs +8 -8
  173. package/dist/ensure-CU-B1ywv.js +9 -0
  174. package/dist/ensure-CU-B1ywv.js.map +1 -0
  175. package/dist/ensure-CWKzeno7.js +9 -0
  176. package/dist/ensure-CWKzeno7.js.map +1 -0
  177. package/dist/ensure-D63lEMUK.cjs +14 -0
  178. package/dist/ensure-D63lEMUK.cjs.map +1 -0
  179. package/dist/ensure-DGEtPU9A.cjs +14 -0
  180. package/dist/ensure-DGEtPU9A.cjs.map +1 -0
  181. package/dist/ensure-DME-_T0j.cjs +14 -0
  182. package/dist/ensure-DME-_T0j.cjs.map +1 -0
  183. package/dist/ensure-DWd0GCYB.js +9 -0
  184. package/dist/ensure-DWd0GCYB.js.map +1 -0
  185. package/dist/ensure-DamKOP6q.cjs +14 -0
  186. package/dist/ensure-DamKOP6q.cjs.map +1 -0
  187. package/dist/ensure-Def-EBWG.js +9 -0
  188. package/dist/ensure-Def-EBWG.js.map +1 -0
  189. package/dist/ensure-Dr7I78Ku.cjs +14 -0
  190. package/dist/ensure-Dr7I78Ku.cjs.map +1 -0
  191. package/dist/ensure-SLVdGd5b.js +9 -0
  192. package/dist/ensure-SLVdGd5b.js.map +1 -0
  193. package/dist/ensure-Sb92MCXu.js +9 -0
  194. package/dist/ensure-Sb92MCXu.js.map +1 -0
  195. package/dist/ensure-l2-H7S5W.js +9 -0
  196. package/dist/ensure-l2-H7S5W.js.map +1 -0
  197. package/dist/ensure-n80crSlX.js +9 -0
  198. package/dist/ensure-n80crSlX.js.map +1 -0
  199. package/dist/ensure-nCxg7MCN.js +9 -0
  200. package/dist/ensure-nCxg7MCN.js.map +1 -0
  201. package/dist/ensure-vS71MV4q.cjs +14 -0
  202. package/dist/ensure-vS71MV4q.cjs.map +1 -0
  203. package/dist/index.cjs +15 -11
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +3 -2
  206. package/dist/index.d.ts +3 -2
  207. package/dist/index.js +12 -11
  208. package/dist/index.js.map +1 -1
  209. package/dist/management-B46QwA9Y.js +32 -0
  210. package/dist/management-B46QwA9Y.js.map +1 -0
  211. package/dist/management-BCKTEZ8Q.js +32 -0
  212. package/dist/management-BCKTEZ8Q.js.map +1 -0
  213. package/dist/management-Bg652agq.js +32 -0
  214. package/dist/management-Bg652agq.js.map +1 -0
  215. package/dist/management-BnedF5ZD.cjs +79 -0
  216. package/dist/management-BnedF5ZD.cjs.map +1 -0
  217. package/dist/management-C-wBdpho.js +18 -10
  218. package/dist/management-CK-GL3wY.js +32 -0
  219. package/dist/management-CK-GL3wY.js.map +1 -0
  220. package/dist/management-CU_V3LIP.js +32 -0
  221. package/dist/management-CU_V3LIP.js.map +1 -0
  222. package/dist/management-CaqiyNzB.js +32 -0
  223. package/dist/management-CaqiyNzB.js.map +1 -0
  224. package/dist/management-Cin-JvYe.js +32 -0
  225. package/dist/management-Cin-JvYe.js.map +1 -0
  226. package/dist/management-ClaXym0F.cjs +79 -0
  227. package/dist/management-ClaXym0F.cjs.map +1 -0
  228. package/dist/management-DL0Uzsoz.js +32 -0
  229. package/dist/management-DL0Uzsoz.js.map +1 -0
  230. package/dist/management-DMZ8qpwr.cjs +79 -0
  231. package/dist/management-DMZ8qpwr.cjs.map +1 -0
  232. package/dist/management-DYLNyj9p.cjs +79 -0
  233. package/dist/management-DYLNyj9p.cjs.map +1 -0
  234. package/dist/management-Dag9u4t6.cjs +79 -0
  235. package/dist/management-Dag9u4t6.cjs.map +1 -0
  236. package/dist/management-DbMRdDBo.cjs +79 -0
  237. package/dist/management-DbMRdDBo.cjs.map +1 -0
  238. package/dist/management-DjBU1gtb.cjs +79 -0
  239. package/dist/management-DjBU1gtb.cjs.map +1 -0
  240. package/dist/management-DwCozsY8.js +32 -0
  241. package/dist/management-DwCozsY8.js.map +1 -0
  242. package/dist/management-ZU2YzOkr.js +29 -0
  243. package/dist/management-ZU2YzOkr.js.map +1 -0
  244. package/dist/management-baPDwA9n.cjs +79 -0
  245. package/dist/management-baPDwA9n.cjs.map +1 -0
  246. package/dist/management-jQGCvZNN.cjs +70 -0
  247. package/dist/management-jQGCvZNN.cjs.map +1 -0
  248. package/dist/management-ry_KteFK.cjs +79 -0
  249. package/dist/management-ry_KteFK.cjs.map +1 -0
  250. package/dist/management-xoZ7w3bI.cjs +44 -44
  251. package/dist/plugin/BlacPlugin.d.ts +4 -93
  252. package/dist/plugin/PluginManager.d.ts +2 -0
  253. package/dist/plugins.cjs +1 -1
  254. package/dist/plugins.js +1 -1
  255. package/dist/registry/acquire.d.ts +1 -1
  256. package/dist/registry/index.d.ts +1 -1
  257. package/dist/registry/queries.d.ts +1 -0
  258. package/dist/registry/release.d.ts +1 -1
  259. package/dist/resolve-dependencies-B2QggQAi.js +646 -0
  260. package/dist/resolve-dependencies-B2QggQAi.js.map +1 -0
  261. package/dist/resolve-dependencies-B6JDXvpr.js +654 -0
  262. package/dist/resolve-dependencies-B6JDXvpr.js.map +1 -0
  263. package/dist/resolve-dependencies-BA3u06uC.js +643 -561
  264. package/dist/resolve-dependencies-BFZQq60Y.cjs +774 -0
  265. package/dist/resolve-dependencies-BFZQq60Y.cjs.map +1 -0
  266. package/dist/resolve-dependencies-BGafS3Ww.js +649 -0
  267. package/dist/resolve-dependencies-BGafS3Ww.js.map +1 -0
  268. package/dist/resolve-dependencies-BHd34gS3.cjs +774 -0
  269. package/dist/resolve-dependencies-BHd34gS3.cjs.map +1 -0
  270. package/dist/resolve-dependencies-BNeayhbQ.cjs +779 -0
  271. package/dist/resolve-dependencies-BNeayhbQ.cjs.map +1 -0
  272. package/dist/resolve-dependencies-BT6TU2HF.cjs +724 -666
  273. package/dist/resolve-dependencies-BWEMpuDy.js +646 -0
  274. package/dist/resolve-dependencies-BWEMpuDy.js.map +1 -0
  275. package/dist/resolve-dependencies-BiWkW2eS.js +649 -0
  276. package/dist/resolve-dependencies-BiWkW2eS.js.map +1 -0
  277. package/dist/resolve-dependencies-By26rT_i.js +654 -0
  278. package/dist/resolve-dependencies-By26rT_i.js.map +1 -0
  279. package/dist/resolve-dependencies-C9Kf7AzY.cjs +774 -0
  280. package/dist/resolve-dependencies-C9Kf7AzY.cjs.map +1 -0
  281. package/dist/resolve-dependencies-CTzV1txG.js +649 -0
  282. package/dist/resolve-dependencies-CTzV1txG.js.map +1 -0
  283. package/dist/resolve-dependencies-ClSsP0DJ.cjs +771 -0
  284. package/dist/resolve-dependencies-ClSsP0DJ.cjs.map +1 -0
  285. package/dist/resolve-dependencies-D0vTzZgs.js +649 -0
  286. package/dist/resolve-dependencies-D0vTzZgs.js.map +1 -0
  287. package/dist/resolve-dependencies-D2WnZMF-.cjs +774 -0
  288. package/dist/resolve-dependencies-D2WnZMF-.cjs.map +1 -0
  289. package/dist/resolve-dependencies-DMlqYJR2.js +649 -0
  290. package/dist/resolve-dependencies-DMlqYJR2.js.map +1 -0
  291. package/dist/resolve-dependencies-DSQNXvnV.cjs +774 -0
  292. package/dist/resolve-dependencies-DSQNXvnV.cjs.map +1 -0
  293. package/dist/resolve-dependencies-DcUUva2P.cjs +774 -0
  294. package/dist/resolve-dependencies-DcUUva2P.cjs.map +1 -0
  295. package/dist/resolve-dependencies-Dd8T6TLt.cjs +774 -0
  296. package/dist/resolve-dependencies-Dd8T6TLt.cjs.map +1 -0
  297. package/dist/resolve-dependencies-Dfdp_DZd.cjs +779 -0
  298. package/dist/resolve-dependencies-Dfdp_DZd.cjs.map +1 -0
  299. package/dist/resolve-dependencies-KSpTt4jy.cjs +771 -0
  300. package/dist/resolve-dependencies-KSpTt4jy.cjs.map +1 -0
  301. package/dist/resolve-dependencies-Nvjp4CwS.js +649 -0
  302. package/dist/resolve-dependencies-Nvjp4CwS.js.map +1 -0
  303. package/dist/resolve-dependencies-f-QUqYiL.js +649 -0
  304. package/dist/resolve-dependencies-f-QUqYiL.js.map +1 -0
  305. package/dist/testing.cjs +5 -5
  306. package/dist/testing.cjs.map +1 -1
  307. package/dist/testing.js +5 -5
  308. package/dist/testing.js.map +1 -1
  309. package/dist/tracked-B77j2g9M.js +177 -0
  310. package/dist/tracked-B77j2g9M.js.map +1 -0
  311. package/dist/tracked-BDVi2LKM.cjs +206 -0
  312. package/dist/tracked-BDVi2LKM.cjs.map +1 -0
  313. package/dist/tracked-BH-gX4T1.cjs +206 -0
  314. package/dist/tracked-BH-gX4T1.cjs.map +1 -0
  315. package/dist/tracked-BTHok3Dl.cjs +206 -0
  316. package/dist/tracked-BTHok3Dl.cjs.map +1 -0
  317. package/dist/tracked-BTbFkFeM.js +192 -0
  318. package/dist/tracked-BTbFkFeM.js.map +1 -0
  319. package/dist/tracked-BhQtzUhZ.js +192 -0
  320. package/dist/tracked-BhQtzUhZ.js.map +1 -0
  321. package/dist/tracked-C52awNV9.js +177 -0
  322. package/dist/tracked-C52awNV9.js.map +1 -0
  323. package/dist/tracked-CGzduF2m.js +192 -0
  324. package/dist/tracked-CGzduF2m.js.map +1 -0
  325. package/dist/tracked-CK_-ixtX.cjs +206 -0
  326. package/dist/tracked-CK_-ixtX.cjs.map +1 -0
  327. package/dist/tracked-CLlvURln.js +192 -0
  328. package/dist/tracked-CLlvURln.js.map +1 -0
  329. package/dist/tracked-CgHWmuGC.cjs +221 -0
  330. package/dist/tracked-CgHWmuGC.cjs.map +1 -0
  331. package/dist/tracked-CoAlC8fs.js +177 -0
  332. package/dist/tracked-CoAlC8fs.js.map +1 -0
  333. package/dist/tracked-D3Xjm1H1.cjs +221 -0
  334. package/dist/tracked-D3Xjm1H1.cjs.map +1 -0
  335. package/dist/tracked-DBn-bs_G.js +177 -0
  336. package/dist/tracked-DBn-bs_G.js.map +1 -0
  337. package/dist/tracked-DCfBaYjL.cjs +196 -175
  338. package/dist/tracked-DKduNLgI.js +171 -151
  339. package/dist/tracked-DMBTDF0P.js +177 -0
  340. package/dist/tracked-DMBTDF0P.js.map +1 -0
  341. package/dist/tracked-DN3h3Rp1.js +177 -0
  342. package/dist/tracked-DN3h3Rp1.js.map +1 -0
  343. package/dist/tracked-DUkp4zve.cjs +206 -0
  344. package/dist/tracked-DUkp4zve.cjs.map +1 -0
  345. package/dist/tracked-Dcu6EATB.js +177 -0
  346. package/dist/tracked-Dcu6EATB.js.map +1 -0
  347. package/dist/tracked-GvAJQVAI.cjs +240 -0
  348. package/dist/tracked-GvAJQVAI.cjs.map +1 -0
  349. package/dist/tracked-O2lv-kJV.cjs +221 -0
  350. package/dist/tracked-O2lv-kJV.cjs.map +1 -0
  351. package/dist/tracked-WF6aXuAo.js +199 -0
  352. package/dist/tracked-WF6aXuAo.js.map +1 -0
  353. package/dist/tracked-d_sQWU3c.cjs +206 -0
  354. package/dist/tracked-d_sQWU3c.cjs.map +1 -0
  355. package/dist/tracked-n9TMK-30.cjs +206 -0
  356. package/dist/tracked-n9TMK-30.cjs.map +1 -0
  357. package/dist/tracked-njU-_pVa.cjs +221 -0
  358. package/dist/tracked-njU-_pVa.cjs.map +1 -0
  359. package/dist/tracking.cjs +1 -1
  360. package/dist/tracking.js +1 -1
  361. package/dist/utils/static-props.d.ts +9 -0
  362. package/dist/watch-entry.cjs +1 -1
  363. package/dist/watch-entry.js +1 -1
  364. package/package.json +1 -1
@@ -1,607 +1,659 @@
1
1
  //#region src/constants.ts
2
2
  /**
3
- * Default configuration constants for BlaC
4
- *
5
- * Centralized location for all magic numbers and default values.
6
- */
3
+ * Default configuration constants for BlaC
4
+ *
5
+ * Centralized location for all magic numbers and default values.
6
+ */
7
7
  /**
8
- * Default configuration constants for BlaC
9
- */
8
+ * Default configuration constants for BlaC
9
+ */
10
10
  const BLAC_DEFAULTS = {
11
- DEFAULT_INSTANCE_KEY: "default",
12
- MAX_GETTER_DEPTH: 10,
13
- CLEANUP_INTERVAL_MS: 3e4,
14
- WEAKREF_CLEANUP_INTERVAL_MS: 1e4,
15
- MAX_SUBSCRIPTIONS: 1e3,
16
- MAX_SUBSCRIPTIONS_HIGH_PERF: 1e4,
17
- PIPELINE_TIMEOUT_MS: 5e3,
18
- CLEANUP_INTERVAL_HIGH_PERF_MS: 5e3,
19
- MAX_PIPELINE_STAGES: 30
11
+ DEFAULT_INSTANCE_KEY: 'default',
12
+ MAX_GETTER_DEPTH: 10,
13
+ CLEANUP_INTERVAL_MS: 3e4,
14
+ WEAKREF_CLEANUP_INTERVAL_MS: 1e4,
15
+ MAX_SUBSCRIPTIONS: 1e3,
16
+ MAX_SUBSCRIPTIONS_HIGH_PERF: 1e4,
17
+ PIPELINE_TIMEOUT_MS: 5e3,
18
+ CLEANUP_INTERVAL_HIGH_PERF_MS: 5e3,
19
+ MAX_PIPELINE_STAGES: 30,
20
20
  };
21
21
  /**
22
- * Static property names for StateContainer classes
23
- * Used for feature flags and configuration on bloc classes
24
- */
22
+ * Static property names for StateContainer classes
23
+ * Used for feature flags and configuration on bloc classes
24
+ */
25
25
  const BLAC_STATIC_PROPS = {
26
- KEEP_ALIVE: "keepAlive",
27
- EXCLUDE_FROM_DEVTOOLS: "__excludeFromDevTools"
26
+ KEEP_ALIVE: 'keepAlive',
27
+ EXCLUDE_FROM_DEVTOOLS: '__excludeFromDevTools',
28
28
  };
29
29
  /**
30
- * Standard error message prefix
31
- */
32
- const BLAC_ERROR_PREFIX = "[BlaC]";
30
+ * Standard error message prefix
31
+ */
32
+ const BLAC_ERROR_PREFIX = '[BlaC]';
33
33
  //#endregion
34
34
  //#region src/plugin/PluginManager.ts
35
35
  /**
36
- * Manages plugin lifecycle for the BlaC state management system.
37
- * Plugins receive notifications about state container lifecycle events.
38
- *
39
- * @example
40
- * ```ts
41
- * const manager = createPluginManager(registry);
42
- * manager.install(myPlugin, { environment: 'development' });
43
- * ```
44
- */
36
+ * Manages plugin lifecycle for the BlaC state management system.
37
+ * Plugins receive notifications about state container lifecycle events.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const manager = createPluginManager(registry);
42
+ * manager.install(myPlugin, { environment: 'development' });
43
+ * ```
44
+ */
45
45
  var PluginManager = class {
46
- /**
47
- * Create a new PluginManager
48
- * @param registry - The StateContainerRegistry to monitor for lifecycle events
49
- */
50
- constructor(registry) {
51
- this.plugins = /* @__PURE__ */ new Map();
52
- this.registry = registry;
53
- this.setupLifecycleHooks();
54
- }
55
- /**
56
- * Install a plugin with optional configuration
57
- * @param plugin - The plugin to install
58
- * @param config - Optional plugin configuration
59
- * @throws Error if plugin is already installed
60
- */
61
- install(plugin, config = {}) {
62
- const effectiveConfig = {
63
- enabled: true,
64
- environment: "all",
65
- ...config
66
- };
67
- if (!this.shouldEnablePlugin(effectiveConfig)) {
68
- console.log(`[BlaC] Plugin "${plugin.name}" skipped (environment mismatch)`);
69
- return;
70
- }
71
- if (this.plugins.has(plugin.name)) throw new Error(`Plugin "${plugin.name}" is already installed`);
72
- const context = this.createPluginContext();
73
- this.plugins.set(plugin.name, {
74
- plugin,
75
- config: effectiveConfig,
76
- context
77
- });
78
- if (plugin.onInstall) try {
79
- plugin.onInstall(context);
80
- } catch (error) {
81
- console.error(`[BlaC] Error installing plugin "${plugin.name}":`, error);
82
- this.plugins.delete(plugin.name);
83
- throw error;
84
- }
85
- console.log(`[BlaC] Plugin "${plugin.name}" v${plugin.version} installed`);
86
- }
87
- /**
88
- * Uninstall a plugin by name
89
- * @param pluginName - The name of the plugin to uninstall
90
- * @throws Error if plugin is not installed
91
- */
92
- uninstall(pluginName) {
93
- const installed = this.plugins.get(pluginName);
94
- if (!installed) throw new Error(`Plugin "${pluginName}" is not installed`);
95
- if (installed.plugin.onUninstall) try {
96
- installed.plugin.onUninstall();
97
- } catch (error) {
98
- console.error(`[BlaC] Error uninstalling plugin "${pluginName}":`, error);
99
- }
100
- this.plugins.delete(pluginName);
101
- console.log(`[BlaC] Plugin "${pluginName}" uninstalled`);
102
- }
103
- /**
104
- * Get an installed plugin by name
105
- * @param pluginName - The name of the plugin to retrieve
106
- * @returns The plugin instance or undefined if not found
107
- */
108
- getPlugin(pluginName) {
109
- return this.plugins.get(pluginName)?.plugin;
110
- }
111
- /**
112
- * Get all installed plugins
113
- * @returns Array of all installed plugins
114
- */
115
- getAllPlugins() {
116
- return Array.from(this.plugins.values()).map((p) => p.plugin);
117
- }
118
- /**
119
- * Check if a plugin is installed
120
- * @param pluginName - The name of the plugin to check
121
- * @returns true if the plugin is installed
122
- */
123
- hasPlugin(pluginName) {
124
- return this.plugins.has(pluginName);
125
- }
126
- /**
127
- * Uninstall all plugins
128
- */
129
- clear() {
130
- for (const name of this.plugins.keys()) this.uninstall(name);
131
- }
132
- /**
133
- * Setup lifecycle hooks to notify plugins
134
- */
135
- setupLifecycleHooks() {
136
- this.registry.on("created", (instance) => {
137
- this.notifyPlugins("onInstanceCreated", instance);
138
- });
139
- this.registry.on("stateChanged", (instance, previousState, currentState, callstack) => {
140
- this.notifyPlugins("onStateChanged", instance, previousState, currentState, callstack);
141
- });
142
- this.registry.on("disposed", (instance) => {
143
- this.notifyPlugins("onInstanceDisposed", instance);
144
- });
145
- }
146
- /**
147
- * Notify all plugins of a lifecycle event
148
- */
149
- notifyPlugins(hookName, ...args) {
150
- for (const { plugin, config, context } of this.plugins.values()) {
151
- if (!config.enabled) continue;
152
- const hook = plugin[hookName];
153
- if (typeof hook === "function") try {
154
- hook.apply(plugin, [...args, context]);
155
- } catch (error) {
156
- console.error(`[BlaC] Error in plugin "${plugin.name}" ${hookName}:`, error);
157
- }
158
- }
159
- }
160
- /**
161
- * Create plugin context with safe API access
162
- */
163
- createPluginContext() {
164
- return {
165
- getInstanceMetadata: (instance) => {
166
- return {
167
- id: instance.instanceId,
168
- className: instance.constructor.name,
169
- isDisposed: instance.isDisposed,
170
- name: instance.name,
171
- lastStateChangeTimestamp: instance.lastUpdateTimestamp,
172
- createdAt: instance.createdAt,
173
- state: instance.state,
174
- hydrationStatus: instance.hydrationStatus,
175
- isHydrated: instance.isHydrated,
176
- hydrationError: instance.hydrationError,
177
- changedWhileHydrating: instance.changedWhileHydrating
178
- };
179
- },
180
- getState: (instance) => {
181
- return instance.state;
182
- },
183
- getHydrationStatus: (instance) => {
184
- return instance.hydrationStatus;
185
- },
186
- startHydration: (instance) => {
187
- instance.beginHydration();
188
- },
189
- applyHydratedState: (instance, state) => {
190
- return instance.applyHydratedState(state);
191
- },
192
- finishHydration: (instance) => {
193
- instance.finishHydration();
194
- },
195
- failHydration: (instance, error) => {
196
- instance.failHydration(error);
197
- },
198
- waitForHydration: (instance) => {
199
- return instance.waitForHydration();
200
- },
201
- queryInstances: (typeClass) => {
202
- return this.registry.getAll(typeClass);
203
- },
204
- getAllTypes: () => {
205
- return this.registry.getTypes();
206
- },
207
- getStats: () => {
208
- return this.registry.getStats();
209
- }
210
- };
211
- }
212
- /**
213
- * Check if plugin should be enabled based on environment
214
- */
215
- shouldEnablePlugin(config) {
216
- if (!config.enabled) return false;
217
- if (config.environment === "all") return true;
218
- return this.getCurrentEnvironment() === config.environment;
219
- }
220
- /**
221
- * Get current environment
222
- */
223
- getCurrentEnvironment() {
224
- if (typeof process !== "undefined") {
225
- if (process.env.NODE_ENV === "test") return "test";
226
- if (process.env.NODE_ENV === "production") return "production";
227
- return "development";
228
- }
229
- return "development";
230
- }
46
+ /**
47
+ * Create a new PluginManager
48
+ * @param registry - The StateContainerRegistry to monitor for lifecycle events
49
+ */
50
+ constructor(registry) {
51
+ this.plugins = /* @__PURE__ */ new Map();
52
+ this.registry = registry;
53
+ this.setupLifecycleHooks();
54
+ }
55
+ /**
56
+ * Install a plugin with optional configuration
57
+ * @param plugin - The plugin to install
58
+ * @param config - Optional plugin configuration
59
+ * @throws Error if plugin is already installed
60
+ */
61
+ install(plugin, config = {}) {
62
+ const effectiveConfig = {
63
+ enabled: true,
64
+ environment: 'all',
65
+ ...config,
66
+ };
67
+ if (!this.shouldEnablePlugin(effectiveConfig)) {
68
+ console.log(
69
+ `[BlaC] Plugin "${plugin.name}" skipped (environment mismatch)`,
70
+ );
71
+ return;
72
+ }
73
+ if (this.plugins.has(plugin.name))
74
+ throw new Error(`Plugin "${plugin.name}" is already installed`);
75
+ const context = this.createPluginContext();
76
+ this.plugins.set(plugin.name, {
77
+ plugin,
78
+ config: effectiveConfig,
79
+ context,
80
+ });
81
+ if (plugin.onInstall)
82
+ try {
83
+ plugin.onInstall(context);
84
+ } catch (error) {
85
+ console.error(
86
+ `[BlaC] Error installing plugin "${plugin.name}":`,
87
+ error,
88
+ );
89
+ this.plugins.delete(plugin.name);
90
+ throw error;
91
+ }
92
+ console.log(`[BlaC] Plugin "${plugin.name}" v${plugin.version} installed`);
93
+ }
94
+ /**
95
+ * Uninstall a plugin by name
96
+ * @param pluginName - The name of the plugin to uninstall
97
+ * @throws Error if plugin is not installed
98
+ */
99
+ uninstall(pluginName) {
100
+ const installed = this.plugins.get(pluginName);
101
+ if (!installed) throw new Error(`Plugin "${pluginName}" is not installed`);
102
+ if (installed.plugin.onUninstall)
103
+ try {
104
+ installed.plugin.onUninstall();
105
+ } catch (error) {
106
+ console.error(
107
+ `[BlaC] Error uninstalling plugin "${pluginName}":`,
108
+ error,
109
+ );
110
+ }
111
+ this.plugins.delete(pluginName);
112
+ console.log(`[BlaC] Plugin "${pluginName}" uninstalled`);
113
+ }
114
+ /**
115
+ * Get an installed plugin by name
116
+ * @param pluginName - The name of the plugin to retrieve
117
+ * @returns The plugin instance or undefined if not found
118
+ */
119
+ getPlugin(pluginName) {
120
+ return this.plugins.get(pluginName)?.plugin;
121
+ }
122
+ /**
123
+ * Get all installed plugins
124
+ * @returns Array of all installed plugins
125
+ */
126
+ getAllPlugins() {
127
+ return Array.from(this.plugins.values()).map((p) => p.plugin);
128
+ }
129
+ /**
130
+ * Check if a plugin is installed
131
+ * @param pluginName - The name of the plugin to check
132
+ * @returns true if the plugin is installed
133
+ */
134
+ hasPlugin(pluginName) {
135
+ return this.plugins.has(pluginName);
136
+ }
137
+ /**
138
+ * Uninstall all plugins
139
+ */
140
+ clear() {
141
+ for (const name of this.plugins.keys()) this.uninstall(name);
142
+ }
143
+ /**
144
+ * Setup lifecycle hooks to notify plugins
145
+ */
146
+ setupLifecycleHooks() {
147
+ this.registry.on('created', (instance) => {
148
+ this.notifyPlugins('onInstanceCreated', instance);
149
+ });
150
+ this.registry.on(
151
+ 'stateChanged',
152
+ (instance, previousState, currentState, callstack) => {
153
+ this.notifyPlugins(
154
+ 'onStateChanged',
155
+ instance,
156
+ previousState,
157
+ currentState,
158
+ callstack,
159
+ );
160
+ },
161
+ );
162
+ this.registry.on('disposed', (instance) => {
163
+ this.notifyPlugins('onInstanceDisposed', instance);
164
+ });
165
+ }
166
+ /**
167
+ * Notify all plugins of a lifecycle event
168
+ */
169
+ notifyPlugins(hookName, ...args) {
170
+ for (const { plugin, config, context } of this.plugins.values()) {
171
+ if (!config.enabled) continue;
172
+ const hook = plugin[hookName];
173
+ if (typeof hook === 'function')
174
+ try {
175
+ hook.apply(plugin, [...args, context]);
176
+ } catch (error) {
177
+ console.error(
178
+ `[BlaC] Error in plugin "${plugin.name}" ${hookName}:`,
179
+ error,
180
+ );
181
+ }
182
+ }
183
+ }
184
+ /**
185
+ * Create plugin context with safe API access
186
+ */
187
+ createPluginContext() {
188
+ return {
189
+ getInstanceMetadata: (instance) => {
190
+ return {
191
+ id: instance.instanceId,
192
+ className: instance.constructor.name,
193
+ isDisposed: instance.isDisposed,
194
+ name: instance.name,
195
+ lastStateChangeTimestamp: instance.lastUpdateTimestamp,
196
+ createdAt: instance.createdAt,
197
+ state: instance.state,
198
+ hydrationStatus: instance.hydrationStatus,
199
+ isHydrated: instance.isHydrated,
200
+ hydrationError: instance.hydrationError,
201
+ changedWhileHydrating: instance.changedWhileHydrating,
202
+ };
203
+ },
204
+ getState: (instance) => {
205
+ return instance.state;
206
+ },
207
+ getHydrationStatus: (instance) => {
208
+ return instance.hydrationStatus;
209
+ },
210
+ startHydration: (instance) => {
211
+ instance.beginHydration();
212
+ },
213
+ applyHydratedState: (instance, state) => {
214
+ return instance.applyHydratedState(state);
215
+ },
216
+ finishHydration: (instance) => {
217
+ instance.finishHydration();
218
+ },
219
+ failHydration: (instance, error) => {
220
+ instance.failHydration(error);
221
+ },
222
+ waitForHydration: (instance) => {
223
+ return instance.waitForHydration();
224
+ },
225
+ queryInstances: (typeClass) => {
226
+ return this.registry.getAll(typeClass);
227
+ },
228
+ getAllTypes: () => {
229
+ return this.registry.getTypes();
230
+ },
231
+ getStats: () => {
232
+ return this.registry.getStats();
233
+ },
234
+ };
235
+ }
236
+ /**
237
+ * Check if plugin should be enabled based on environment
238
+ */
239
+ shouldEnablePlugin(config) {
240
+ if (!config.enabled) return false;
241
+ if (config.environment === 'all') return true;
242
+ return this.getCurrentEnvironment() === config.environment;
243
+ }
244
+ /**
245
+ * Get current environment
246
+ */
247
+ getCurrentEnvironment() {
248
+ if (typeof process !== 'undefined') {
249
+ if (process.env.NODE_ENV === 'test') return 'test';
250
+ if (process.env.NODE_ENV === 'production') return 'production';
251
+ return 'development';
252
+ }
253
+ return 'development';
254
+ }
231
255
  };
232
256
  /**
233
- * Create a plugin manager instance
234
- * @param registry - The StateContainerRegistry to monitor for lifecycle events
235
- * @returns A new PluginManager instance
236
- */
257
+ * Create a plugin manager instance
258
+ * @param registry - The StateContainerRegistry to monitor for lifecycle events
259
+ * @returns A new PluginManager instance
260
+ */
237
261
  function createPluginManager(registry) {
238
- return new PluginManager(registry);
262
+ return new PluginManager(registry);
239
263
  }
240
264
  //#endregion
241
265
  //#region src/utils/static-props.ts
242
266
  /**
243
- * Utility functions for accessing static properties on StateContainer classes
244
- */
267
+ * Utility functions for accessing static properties on StateContainer classes
268
+ */
245
269
  /**
246
- * Get a static property from a class constructor
247
- * Type-safe helper that avoids (Type as any) casts
248
- *
249
- * @param Type - The class constructor
250
- * @param propName - The property name to access
251
- * @param defaultValue - Optional default value if property is undefined
252
- * @returns The property value or default
253
- */
270
+ * Get a static property from a class constructor
271
+ * Type-safe helper that avoids (Type as any) casts
272
+ *
273
+ * @param Type - The class constructor
274
+ * @param propName - The property name to access
275
+ * @param defaultValue - Optional default value if property is undefined
276
+ * @returns The property value or default
277
+ */
254
278
  function getStaticProp(Type, propName, defaultValue) {
255
- return Type[propName] ?? defaultValue;
279
+ return Type[propName] ?? defaultValue;
256
280
  }
257
281
  /**
258
- * Check if a class is marked as keepAlive.
259
- * KeepAlive classes are never auto-disposed when ref count reaches 0.
260
- * @param Type - The class constructor to check
261
- * @returns true if the class has `static keepAlive = true`
262
- */
282
+ * Check if a class is marked as keepAlive.
283
+ * KeepAlive classes are never auto-disposed when ref count reaches 0.
284
+ * @param Type - The class constructor to check
285
+ * @returns true if the class has `static keepAlive = true`
286
+ */
263
287
  function isKeepAliveClass(Type) {
264
- return getStaticProp(Type, BLAC_STATIC_PROPS.KEEP_ALIVE) === true;
288
+ return getStaticProp(Type, BLAC_STATIC_PROPS.KEEP_ALIVE) === true;
265
289
  }
266
290
  //#endregion
267
291
  //#region src/core/StateContainerRegistry.ts
268
292
  /**
269
- * Central registry for managing StateContainer instances.
270
- * Handles instance lifecycle, ref counting, and lifecycle event emission.
271
- *
272
- * @example
273
- * ```ts
274
- * const registry = new StateContainerRegistry();
275
- * const instance = registry.acquire(MyBloc); // ownership, must release
276
- * const other = registry.ensure(OtherBloc); // no ownership, bloc-to-bloc
277
- * registry.on('stateChanged', (container, prev, next) => {
278
- * console.log('State changed:', prev, '->', next);
279
- * });
280
- * ```
281
- */
293
+ * Central registry for managing StateContainer instances.
294
+ * Handles instance lifecycle, ref counting, and lifecycle event emission.
295
+ *
296
+ * @example
297
+ * ```ts
298
+ * const registry = new StateContainerRegistry();
299
+ * const instance = registry.acquire(MyBloc); // ownership, must release
300
+ * const other = registry.ensure(OtherBloc); // no ownership, bloc-to-bloc
301
+ * registry.on('stateChanged', (container, prev, next) => {
302
+ * console.log('State changed:', prev, '->', next);
303
+ * });
304
+ * ```
305
+ */
282
306
  var StateContainerRegistry = class {
283
- constructor() {
284
- this.instancesByConstructor = /* @__PURE__ */ new WeakMap();
285
- this.types = /* @__PURE__ */ new Set();
286
- this.registeredTypeNames = /* @__PURE__ */ new Set();
287
- this.listeners = /* @__PURE__ */ new Map();
288
- }
289
- /**
290
- * Register a type for lifecycle event tracking
291
- * @param constructor - The StateContainer class constructor
292
- */
293
- registerType(constructor) {
294
- this.types.add(constructor);
295
- }
296
- /**
297
- * Register a StateContainer class with configuration
298
- * @param constructor - The StateContainer class constructor
299
- * @throws Error if type is already registered
300
- */
301
- register(constructor) {
302
- const className = constructor.name;
303
- if (this.registeredTypeNames.has(className)) throw new Error(`${BLAC_ERROR_PREFIX} Type "${className}" is already registered`);
304
- this.registeredTypeNames.add(className);
305
- this.registerType(constructor);
306
- }
307
- ensureInstancesMap(Type) {
308
- let instances = this.instancesByConstructor.get(Type);
309
- if (!instances) {
310
- instances = /* @__PURE__ */ new Map();
311
- this.instancesByConstructor.set(Type, instances);
312
- }
313
- return instances;
314
- }
315
- /**
316
- * Get the instances Map for a specific class (public API for stats/debugging)
317
- */
318
- getInstancesMap(Type) {
319
- return this.instancesByConstructor.get(Type) || /* @__PURE__ */ new Map();
320
- }
321
- /**
322
- * Acquire an instance with ref counting (ownership semantics).
323
- * Creates a new instance if one doesn't exist, or returns existing and increments ref count.
324
- * You must call `release()` when done to decrement the ref count.
325
- * @param Type - The StateContainer class constructor
326
- * @param instanceKey - Instance key (defaults to 'default')
327
- * @param options - Acquisition options
328
- * @param options.canCreate - Whether to create new instance if not found (default: true)
329
- * @param options.countRef - Whether to increment ref count (default: true)
330
- * @returns The state container instance
331
- */
332
- acquire(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY, options = {}) {
333
- const { canCreate = true, countRef = true } = options;
334
- const config = { instanceId: instanceKey };
335
- const instances = this.ensureInstancesMap(Type);
336
- let entry = instances.get(instanceKey);
337
- if (entry?.instance.isDisposed) {
338
- instances.delete(instanceKey);
339
- entry = void 0;
340
- }
341
- if (entry && countRef) entry.refCount++;
342
- if (entry) return entry.instance;
343
- if (!canCreate) throw new Error(`${BLAC_ERROR_PREFIX} ${Type.name} instance "${instanceKey}" not found and creation is disabled.`);
344
- const instance = new Type();
345
- instance.initConfig(config);
346
- instances.set(instanceKey, {
347
- instance,
348
- refCount: 1
349
- });
350
- this.registerType(Type);
351
- return instance;
352
- }
353
- /**
354
- * Borrow an existing instance without incrementing ref count (borrowing semantics).
355
- * Tracks cross-bloc dependency for reactive updates.
356
- * @param Type - The StateContainer class constructor
357
- * @param instanceKey - Instance key (defaults to 'default')
358
- * @returns The state container instance
359
- * @throws Error if instance doesn't exist
360
- */
361
- borrow(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
362
- return this.acquire(Type, instanceKey, {
363
- canCreate: false,
364
- countRef: false
365
- });
366
- }
367
- /**
368
- * Safely borrow an existing instance (borrowing semantics with error handling).
369
- * Returns discriminated union for type-safe conditional access.
370
- * @param Type - The StateContainer class constructor
371
- * @param instanceKey - Instance key (defaults to 'default')
372
- * @returns Discriminated union with either the instance or an error
373
- */
374
- borrowSafe(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
375
- try {
376
- return {
377
- error: null,
378
- instance: this.borrow(Type, instanceKey)
379
- };
380
- } catch (error) {
381
- return {
382
- error,
383
- instance: null
384
- };
385
- }
386
- }
387
- /**
388
- * Ensure an instance exists without taking ownership (for bloc-to-bloc communication).
389
- * Gets existing instance OR creates it if it doesn't exist, without incrementing ref count.
390
- * Tracks cross-bloc dependency for reactive updates.
391
- *
392
- * Use this in bloc-to-bloc communication when you need to ensure an instance exists
393
- * but don't want to claim ownership (no ref count increment).
394
- * @param Type - The StateContainer class constructor
395
- * @param instanceKey - Instance key (defaults to 'default')
396
- * @returns The state container instance
397
- */
398
- ensure(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
399
- return this.acquire(Type, instanceKey, {
400
- canCreate: true,
401
- countRef: false
402
- });
403
- }
404
- /**
405
- * Release a reference to an instance.
406
- * Decrements ref count and disposes when it reaches 0 (unless keepAlive).
407
- * @param Type - The StateContainer class constructor
408
- * @param instanceKey - Instance key (defaults to 'default')
409
- * @param forceDispose - Force immediate disposal regardless of ref count
410
- */
411
- release(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY, forceDispose = false) {
412
- const instances = this.ensureInstancesMap(Type);
413
- const entry = instances.get(instanceKey);
414
- if (!entry) return;
415
- if (forceDispose) {
416
- if (!entry.instance.isDisposed) entry.instance.dispose();
417
- instances.delete(instanceKey);
418
- return;
419
- }
420
- entry.refCount--;
421
- const keepAlive = isKeepAliveClass(Type);
422
- if (entry.refCount <= 0 && !keepAlive) {
423
- if (!entry.instance.isDisposed) entry.instance.dispose();
424
- instances.delete(instanceKey);
425
- }
426
- }
427
- /**
428
- * Get all instances of a specific type.
429
- * @param Type - The StateContainer class constructor
430
- * @returns Array of all instances
431
- */
432
- getAll(Type) {
433
- const instances = this.ensureInstancesMap(Type);
434
- const result = [];
435
- for (const entry of instances.values()) result.push(entry.instance);
436
- return result;
437
- }
438
- /**
439
- * Safely iterate over all instances of a type.
440
- * Skips disposed instances and catches callback errors.
441
- * @param Type - The StateContainer class constructor
442
- * @param callback - Function to call for each instance
443
- */
444
- forEach(Type, callback) {
445
- const instances = this.ensureInstancesMap(Type);
446
- for (const entry of instances.values()) {
447
- const instance = entry.instance;
448
- if (!instance.isDisposed) try {
449
- callback(instance);
450
- } catch (error) {
451
- console.error(`${BLAC_ERROR_PREFIX} forEach callback error for ${Type.name}:`, error);
452
- }
453
- }
454
- }
455
- /**
456
- * Clear all instances of a specific type (disposes them).
457
- * @param Type - The StateContainer class constructor
458
- */
459
- clear(Type) {
460
- const instances = this.ensureInstancesMap(Type);
461
- for (const entry of instances.values()) if (!entry.instance.isDisposed) entry.instance.dispose();
462
- instances.clear();
463
- }
464
- /**
465
- * Get reference count for an instance.
466
- * @param Type - The StateContainer class constructor
467
- * @param instanceKey - Instance key (defaults to 'default')
468
- * @returns Current ref count (0 if instance doesn't exist)
469
- */
470
- getRefCount(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
471
- return this.ensureInstancesMap(Type).get(instanceKey)?.refCount ?? 0;
472
- }
473
- /**
474
- * Check if an instance exists.
475
- * @param Type - The StateContainer class constructor
476
- * @param instanceKey - Instance key (defaults to 'default')
477
- * @returns true if instance exists
478
- */
479
- hasInstance(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
480
- return this.ensureInstancesMap(Type).has(instanceKey);
481
- }
482
- /**
483
- * Clear all instances from all types (for testing)
484
- *
485
- * Iterates all registered types and clears their instances.
486
- * Also clears type tracking to reset the registry state.
487
- */
488
- clearAll() {
489
- for (const Type of this.types) this.clear(Type);
490
- this.types.clear();
491
- this.registeredTypeNames.clear();
492
- }
493
- /**
494
- * Get registry statistics for debugging.
495
- * @returns Object with registeredTypes, totalInstances, and typeBreakdown
496
- */
497
- getStats() {
498
- const typeBreakdown = {};
499
- let totalInstances = 0;
500
- for (const Type of this.types) {
501
- const typeName = Type.name;
502
- const count = this.getInstancesMap(Type).size;
503
- typeBreakdown[typeName] = count;
504
- totalInstances += count;
505
- }
506
- return {
507
- registeredTypes: this.types.size,
508
- totalInstances,
509
- typeBreakdown
510
- };
511
- }
512
- /**
513
- * Get all registered types (for plugin system).
514
- * @returns Array of all registered StateContainer class constructors
515
- */
516
- getTypes() {
517
- return Array.from(this.types);
518
- }
519
- /**
520
- * Subscribe to lifecycle events
521
- * @param event - The lifecycle event to listen for
522
- * @param listener - The listener function to call when the event occurs
523
- * @returns Unsubscribe function
524
- */
525
- on(event, listener) {
526
- if (!this.listeners.has(event)) this.listeners.set(event, /* @__PURE__ */ new Set());
527
- const instance = this.listeners.get(event);
528
- if (!instance) throw new Error(`${BLAC_ERROR_PREFIX} Failed to register listener for event '${event}'`);
529
- instance.add(listener);
530
- return () => {
531
- this.listeners.get(event)?.delete(listener);
532
- };
533
- }
534
- /**
535
- * Emit lifecycle event to all listeners
536
- * @internal - Called by StateContainer lifecycle methods
537
- */
538
- emit(event, ...args) {
539
- const listeners = this.listeners.get(event);
540
- if (!listeners || listeners.size === 0) return;
541
- for (const listener of listeners) try {
542
- listener(...args);
543
- } catch (error) {
544
- console.error(`${BLAC_ERROR_PREFIX} Listener error for '${event}':`, error);
545
- }
546
- }
307
+ constructor() {
308
+ this.instancesByConstructor = /* @__PURE__ */ new WeakMap();
309
+ this.types = /* @__PURE__ */ new Set();
310
+ this.registeredTypeNames = /* @__PURE__ */ new Set();
311
+ this.listeners = /* @__PURE__ */ new Map();
312
+ }
313
+ /**
314
+ * Register a type for lifecycle event tracking
315
+ * @param constructor - The StateContainer class constructor
316
+ */
317
+ registerType(constructor) {
318
+ this.types.add(constructor);
319
+ }
320
+ /**
321
+ * Register a StateContainer class with configuration
322
+ * @param constructor - The StateContainer class constructor
323
+ * @throws Error if type is already registered
324
+ */
325
+ register(constructor) {
326
+ const className = constructor.name;
327
+ if (this.registeredTypeNames.has(className))
328
+ throw new Error(
329
+ `${BLAC_ERROR_PREFIX} Type "${className}" is already registered`,
330
+ );
331
+ this.registeredTypeNames.add(className);
332
+ this.registerType(constructor);
333
+ }
334
+ ensureInstancesMap(Type) {
335
+ let instances = this.instancesByConstructor.get(Type);
336
+ if (!instances) {
337
+ instances = /* @__PURE__ */ new Map();
338
+ this.instancesByConstructor.set(Type, instances);
339
+ }
340
+ return instances;
341
+ }
342
+ /**
343
+ * Get the instances Map for a specific class (public API for stats/debugging)
344
+ */
345
+ getInstancesMap(Type) {
346
+ return this.instancesByConstructor.get(Type) || /* @__PURE__ */ new Map();
347
+ }
348
+ /**
349
+ * Acquire an instance with ref counting (ownership semantics).
350
+ * Creates a new instance if one doesn't exist, or returns existing and increments ref count.
351
+ * You must call `release()` when done to decrement the ref count.
352
+ * @param Type - The StateContainer class constructor
353
+ * @param instanceKey - Instance key (defaults to 'default')
354
+ * @param options - Acquisition options
355
+ * @param options.canCreate - Whether to create new instance if not found (default: true)
356
+ * @param options.countRef - Whether to increment ref count (default: true)
357
+ * @returns The state container instance
358
+ */
359
+ acquire(
360
+ Type,
361
+ instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY,
362
+ options = {},
363
+ ) {
364
+ const { canCreate = true, countRef = true } = options;
365
+ const config = { instanceId: instanceKey };
366
+ const instances = this.ensureInstancesMap(Type);
367
+ let entry = instances.get(instanceKey);
368
+ if (entry?.instance.isDisposed) {
369
+ instances.delete(instanceKey);
370
+ entry = void 0;
371
+ }
372
+ if (entry && countRef) entry.refCount++;
373
+ if (entry) return entry.instance;
374
+ if (!canCreate)
375
+ throw new Error(
376
+ `${BLAC_ERROR_PREFIX} ${Type.name} instance "${instanceKey}" not found and creation is disabled.`,
377
+ );
378
+ const instance = new Type();
379
+ instance.initConfig(config);
380
+ instances.set(instanceKey, {
381
+ instance,
382
+ refCount: 1,
383
+ });
384
+ this.registerType(Type);
385
+ return instance;
386
+ }
387
+ /**
388
+ * Borrow an existing instance without incrementing ref count (borrowing semantics).
389
+ * Tracks cross-bloc dependency for reactive updates.
390
+ * @param Type - The StateContainer class constructor
391
+ * @param instanceKey - Instance key (defaults to 'default')
392
+ * @returns The state container instance
393
+ * @throws Error if instance doesn't exist
394
+ */
395
+ borrow(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
396
+ return this.acquire(Type, instanceKey, {
397
+ canCreate: false,
398
+ countRef: false,
399
+ });
400
+ }
401
+ /**
402
+ * Safely borrow an existing instance (borrowing semantics with error handling).
403
+ * Returns discriminated union for type-safe conditional access.
404
+ * @param Type - The StateContainer class constructor
405
+ * @param instanceKey - Instance key (defaults to 'default')
406
+ * @returns Discriminated union with either the instance or an error
407
+ */
408
+ borrowSafe(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
409
+ try {
410
+ return {
411
+ error: null,
412
+ instance: this.borrow(Type, instanceKey),
413
+ };
414
+ } catch (error) {
415
+ return {
416
+ error,
417
+ instance: null,
418
+ };
419
+ }
420
+ }
421
+ /**
422
+ * Ensure an instance exists without taking ownership (for bloc-to-bloc communication).
423
+ * Gets existing instance OR creates it if it doesn't exist, without incrementing ref count.
424
+ * Tracks cross-bloc dependency for reactive updates.
425
+ *
426
+ * Use this in bloc-to-bloc communication when you need to ensure an instance exists
427
+ * but don't want to claim ownership (no ref count increment).
428
+ * @param Type - The StateContainer class constructor
429
+ * @param instanceKey - Instance key (defaults to 'default')
430
+ * @returns The state container instance
431
+ */
432
+ ensure(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
433
+ return this.acquire(Type, instanceKey, {
434
+ canCreate: true,
435
+ countRef: false,
436
+ });
437
+ }
438
+ /**
439
+ * Release a reference to an instance.
440
+ * Decrements ref count and disposes when it reaches 0 (unless keepAlive).
441
+ * @param Type - The StateContainer class constructor
442
+ * @param instanceKey - Instance key (defaults to 'default')
443
+ * @param forceDispose - Force immediate disposal regardless of ref count
444
+ */
445
+ release(
446
+ Type,
447
+ instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY,
448
+ forceDispose = false,
449
+ ) {
450
+ const instances = this.ensureInstancesMap(Type);
451
+ const entry = instances.get(instanceKey);
452
+ if (!entry) return;
453
+ if (forceDispose) {
454
+ if (!entry.instance.isDisposed) entry.instance.dispose();
455
+ instances.delete(instanceKey);
456
+ return;
457
+ }
458
+ entry.refCount--;
459
+ const keepAlive = isKeepAliveClass(Type);
460
+ if (entry.refCount <= 0 && !keepAlive) {
461
+ if (!entry.instance.isDisposed) entry.instance.dispose();
462
+ instances.delete(instanceKey);
463
+ }
464
+ }
465
+ /**
466
+ * Get all instances of a specific type.
467
+ * @param Type - The StateContainer class constructor
468
+ * @returns Array of all instances
469
+ */
470
+ getAll(Type) {
471
+ const instances = this.ensureInstancesMap(Type);
472
+ const result = [];
473
+ for (const entry of instances.values()) result.push(entry.instance);
474
+ return result;
475
+ }
476
+ /**
477
+ * Safely iterate over all instances of a type.
478
+ * Skips disposed instances and catches callback errors.
479
+ * @param Type - The StateContainer class constructor
480
+ * @param callback - Function to call for each instance
481
+ */
482
+ forEach(Type, callback) {
483
+ const instances = this.ensureInstancesMap(Type);
484
+ for (const entry of instances.values()) {
485
+ const instance = entry.instance;
486
+ if (!instance.isDisposed)
487
+ try {
488
+ callback(instance);
489
+ } catch (error) {
490
+ console.error(
491
+ `${BLAC_ERROR_PREFIX} forEach callback error for ${Type.name}:`,
492
+ error,
493
+ );
494
+ }
495
+ }
496
+ }
497
+ /**
498
+ * Clear all instances of a specific type (disposes them).
499
+ * @param Type - The StateContainer class constructor
500
+ */
501
+ clear(Type) {
502
+ const instances = this.ensureInstancesMap(Type);
503
+ for (const entry of instances.values())
504
+ if (!entry.instance.isDisposed) entry.instance.dispose();
505
+ instances.clear();
506
+ }
507
+ /**
508
+ * Get reference count for an instance.
509
+ * @param Type - The StateContainer class constructor
510
+ * @param instanceKey - Instance key (defaults to 'default')
511
+ * @returns Current ref count (0 if instance doesn't exist)
512
+ */
513
+ getRefCount(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
514
+ return this.ensureInstancesMap(Type).get(instanceKey)?.refCount ?? 0;
515
+ }
516
+ /**
517
+ * Check if an instance exists.
518
+ * @param Type - The StateContainer class constructor
519
+ * @param instanceKey - Instance key (defaults to 'default')
520
+ * @returns true if instance exists
521
+ */
522
+ hasInstance(Type, instanceKey = BLAC_DEFAULTS.DEFAULT_INSTANCE_KEY) {
523
+ return this.ensureInstancesMap(Type).has(instanceKey);
524
+ }
525
+ /**
526
+ * Clear all instances from all types (for testing)
527
+ *
528
+ * Iterates all registered types and clears their instances.
529
+ * Also clears type tracking to reset the registry state.
530
+ */
531
+ clearAll() {
532
+ for (const Type of this.types) this.clear(Type);
533
+ this.types.clear();
534
+ this.registeredTypeNames.clear();
535
+ }
536
+ /**
537
+ * Get registry statistics for debugging.
538
+ * @returns Object with registeredTypes, totalInstances, and typeBreakdown
539
+ */
540
+ getStats() {
541
+ const typeBreakdown = {};
542
+ let totalInstances = 0;
543
+ for (const Type of this.types) {
544
+ const typeName = Type.name;
545
+ const count = this.getInstancesMap(Type).size;
546
+ typeBreakdown[typeName] = count;
547
+ totalInstances += count;
548
+ }
549
+ return {
550
+ registeredTypes: this.types.size,
551
+ totalInstances,
552
+ typeBreakdown,
553
+ };
554
+ }
555
+ /**
556
+ * Get all registered types (for plugin system).
557
+ * @returns Array of all registered StateContainer class constructors
558
+ */
559
+ getTypes() {
560
+ return Array.from(this.types);
561
+ }
562
+ /**
563
+ * Subscribe to lifecycle events
564
+ * @param event - The lifecycle event to listen for
565
+ * @param listener - The listener function to call when the event occurs
566
+ * @returns Unsubscribe function
567
+ */
568
+ on(event, listener) {
569
+ if (!this.listeners.has(event))
570
+ this.listeners.set(event, /* @__PURE__ */ new Set());
571
+ const instance = this.listeners.get(event);
572
+ if (!instance)
573
+ throw new Error(
574
+ `${BLAC_ERROR_PREFIX} Failed to register listener for event '${event}'`,
575
+ );
576
+ instance.add(listener);
577
+ return () => {
578
+ this.listeners.get(event)?.delete(listener);
579
+ };
580
+ }
581
+ /**
582
+ * Emit lifecycle event to all listeners
583
+ * @internal - Called by StateContainer lifecycle methods
584
+ */
585
+ emit(event, ...args) {
586
+ const listeners = this.listeners.get(event);
587
+ if (!listeners || listeners.size === 0) return;
588
+ for (const listener of listeners)
589
+ try {
590
+ listener(...args);
591
+ } catch (error) {
592
+ console.error(
593
+ `${BLAC_ERROR_PREFIX} Listener error for '${event}':`,
594
+ error,
595
+ );
596
+ }
597
+ }
547
598
  };
548
599
  /**
549
- * Global default registry instance
550
- */
600
+ * Global default registry instance
601
+ */
551
602
  const globalRegistry = new StateContainerRegistry();
552
603
  /**
553
- * Global plugin manager (initialized lazily)
554
- */
604
+ * Global plugin manager (initialized lazily)
605
+ */
555
606
  let _globalPluginManager = null;
556
607
  /**
557
- * Get the global plugin manager
558
- */
608
+ * Get the global plugin manager
609
+ */
559
610
  function getPluginManager() {
560
- if (!_globalPluginManager) _globalPluginManager = createPluginManager(globalRegistry);
561
- return _globalPluginManager;
611
+ if (!_globalPluginManager)
612
+ _globalPluginManager = createPluginManager(globalRegistry);
613
+ return _globalPluginManager;
562
614
  }
563
615
  //#endregion
564
- Object.defineProperty(exports, "BLAC_DEFAULTS", {
565
- enumerable: true,
566
- get: function() {
567
- return BLAC_DEFAULTS;
568
- }
616
+ Object.defineProperty(exports, 'BLAC_DEFAULTS', {
617
+ enumerable: true,
618
+ get: function () {
619
+ return BLAC_DEFAULTS;
620
+ },
569
621
  });
570
- Object.defineProperty(exports, "BLAC_ERROR_PREFIX", {
571
- enumerable: true,
572
- get: function() {
573
- return BLAC_ERROR_PREFIX;
574
- }
622
+ Object.defineProperty(exports, 'BLAC_ERROR_PREFIX', {
623
+ enumerable: true,
624
+ get: function () {
625
+ return BLAC_ERROR_PREFIX;
626
+ },
575
627
  });
576
- Object.defineProperty(exports, "BLAC_STATIC_PROPS", {
577
- enumerable: true,
578
- get: function() {
579
- return BLAC_STATIC_PROPS;
580
- }
628
+ Object.defineProperty(exports, 'BLAC_STATIC_PROPS', {
629
+ enumerable: true,
630
+ get: function () {
631
+ return BLAC_STATIC_PROPS;
632
+ },
581
633
  });
582
- Object.defineProperty(exports, "PluginManager", {
583
- enumerable: true,
584
- get: function() {
585
- return PluginManager;
586
- }
634
+ Object.defineProperty(exports, 'PluginManager', {
635
+ enumerable: true,
636
+ get: function () {
637
+ return PluginManager;
638
+ },
587
639
  });
588
- Object.defineProperty(exports, "StateContainerRegistry", {
589
- enumerable: true,
590
- get: function() {
591
- return StateContainerRegistry;
592
- }
640
+ Object.defineProperty(exports, 'StateContainerRegistry', {
641
+ enumerable: true,
642
+ get: function () {
643
+ return StateContainerRegistry;
644
+ },
593
645
  });
594
- Object.defineProperty(exports, "getPluginManager", {
595
- enumerable: true,
596
- get: function() {
597
- return getPluginManager;
598
- }
646
+ Object.defineProperty(exports, 'getPluginManager', {
647
+ enumerable: true,
648
+ get: function () {
649
+ return getPluginManager;
650
+ },
599
651
  });
600
- Object.defineProperty(exports, "globalRegistry", {
601
- enumerable: true,
602
- get: function() {
603
- return globalRegistry;
604
- }
652
+ Object.defineProperty(exports, 'globalRegistry', {
653
+ enumerable: true,
654
+ get: function () {
655
+ return globalRegistry;
656
+ },
605
657
  });
606
658
 
607
- //# sourceMappingURL=StateContainerRegistry-BsMIpllP.cjs.map
659
+ //# sourceMappingURL=StateContainerRegistry-BsMIpllP.cjs.map