@blac/core 2.1.0 → 2.1.2

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 (391) hide show
  1. package/README.md +19 -29
  2. package/dist/StateContainer-BUyuxKb3.cjs +667 -0
  3. package/dist/StateContainer-BUyuxKb3.cjs.map +1 -0
  4. package/dist/StateContainer-B_7UHc3I.js +632 -0
  5. package/dist/StateContainer-B_7UHc3I.js.map +1 -0
  6. package/dist/StateContainer-Bh2ipNYj.js +632 -0
  7. package/dist/StateContainer-Bh2ipNYj.js.map +1 -0
  8. package/dist/StateContainer-ClzwKnQZ.cjs +667 -0
  9. package/dist/StateContainer-ClzwKnQZ.cjs.map +1 -0
  10. package/dist/StateContainer-CwByTd5L.js +656 -0
  11. package/dist/StateContainer-CwByTd5L.js.map +1 -0
  12. package/dist/StateContainer-D2b10eR4.cjs +691 -0
  13. package/dist/StateContainer-D2b10eR4.cjs.map +1 -0
  14. package/dist/StateContainer-DiQATvZh.js +632 -0
  15. package/dist/StateContainer-DiQATvZh.js.map +1 -0
  16. package/dist/StateContainer-j16zciex.cjs +667 -0
  17. package/dist/StateContainer-j16zciex.cjs.map +1 -0
  18. package/dist/{StateContainerRegistry-CSNm2Ws5.cjs → StateContainerRegistry-141uHhtF.cjs} +300 -397
  19. package/dist/StateContainerRegistry-141uHhtF.cjs.map +1 -0
  20. package/dist/StateContainerRegistry-B6O6cfJd.cjs +903 -0
  21. package/dist/StateContainerRegistry-B6O6cfJd.cjs.map +1 -0
  22. package/dist/{StateContainerRegistry-DVIBTxGZ.js → StateContainerRegistry-BH7aOMWV.js} +299 -406
  23. package/dist/StateContainerRegistry-BH7aOMWV.js.map +1 -0
  24. package/dist/StateContainerRegistry-BX-DlHXO.js +747 -0
  25. package/dist/StateContainerRegistry-BX-DlHXO.js.map +1 -0
  26. package/dist/StateContainerRegistry-Bf5VuVjm.js +747 -0
  27. package/dist/StateContainerRegistry-Bf5VuVjm.js.map +1 -0
  28. package/dist/{StateContainerRegistry-Dj77cok9.js → StateContainerRegistry-BsH_s0pJ.js} +303 -413
  29. package/dist/StateContainerRegistry-BsH_s0pJ.js.map +1 -0
  30. package/dist/StateContainerRegistry-BvSRfhKv.cjs +866 -0
  31. package/dist/StateContainerRegistry-BvSRfhKv.cjs.map +1 -0
  32. package/dist/StateContainerRegistry-C8jxrcqk.cjs +866 -0
  33. package/dist/StateContainerRegistry-C8jxrcqk.cjs.map +1 -0
  34. package/dist/{StateContainerRegistry-lIwo-0m3.cjs → StateContainerRegistry-CBLeHObO.cjs} +326 -418
  35. package/dist/StateContainerRegistry-CBLeHObO.cjs.map +1 -0
  36. package/dist/StateContainerRegistry-CrTtRX5V.js +772 -0
  37. package/dist/StateContainerRegistry-CrTtRX5V.js.map +1 -0
  38. package/dist/StateContainerRegistry-DjQQtlCW.cjs +870 -0
  39. package/dist/StateContainerRegistry-DjQQtlCW.cjs.map +1 -0
  40. package/dist/{StateContainerRegistry-D9BIRjwv.cjs → StateContainerRegistry-MkT0W4C2.cjs} +322 -411
  41. package/dist/StateContainerRegistry-MkT0W4C2.cjs.map +1 -0
  42. package/dist/StateContainerRegistry-gQbEutkN.js +751 -0
  43. package/dist/StateContainerRegistry-gQbEutkN.js.map +1 -0
  44. package/dist/{StateContainerRegistry-CvBOhAT2.js → StateContainerRegistry-vWgsD-RP.js} +277 -392
  45. package/dist/StateContainerRegistry-vWgsD-RP.js.map +1 -0
  46. package/dist/config.d.cts +8 -8
  47. package/dist/config.d.ts +8 -8
  48. package/dist/constants.d.cts +20 -28
  49. package/dist/constants.d.ts +20 -28
  50. package/dist/core/Cubit.d.ts +14 -10
  51. package/dist/core/StateContainer.d.ts +89 -62
  52. package/dist/core/StateContainerRegistry.d.ts +89 -166
  53. package/dist/core/meta.d.ts +37 -47
  54. package/dist/core/onActivated.d.ts +10 -0
  55. package/dist/core/symbols.d.ts +26 -1
  56. package/dist/decorators/blac.d.ts +38 -28
  57. package/dist/{acquire-B1LYXSGj.js → ensure-Bi_yXk6f.js} +16 -5
  58. package/dist/ensure-Bi_yXk6f.js.map +1 -0
  59. package/dist/{ensure-r1C_7K6_.cjs → ensure-BjhbDW8Z.cjs} +203 -160
  60. package/dist/ensure-BjhbDW8Z.cjs.map +1 -0
  61. package/dist/{ensure-BSJHkUNX.js → ensure-BnVyd6s4.js} +297 -122
  62. package/dist/ensure-BnVyd6s4.js.map +1 -0
  63. package/dist/{acquire-BZIs6tpN.cjs → ensure-Bx41d-il.cjs} +23 -6
  64. package/dist/ensure-Bx41d-il.cjs.map +1 -0
  65. package/dist/{acquire-BRIJVJaA.js → ensure-C7UQ_mKM.js} +16 -5
  66. package/dist/ensure-C7UQ_mKM.js.map +1 -0
  67. package/dist/{ensure-B59ri8oo.js → ensure-CneMkpbI.js} +298 -122
  68. package/dist/ensure-CneMkpbI.js.map +1 -0
  69. package/dist/{acquire-BdsVZBSe.js → ensure-CwtQVTam.js} +16 -5
  70. package/dist/ensure-CwtQVTam.js.map +1 -0
  71. package/dist/{ensure-B2DYCbbI.cjs → ensure-D15vGnk5.cjs} +328 -123
  72. package/dist/ensure-D15vGnk5.cjs.map +1 -0
  73. package/dist/{acquire-B1Wuqla6.cjs → ensure-D1D4WjYf.cjs} +23 -6
  74. package/dist/ensure-D1D4WjYf.cjs.map +1 -0
  75. package/dist/{ensure-BKdq5xsY.cjs → ensure-D3w6YGp9.cjs} +329 -123
  76. package/dist/ensure-D3w6YGp9.cjs.map +1 -0
  77. package/dist/{acquire-BJ3xUEmh.cjs → ensure-DBnuRJ0R.cjs} +23 -6
  78. package/dist/ensure-DBnuRJ0R.cjs.map +1 -0
  79. package/dist/{acquire-B_p1fNEh.cjs → ensure-DShrbIYY.cjs} +23 -6
  80. package/dist/ensure-DShrbIYY.cjs.map +1 -0
  81. package/dist/{acquire-BP-ZfUH2.js → ensure-NTB9nnnj.js} +16 -5
  82. package/dist/ensure-NTB9nnnj.js.map +1 -0
  83. package/dist/{ensure-D3WWWwMo.cjs → ensure-ORVw-WRE.cjs} +194 -155
  84. package/dist/ensure-ORVw-WRE.cjs.map +1 -0
  85. package/dist/{ensure-BEeY5Ab7.js → ensure-dsqWhIuO.js} +182 -147
  86. package/dist/ensure-dsqWhIuO.js.map +1 -0
  87. package/dist/{ensure-11-asM1e.js → ensure-k-6q7O25.js} +173 -150
  88. package/dist/ensure-k-6q7O25.js.map +1 -0
  89. package/dist/index.cjs +257 -86
  90. package/dist/index.cjs.map +1 -1
  91. package/dist/index.d.cts +6 -13
  92. package/dist/index.d.ts +6 -13
  93. package/dist/index.js +232 -52
  94. package/dist/index.js.map +1 -1
  95. package/dist/internal.cjs +10 -0
  96. package/dist/internal.d.cts +8 -0
  97. package/dist/internal.d.ts +8 -0
  98. package/dist/internal.js +3 -0
  99. package/dist/plugin/BlacPlugin.d.ts +25 -25
  100. package/dist/plugin/PluginManager.d.ts +46 -59
  101. package/dist/plugins.cjs +383 -3
  102. package/dist/plugins.cjs.map +1 -0
  103. package/dist/plugins.d.cts +10 -5
  104. package/dist/plugins.d.ts +10 -5
  105. package/dist/plugins.js +381 -1
  106. package/dist/plugins.js.map +1 -0
  107. package/dist/registry/acquire.d.ts +2 -2
  108. package/dist/registry/config.d.ts +12 -0
  109. package/dist/registry/index.d.ts +2 -2
  110. package/dist/registry/management.d.ts +5 -0
  111. package/dist/registry/queries.d.ts +15 -0
  112. package/dist/registry/release.d.ts +4 -20
  113. package/dist/testing.cjs +63 -38
  114. package/dist/testing.cjs.map +1 -1
  115. package/dist/testing.d.cts +14 -12
  116. package/dist/testing.d.ts +14 -12
  117. package/dist/testing.js +53 -29
  118. package/dist/testing.js.map +1 -1
  119. package/dist/types/branded.d.ts +6 -13
  120. package/dist/types/utilities.d.ts +40 -31
  121. package/dist/utils/idGenerator.d.ts +6 -13
  122. package/dist/utils/static-props.d.ts +28 -29
  123. package/dist/utils/structural-key.d.ts +0 -22
  124. package/dist/watch/index.d.ts +1 -2
  125. package/dist/watch/watch.d.ts +23 -3
  126. package/package.json +28 -54
  127. package/dist/StateContainerRegistry-4Ljd9EJx.js +0 -1018
  128. package/dist/StateContainerRegistry-4Ljd9EJx.js.map +0 -1
  129. package/dist/StateContainerRegistry-8zNFMAf7.js +0 -1067
  130. package/dist/StateContainerRegistry-8zNFMAf7.js.map +0 -1
  131. package/dist/StateContainerRegistry-B1GYx9Xo.js +0 -975
  132. package/dist/StateContainerRegistry-B1GYx9Xo.js.map +0 -1
  133. package/dist/StateContainerRegistry-B_ViBLvJ.js +0 -975
  134. package/dist/StateContainerRegistry-B_ViBLvJ.js.map +0 -1
  135. package/dist/StateContainerRegistry-Bx2ly-ba.cjs +0 -1162
  136. package/dist/StateContainerRegistry-Bx2ly-ba.cjs.map +0 -1
  137. package/dist/StateContainerRegistry-C0dCNlTF.js +0 -1005
  138. package/dist/StateContainerRegistry-C0dCNlTF.js.map +0 -1
  139. package/dist/StateContainerRegistry-C75QpeaO.cjs +0 -1260
  140. package/dist/StateContainerRegistry-C75QpeaO.cjs.map +0 -1
  141. package/dist/StateContainerRegistry-CEWpc1bj.cjs +0 -1113
  142. package/dist/StateContainerRegistry-CEWpc1bj.cjs.map +0 -1
  143. package/dist/StateContainerRegistry-CS18y4au.cjs +0 -1163
  144. package/dist/StateContainerRegistry-CS18y4au.cjs.map +0 -1
  145. package/dist/StateContainerRegistry-CSNm2Ws5.cjs.map +0 -1
  146. package/dist/StateContainerRegistry-CchRjnjX.cjs +0 -1094
  147. package/dist/StateContainerRegistry-CchRjnjX.cjs.map +0 -1
  148. package/dist/StateContainerRegistry-CvBOhAT2.js.map +0 -1
  149. package/dist/StateContainerRegistry-D8nu7Z0T.js +0 -1068
  150. package/dist/StateContainerRegistry-D8nu7Z0T.js.map +0 -1
  151. package/dist/StateContainerRegistry-D9BIRjwv.cjs.map +0 -1
  152. package/dist/StateContainerRegistry-DJQqLrli.cjs +0 -1046
  153. package/dist/StateContainerRegistry-DJQqLrli.cjs.map +0 -1
  154. package/dist/StateContainerRegistry-DL5Ai7wh.js +0 -1153
  155. package/dist/StateContainerRegistry-DL5Ai7wh.js.map +0 -1
  156. package/dist/StateContainerRegistry-DVIBTxGZ.js.map +0 -1
  157. package/dist/StateContainerRegistry-DWOzx7Gd.js +0 -1154
  158. package/dist/StateContainerRegistry-DWOzx7Gd.js.map +0 -1
  159. package/dist/StateContainerRegistry-Dj77cok9.js.map +0 -1
  160. package/dist/StateContainerRegistry-FWKzPfS-.cjs +0 -1046
  161. package/dist/StateContainerRegistry-FWKzPfS-.cjs.map +0 -1
  162. package/dist/StateContainerRegistry-G81GcCRm.cjs +0 -1261
  163. package/dist/StateContainerRegistry-G81GcCRm.cjs.map +0 -1
  164. package/dist/StateContainerRegistry-lIwo-0m3.cjs.map +0 -1
  165. package/dist/acquire-B1LYXSGj.js.map +0 -1
  166. package/dist/acquire-B1Wuqla6.cjs.map +0 -1
  167. package/dist/acquire-BJ3xUEmh.cjs.map +0 -1
  168. package/dist/acquire-BP-ZfUH2.js.map +0 -1
  169. package/dist/acquire-BRIJVJaA.js.map +0 -1
  170. package/dist/acquire-BZIs6tpN.cjs.map +0 -1
  171. package/dist/acquire-B_p1fNEh.cjs.map +0 -1
  172. package/dist/acquire-BdsVZBSe.js.map +0 -1
  173. package/dist/acquire-C3nOb3XR.cjs +0 -46
  174. package/dist/acquire-C3nOb3XR.cjs.map +0 -1
  175. package/dist/acquire-C4WAS13G.cjs +0 -46
  176. package/dist/acquire-C4WAS13G.cjs.map +0 -1
  177. package/dist/acquire-C7beGI55.cjs +0 -46
  178. package/dist/acquire-C7beGI55.cjs.map +0 -1
  179. package/dist/acquire-CE0uq0Dx.cjs +0 -46
  180. package/dist/acquire-CE0uq0Dx.cjs.map +0 -1
  181. package/dist/acquire-CU0u8BMn.js +0 -35
  182. package/dist/acquire-CU0u8BMn.js.map +0 -1
  183. package/dist/acquire-CbMz7gWs.cjs +0 -46
  184. package/dist/acquire-CbMz7gWs.cjs.map +0 -1
  185. package/dist/acquire-CkgLJ8WL.cjs +0 -46
  186. package/dist/acquire-CkgLJ8WL.cjs.map +0 -1
  187. package/dist/acquire-CwB083au.js +0 -35
  188. package/dist/acquire-CwB083au.js.map +0 -1
  189. package/dist/acquire-DHEOEVcj.cjs +0 -46
  190. package/dist/acquire-DHEOEVcj.cjs.map +0 -1
  191. package/dist/acquire-DTvfYJ0y.js +0 -35
  192. package/dist/acquire-DTvfYJ0y.js.map +0 -1
  193. package/dist/acquire-DXEQDZGr.js +0 -35
  194. package/dist/acquire-DXEQDZGr.js.map +0 -1
  195. package/dist/acquire-Dg-uXwjF.js +0 -35
  196. package/dist/acquire-Dg-uXwjF.js.map +0 -1
  197. package/dist/acquire-Don7499S.js +0 -35
  198. package/dist/acquire-Don7499S.js.map +0 -1
  199. package/dist/acquire-G8aB3GAx.js +0 -35
  200. package/dist/acquire-G8aB3GAx.js.map +0 -1
  201. package/dist/branded-BybA0_xw.cjs +0 -18
  202. package/dist/branded-BybA0_xw.cjs.map +0 -1
  203. package/dist/branded-DkbUzncc.js +0 -13
  204. package/dist/branded-DkbUzncc.js.map +0 -1
  205. package/dist/config-8pyOC5gv.js +0 -16
  206. package/dist/config-8pyOC5gv.js.map +0 -1
  207. package/dist/config-B1l8ZGlU.cjs +0 -32
  208. package/dist/config-B1l8ZGlU.cjs.map +0 -1
  209. package/dist/config-C1T6Jw7n.cjs +0 -32
  210. package/dist/config-C1T6Jw7n.cjs.map +0 -1
  211. package/dist/config-C7Ktkjh2.cjs +0 -32
  212. package/dist/config-C7Ktkjh2.cjs.map +0 -1
  213. package/dist/config-COT4Xkbc.js +0 -16
  214. package/dist/config-COT4Xkbc.js.map +0 -1
  215. package/dist/config-CzcoAvBo.js +0 -16
  216. package/dist/config-CzcoAvBo.js.map +0 -1
  217. package/dist/config-D2A8ZYRM.js +0 -16
  218. package/dist/config-D2A8ZYRM.js.map +0 -1
  219. package/dist/config-D34BkraU.cjs +0 -32
  220. package/dist/config-D34BkraU.cjs.map +0 -1
  221. package/dist/config-D6BoWWPv.js +0 -16
  222. package/dist/config-D6BoWWPv.js.map +0 -1
  223. package/dist/config-DOO82lbZ.js +0 -16
  224. package/dist/config-DOO82lbZ.js.map +0 -1
  225. package/dist/config-DVM_ESQt.js +0 -16
  226. package/dist/config-DVM_ESQt.js.map +0 -1
  227. package/dist/config-DVMnlHLv.cjs +0 -32
  228. package/dist/config-DVMnlHLv.cjs.map +0 -1
  229. package/dist/config-DWUq7zEQ.cjs +0 -32
  230. package/dist/config-DWUq7zEQ.cjs.map +0 -1
  231. package/dist/config-DXI3kzmA.js +0 -16
  232. package/dist/config-DXI3kzmA.js.map +0 -1
  233. package/dist/config-Dk1FxfXj.js +0 -16
  234. package/dist/config-Dk1FxfXj.js.map +0 -1
  235. package/dist/config-ZVy_yFZ3.js +0 -16
  236. package/dist/config-ZVy_yFZ3.js.map +0 -1
  237. package/dist/config-b2z51Y_C.cjs +0 -32
  238. package/dist/config-b2z51Y_C.cjs.map +0 -1
  239. package/dist/config-buwpT7l3.js +0 -16
  240. package/dist/config-buwpT7l3.js.map +0 -1
  241. package/dist/config-cwaTn5oy.cjs +0 -32
  242. package/dist/config-cwaTn5oy.cjs.map +0 -1
  243. package/dist/config-d9_U58ef.cjs +0 -32
  244. package/dist/config-d9_U58ef.cjs.map +0 -1
  245. package/dist/config-hWTayX76.cjs +0 -32
  246. package/dist/config-hWTayX76.cjs.map +0 -1
  247. package/dist/config-sCPKPYxZ.cjs +0 -32
  248. package/dist/config-sCPKPYxZ.cjs.map +0 -1
  249. package/dist/debug.cjs +0 -14
  250. package/dist/debug.d.cts +0 -34
  251. package/dist/debug.d.ts +0 -34
  252. package/dist/debug.js +0 -4
  253. package/dist/ensure-11-asM1e.js.map +0 -1
  254. package/dist/ensure-B1dEDsZV.cjs +0 -559
  255. package/dist/ensure-B1dEDsZV.cjs.map +0 -1
  256. package/dist/ensure-B2DYCbbI.cjs.map +0 -1
  257. package/dist/ensure-B59ri8oo.js.map +0 -1
  258. package/dist/ensure-B9oOqpOB.cjs +0 -558
  259. package/dist/ensure-B9oOqpOB.cjs.map +0 -1
  260. package/dist/ensure-BEeY5Ab7.js.map +0 -1
  261. package/dist/ensure-BKdq5xsY.cjs.map +0 -1
  262. package/dist/ensure-BSJHkUNX.js.map +0 -1
  263. package/dist/ensure-BfYnvAsI.js +0 -709
  264. package/dist/ensure-BfYnvAsI.js.map +0 -1
  265. package/dist/ensure-Bm91o37h.js +0 -536
  266. package/dist/ensure-Bm91o37h.js.map +0 -1
  267. package/dist/ensure-C1a8IFWy.js +0 -535
  268. package/dist/ensure-C1a8IFWy.js.map +0 -1
  269. package/dist/ensure-CLQEx0Nn.cjs +0 -528
  270. package/dist/ensure-CLQEx0Nn.cjs.map +0 -1
  271. package/dist/ensure-CPMiGvov.js +0 -493
  272. package/dist/ensure-CPMiGvov.js.map +0 -1
  273. package/dist/ensure-CQimeD0I.cjs +0 -559
  274. package/dist/ensure-CQimeD0I.cjs.map +0 -1
  275. package/dist/ensure-D3WWWwMo.cjs.map +0 -1
  276. package/dist/ensure-DEXSmA-N.js +0 -526
  277. package/dist/ensure-DEXSmA-N.js.map +0 -1
  278. package/dist/ensure-DTTTd2h8.js +0 -536
  279. package/dist/ensure-DTTTd2h8.js.map +0 -1
  280. package/dist/ensure-Dx86f80B.cjs +0 -567
  281. package/dist/ensure-Dx86f80B.cjs.map +0 -1
  282. package/dist/ensure-DzqGej43.js +0 -526
  283. package/dist/ensure-DzqGej43.js.map +0 -1
  284. package/dist/ensure-VuiNPccZ.cjs +0 -559
  285. package/dist/ensure-VuiNPccZ.cjs.map +0 -1
  286. package/dist/ensure-_Oh8XPm4.cjs +0 -732
  287. package/dist/ensure-_Oh8XPm4.cjs.map +0 -1
  288. package/dist/ensure-fsQMjaQL.cjs +0 -567
  289. package/dist/ensure-fsQMjaQL.cjs.map +0 -1
  290. package/dist/ensure-r1C_7K6_.cjs.map +0 -1
  291. package/dist/ensure-vxAGa2v3.js +0 -536
  292. package/dist/ensure-vxAGa2v3.js.map +0 -1
  293. package/dist/events.d.cts +0 -42
  294. package/dist/events.d.ts +0 -42
  295. package/dist/management-14vsHr4t.cjs +0 -85
  296. package/dist/management-14vsHr4t.cjs.map +0 -1
  297. package/dist/management-444tdCBG.js +0 -38
  298. package/dist/management-444tdCBG.js.map +0 -1
  299. package/dist/management-7jLjVHJd.js +0 -38
  300. package/dist/management-7jLjVHJd.js.map +0 -1
  301. package/dist/management-8x1OVMi6.js +0 -38
  302. package/dist/management-8x1OVMi6.js.map +0 -1
  303. package/dist/management-AFuqQEwz.js +0 -38
  304. package/dist/management-AFuqQEwz.js.map +0 -1
  305. package/dist/management-BZgsi29F.js +0 -38
  306. package/dist/management-BZgsi29F.js.map +0 -1
  307. package/dist/management-BodVLAfJ.cjs +0 -85
  308. package/dist/management-BodVLAfJ.cjs.map +0 -1
  309. package/dist/management-BqGBdL01.js +0 -38
  310. package/dist/management-BqGBdL01.js.map +0 -1
  311. package/dist/management-BvUAjril.js +0 -38
  312. package/dist/management-BvUAjril.js.map +0 -1
  313. package/dist/management-C-WGcwPD.js +0 -38
  314. package/dist/management-C-WGcwPD.js.map +0 -1
  315. package/dist/management-C2wv4vGS.cjs +0 -85
  316. package/dist/management-C2wv4vGS.cjs.map +0 -1
  317. package/dist/management-D2pjr38g.js +0 -38
  318. package/dist/management-D2pjr38g.js.map +0 -1
  319. package/dist/management-D5WsZoTV.js +0 -38
  320. package/dist/management-D5WsZoTV.js.map +0 -1
  321. package/dist/management-DAV9sN-k.cjs +0 -85
  322. package/dist/management-DAV9sN-k.cjs.map +0 -1
  323. package/dist/management-Df7Y2sF1.cjs +0 -85
  324. package/dist/management-Df7Y2sF1.cjs.map +0 -1
  325. package/dist/management-Dg2SxUb6.cjs +0 -85
  326. package/dist/management-Dg2SxUb6.cjs.map +0 -1
  327. package/dist/management-DwO0nBzL.cjs +0 -85
  328. package/dist/management-DwO0nBzL.cjs.map +0 -1
  329. package/dist/management-GcnNJjnm.cjs +0 -85
  330. package/dist/management-GcnNJjnm.cjs.map +0 -1
  331. package/dist/management-P_Vi_cvw.js +0 -38
  332. package/dist/management-P_Vi_cvw.js.map +0 -1
  333. package/dist/management-QWLpbXlW.cjs +0 -85
  334. package/dist/management-QWLpbXlW.cjs.map +0 -1
  335. package/dist/management-hkY13log.cjs +0 -85
  336. package/dist/management-hkY13log.cjs.map +0 -1
  337. package/dist/management-iE4x6IQY.cjs +0 -85
  338. package/dist/management-iE4x6IQY.cjs.map +0 -1
  339. package/dist/types.cjs +0 -3
  340. package/dist/types.d.cts +0 -8
  341. package/dist/types.d.ts +0 -8
  342. package/dist/types.js +0 -2
  343. package/dist/watch/observe.d.ts +0 -13
  344. package/dist/watch-B0pUfh-v.cjs +0 -119
  345. package/dist/watch-B0pUfh-v.cjs.map +0 -1
  346. package/dist/watch-B91opmva.cjs +0 -70
  347. package/dist/watch-B91opmva.cjs.map +0 -1
  348. package/dist/watch-BDiwCPmb.js +0 -108
  349. package/dist/watch-BDiwCPmb.js.map +0 -1
  350. package/dist/watch-BHfCtbn1.cjs +0 -119
  351. package/dist/watch-BHfCtbn1.cjs.map +0 -1
  352. package/dist/watch-BW7gYiDf.js +0 -108
  353. package/dist/watch-BW7gYiDf.js.map +0 -1
  354. package/dist/watch-BmC-Tyqg.js +0 -59
  355. package/dist/watch-BmC-Tyqg.js.map +0 -1
  356. package/dist/watch-Bx0y-Kcc.js +0 -108
  357. package/dist/watch-Bx0y-Kcc.js.map +0 -1
  358. package/dist/watch-CKWt788i.cjs +0 -70
  359. package/dist/watch-CKWt788i.cjs.map +0 -1
  360. package/dist/watch-CfrSSrRY.js +0 -59
  361. package/dist/watch-CfrSSrRY.js.map +0 -1
  362. package/dist/watch-Cnh3PtQA.cjs +0 -70
  363. package/dist/watch-Cnh3PtQA.cjs.map +0 -1
  364. package/dist/watch-D01MdwKy.js +0 -108
  365. package/dist/watch-D01MdwKy.js.map +0 -1
  366. package/dist/watch-D8hwbFU1.js +0 -59
  367. package/dist/watch-D8hwbFU1.js.map +0 -1
  368. package/dist/watch-DPVUwPUY.js +0 -59
  369. package/dist/watch-DPVUwPUY.js.map +0 -1
  370. package/dist/watch-DVmvZBMD.cjs +0 -70
  371. package/dist/watch-DVmvZBMD.cjs.map +0 -1
  372. package/dist/watch-DkDGmGAx.cjs +0 -119
  373. package/dist/watch-DkDGmGAx.cjs.map +0 -1
  374. package/dist/watch-DttHqefn.js +0 -108
  375. package/dist/watch-DttHqefn.js.map +0 -1
  376. package/dist/watch-DxdIZjpt.cjs +0 -119
  377. package/dist/watch-DxdIZjpt.cjs.map +0 -1
  378. package/dist/watch-DztcJuUy.cjs +0 -119
  379. package/dist/watch-DztcJuUy.cjs.map +0 -1
  380. package/dist/watch-IrR8G28N.js +0 -108
  381. package/dist/watch-IrR8G28N.js.map +0 -1
  382. package/dist/watch-aoNLQAXp.cjs +0 -119
  383. package/dist/watch-aoNLQAXp.cjs.map +0 -1
  384. package/dist/watch-entry.cjs +0 -4
  385. package/dist/watch-entry.d.cts +0 -24
  386. package/dist/watch-entry.d.ts +0 -24
  387. package/dist/watch-entry.js +0 -2
  388. package/dist/watch-hx0r92Zc.js +0 -108
  389. package/dist/watch-hx0r92Zc.js.map +0 -1
  390. package/dist/watch-lEco5Tbl.cjs +0 -119
  391. package/dist/watch-lEco5Tbl.cjs.map +0 -1
@@ -1,5 +1,4 @@
1
- const require_StateContainerRegistry = require("./StateContainerRegistry-C75QpeaO.cjs");
2
- const require_config = require("./config-D34BkraU.cjs");
1
+ const require_StateContainerRegistry = require("./StateContainerRegistry-141uHhtF.cjs");
3
2
  let _dirtytalk_structural = require("@dirtytalk/structural");
4
3
  //#region src/utils/idGenerator.ts
5
4
  /**
@@ -27,75 +26,25 @@ function generateSimpleId(prefix, affix) {
27
26
  return `${prefix}:${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
28
27
  }
29
28
  //#endregion
30
- //#region src/events.ts
29
+ //#region src/registry/config.ts
30
+ let _registry = require_StateContainerRegistry.globalRegistry;
31
31
  /**
32
- * Subscriber storage, keyed by REGISTRY INSTANCE rather than a field on
33
- * `StateContainerRegistry`. This gives registry-swap isolation (a test's
34
- * `withTestRegistry`/`blacTestSetup` scope gets an independent subscriber
35
- * set) for free, through machinery that already exists, with zero new
36
- * public surface on `StateContainerRegistry`.
32
+ * @public
37
33
  */
38
- const busByRegistry = /* @__PURE__ */ new WeakMap();
39
- function defineEvent(name) {
40
- return { name };
34
+ function getRegistry() {
35
+ return _registry;
41
36
  }
42
37
  /**
43
- * @internal Bus scoped to an explicit registry — used by `StateContainer#on`
44
- * so a container always listens on the bus of the registry it belongs to,
45
- * not the ambient one. Not part of the public API.
38
+ * @public
46
39
  */
47
- function onEventFor(registry, token, handler) {
48
- let bus = busByRegistry.get(registry);
49
- if (!bus) {
50
- bus = /* @__PURE__ */ new Map();
51
- busByRegistry.set(registry, bus);
52
- }
53
- let handlers = bus.get(token);
54
- if (!handlers) {
55
- handlers = /* @__PURE__ */ new Set();
56
- bus.set(token, handlers);
57
- }
58
- handlers.add(handler);
59
- const tokenMap = bus;
60
- const handlerSet = handlers;
61
- let removed = false;
62
- return () => {
63
- if (removed) return;
64
- removed = true;
65
- handlerSet.delete(handler);
66
- if (handlerSet.size === 0) tokenMap.delete(token);
67
- };
68
- }
69
- /** Subscribe on the ambient registry (`getRegistry()`). */
70
- function onEvent(token, handler) {
71
- return onEventFor(require_config.getRegistry(), token, handler);
40
+ function setRegistry(registry) {
41
+ _registry = registry;
72
42
  }
73
43
  /**
74
- * Dispatch `token` to every current subscriber on the ambient registry, in
75
- * registration order.
76
- *
77
- * Cost is O(subscribers for this token) — a token with no subscribers (or no
78
- * bus yet on this registry) returns immediately, never touching live
79
- * instances.
80
- *
81
- * Dispatch iterates a SNAPSHOT of the handler `Set`, so it is safe for a
82
- * handler to synchronously call `emitEvent`/`onEvent` re-entrantly: a nested
83
- * `emitEvent` for the same token completes against its own snapshot, and a
84
- * handler registered via `onEvent` during dispatch is NOT invoked for the
85
- * in-flight emit (it only sees emits that start after it subscribed).
86
- *
87
- * The variadic tuple (`void extends P ? [] : [P]`) means a `void`-payload
88
- * token needs no second argument, and a typed-payload token requires one.
44
+ * @public
89
45
  */
90
- function emitEvent(token, ...payload) {
91
- const handlers = busByRegistry.get(require_config.getRegistry())?.get(token);
92
- if (!handlers) return;
93
- const value = payload[0];
94
- for (const handler of Array.from(handlers)) try {
95
- handler(value);
96
- } catch (error) {
97
- console.error(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} event handler error for '${token.name}':`, error);
98
- }
46
+ function getStats() {
47
+ return _registry.getStats();
99
48
  }
100
49
  //#endregion
101
50
  //#region src/core/meta.ts
@@ -244,7 +193,7 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
244
193
  const owners = this._depsByOwner ??= /* @__PURE__ */ new Map();
245
194
  const prevSlice = owners.get(ownerId);
246
195
  if (prevSlice && shallowEqualRecord(prevSlice, slice)) return;
247
- if (process.env.NODE_ENV !== "production") for (const key of Object.keys(slice)) for (const [otherOwner, otherSlice] of owners) {
196
+ if (require_StateContainerRegistry.IS_DEV) for (const key of Object.keys(slice)) for (const [otherOwner, otherSlice] of owners) {
248
197
  if (otherOwner === ownerId) continue;
249
198
  if (key in otherSlice && otherSlice[key] !== slice[key]) console.warn(`[${this._name}] multiple owners writing dep \`${String(key)}\`; last write wins`);
250
199
  }
@@ -267,6 +216,34 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
267
216
  [require_StateContainerRegistry.ON_DISPOSE](handler) {
268
217
  return this.onSystemEvent("dispose", handler);
269
218
  }
219
+ /**
220
+ * @internal Drive the 0↔1 ownership transition. Idempotent: repeated calls
221
+ * with the same value are no-ops, so the registry can call it from every
222
+ * acquire/release without tracking edges itself.
223
+ *
224
+ * Returns which real transition (if any) just happened, so the registry can
225
+ * emit the matching `activated`/`deactivated` plugin event without exposing
226
+ * `_activation` itself — `'none'` for an idempotent no-op call.
227
+ */
228
+ [require_StateContainerRegistry.SET_ACTIVE](active) {
229
+ if (this._disposed) return "none";
230
+ if (active === (this._activation !== null)) return "none";
231
+ if (active) {
232
+ this._activation = new AbortController();
233
+ this.onActivate(this._activation.signal);
234
+ return {
235
+ kind: "activated",
236
+ signal: this._activation.signal
237
+ };
238
+ }
239
+ this._abortActivation();
240
+ this.onDeactivate();
241
+ return "deactivated";
242
+ }
243
+ _abortActivation() {
244
+ this._activation?.abort();
245
+ this._activation = null;
246
+ }
270
247
  reconcileDeps() {
271
248
  const prev = this._deps;
272
249
  const next = {};
@@ -278,6 +255,30 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
278
255
  this._registry.emit("depsChanged", this, prev, next);
279
256
  }
280
257
  onDepsChanged(_next, _prev) {}
258
+ get state() {
259
+ return this._stateOverride ?? super.state;
260
+ }
261
+ /**
262
+ * @internal Run `fn` with `state` reporting `tracked`, and with dep handles
263
+ * read off `this` routed through `onDepHandle`. Restored in `finally`, and
264
+ * nestable — getters reading other getters stay in tracked context.
265
+ *
266
+ * The dep hook lives here rather than in the adapter's proxy because getters
267
+ * now run with `this` = the real instance (so ES `#private` works), which
268
+ * means a `this.someDep` read never passes through the proxy's trap.
269
+ */
270
+ [require_StateContainerRegistry.WITH_TRACKED_STATE](tracked, fn, onDepHandle) {
271
+ const prevState = this._stateOverride;
272
+ const prevHook = this._depHandleHook;
273
+ this._stateOverride = tracked;
274
+ this._depHandleHook = onDepHandle;
275
+ try {
276
+ return fn();
277
+ } finally {
278
+ this._stateOverride = prevState;
279
+ this._depHandleHook = prevHook;
280
+ }
281
+ }
281
282
  get args() {
282
283
  return this._config.args;
283
284
  }
@@ -303,13 +304,6 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
303
304
  const resolve = (args) => {
304
305
  const effectiveArgs = args ?? defaultArgs;
305
306
  const key = this._registry.resolveKey(Type, void 0, effectiveArgs);
306
- const edges = this._depEdges ??= /* @__PURE__ */ new Map();
307
- let resolvedKeys = edges.get(Type);
308
- if (resolvedKeys === void 0) {
309
- resolvedKeys = /* @__PURE__ */ new Set();
310
- edges.set(Type, resolvedKeys);
311
- }
312
- resolvedKeys.add(key);
313
307
  return this._registry.acquire(Type, key, {
314
308
  canCreate: true,
315
309
  countRef: false,
@@ -319,6 +313,8 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
319
313
  };
320
314
  const handle = {
321
315
  track: (options) => {
316
+ const wrapped = this._depHandleHook?.(handle);
317
+ if (wrapped !== void 0 && wrapped !== handle) return wrapped.track(options);
322
318
  const instance = resolve(options?.args);
323
319
  return [instance.state, instance];
324
320
  },
@@ -346,19 +342,19 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
346
342
  this._hydrationPromiseSettled = false;
347
343
  this._config = {};
348
344
  this._initCalled = false;
345
+ this._activation = null;
349
346
  this._emitWindowStart = 0;
350
347
  this._emitCount = 0;
351
348
  this._emitRateWarned = false;
352
349
  this._systemEventHandlers = /* @__PURE__ */ new Map();
353
350
  this._dependencies = null;
354
- this._depEdges = null;
355
351
  this._pendingChange = null;
356
352
  this._bridgeUnsub = null;
357
- this._registry = require_config.getRegistry();
353
+ this._registry = getRegistry();
358
354
  this._equalityFn = require_StateContainerRegistry.getBlacConfig().equality;
359
- this._name = this.constructor.name;
355
+ this._name = require_StateContainerRegistry.getBlacName(this.constructor);
360
356
  this._debug = false;
361
- this._instanceId = generateSimpleId(this.constructor.name, "main");
357
+ this._instanceId = generateSimpleId(require_StateContainerRegistry.getBlacName(this.constructor), "main");
362
358
  this._createdAt = Date.now();
363
359
  this.$blac = createMeta(this);
364
360
  this.onSystemEvent = (event, handler) => {
@@ -367,42 +363,17 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
367
363
  handlers = /* @__PURE__ */ new Set();
368
364
  this._systemEventHandlers.set(event, handlers);
369
365
  }
370
- const wasFirst = event === "stateChanged" && handlers.size === 0;
371
366
  handlers.add(handler);
372
- if (wasFirst) this._subscribeBridge();
373
- let removed = false;
367
+ if (event === "stateChanged" && this._bridgeUnsub === null) this._bridgeUnsub = this.channel.subscribe(() => _dirtytalk_structural.ALL_PATHS, () => this._drainPending());
374
368
  return () => {
375
- if (removed) return;
376
- removed = true;
377
369
  handlers?.delete(handler);
378
- if (event === "stateChanged" && (!handlers || handlers.size === 0)) {
370
+ if (event === "stateChanged" && handlers?.size === 0) {
379
371
  this._bridgeUnsub?.();
380
372
  this._bridgeUnsub = null;
381
373
  this._pendingChange = null;
382
374
  }
383
375
  };
384
376
  };
385
- this.on = (token, handler) => {
386
- if (this._disposed) return () => {};
387
- const unsub = onEventFor(this._registry, token, handler);
388
- this.onSystemEvent("dispose", unsub);
389
- return unsub;
390
- };
391
- }
392
- /**
393
- * @internal Subscribe the channel bridge that turns flushes into
394
- * 'stateChanged' system events. Interest is ALL_PATHS so we wake on every
395
- * flush. Coalesced via `_pendingChange`: if no emit happened (e.g. a no-op
396
- * patch), the bridge sees null and skips. Lazy: only subscribed while at
397
- * least one 'stateChanged' handler exists.
398
- */
399
- _subscribeBridge() {
400
- if (this._bridgeUnsub) return;
401
- this._bridgeUnsub = this.channel.subscribe(() => _dirtytalk_structural.ALL_PATHS, () => this._drainPending());
402
- }
403
- _hasStateChangedHandlers() {
404
- const handlers = this._systemEventHandlers.get("stateChanged");
405
- return !!handlers && handlers.size > 0;
406
377
  }
407
378
  /**
408
379
  * Called once after construction with the args passed at acquire time, before the first
@@ -411,6 +382,24 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
411
382
  */
412
383
  init(_args) {}
413
384
  /**
385
+ * Called when this instance goes from unowned to owned (first ref or first
386
+ * `depend()` dependent). Override to start work that should only run while
387
+ * something is actually using the instance — fetches, timers, listeners.
388
+ *
389
+ * `signal` aborts on the matching {@link onDeactivate} and on dispose, so
390
+ * async work started here can be cancelled without extra bookkeeping.
391
+ *
392
+ * Runs before the first `useBlocDeps` slice is applied, so `this.deps` is
393
+ * empty on first activation — use `onDepsChanged` for deps-driven work.
394
+ */
395
+ onActivate(_signal) {}
396
+ /**
397
+ * Called when this instance goes from owned back to unowned while surviving
398
+ * in the registry (i.e. `keepAlive`). A disposed instance does NOT get this
399
+ * callback — `dispose()` is the teardown path for that case.
400
+ */
401
+ onDeactivate() {}
402
+ /**
414
403
  * @internal Framework-only configuration entry point (registry + testing
415
404
  * helpers). Writes the `_`-private identity fields directly, resolves
416
405
  * per-class equality, emits the registry `created` event, and runs `init()`
@@ -418,17 +407,17 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
418
407
  */
419
408
  [require_StateContainerRegistry.INIT_CONFIG](config) {
420
409
  this._config = { ...config };
421
- this._name = this._config.name || this.constructor.name;
410
+ this._name = this._config.name || require_StateContainerRegistry.getBlacName(this.constructor);
422
411
  this._debug = this._config.debug ?? false;
423
- this._instanceId = generateSimpleId(this.constructor.name, this._config.instanceId);
412
+ this._instanceId = generateSimpleId(require_StateContainerRegistry.getBlacName(this.constructor), this._config.instanceId);
424
413
  const perClass = require_StateContainerRegistry.getClassEquality(this.constructor);
425
414
  this._equalityFn = perClass ?? require_StateContainerRegistry.getBlacConfig().equality;
426
- this._registry.emit("created", this);
427
415
  if (!this._initCalled) {
428
416
  this._initCalled = true;
429
417
  this.init(this._config.args);
430
418
  }
431
- if (process.env.NODE_ENV !== "production") {
419
+ this._registry.emit("created", this);
420
+ if (require_StateContainerRegistry.IS_DEV) {
432
421
  if (!this.$blac?.[META_BRAND]) console.warn(`[blac] ${this.constructor.name} appears to declare its own \`$blac\` member, which shadows the reserved meta namespace. \`$blac\` is reserved by StateContainer — remove the subclass field.`);
433
422
  }
434
423
  }
@@ -444,11 +433,12 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
444
433
  this.emitSystemEvent("dispose", void 0);
445
434
  this._bridgeUnsub?.();
446
435
  this._bridgeUnsub = null;
436
+ this._abortActivation();
447
437
  this._systemEventHandlers.clear();
448
438
  this._pendingChange = null;
449
439
  this._registry.emit("disposed", this);
450
- if (this._debug) console.log(`[${this._name}] Disposed successfully`);
451
440
  super.dispose();
441
+ if (this._debug) console.log(`[${this._name}] Disposed successfully`);
452
442
  }
453
443
  emit(next) {
454
444
  this.applyState(next, "default");
@@ -463,25 +453,17 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
463
453
  * preserved.
464
454
  */
465
455
  patch(partial) {
466
- if (this._disposed) throw new Error(`Cannot emit state from disposed container ${this._name}`);
467
- const prev = this.state;
468
- let hasKeys = false;
469
- let allEqual = true;
470
- for (const key in partial) {
471
- hasKeys = true;
472
- if (!Object.is(prev[key], partial[key])) {
473
- allEqual = false;
474
- break;
475
- }
456
+ if (this._disposed) {
457
+ this._warnDisposedMutation("patch");
458
+ return;
476
459
  }
477
- if (!hasKeys) return;
478
- if (allEqual) return;
479
- if (process.env.NODE_ENV !== "production") this._checkEmitRate();
460
+ const prev = this.state;
480
461
  super.patch(partial);
481
462
  const next = this.state;
482
463
  if (Object.is(prev, next)) return;
464
+ if (require_StateContainerRegistry.IS_DEV) this._checkEmitRate();
483
465
  if (this._hydrationStatus === "hydrating") this._changedWhileHydrating = true;
484
- if (this._hasStateChangedHandlers()) if (this._pendingChange) this._pendingChange.next = next;
466
+ if (this._bridgeUnsub !== null) if (this._pendingChange) this._pendingChange.next = next;
485
467
  else this._pendingChange = {
486
468
  prev,
487
469
  next
@@ -489,13 +471,16 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
489
471
  if (this._registry.hasStateChangedListeners) this._registry.notifyStateChanged(this, prev, next);
490
472
  }
491
473
  applyState(next, source) {
492
- if (this._disposed) throw new Error(`Cannot emit state from disposed container ${this._name}`);
474
+ if (this._disposed) {
475
+ this._warnDisposedMutation("emit");
476
+ return;
477
+ }
493
478
  const prev = this.state;
494
479
  if (prev === next) return;
495
480
  if (this._equalityFn(prev, next)) return;
496
- if (process.env.NODE_ENV !== "production") this._checkEmitRate();
481
+ if (require_StateContainerRegistry.IS_DEV) this._checkEmitRate();
497
482
  if (this._hydrationStatus === "hydrating" && source !== "hydration") this._changedWhileHydrating = true;
498
- if (this._hasStateChangedHandlers()) if (this._pendingChange) this._pendingChange.next = next;
483
+ if (this._bridgeUnsub !== null) if (this._pendingChange) this._pendingChange.next = next;
499
484
  else this._pendingChange = {
500
485
  prev,
501
486
  next
@@ -541,9 +526,15 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
541
526
  this.ensureHydrationPromise();
542
527
  this.setHydrationStatus("hydrating");
543
528
  }
529
+ _warnDisposedMutation(op) {
530
+ if (require_StateContainerRegistry.IS_DEV) console.warn(`[blac] ${this._name}: ${op}() after dispose ignored. This usually means an async method resolved after the last consumer unmounted. Guard with \`if (this.$blac.disposed) return\` after each \`await\`, or abort the work from \`onSystemEvent('dispose', ...)\`.`);
531
+ }
544
532
  _applyHydratedState(next) {
545
533
  if (this._disposed) return false;
546
- if (this._hydrationStatus !== "hydrating" || this._changedWhileHydrating) return false;
534
+ if (this._hydrationStatus !== "hydrating" || this._changedWhileHydrating) {
535
+ if (require_StateContainerRegistry.IS_DEV && this._changedWhileHydrating) console.warn(`[blac] ${this._name}: persisted state discarded because the container emitted while hydrating.`);
536
+ return false;
537
+ }
547
538
  this.applyState(next, "hydration");
548
539
  return true;
549
540
  }
@@ -607,15 +598,10 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
607
598
  emitSystemEvent(event, payload) {
608
599
  const handlers = this._systemEventHandlers.get(event);
609
600
  if (!handlers) return;
610
- const size = handlers.size;
611
- let count = 0;
612
- for (const handler of handlers) {
613
- if (++count > size) break;
614
- try {
615
- handler(payload);
616
- } catch (error) {
617
- console.error(`[${this._name}] Error in system event handler:`, error);
618
- }
601
+ for (const handler of handlers) try {
602
+ handler(payload);
603
+ } catch (error) {
604
+ console.error(`[${this._name}] Error in system event handler:`, error);
619
605
  }
620
606
  }
621
607
  /**
@@ -643,19 +629,60 @@ var StateContainer = class extends _dirtytalk_structural.StructuralContainer {
643
629
  //#endregion
644
630
  //#region src/core/Cubit.ts
645
631
  /**
646
- * `Cubit<S>` is a `StateContainer<S>` with `emit` / `patch` exposed as
647
- * public mutation surface. Today it adds nothing structurally beyond
648
- * `StateContainer` — both are inherited from the underlying
649
- * `StructuralContainer<S>`. Kept as a real class (not a type alias) because
650
- * downstream code does `instance instanceof Cubit` checks.
632
+ * `Cubit<S>` is a `StateContainer<S>` that exposes mutation publicly.
633
+ *
634
+ * That is the whole difference, and it is a real one: on `StateContainer`
635
+ * `emit` / `patch` / `update` are `protected`, so a container mutates itself
636
+ * from its own methods and callers go through the API it chooses to publish.
637
+ * `Cubit` re-declares the three as `public` for the cases where a caller
638
+ * legitimately drives state from outside — test helpers, devtools
639
+ * time-travel, benchmarks.
640
+ *
641
+ * Reach for `StateContainer` when business logic should live in the class,
642
+ * and `Cubit` when the caller owns the transitions.
643
+ */
644
+ var Cubit = class extends StateContainer {
645
+ emit(next) {
646
+ super.emit(next);
647
+ }
648
+ patch(partial) {
649
+ super.patch(partial);
650
+ }
651
+ update(fn) {
652
+ super.update(fn);
653
+ }
654
+ };
655
+ //#endregion
656
+ //#region src/registry/acquire.ts
657
+ /**
658
+ * Acquire an instance with ref tracking (ownership semantics). Instance
659
+ * identity is derived purely from `args` (via the class's `static key(args)`,
660
+ * a structural hash of `args`, or the default sentinel when there are none).
651
661
  *
652
- * The class body is intentionally empty: a no-op `emit` override would
653
- * still go through `applyState`, and `patch` is inherited from
654
- * `StructuralContainer` (path-diffed, microtask-flushed). A caller that
655
- * wants "skip if no real change" patch semantics can wrap `patch`
656
- * themselves or call `emit` after a manual equality check.
662
+ * @param BlocClass - The StateContainer class constructor
663
+ * @param opts - `args` derives the instance key; `refId` names the reference
664
+ * for debugging and is auto-generated when omitted.
665
+ */
666
+ function acquire(BlocClass, opts) {
667
+ const registry = getRegistry();
668
+ const key = registry.resolveKey(BlocClass, void 0, opts?.args);
669
+ return registry.acquire(BlocClass, key, {
670
+ canCreate: true,
671
+ countRef: true,
672
+ refId: opts?.refId,
673
+ args: opts?.args
674
+ });
675
+ }
676
+ /**
677
+ * Resolve the storage key an instance would be acquired under, given its
678
+ * construction `args`. This is the canonical key-computation path. Callers that
679
+ * both acquire and release against the `@internal` registry tier (e.g.
680
+ * `@blac/react` `useBloc`) must use this once and pass the same resolved key to
681
+ * both, so the ref is dropped under the key it was taken.
657
682
  */
658
- var Cubit = class extends StateContainer {};
683
+ function resolveInstanceKey(BlocClass, args) {
684
+ return getRegistry().resolveKey(BlocClass, void 0, args);
685
+ }
659
686
  //#endregion
660
687
  //#region src/registry/ensure.ts
661
688
  /**
@@ -663,7 +690,7 @@ var Cubit = class extends StateContainer {};
663
690
  * identity is derived purely from `args`, matching `acquire`.
664
691
  */
665
692
  function ensure(BlocClass, opts) {
666
- const registry = require_config.getRegistry();
693
+ const registry = getRegistry();
667
694
  const key = registry.resolveKey(BlocClass, void 0, opts?.args);
668
695
  return registry.ensure(BlocClass, key, opts?.args);
669
696
  }
@@ -686,29 +713,41 @@ Object.defineProperty(exports, "StateContainer", {
686
713
  return StateContainer;
687
714
  }
688
715
  });
689
- Object.defineProperty(exports, "defineEvent", {
716
+ Object.defineProperty(exports, "acquire", {
690
717
  enumerable: true,
691
718
  get: function() {
692
- return defineEvent;
719
+ return acquire;
693
720
  }
694
721
  });
695
- Object.defineProperty(exports, "emitEvent", {
722
+ Object.defineProperty(exports, "ensure", {
696
723
  enumerable: true,
697
724
  get: function() {
698
- return emitEvent;
725
+ return ensure;
699
726
  }
700
727
  });
701
- Object.defineProperty(exports, "ensure", {
728
+ Object.defineProperty(exports, "getRegistry", {
702
729
  enumerable: true,
703
730
  get: function() {
704
- return ensure;
731
+ return getRegistry;
732
+ }
733
+ });
734
+ Object.defineProperty(exports, "getStats", {
735
+ enumerable: true,
736
+ get: function() {
737
+ return getStats;
738
+ }
739
+ });
740
+ Object.defineProperty(exports, "resolveInstanceKey", {
741
+ enumerable: true,
742
+ get: function() {
743
+ return resolveInstanceKey;
705
744
  }
706
745
  });
707
- Object.defineProperty(exports, "onEvent", {
746
+ Object.defineProperty(exports, "setRegistry", {
708
747
  enumerable: true,
709
748
  get: function() {
710
- return onEvent;
749
+ return setRegistry;
711
750
  }
712
751
  });
713
752
 
714
- //# sourceMappingURL=ensure-D3WWWwMo.cjs.map
753
+ //# sourceMappingURL=ensure-ORVw-WRE.cjs.map