@callable-recharge/callbag-recharge 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/README.md +259 -0
  2. package/dist/backoff-BXsH2Ago.d.cts +25 -0
  3. package/dist/backoff-BXsH2Ago.d.ts +25 -0
  4. package/dist/chunk-2BINVZ33.js +2 -0
  5. package/dist/chunk-2BINVZ33.js.map +1 -0
  6. package/dist/chunk-2E3ALULW.js +2 -0
  7. package/dist/chunk-2E3ALULW.js.map +1 -0
  8. package/dist/chunk-2IM76CX3.js +2 -0
  9. package/dist/chunk-2IM76CX3.js.map +1 -0
  10. package/dist/chunk-2KKEBHMR.js +2 -0
  11. package/dist/chunk-2KKEBHMR.js.map +1 -0
  12. package/dist/chunk-2P6G236K.js +2 -0
  13. package/dist/chunk-2P6G236K.js.map +1 -0
  14. package/dist/chunk-4AANJADQ.js +2 -0
  15. package/dist/chunk-4AANJADQ.js.map +1 -0
  16. package/dist/chunk-4WFD6EA7.js +2 -0
  17. package/dist/chunk-4WFD6EA7.js.map +1 -0
  18. package/dist/chunk-52WEI2L4.js +2 -0
  19. package/dist/chunk-52WEI2L4.js.map +1 -0
  20. package/dist/chunk-52YSBIVX.js +2 -0
  21. package/dist/chunk-52YSBIVX.js.map +1 -0
  22. package/dist/chunk-5PJCNPKY.js +2 -0
  23. package/dist/chunk-5PJCNPKY.js.map +1 -0
  24. package/dist/chunk-6YHJJXF4.js +2 -0
  25. package/dist/chunk-6YHJJXF4.js.map +1 -0
  26. package/dist/chunk-7CQ6XF2G.js +2 -0
  27. package/dist/chunk-7CQ6XF2G.js.map +1 -0
  28. package/dist/chunk-7WTS4C5R.js +3 -0
  29. package/dist/chunk-7WTS4C5R.js.map +1 -0
  30. package/dist/chunk-A6BNAR7H.js +2 -0
  31. package/dist/chunk-A6BNAR7H.js.map +1 -0
  32. package/dist/chunk-BNY43SC2.js +2 -0
  33. package/dist/chunk-BNY43SC2.js.map +1 -0
  34. package/dist/chunk-C2BNB3CS.js +2 -0
  35. package/dist/chunk-C2BNB3CS.js.map +1 -0
  36. package/dist/chunk-COAIGQ25.js +2 -0
  37. package/dist/chunk-COAIGQ25.js.map +1 -0
  38. package/dist/chunk-DBAHFYN4.js +2 -0
  39. package/dist/chunk-DBAHFYN4.js.map +1 -0
  40. package/dist/chunk-E63D25PW.js +1 -0
  41. package/dist/chunk-E63D25PW.js.map +1 -0
  42. package/dist/chunk-E6EZEFS5.js +2 -0
  43. package/dist/chunk-E6EZEFS5.js.map +1 -0
  44. package/dist/chunk-EMNGVHNM.js +2 -0
  45. package/dist/chunk-EMNGVHNM.js.map +1 -0
  46. package/dist/chunk-F356J323.js +2 -0
  47. package/dist/chunk-F356J323.js.map +1 -0
  48. package/dist/chunk-HKDBOVSA.js +2 -0
  49. package/dist/chunk-HKDBOVSA.js.map +1 -0
  50. package/dist/chunk-IJNZ5GDS.js +2 -0
  51. package/dist/chunk-IJNZ5GDS.js.map +1 -0
  52. package/dist/chunk-IQUXZNBK.js +2 -0
  53. package/dist/chunk-IQUXZNBK.js.map +1 -0
  54. package/dist/chunk-IUHESEXZ.js +2 -0
  55. package/dist/chunk-IUHESEXZ.js.map +1 -0
  56. package/dist/chunk-IZ5GFMMK.js +2 -0
  57. package/dist/chunk-IZ5GFMMK.js.map +1 -0
  58. package/dist/chunk-JCITTHWJ.js +2 -0
  59. package/dist/chunk-JCITTHWJ.js.map +1 -0
  60. package/dist/chunk-JS2FB4B3.js +2 -0
  61. package/dist/chunk-JS2FB4B3.js.map +1 -0
  62. package/dist/chunk-K7VPCAZD.js +2 -0
  63. package/dist/chunk-K7VPCAZD.js.map +1 -0
  64. package/dist/chunk-KDB2NMLA.js +2 -0
  65. package/dist/chunk-KDB2NMLA.js.map +1 -0
  66. package/dist/chunk-LHEWNZ3X.js +2 -0
  67. package/dist/chunk-LHEWNZ3X.js.map +1 -0
  68. package/dist/chunk-LM26JNAK.js +2 -0
  69. package/dist/chunk-LM26JNAK.js.map +1 -0
  70. package/dist/chunk-M6ZEDHQT.js +2 -0
  71. package/dist/chunk-M6ZEDHQT.js.map +1 -0
  72. package/dist/chunk-MJB2RHP4.js +2 -0
  73. package/dist/chunk-MJB2RHP4.js.map +1 -0
  74. package/dist/chunk-MKQEMUUJ.js +2 -0
  75. package/dist/chunk-MKQEMUUJ.js.map +1 -0
  76. package/dist/chunk-MVAQ5TH7.js +2 -0
  77. package/dist/chunk-MVAQ5TH7.js.map +1 -0
  78. package/dist/chunk-NEUWMVR4.js +2 -0
  79. package/dist/chunk-NEUWMVR4.js.map +1 -0
  80. package/dist/chunk-NSJJXMWD.js +2 -0
  81. package/dist/chunk-NSJJXMWD.js.map +1 -0
  82. package/dist/chunk-NUVYBG4B.js +2 -0
  83. package/dist/chunk-NUVYBG4B.js.map +1 -0
  84. package/dist/chunk-O5WOX6C7.js +2 -0
  85. package/dist/chunk-O5WOX6C7.js.map +1 -0
  86. package/dist/chunk-O7ITRRPK.js +2 -0
  87. package/dist/chunk-O7ITRRPK.js.map +1 -0
  88. package/dist/chunk-OHGZIPRU.js +2 -0
  89. package/dist/chunk-OHGZIPRU.js.map +1 -0
  90. package/dist/chunk-PXF7567W.js +2 -0
  91. package/dist/chunk-PXF7567W.js.map +1 -0
  92. package/dist/chunk-PYRVYHZG.js +2 -0
  93. package/dist/chunk-PYRVYHZG.js.map +1 -0
  94. package/dist/chunk-QECUTAQY.js +2 -0
  95. package/dist/chunk-QECUTAQY.js.map +1 -0
  96. package/dist/chunk-QPY7RRUK.js +2 -0
  97. package/dist/chunk-QPY7RRUK.js.map +1 -0
  98. package/dist/chunk-QYUTDL4D.js +2 -0
  99. package/dist/chunk-QYUTDL4D.js.map +1 -0
  100. package/dist/chunk-UEA4RIP5.js +2 -0
  101. package/dist/chunk-UEA4RIP5.js.map +1 -0
  102. package/dist/chunk-UHUNMZJO.js +2 -0
  103. package/dist/chunk-UHUNMZJO.js.map +1 -0
  104. package/dist/chunk-W5MQVYXW.js +2 -0
  105. package/dist/chunk-W5MQVYXW.js.map +1 -0
  106. package/dist/chunk-WHAGQ74D.js +2 -0
  107. package/dist/chunk-WHAGQ74D.js.map +1 -0
  108. package/dist/chunk-WRNNR3U5.js +2 -0
  109. package/dist/chunk-WRNNR3U5.js.map +1 -0
  110. package/dist/chunk-X6UCLV7L.js +2 -0
  111. package/dist/chunk-X6UCLV7L.js.map +1 -0
  112. package/dist/chunk-XHUZ4TRE.js +2 -0
  113. package/dist/chunk-XHUZ4TRE.js.map +1 -0
  114. package/dist/chunk-XISWBEKL.js +2 -0
  115. package/dist/chunk-XISWBEKL.js.map +1 -0
  116. package/dist/chunk-YCL7NHHW.js +2 -0
  117. package/dist/chunk-YCL7NHHW.js.map +1 -0
  118. package/dist/chunk-YMOLNCDC.js +2 -0
  119. package/dist/chunk-YMOLNCDC.js.map +1 -0
  120. package/dist/chunk-ZRKP6HCI.js +2 -0
  121. package/dist/chunk-ZRKP6HCI.js.map +1 -0
  122. package/dist/data/index.cjs +3 -0
  123. package/dist/data/index.cjs.map +1 -0
  124. package/dist/data/index.d.cts +32 -0
  125. package/dist/data/index.d.ts +32 -0
  126. package/dist/data/index.js +2 -0
  127. package/dist/data/index.js.map +1 -0
  128. package/dist/eviction-DGPP1vHP.d.cts +21 -0
  129. package/dist/eviction-DGPP1vHP.d.ts +21 -0
  130. package/dist/extra/buffer.cjs +3 -0
  131. package/dist/extra/buffer.cjs.map +1 -0
  132. package/dist/extra/buffer.d.cts +21 -0
  133. package/dist/extra/buffer.d.ts +21 -0
  134. package/dist/extra/buffer.js +2 -0
  135. package/dist/extra/buffer.js.map +1 -0
  136. package/dist/extra/bufferTime.cjs +3 -0
  137. package/dist/extra/bufferTime.cjs.map +1 -0
  138. package/dist/extra/bufferTime.d.cts +15 -0
  139. package/dist/extra/bufferTime.d.ts +15 -0
  140. package/dist/extra/bufferTime.js +2 -0
  141. package/dist/extra/bufferTime.js.map +1 -0
  142. package/dist/extra/combine.cjs +3 -0
  143. package/dist/extra/combine.cjs.map +1 -0
  144. package/dist/extra/combine.d.cts +19 -0
  145. package/dist/extra/combine.d.ts +19 -0
  146. package/dist/extra/combine.js +2 -0
  147. package/dist/extra/combine.js.map +1 -0
  148. package/dist/extra/concat.cjs +3 -0
  149. package/dist/extra/concat.cjs.map +1 -0
  150. package/dist/extra/concat.d.cts +18 -0
  151. package/dist/extra/concat.d.ts +18 -0
  152. package/dist/extra/concat.js +2 -0
  153. package/dist/extra/concat.js.map +1 -0
  154. package/dist/extra/concatMap.cjs +3 -0
  155. package/dist/extra/concatMap.cjs.map +1 -0
  156. package/dist/extra/concatMap.d.cts +25 -0
  157. package/dist/extra/concatMap.d.ts +25 -0
  158. package/dist/extra/concatMap.js +2 -0
  159. package/dist/extra/concatMap.js.map +1 -0
  160. package/dist/extra/debounce.cjs +3 -0
  161. package/dist/extra/debounce.cjs.map +1 -0
  162. package/dist/extra/debounce.d.cts +17 -0
  163. package/dist/extra/debounce.d.ts +17 -0
  164. package/dist/extra/debounce.js +2 -0
  165. package/dist/extra/debounce.js.map +1 -0
  166. package/dist/extra/delay.cjs +3 -0
  167. package/dist/extra/delay.cjs.map +1 -0
  168. package/dist/extra/delay.d.cts +15 -0
  169. package/dist/extra/delay.d.ts +15 -0
  170. package/dist/extra/delay.js +2 -0
  171. package/dist/extra/delay.js.map +1 -0
  172. package/dist/extra/distinctUntilChanged.cjs +3 -0
  173. package/dist/extra/distinctUntilChanged.cjs.map +1 -0
  174. package/dist/extra/distinctUntilChanged.d.cts +16 -0
  175. package/dist/extra/distinctUntilChanged.d.ts +16 -0
  176. package/dist/extra/distinctUntilChanged.js +2 -0
  177. package/dist/extra/distinctUntilChanged.js.map +1 -0
  178. package/dist/extra/elementAt.cjs +3 -0
  179. package/dist/extra/elementAt.cjs.map +1 -0
  180. package/dist/extra/elementAt.d.cts +17 -0
  181. package/dist/extra/elementAt.d.ts +17 -0
  182. package/dist/extra/elementAt.js +2 -0
  183. package/dist/extra/elementAt.js.map +1 -0
  184. package/dist/extra/empty.cjs +3 -0
  185. package/dist/extra/empty.cjs.map +1 -0
  186. package/dist/extra/empty.d.cts +13 -0
  187. package/dist/extra/empty.d.ts +13 -0
  188. package/dist/extra/empty.js +2 -0
  189. package/dist/extra/empty.js.map +1 -0
  190. package/dist/extra/exhaustMap.cjs +3 -0
  191. package/dist/extra/exhaustMap.cjs.map +1 -0
  192. package/dist/extra/exhaustMap.d.cts +21 -0
  193. package/dist/extra/exhaustMap.d.ts +21 -0
  194. package/dist/extra/exhaustMap.js +2 -0
  195. package/dist/extra/exhaustMap.js.map +1 -0
  196. package/dist/extra/filter.cjs +3 -0
  197. package/dist/extra/filter.cjs.map +1 -0
  198. package/dist/extra/filter.d.cts +16 -0
  199. package/dist/extra/filter.d.ts +16 -0
  200. package/dist/extra/filter.js +2 -0
  201. package/dist/extra/filter.js.map +1 -0
  202. package/dist/extra/find.cjs +3 -0
  203. package/dist/extra/find.cjs.map +1 -0
  204. package/dist/extra/find.d.cts +17 -0
  205. package/dist/extra/find.d.ts +17 -0
  206. package/dist/extra/find.js +2 -0
  207. package/dist/extra/find.js.map +1 -0
  208. package/dist/extra/first.cjs +3 -0
  209. package/dist/extra/first.cjs.map +1 -0
  210. package/dist/extra/first.d.cts +15 -0
  211. package/dist/extra/first.d.ts +15 -0
  212. package/dist/extra/first.js +2 -0
  213. package/dist/extra/first.js.map +1 -0
  214. package/dist/extra/flat.cjs +3 -0
  215. package/dist/extra/flat.cjs.map +1 -0
  216. package/dist/extra/flat.d.cts +21 -0
  217. package/dist/extra/flat.d.ts +21 -0
  218. package/dist/extra/flat.js +2 -0
  219. package/dist/extra/flat.js.map +1 -0
  220. package/dist/extra/forEach.cjs +2 -0
  221. package/dist/extra/forEach.cjs.map +1 -0
  222. package/dist/extra/forEach.d.cts +13 -0
  223. package/dist/extra/forEach.d.ts +13 -0
  224. package/dist/extra/forEach.js +2 -0
  225. package/dist/extra/forEach.js.map +1 -0
  226. package/dist/extra/fromEvent.cjs +3 -0
  227. package/dist/extra/fromEvent.cjs.map +1 -0
  228. package/dist/extra/fromEvent.d.cts +14 -0
  229. package/dist/extra/fromEvent.d.ts +14 -0
  230. package/dist/extra/fromEvent.js +2 -0
  231. package/dist/extra/fromEvent.js.map +1 -0
  232. package/dist/extra/fromIter.cjs +3 -0
  233. package/dist/extra/fromIter.cjs.map +1 -0
  234. package/dist/extra/fromIter.d.cts +15 -0
  235. package/dist/extra/fromIter.d.ts +15 -0
  236. package/dist/extra/fromIter.js +2 -0
  237. package/dist/extra/fromIter.js.map +1 -0
  238. package/dist/extra/fromObs.cjs +3 -0
  239. package/dist/extra/fromObs.cjs.map +1 -0
  240. package/dist/extra/fromObs.d.cts +25 -0
  241. package/dist/extra/fromObs.d.ts +25 -0
  242. package/dist/extra/fromObs.js +2 -0
  243. package/dist/extra/fromObs.js.map +1 -0
  244. package/dist/extra/fromPromise.cjs +3 -0
  245. package/dist/extra/fromPromise.cjs.map +1 -0
  246. package/dist/extra/fromPromise.d.cts +16 -0
  247. package/dist/extra/fromPromise.d.ts +16 -0
  248. package/dist/extra/fromPromise.js +2 -0
  249. package/dist/extra/fromPromise.js.map +1 -0
  250. package/dist/extra/index.cjs +3 -0
  251. package/dist/extra/index.cjs.map +1 -0
  252. package/dist/extra/index.d.cts +220 -0
  253. package/dist/extra/index.d.ts +220 -0
  254. package/dist/extra/index.js +2 -0
  255. package/dist/extra/index.js.map +1 -0
  256. package/dist/extra/interval.cjs +3 -0
  257. package/dist/extra/interval.cjs.map +1 -0
  258. package/dist/extra/interval.d.cts +15 -0
  259. package/dist/extra/interval.d.ts +15 -0
  260. package/dist/extra/interval.js +2 -0
  261. package/dist/extra/interval.js.map +1 -0
  262. package/dist/extra/last.cjs +3 -0
  263. package/dist/extra/last.cjs.map +1 -0
  264. package/dist/extra/last.d.cts +16 -0
  265. package/dist/extra/last.d.ts +16 -0
  266. package/dist/extra/last.js +2 -0
  267. package/dist/extra/last.js.map +1 -0
  268. package/dist/extra/map.cjs +3 -0
  269. package/dist/extra/map.cjs.map +1 -0
  270. package/dist/extra/map.d.cts +15 -0
  271. package/dist/extra/map.d.ts +15 -0
  272. package/dist/extra/map.js +2 -0
  273. package/dist/extra/map.js.map +1 -0
  274. package/dist/extra/merge.cjs +3 -0
  275. package/dist/extra/merge.cjs.map +1 -0
  276. package/dist/extra/merge.d.cts +21 -0
  277. package/dist/extra/merge.d.ts +21 -0
  278. package/dist/extra/merge.js +2 -0
  279. package/dist/extra/merge.js.map +1 -0
  280. package/dist/extra/never.cjs +3 -0
  281. package/dist/extra/never.cjs.map +1 -0
  282. package/dist/extra/never.d.cts +13 -0
  283. package/dist/extra/never.d.ts +13 -0
  284. package/dist/extra/never.js +2 -0
  285. package/dist/extra/never.js.map +1 -0
  286. package/dist/extra/of.cjs +3 -0
  287. package/dist/extra/of.cjs.map +1 -0
  288. package/dist/extra/of.d.cts +14 -0
  289. package/dist/extra/of.d.ts +14 -0
  290. package/dist/extra/of.js +2 -0
  291. package/dist/extra/of.js.map +1 -0
  292. package/dist/extra/pairwise.cjs +3 -0
  293. package/dist/extra/pairwise.cjs.map +1 -0
  294. package/dist/extra/pairwise.d.cts +16 -0
  295. package/dist/extra/pairwise.d.ts +16 -0
  296. package/dist/extra/pairwise.js +2 -0
  297. package/dist/extra/pairwise.js.map +1 -0
  298. package/dist/extra/partition.cjs +3 -0
  299. package/dist/extra/partition.cjs.map +1 -0
  300. package/dist/extra/partition.d.cts +24 -0
  301. package/dist/extra/partition.d.ts +24 -0
  302. package/dist/extra/partition.js +2 -0
  303. package/dist/extra/partition.js.map +1 -0
  304. package/dist/extra/pipeRaw.cjs +3 -0
  305. package/dist/extra/pipeRaw.cjs.map +1 -0
  306. package/dist/extra/pipeRaw.d.cts +22 -0
  307. package/dist/extra/pipeRaw.d.ts +22 -0
  308. package/dist/extra/pipeRaw.js +2 -0
  309. package/dist/extra/pipeRaw.js.map +1 -0
  310. package/dist/extra/remember.cjs +3 -0
  311. package/dist/extra/remember.cjs.map +1 -0
  312. package/dist/extra/remember.d.cts +17 -0
  313. package/dist/extra/remember.d.ts +17 -0
  314. package/dist/extra/remember.js +2 -0
  315. package/dist/extra/remember.js.map +1 -0
  316. package/dist/extra/repeat.cjs +3 -0
  317. package/dist/extra/repeat.cjs.map +1 -0
  318. package/dist/extra/repeat.d.cts +29 -0
  319. package/dist/extra/repeat.d.ts +29 -0
  320. package/dist/extra/repeat.js +2 -0
  321. package/dist/extra/repeat.js.map +1 -0
  322. package/dist/extra/rescue.cjs +3 -0
  323. package/dist/extra/rescue.cjs.map +1 -0
  324. package/dist/extra/rescue.d.cts +16 -0
  325. package/dist/extra/rescue.d.ts +16 -0
  326. package/dist/extra/rescue.js +2 -0
  327. package/dist/extra/rescue.js.map +1 -0
  328. package/dist/extra/retry.cjs +3 -0
  329. package/dist/extra/retry.cjs.map +1 -0
  330. package/dist/extra/retry.d.cts +29 -0
  331. package/dist/extra/retry.d.ts +29 -0
  332. package/dist/extra/retry.js +2 -0
  333. package/dist/extra/retry.js.map +1 -0
  334. package/dist/extra/sample.cjs +3 -0
  335. package/dist/extra/sample.cjs.map +1 -0
  336. package/dist/extra/sample.d.cts +15 -0
  337. package/dist/extra/sample.d.ts +15 -0
  338. package/dist/extra/sample.js +2 -0
  339. package/dist/extra/sample.js.map +1 -0
  340. package/dist/extra/scan.cjs +3 -0
  341. package/dist/extra/scan.cjs.map +1 -0
  342. package/dist/extra/scan.d.cts +16 -0
  343. package/dist/extra/scan.d.ts +16 -0
  344. package/dist/extra/scan.js +2 -0
  345. package/dist/extra/scan.js.map +1 -0
  346. package/dist/extra/share.cjs +2 -0
  347. package/dist/extra/share.cjs.map +1 -0
  348. package/dist/extra/share.d.cts +12 -0
  349. package/dist/extra/share.d.ts +12 -0
  350. package/dist/extra/share.js +2 -0
  351. package/dist/extra/share.js.map +1 -0
  352. package/dist/extra/skip.cjs +3 -0
  353. package/dist/extra/skip.cjs.map +1 -0
  354. package/dist/extra/skip.d.cts +16 -0
  355. package/dist/extra/skip.d.ts +16 -0
  356. package/dist/extra/skip.js +2 -0
  357. package/dist/extra/skip.js.map +1 -0
  358. package/dist/extra/startWith.cjs +3 -0
  359. package/dist/extra/startWith.cjs.map +1 -0
  360. package/dist/extra/startWith.d.cts +15 -0
  361. package/dist/extra/startWith.d.ts +15 -0
  362. package/dist/extra/startWith.js +2 -0
  363. package/dist/extra/startWith.js.map +1 -0
  364. package/dist/extra/subject.cjs +3 -0
  365. package/dist/extra/subject.cjs.map +1 -0
  366. package/dist/extra/subject.d.cts +27 -0
  367. package/dist/extra/subject.d.ts +27 -0
  368. package/dist/extra/subject.js +2 -0
  369. package/dist/extra/subject.js.map +1 -0
  370. package/dist/extra/subscribe.cjs +2 -0
  371. package/dist/extra/subscribe.cjs.map +1 -0
  372. package/dist/extra/subscribe.d.cts +19 -0
  373. package/dist/extra/subscribe.d.ts +19 -0
  374. package/dist/extra/subscribe.js +2 -0
  375. package/dist/extra/subscribe.js.map +1 -0
  376. package/dist/extra/switchMap.cjs +3 -0
  377. package/dist/extra/switchMap.cjs.map +1 -0
  378. package/dist/extra/switchMap.d.cts +21 -0
  379. package/dist/extra/switchMap.d.ts +21 -0
  380. package/dist/extra/switchMap.js +2 -0
  381. package/dist/extra/switchMap.js.map +1 -0
  382. package/dist/extra/take.cjs +3 -0
  383. package/dist/extra/take.cjs.map +1 -0
  384. package/dist/extra/take.d.cts +15 -0
  385. package/dist/extra/take.d.ts +15 -0
  386. package/dist/extra/take.js +2 -0
  387. package/dist/extra/take.js.map +1 -0
  388. package/dist/extra/takeUntil.cjs +3 -0
  389. package/dist/extra/takeUntil.cjs.map +1 -0
  390. package/dist/extra/takeUntil.d.cts +20 -0
  391. package/dist/extra/takeUntil.d.ts +20 -0
  392. package/dist/extra/takeUntil.js +2 -0
  393. package/dist/extra/takeUntil.js.map +1 -0
  394. package/dist/extra/tap.cjs +3 -0
  395. package/dist/extra/tap.cjs.map +1 -0
  396. package/dist/extra/tap.d.cts +15 -0
  397. package/dist/extra/tap.d.ts +15 -0
  398. package/dist/extra/tap.js +2 -0
  399. package/dist/extra/tap.js.map +1 -0
  400. package/dist/extra/throttle.cjs +3 -0
  401. package/dist/extra/throttle.cjs.map +1 -0
  402. package/dist/extra/throttle.d.cts +16 -0
  403. package/dist/extra/throttle.d.ts +16 -0
  404. package/dist/extra/throttle.js +2 -0
  405. package/dist/extra/throttle.js.map +1 -0
  406. package/dist/extra/throwError.cjs +3 -0
  407. package/dist/extra/throwError.cjs.map +1 -0
  408. package/dist/extra/throwError.d.cts +13 -0
  409. package/dist/extra/throwError.d.ts +13 -0
  410. package/dist/extra/throwError.js +2 -0
  411. package/dist/extra/throwError.js.map +1 -0
  412. package/dist/extra/timeout.cjs +3 -0
  413. package/dist/extra/timeout.cjs.map +1 -0
  414. package/dist/extra/timeout.d.cts +19 -0
  415. package/dist/extra/timeout.d.ts +19 -0
  416. package/dist/extra/timeout.js +2 -0
  417. package/dist/extra/timeout.js.map +1 -0
  418. package/dist/index.cjs +3 -0
  419. package/dist/index.cjs.map +1 -0
  420. package/dist/index.d.cts +197 -0
  421. package/dist/index.d.ts +197 -0
  422. package/dist/index.js +2 -0
  423. package/dist/index.js.map +1 -0
  424. package/dist/memory/index.cjs +3 -0
  425. package/dist/memory/index.cjs.map +1 -0
  426. package/dist/memory/index.d.cts +113 -0
  427. package/dist/memory/index.d.ts +113 -0
  428. package/dist/memory/index.js +2 -0
  429. package/dist/memory/index.js.map +1 -0
  430. package/dist/orchestrate/index.cjs +3 -0
  431. package/dist/orchestrate/index.cjs.map +1 -0
  432. package/dist/orchestrate/index.d.cts +101 -0
  433. package/dist/orchestrate/index.d.ts +101 -0
  434. package/dist/orchestrate/index.js +2 -0
  435. package/dist/orchestrate/index.js.map +1 -0
  436. package/dist/patterns/createStore/index.cjs +3 -0
  437. package/dist/patterns/createStore/index.cjs.map +1 -0
  438. package/dist/patterns/createStore/index.d.cts +55 -0
  439. package/dist/patterns/createStore/index.d.ts +55 -0
  440. package/dist/patterns/createStore/index.js +2 -0
  441. package/dist/patterns/createStore/index.js.map +1 -0
  442. package/dist/types-BiLijSKv.d.cts +192 -0
  443. package/dist/types-CIITLkgL.d.ts +192 -0
  444. package/dist/types-DsAN6Hga.d.cts +86 -0
  445. package/dist/types-DsAN6Hga.d.ts +86 -0
  446. package/dist/utils/index.cjs +3 -0
  447. package/dist/utils/index.cjs.map +1 -0
  448. package/dist/utils/index.d.cts +8 -0
  449. package/dist/utils/index.d.ts +8 -0
  450. package/dist/utils/index.js +2 -0
  451. package/dist/utils/index.js.map +1 -0
  452. package/package.json +141 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/empty.ts","../../src/core/protocol.ts","../../src/core/inspector.ts","../../src/core/producer.ts"],"sourcesContent":["import { producer } from \"../core/producer\";\nimport type { ProducerStore } from \"../core/types\";\n\n/**\n * Creates a source that completes immediately without emitting any values.\n *\n * Stateful: get() always returns undefined — no values are ever emitted.\n *\n * v3: Tier 2 Producer — sends END immediately on start. Tests validate\n * that END propagation works with no preceding DATA.\n */\nexport function empty<T = never>(): ProducerStore<T> {\n\treturn producer<T>(({ complete }) => {\n\t\tcomplete();\n\t\treturn undefined;\n\t});\n}\n","// ---------------------------------------------------------------------------\n// Protocol — v3 type 3 control channel\n// ---------------------------------------------------------------------------\n// Type 3 (STATE) carries control signals: DIRTY, RESOLVED\n// Type 1 (DATA) carries only real values — never sentinels\n// ---------------------------------------------------------------------------\n\n/** Control signal: \"my value is about to change\" */\nexport const DIRTY = Symbol(\"DIRTY\");\n\n/** Control signal: \"I was dirty but my value didn't change\" */\nexport const RESOLVED = Symbol(\"RESOLVED\");\n\nexport type Signal = typeof DIRTY | typeof RESOLVED;\n\n/** Node status — tracks current lifecycle state (v4) */\nexport type NodeStatus =\n\t| \"DISCONNECTED\"\n\t| \"DIRTY\"\n\t| \"SETTLED\"\n\t| \"RESOLVED\"\n\t| \"COMPLETED\"\n\t| \"ERRORED\";\n\n// ---------------------------------------------------------------------------\n// Integer status constants — pack into _flags for hot-path performance.\n// 3 bits (7-9) encode 6 statuses. Use STATUS_MASK to read/write.\n// ---------------------------------------------------------------------------\nexport const S_DISCONNECTED = 0;\nexport const S_DIRTY = 1;\nexport const S_SETTLED = 2;\nexport const S_RESOLVED = 3;\nexport const S_COMPLETED = 4;\nexport const S_ERRORED = 5;\nexport const STATUS_SHIFT = 7;\nexport const STATUS_MASK = 0b111 << STATUS_SHIFT; // bits 7-9\n\nconst STATUS_STRINGS: NodeStatus[] = [\n\t\"DISCONNECTED\",\n\t\"DIRTY\",\n\t\"SETTLED\",\n\t\"RESOLVED\",\n\t\"COMPLETED\",\n\t\"ERRORED\",\n];\n\n/** Decode integer status bits back to string (for Inspector / tests) */\nexport function decodeStatus(flags: number): NodeStatus {\n\treturn STATUS_STRINGS[(flags & STATUS_MASK) >>> STATUS_SHIFT];\n}\n\n/** Callbag signal types */\nexport const START = 0;\nexport const DATA = 1;\nexport const END = 2;\nexport const STATE = 3;\n\n// ---------------------------------------------------------------------------\n// Batch — defers type 1 value emissions; type 3 DIRTY propagates immediately\n// ---------------------------------------------------------------------------\n\nlet batchDepth = 0;\nconst deferredEmissions: Array<() => void> = [];\n\n// `draining` prevents re-entrant drain when a nested batch() call ends while\n// the outer drain loop is already running. Without it, the inner batch's\n// finally block would see batchDepth===0 and start a second drain, racing the\n// outer loop — potentially double-processing items or clearing the array mid-\n// iteration. With draining=true, the inner batch skips its drain; any items it\n// pushes are picked up by the outer loop (the `for` condition re-evaluates\n// `deferredEmissions.length` on every iteration, so appends during drain are\n// naturally included in the same pass).\nlet draining = false;\n\nexport function batch<T>(fn: () => T): T {\n\tbatchDepth++;\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tbatchDepth--;\n\t\tif (batchDepth === 0 && !draining) {\n\t\t\tdraining = true;\n\t\t\tfor (let i = 0; i < deferredEmissions.length; i++) {\n\t\t\t\tdeferredEmissions[i]();\n\t\t\t}\n\t\t\tdeferredEmissions.length = 0;\n\t\t\tdraining = false;\n\t\t}\n\t}\n}\n\nexport function isBatching(): boolean {\n\treturn batchDepth > 0;\n}\n\nexport function deferEmission(fn: () => void): void {\n\tdeferredEmissions.push(fn);\n}\n\n// ---------------------------------------------------------------------------\n// Connection batching (producer start deferral) — unchanged from v2\n// ---------------------------------------------------------------------------\n\nlet connectDepth = 0;\nconst pendingStarts: Array<() => void> = [];\n\nexport function beginDeferredStart(): void {\n\tconnectDepth++;\n}\n\nexport function endDeferredStart(): void {\n\tconnectDepth--;\n\tif (connectDepth === 0) {\n\t\tfor (let i = 0; i < pendingStarts.length; i++) {\n\t\t\tpendingStarts[i]();\n\t\t}\n\t\tpendingStarts.length = 0;\n\t}\n}\n\nexport function deferStart(start: () => void): void {\n\tif (connectDepth > 0) {\n\t\tpendingStarts.push(start);\n\t} else {\n\t\tstart();\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// teardown — protocol-level graph destruction\n// ---------------------------------------------------------------------------\n// Sends END to all downstream sinks of a store node, cascading through the\n// entire subgraph. After teardown, the node is in COMPLETED state and won't\n// accept new values or subscriptions.\n//\n// Works with any node that uses the output slot model:\n// - ProducerImpl / StateImpl / OperatorImpl → calls .complete()\n// - DerivedImpl → calls ._handleEnd() (no public complete() on derived)\n// ---------------------------------------------------------------------------\n\nexport function teardown(store: { source: (type: number, payload?: any) => void }): void {\n\tconst node = store as any;\n\tif (typeof node.complete === \"function\") {\n\t\tnode.complete();\n\t} else if (typeof node._handleEnd === \"function\") {\n\t\tnode._handleEnd(undefined);\n\t}\n}\n","// ---------------------------------------------------------------------------\n// Inspector — static class for observability\n// ---------------------------------------------------------------------------\n// All debug metadata lives here in WeakMaps, not on the store objects.\n// Stores stay lean. Inspector is opt-in overhead.\n//\n// v5: Zero intrusion into primitives. No hooks in hot paths. All methods\n// are static — call directly as Inspector.observe(), Inspector.tap(), etc.\n// - register/registerEdge: metadata collection (called from constructors)\n// - inspect/graph/dumpGraph/snapshot: read-only graph queries\n// - observe/spy/trace: callbag sinks for debugging (subscribe externally)\n// - tap: transparent passthrough wrapper for graph visualization\n// ---------------------------------------------------------------------------\n\nimport type { NodeStatus, Signal } from \"./protocol\";\nimport { DATA, DIRTY, END, RESOLVED, START, STATE } from \"./protocol\";\nimport type { Store } from \"./types\";\n\nexport interface StoreInfo<T = unknown> {\n\tname: string | undefined;\n\tkind: string;\n\tvalue: T;\n\t/** v4: node lifecycle status */\n\tstatus: NodeStatus | undefined;\n}\n\nexport interface ObserveResult<T> {\n\t/** All DATA (type 1) values received, in order */\n\tvalues: T[];\n\t/** All STATE (type 3) payloads received (DIRTY, RESOLVED, or unknown) */\n\tsignals: Signal[];\n\t/** All events in protocol order: { type, data } */\n\tevents: Array<{ type: \"data\" | \"signal\" | \"end\"; data: unknown }>;\n\t/** Whether END (type 2) has been received */\n\tended: boolean;\n\t/** Error payload from END, if any */\n\tendError: unknown;\n\t/** Count of DIRTY signals received */\n\tdirtyCount: number;\n\t/** Count of RESOLVED signals received */\n\tresolvedCount: number;\n\t/** Store name (from Inspector, if registered) */\n\tname: string | undefined;\n\t/** Disconnect the observer */\n\tdispose: () => void;\n}\n\n// Static-only class is intentional API for Inspector namespace\n// biome-ignore lint/complexity/noStaticOnlyClass: public API surface\nexport class Inspector {\n\t// WeakMaps for metadata — keyed by any graph node (stores, effects, etc.)\n\tprivate static _names = new WeakMap<object, string>();\n\tprivate static _kinds = new WeakMap<object, string>();\n\tprivate static _keys = new WeakMap<object, string>();\n\n\t// WeakRef set for graph() — allows GC of unused nodes\n\tprivate static _stores = new Set<WeakRef<object>>();\n\n\t// Dependency edges: parent key → child keys\n\tprivate static _edges = new Map<string, string[]>();\n\n\t// Unique key generation\n\tprivate static _nextId = 0;\n\tprivate static _usedKeys = new Set<string>();\n\n\t// Enabled flag — when false, register/getName are no-ops\n\tprivate static _explicitEnabled: boolean | null = null;\n\tprivate static _cachedDefault: boolean | null = null;\n\n\tstatic get enabled(): boolean {\n\t\tif (Inspector._explicitEnabled !== null) return Inspector._explicitEnabled;\n\t\tif (Inspector._cachedDefault !== null) return Inspector._cachedDefault;\n\t\ttry {\n\t\t\tInspector._cachedDefault = (globalThis as any).process?.env?.NODE_ENV !== \"production\";\n\t\t} catch {\n\t\t\tInspector._cachedDefault = true;\n\t\t}\n\t\treturn Inspector._cachedDefault;\n\t}\n\n\tstatic set enabled(value: boolean) {\n\t\tInspector._explicitEnabled = value;\n\t}\n\n\t/** Compute a dep-name-based suffix for unique key generation */\n\tprivate static _depSuffix(deps?: object[]): string | undefined {\n\t\tif (!deps?.length) return undefined;\n\t\tconst names = deps.map((d) => Inspector._names.get(d) ?? \"?\");\n\t\tconst joined = names.join(\",\");\n\t\treturn joined.length > 40 ? `${joined.slice(0, 37)}...` : joined;\n\t}\n\n\t/** Resolve a node to its unique graph key */\n\tprivate static _resolveKey(node: object): string {\n\t\treturn Inspector._keys.get(node) ?? Inspector._names.get(node) ?? \"anonymous\";\n\t}\n\n\t/** Register a graph node (store, effect, etc.) with the inspector */\n\tstatic register(node: object, opts?: { name?: string; kind?: string; deps?: object[] }): void {\n\t\tif (!Inspector.enabled) return;\n\t\tif (opts?.name) Inspector._names.set(node, opts.name);\n\t\tif (opts?.kind) Inspector._kinds.set(node, opts.kind);\n\n\t\t// Compute unique key\n\t\tconst id = Inspector._nextId++;\n\t\tlet key = opts?.name;\n\t\tif (key && !Inspector._usedKeys.has(key)) {\n\t\t\t// Unique name — use as-is\n\t\t} else if (key) {\n\t\t\t// Name collision — differentiate with dep names or ID\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${key}(${depSuffix})` : `${key}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t} else {\n\t\t\t// Unnamed — use kind + dep names or ID\n\t\t\tconst kind = opts?.kind ?? \"store\";\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${kind}(${depSuffix})` : `${kind}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t}\n\n\t\tInspector._usedKeys.add(key);\n\t\tInspector._keys.set(node, key);\n\t\tInspector._stores.add(new WeakRef(node));\n\t}\n\n\t/** Register a dependency edge between parent and child nodes */\n\tstatic registerEdge(parent: object, child: object): void {\n\t\tif (!Inspector.enabled) return;\n\t\tconst parentKey = Inspector._resolveKey(parent);\n\t\tconst childKey = Inspector._resolveKey(child);\n\t\tconst children = Inspector._edges.get(parentKey);\n\t\tif (children) {\n\t\t\tif (!children.includes(childKey)) children.push(childKey);\n\t\t} else {\n\t\t\tInspector._edges.set(parentKey, [childKey]);\n\t\t}\n\t}\n\n\t/** Get dependency edges: parent → children */\n\tstatic getEdges(): Map<string, string[]> {\n\t\treturn new Map(Inspector._edges);\n\t}\n\n\t/** Get the name of a node */\n\tstatic getName(node: object): string | undefined {\n\t\tif (!Inspector.enabled) return undefined;\n\t\treturn Inspector._names.get(node);\n\t}\n\n\t/** Get the kind of a node */\n\tstatic getKind(node: object): string | undefined {\n\t\treturn Inspector._kinds.get(node);\n\t}\n\n\t/** Inspect a single graph node — includes status and value (if available) */\n\tstatic inspect<T = unknown>(node: object): StoreInfo<T> {\n\t\treturn {\n\t\t\tname: Inspector._names.get(node),\n\t\t\tkind: Inspector._kinds.get(node) ?? \"unknown\",\n\t\t\tvalue: (typeof (node as any).get === \"function\" ? (node as any).get() : undefined) as T,\n\t\t\tstatus: (node as any)._status,\n\t\t};\n\t}\n\n\t/** Get all living nodes as a Map. Also prunes dead edges from GC'd nodes. */\n\tstatic graph(): Map<string, StoreInfo> {\n\t\tconst result = new Map<string, StoreInfo>();\n\t\tconst livingKeys = new Set<string>();\n\t\tfor (const ref of Inspector._stores) {\n\t\t\tconst node = ref.deref();\n\t\t\tif (!node) {\n\t\t\t\tInspector._stores.delete(ref); // cleanup GC'd refs\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst key = Inspector._resolveKey(node);\n\t\t\tlivingKeys.add(key);\n\t\t\tresult.set(key, Inspector.inspect(node));\n\t\t}\n\t\t// Prune edges referencing GC'd stores\n\t\tfor (const [key, children] of Inspector._edges) {\n\t\t\tif (!livingKeys.has(key)) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t\tInspector._usedKeys.delete(key);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst alive = children.filter((c) => livingKeys.has(c));\n\t\t\tif (alive.length === 0) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t} else if (alive.length !== children.length) {\n\t\t\t\tInspector._edges.set(key, alive);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/** Trace a specific store's value changes (raw callbag — no extra/ dependency) */\n\tstatic trace<T>(store: Store<T>, cb: (value: T, prev: T | undefined) => void): () => void {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tlet prev: T | undefined = store.get();\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) talkback = data;\n\t\t\tif (type === END) {\n\t\t\t\ttalkback = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === 1) {\n\t\t\t\tconst next = data as T;\n\t\t\t\tif (!Object.is(next, prev)) {\n\t\t\t\t\tconst p = prev;\n\t\t\t\t\tprev = next;\n\t\t\t\t\tcb(next, p);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn () => talkback?.(END);\n\t}\n\n\t/** Pretty-print the entire store graph for console/CLI debugging */\n\tstatic dumpGraph(): string {\n\t\tconst g = Inspector.graph();\n\t\tconst edges = Inspector.getEdges();\n\n\t\t// Build reverse map: child key → parent keys (deps)\n\t\tconst depsMap = new Map<string, string[]>();\n\t\tfor (const [parent, children] of edges) {\n\t\t\tfor (const child of children) {\n\t\t\t\tconst deps = depsMap.get(child);\n\t\t\t\tif (deps) {\n\t\t\t\t\tif (!deps.includes(parent)) deps.push(parent);\n\t\t\t\t} else {\n\t\t\t\t\tdepsMap.set(child, [parent]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines: string[] = [];\n\t\tfor (const [key, info] of g) {\n\t\t\tconst deps = depsMap.get(key);\n\t\t\tconst children = edges.get(key);\n\t\t\tconst depsStr = deps?.length ? ` ← [${deps.join(\", \")}]` : \"\";\n\t\t\tconst childStr = children?.length ? ` → [${children.join(\", \")}]` : \"\";\n\t\t\tlines.push(\n\t\t\t\t` ${key} (${info.kind}) = ${JSON.stringify(info.value)} [${info.status ?? \"?\"}]${depsStr}${childStr}`,\n\t\t\t);\n\t\t}\n\t\tconst header = `Store Graph (${g.size} nodes):`;\n\t\treturn [header, ...lines].join(\"\\n\");\n\t}\n\n\t/**\n\t * Internal observe implementation shared by observe() and spy().\n\t */\n\tprivate static _observe<T>(\n\t\tstore: Store<T>,\n\t\tlabel?: string,\n\t\tlog?: (...args: any[]) => void,\n\t): ObserveResult<T> {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tconst name = label ?? Inspector.getName(store);\n\t\tconst result: ObserveResult<T> = {\n\t\t\tvalues: [],\n\t\t\tsignals: [],\n\t\t\tevents: [],\n\t\t\tended: false,\n\t\t\tendError: undefined,\n\t\t\tdirtyCount: 0,\n\t\t\tresolvedCount: 0,\n\t\t\tname,\n\t\t\tdispose: () => talkback?.(END),\n\t\t};\n\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) {\n\t\t\t\ttalkback = data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === DATA) {\n\t\t\t\tresult.values.push(data);\n\t\t\t\tresult.events.push({ type: \"data\", data });\n\t\t\t\tif (log) log(`[${name}] DATA:`, data);\n\t\t\t} else if (type === STATE) {\n\t\t\t\tresult.signals.push(data);\n\t\t\t\tresult.events.push({ type: \"signal\", data });\n\t\t\t\tif (data === DIRTY) result.dirtyCount++;\n\t\t\t\telse if (data === RESOLVED) result.resolvedCount++;\n\t\t\t\tif (log) log(`[${name}] STATE:`, data);\n\t\t\t} else if (type === END) {\n\t\t\t\tresult.ended = true;\n\t\t\t\tresult.endError = data;\n\t\t\t\tresult.events.push({ type: \"end\", data });\n\t\t\t\tif (log) log(`[${name}] END`, data !== undefined ? data : \"\");\n\t\t\t\ttalkback = null;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Observe a store's full callbag protocol — the test-friendly alternative\n\t * to hooks. Captures DATA values, STATE signals, END, and provides\n\t * convenience accessors.\n\t *\n\t * Returns a live observation object — arrays grow as the store emits.\n\t *\n\t * ```ts\n\t * const obs = Inspector.observe(myStore);\n\t * myState.set(5);\n\t * obs.values // [5]\n\t * obs.signals // [DIRTY]\n\t * obs.ended // false\n\t * obs.dirtyCount // 1\n\t * obs.dispose() // stop observing\n\t * ```\n\t */\n\tstatic observe<T>(store: Store<T>): ObserveResult<T> {\n\t\treturn Inspector._observe(store);\n\t}\n\n\t/**\n\t * Create a transparent passthrough wrapper for graph visualization.\n\t * The wrapper delegates `get()` and `source()` to the original store,\n\t * appearing as a distinct node in the Inspector graph. Zero overhead —\n\t * subscribers connect directly to the original store's source.\n\t */\n\tstatic tap<T>(store: Store<T>, name?: string): Store<T> {\n\t\tconst tapName = name ?? `tap(${Inspector.getName(store) ?? \"anon\"})`;\n\t\tconst wrapper: Store<T> = {\n\t\t\tget: () => store.get(),\n\t\t\tsource: store.source,\n\t\t};\n\t\tInspector.register(wrapper, { name: tapName, kind: \"tap\" });\n\t\tInspector.registerEdge(store, wrapper);\n\t\treturn wrapper;\n\t}\n\n\t/**\n\t * Enhanced observe() with logging — for interactive debugging.\n\t * Returns the same observation object as observe(), but also logs each\n\t * event as it happens. Pass a custom logger or defaults to console.log.\n\t */\n\tstatic spy<T>(\n\t\tstore: Store<T>,\n\t\topts?: { name?: string; log?: (...args: any[]) => void },\n\t): ObserveResult<T> {\n\t\tconst label = opts?.name ?? Inspector.getName(store) ?? \"spy\";\n\t\tconst log = opts?.log ?? console.log;\n\t\treturn Inspector._observe(store, label, log);\n\t}\n\n\t/**\n\t * JSON-serializable snapshot of the entire graph — nodes + edges.\n\t * Designed for AI consumption during debugging sessions.\n\t */\n\tstatic snapshot(): {\n\t\tnodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }>;\n\t\tedges: Array<{ from: string; to: string }>;\n\t} {\n\t\tconst g = Inspector.graph();\n\t\tconst edgeMap = Inspector.getEdges();\n\t\tconst nodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }> =\n\t\t\t[];\n\t\tfor (const [key, info] of g) {\n\t\t\tnodes.push({ name: key, kind: info.kind, value: info.value, status: info.status });\n\t\t}\n\t\tconst edges: Array<{ from: string; to: string }> = [];\n\t\tfor (const [parent, children] of edgeMap) {\n\t\t\tfor (const child of children) {\n\t\t\t\tedges.push({ from: parent, to: child });\n\t\t\t}\n\t\t}\n\t\treturn { nodes, edges };\n\t}\n\n\t/** Reset all state (for testing) */\n\tstatic _reset(): void {\n\t\tInspector._names = new WeakMap<object, string>();\n\t\tInspector._kinds = new WeakMap<object, string>();\n\t\tInspector._keys = new WeakMap<object, string>();\n\t\tInspector._stores = new Set<WeakRef<object>>();\n\t\tInspector._edges = new Map();\n\t\tInspector._usedKeys = new Set();\n\t\tInspector._nextId = 0;\n\t\tInspector._explicitEnabled = null;\n\t\tInspector._cachedDefault = null;\n\t}\n}\n","/**\n * General-purpose source primitive. Can emit values, send control signals,\n * complete, and error. Lazy start on first sink, auto-cleanup on last\n * sink disconnect.\n *\n * Stateful: maintains currentValue. get() returns currentValue (or\n * getter(currentValue) when getter option is provided).\n *\n * v4: Output slot model replaces _sinks Set. _output is null (no sinks),\n * a function (single sink — P0 optimization), or a Set (multi sink).\n * _status tracks node lifecycle. autoDirty (default true) sends DIRTY on\n * type 3 before each type 1 DATA. equals option guards emit();\n * resetOnTeardown resets value on stop.\n *\n * v5: _status packed into _flags bits 7-9 for hot-path performance.\n * String status exposed via getter for Inspector/test backward compat.\n *\n * Class-based for V8 hidden class optimization and prototype method sharing.\n * Boolean fields packed into _flags bitmask to reduce hidden class size.\n */\n\nimport { Inspector } from \"./inspector\";\nimport type { Signal } from \"./protocol\";\nimport {\n\tDATA,\n\tDIRTY,\n\tdecodeStatus,\n\tdeferEmission,\n\tdeferStart,\n\tEND,\n\tisBatching,\n\tRESOLVED,\n\tS_COMPLETED,\n\tS_DIRTY,\n\tS_DISCONNECTED,\n\tS_ERRORED,\n\tS_RESOLVED,\n\tS_SETTLED,\n\tSTART,\n\tSTATE,\n\tSTATUS_MASK,\n\tSTATUS_SHIFT,\n} from \"./protocol\";\nimport type { ProducerStore, SourceOptions, Store } from \"./types\";\n\nexport type ProducerFn<T> = (actions: {\n\temit: (value: T) => void;\n\tsignal: (s: Signal) => void;\n\tcomplete: () => void;\n\terror: (e: unknown) => void;\n}) => (() => void) | undefined;\n\nexport type ProducerOpts<T> = SourceOptions<T> & {\n\tautoDirty?: boolean;\n\t_skipInspect?: boolean;\n};\n\n// Flag bits for _flags bitmask (bits 0-6)\nconst P_STARTED = 1;\nconst P_MULTI = 64;\n\n// Exported for subclass fast paths (StateImpl)\nexport const P_COMPLETED = 2;\nexport const P_AUTO_DIRTY = 4;\nconst P_RESET = 8;\nconst P_RESUB = 16;\nexport const P_PENDING = 32;\n\n// Status bits (bits 7-9) — exported for StateImpl fast path\nexport const _STATUS_MASK = STATUS_MASK;\nexport const _S_DIRTY = S_DIRTY << STATUS_SHIFT;\nexport const _S_SETTLED = S_SETTLED << STATUS_SHIFT;\nexport const _S_DISCONNECTED = S_DISCONNECTED << STATUS_SHIFT;\nexport const _S_COMPLETED = S_COMPLETED << STATUS_SHIFT;\nexport const _S_ERRORED = S_ERRORED << STATUS_SHIFT;\nexport const _S_RESOLVED = S_RESOLVED << STATUS_SHIFT;\n\nexport class ProducerImpl<T> {\n\t_value: T | undefined;\n\t_output: ((type: number, data?: any) => void) | Set<any> | null = null;\n\t_flags: number;\n\n\tget _status() {\n\t\treturn decodeStatus(this._flags);\n\t}\n\t_cleanup: (() => void) | undefined;\n\t_fn: ProducerFn<T> | undefined;\n\t_eqFn: ((a: T, b: T) => boolean) | undefined;\n\t_getterFn: ((cached: T | undefined) => T) | undefined;\n\t_initial: T | undefined;\n\n\tconstructor(fn?: ProducerFn<T>, opts?: ProducerOpts<T>) {\n\t\tthis._value = opts?.initial;\n\t\tthis._fn = fn;\n\t\tthis._eqFn = opts?.equals;\n\t\tthis._getterFn = opts?.getter;\n\t\tthis._initial = opts?.initial;\n\n\t\tlet flags = 0;\n\t\tif (opts?.autoDirty !== false) flags |= P_AUTO_DIRTY;\n\t\tif (opts?.resetOnTeardown) flags |= P_RESET;\n\t\tif (opts?.resubscribable) flags |= P_RESUB;\n\t\t// S_DISCONNECTED = 0, so no need to set status bits\n\t\tthis._flags = flags;\n\n\t\t// Bind public API methods so they work when detached (callbag interop,\n\t\t// destructuring, etc.). Replaces per-instance closure functions.\n\t\tthis.source = this.source.bind(this);\n\t\tthis.emit = this.emit.bind(this);\n\t\tthis.signal = this.signal.bind(this);\n\t\tthis.complete = this.complete.bind(this);\n\t\tthis.error = this.error.bind(this);\n\n\t\tif (!opts?._skipInspect) Inspector.register(this as any, { kind: \"producer\", ...opts });\n\t}\n\n\tget(): T | undefined {\n\t\treturn this._getterFn ? this._getterFn(this._value) : this._value;\n\t}\n\n\t/**\n\t * Dispatch a signal to all current subscribers via the output slot.\n\t *\n\t * Safety: P_MULTI flag and _output type are always updated together.\n\t * No reentrancy can occur between the two assignments (source() doesn't\n\t * trigger dispatch, and dispatch doesn't trigger source()). The null-check\n\t * provides an additional guard for the MULTI→null transition path.\n\t */\n\t_dispatch(type: number, data?: any): void {\n\t\tconst output = this._output;\n\t\tif (!output) return;\n\t\tif (this._flags & P_MULTI) {\n\t\t\tfor (const sink of output as Set<any>) sink(type, data);\n\t\t} else {\n\t\t\t(output as (type: number, data?: any) => void)(type, data);\n\t\t}\n\t}\n\n\temit(value: T): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tif (this._eqFn && this._value !== undefined && this._eqFn(this._value as T, value)) return;\n\t\tthis._value = value;\n\t\tif (!this._output) return;\n\t\tif (isBatching()) {\n\t\t\tif (!(this._flags & P_PENDING)) {\n\t\t\t\tthis._flags |= P_PENDING;\n\t\t\t\tif (this._flags & P_AUTO_DIRTY) {\n\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\t\t\t\tthis._dispatch(STATE, DIRTY);\n\t\t\t\t}\n\t\t\t\tdeferEmission(() => {\n\t\t\t\t\tthis._flags &= ~P_PENDING;\n\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_SETTLED;\n\t\t\t\t\tthis._dispatch(DATA, this._value);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._flags & P_AUTO_DIRTY) {\n\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\t\t\tthis._dispatch(STATE, DIRTY);\n\t\t\t}\n\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_SETTLED;\n\t\t\tthis._dispatch(DATA, this._value);\n\t\t}\n\t}\n\n\tsignal(s: Signal): void {\n\t\tif (this._flags & P_COMPLETED || !this._output) return;\n\t\tif (s === DIRTY) this._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\telse if (s === RESOLVED) this._flags = (this._flags & ~_STATUS_MASK) | _S_RESOLVED;\n\t\t// Unknown signals: dispatch without _status change (v4 forward-compat)\n\t\tthis._dispatch(STATE, s);\n\t}\n\n\tcomplete(): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tthis._flags = ((this._flags | P_COMPLETED) & ~_STATUS_MASK) | _S_COMPLETED;\n\t\tconst output = this._output;\n\t\tconst wasMulti = this._flags & P_MULTI;\n\t\tthis._output = null;\n\t\tthis._flags &= ~P_MULTI;\n\t\tthis._stop();\n\t\tif (output) {\n\t\t\tif (wasMulti) {\n\t\t\t\tfor (const sink of output as Set<any>) sink(END);\n\t\t\t} else {\n\t\t\t\t(output as (type: number, data?: any) => void)(END);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(e: unknown): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tthis._flags = ((this._flags | P_COMPLETED) & ~_STATUS_MASK) | _S_ERRORED;\n\t\tconst output = this._output;\n\t\tconst wasMulti = this._flags & P_MULTI;\n\t\tthis._output = null;\n\t\tthis._flags &= ~P_MULTI;\n\t\tthis._stop();\n\t\tif (output) {\n\t\t\tif (wasMulti) {\n\t\t\t\tfor (const sink of output as Set<any>) sink(END, e);\n\t\t\t} else {\n\t\t\t\t(output as (type: number, data?: any) => void)(END, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t_start(): void {\n\t\tif (this._flags & P_STARTED || !this._fn) return;\n\t\tthis._flags |= P_STARTED;\n\t\tconst result = this._fn(this as any);\n\t\tthis._cleanup = typeof result === \"function\" ? result : undefined;\n\t}\n\n\t_stop(): void {\n\t\tif (!(this._flags & P_STARTED)) return;\n\t\tthis._flags &= ~P_STARTED;\n\t\tif (this._cleanup) this._cleanup();\n\t\tthis._cleanup = undefined;\n\t\tif (this._flags & P_RESET) this._value = this._initial;\n\t\tif (!(this._flags & P_COMPLETED)) this._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t}\n\n\tsource(type: number, payload?: any): void {\n\t\tif (type === START) {\n\t\t\tconst sink = payload;\n\t\t\tif (this._flags & P_COMPLETED) {\n\t\t\t\tif (this._flags & P_RESUB && this._output === null) {\n\t\t\t\t\tthis._flags = (this._flags & ~(P_COMPLETED | _STATUS_MASK)) | _S_DISCONNECTED;\n\t\t\t\t} else {\n\t\t\t\t\tsink(START, (_t: number) => {});\n\t\t\t\t\tsink(END);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._output === null) {\n\t\t\t\tthis._output = sink;\n\t\t\t} else if (!(this._flags & P_MULTI)) {\n\t\t\t\tconst set = new Set<any>();\n\t\t\t\tset.add(this._output);\n\t\t\t\tset.add(sink);\n\t\t\t\tthis._output = set;\n\t\t\t\tthis._flags |= P_MULTI;\n\t\t\t} else {\n\t\t\t\t(this._output as Set<any>).add(sink);\n\t\t\t}\n\t\t\tsink(START, (t: number) => {\n\t\t\t\tif (t === DATA) sink(DATA, this._value);\n\t\t\t\tif (t === END) {\n\t\t\t\t\tif (this._output === null) return;\n\t\t\t\t\tif (this._flags & P_MULTI) {\n\t\t\t\t\t\tconst set = this._output as Set<any>;\n\t\t\t\t\t\tset.delete(sink);\n\t\t\t\t\t\tif (set.size === 1) {\n\t\t\t\t\t\t\tthis._output = set.values().next().value;\n\t\t\t\t\t\t\tthis._flags &= ~P_MULTI;\n\t\t\t\t\t\t} else if (set.size === 0) {\n\t\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\t\tthis._flags &= ~P_MULTI;\n\t\t\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t\t\t\t\t\t\tthis._stop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this._output === sink) {\n\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t\t\t\t\t\tthis._stop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tdeferStart(() => this._start());\n\t\t}\n\t}\n}\n\nexport function producer<T>(\n\tfn: ProducerFn<T> | undefined,\n\topts: ProducerOpts<T> & { initial: T },\n): ProducerStore<T> & Store<T>;\nexport function producer<T>(fn?: ProducerFn<T>, opts?: ProducerOpts<T>): ProducerStore<T>;\nexport function producer<T>(fn?: ProducerFn<T>, opts?: ProducerOpts<T>): ProducerStore<T> {\n\treturn new ProducerImpl<T>(fn, opts) as any;\n}\n"],"mappings":"yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,WAAAE,KAAA,eAAAC,EAAAH,ICQO,IAAMI,EAAQ,OAAO,OAAO,EAGtBC,EAAW,OAAO,UAAU,EAiB5BC,EAAiB,EACjBC,EAAU,EACVC,EAAY,EACZC,EAAa,EACbC,EAAc,EAC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N6C,EAAI,OAAS,IACvB,KAAK,QAAU,KACf,KAAK,QAAU,CAAC7C,EAChB,KAAK,OAAU,KAAK,OAAS,CAACM,EAAgBO,EAC9C,KAAK,MAAM,EAEb,MAAW,KAAK,UAAYiB,IAC3B,KAAK,QAAU,KACf,KAAK,OAAU,KAAK,OAAS,CAACxB,EAAgBO,EAC9C,KAAK,MAAM,EAEb,CACD,CAAC,EACDkC,EAAW,IAAM,KAAK,OAAO,CAAC,CAC/B,CACD,CACD,EAOO,SAASC,EAAYzB,EAAoBC,EAA0C,CACzF,OAAO,IAAIH,EAAgBE,EAAIC,CAAI,CACpC,CH/QO,SAASyB,IAAqC,CACpD,OAAOC,EAAY,CAAC,CAAE,SAAAC,CAAS,IAAM,CACpCA,EAAS,CAEV,CAAC,CACF","names":["empty_exports","__export","empty","__toCommonJS","DIRTY","RESOLVED","S_DISCONNECTED","S_DIRTY","S_SETTLED","S_RESOLVED","S_COMPLETED","S_ERRORED","STATUS_SHIFT","STATUS_MASK","STATUS_STRINGS","decodeStatus","flags","START","DATA","END","STATE","batchDepth","deferredEmissions","isBatching","batchDepth","deferEmission","fn","deferredEmissions","connectDepth","pendingStarts","deferStart","start","connectDepth","pendingStarts","Inspector","_Inspector","value","deps","joined","d","node","opts","id","key","depSuffix","kind","parent","child","parentKey","childKey","children","result","livingKeys","ref","alive","c","store","cb","talkback","prev","START","type","data","END","next","p","g","edges","depsMap","lines","info","depsStr","childStr","label","log","name","DATA","STATE","DIRTY","RESOLVED","tapName","wrapper","edgeMap","nodes","P_STARTED","P_MULTI","P_COMPLETED","P_AUTO_DIRTY","P_RESET","P_RESUB","P_PENDING","_STATUS_MASK","STATUS_MASK","_S_DIRTY","S_DIRTY","STATUS_SHIFT","_S_SETTLED","S_SETTLED","_S_DISCONNECTED","S_DISCONNECTED","_S_COMPLETED","S_COMPLETED","_S_ERRORED","S_ERRORED","_S_RESOLVED","S_RESOLVED","ProducerImpl","decodeStatus","fn","opts","flags","Inspector","type","data","output","sink","value","isBatching","STATE","DIRTY","deferEmission","DATA","s","RESOLVED","wasMulti","END","result","payload","START","_t","set","t","deferStart","producer","empty","producer","complete"]}
@@ -0,0 +1,13 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Creates a source that completes immediately without emitting any values.
5
+ *
6
+ * Stateful: get() always returns undefined — no values are ever emitted.
7
+ *
8
+ * v3: Tier 2 Producer — sends END immediately on start. Tests validate
9
+ * that END propagation works with no preceding DATA.
10
+ */
11
+ declare function empty<T = never>(): ProducerStore<T>;
12
+
13
+ export { empty };
@@ -0,0 +1,13 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Creates a source that completes immediately without emitting any values.
5
+ *
6
+ * Stateful: get() always returns undefined — no values are ever emitted.
7
+ *
8
+ * v3: Tier 2 Producer — sends END immediately on start. Tests validate
9
+ * that END propagation works with no preceding DATA.
10
+ */
11
+ declare function empty<T = never>(): ProducerStore<T>;
12
+
13
+ export { empty };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-EMNGVHNM.js";import"../chunk-LM26JNAK.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as empty};
2
+ //# sourceMappingURL=empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var w=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var ne=(e,t)=>{for(var i in t)w(e,i,{get:t[i],enumerable:!0})},se=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ee(t))!te.call(e,s)&&s!==i&&w(e,s,{get:()=>t[s],enumerable:!(n=Z(t,s))||n.enumerable});return e};var ie=e=>se(w({},"__esModule",{value:!0}),e);var ce={};ne(ce,{exhaustMap:()=>de});module.exports=ie(ce);var S=Symbol("DIRTY"),D=Symbol("RESOLVED"),C=0,L=1,B=2,K=3,F=4,V=5,h=7,N=7<<h,re=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function Y(e){return re[(e&N)>>>h]}var f=0,T=1,l=2,v=3,oe=0,ae=[];function U(){return oe>0}function W(e){ae.push(e)}var y=0,m=[];function q(){y++}function G(){if(y--,y===0){for(let e=0;e<m.length;e++)m[e]();m.length=0}}function z(e){y>0?m.push(e):e()}var E=class e{static _names=new WeakMap;static _kinds=new WeakMap;static _keys=new WeakMap;static _stores=new Set;static _edges=new Map;static _nextId=0;static _usedKeys=new Set;static _explicitEnabled=null;static _cachedDefault=null;static get enabled(){if(e._explicitEnabled!==null)return e._explicitEnabled;if(e._cachedDefault!==null)return e._cachedDefault;try{e._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{e._cachedDefault=!0}return e._cachedDefault}static set enabled(t){e._explicitEnabled=t}static _depSuffix(t){if(!t?.length)return;let n=t.map(s=>e._names.get(s)??"?").join(",");return n.length>40?`${n.slice(0,37)}...`:n}static _resolveKey(t){return e._keys.get(t)??e._names.get(t)??"anonymous"}static register(t,i){if(!e.enabled)return;i?.name&&e._names.set(t,i.name),i?.kind&&e._kinds.set(t,i.kind);let n=e._nextId++,s=i?.name;if(!(s&&!e._usedKeys.has(s)))if(s){let r=e._depSuffix(i?.deps);s=r?`${s}(${r})`:`${s}_${n}`,e._usedKeys.has(s)&&(s=`${s}_${n}`)}else{let r=i?.kind??"store",o=e._depSuffix(i?.deps);s=o?`${r}(${o})`:`${r}_${n}`,e._usedKeys.has(s)&&(s=`${s}_${n}`)}e._usedKeys.add(s),e._keys.set(t,s),e._stores.add(new WeakRef(t))}static registerEdge(t,i){if(!e.enabled)return;let n=e._resolveKey(t),s=e._resolveKey(i),r=e._edges.get(n);r?r.includes(s)||r.push(s):e._edges.set(n,[s])}static getEdges(){return new Map(e._edges)}static getName(t){if(e.enabled)return e._names.get(t)}static getKind(t){return e._kinds.get(t)}static inspect(t){return{name:e._names.get(t),kind:e._kinds.get(t)??"unknown",value:typeof t.get=="function"?t.get():void 0,status:t._status}}static graph(){let t=new Map,i=new Set;for(let n of e._stores){let s=n.deref();if(!s){e._stores.delete(n);continue}let r=e._resolveKey(s);i.add(r),t.set(r,e.inspect(s))}for(let[n,s]of e._edges){if(!i.has(n)){e._edges.delete(n),e._usedKeys.delete(n);continue}let r=s.filter(o=>i.has(o));r.length===0?e._edges.delete(n):r.length!==s.length&&e._edges.set(n,r)}return t}static trace(t,i){let n=null,s=t.get();return t.source(f,(r,o)=>{if(r===f&&(n=o),r===l){n=null;return}if(r===1){let u=o;if(!Object.is(u,s)){let a=s;s=u,i(u,a)}}}),()=>n?.(l)}static dumpGraph(){let t=e.graph(),i=e.getEdges(),n=new Map;for(let[o,u]of i)for(let a of u){let p=n.get(a);p?p.includes(o)||p.push(o):n.set(a,[o])}let s=[];for(let[o,u]of t){let a=n.get(o),p=i.get(o),R=a?.length?` \u2190 [${a.join(", ")}]`:"",O=p?.length?` \u2192 [${p.join(", ")}]`:"";s.push(` ${o} (${u.kind}) = ${JSON.stringify(u.value)} [${u.status??"?"}]${R}${O}`)}return[`Store Graph (${t.size} nodes):`,...s].join(`
2
+ `)}static _observe(t,i,n){let s=null,r=i??e.getName(t),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>s?.(l)};return t.source(f,(u,a)=>{if(u===f){s=a;return}u===T?(o.values.push(a),o.events.push({type:"data",data:a}),n&&n(`[${r}] DATA:`,a)):u===v?(o.signals.push(a),o.events.push({type:"signal",data:a}),a===S?o.dirtyCount++:a===D&&o.resolvedCount++,n&&n(`[${r}] STATE:`,a)):u===l&&(o.ended=!0,o.endError=a,o.events.push({type:"end",data:a}),n&&n(`[${r}] END`,a!==void 0?a:""),s=null)}),o}static observe(t){return e._observe(t)}static tap(t,i){let n=i??`tap(${e.getName(t)??"anon"})`,s={get:()=>t.get(),source:t.source};return e.register(s,{name:n,kind:"tap"}),e.registerEdge(t,s),s}static spy(t,i){let n=i?.name??e.getName(t)??"spy",s=i?.log??console.log;return e._observe(t,n,s)}static snapshot(){let t=e.graph(),i=e.getEdges(),n=[];for(let[r,o]of t)n.push({name:r,kind:o.kind,value:o.value,status:o.status});let s=[];for(let[r,o]of i)for(let u of o)s.push({from:r,to:u});return{nodes:n,edges:s}}static _reset(){e._names=new WeakMap,e._kinds=new WeakMap,e._keys=new WeakMap,e._stores=new Set,e._edges=new Map,e._usedKeys=new Set,e._nextId=0,e._explicitEnabled=null,e._cachedDefault=null}};var x=1,c=64,g=2,I=4,H=8,J=16,M=32,d=N,P=L<<h,Q=B<<h,k=C<<h,ue=F<<h,le=V<<h,fe=K<<h,$=class{_value;_output=null;_flags;get _status(){return Y(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;constructor(t,i){this._value=i?.initial,this._fn=t,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let n=0;i?.autoDirty!==!1&&(n|=I),i?.resetOnTeardown&&(n|=H),i?.resubscribable&&(n|=J),this._flags=n,this.source=this.source.bind(this),this.emit=this.emit.bind(this),this.signal=this.signal.bind(this),this.complete=this.complete.bind(this),this.error=this.error.bind(this),i?._skipInspect||E.register(this,{kind:"producer",...i})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(t,i){let n=this._output;if(n)if(this._flags&c)for(let s of n)s(t,i);else n(t,i)}emit(t){this._flags&g||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(U()?this._flags&M||(this._flags|=M,this._flags&I&&(this._flags=this._flags&~d|P,this._dispatch(v,S)),W(()=>{this._flags&=~M,this._flags=this._flags&~d|Q,this._dispatch(T,this._value)})):(this._flags&I&&(this._flags=this._flags&~d|P,this._dispatch(v,S)),this._flags=this._flags&~d|Q,this._dispatch(T,this._value))))}signal(t){this._flags&g||!this._output||(t===S?this._flags=this._flags&~d|P:t===D&&(this._flags=this._flags&~d|fe),this._dispatch(v,t))}complete(){if(this._flags&g)return;this._flags=(this._flags|g)&~d|ue;let t=this._output,i=this._flags&c;if(this._output=null,this._flags&=~c,this._stop(),t)if(i)for(let n of t)n(l);else t(l)}error(t){if(this._flags&g)return;this._flags=(this._flags|g)&~d|le;let i=this._output,n=this._flags&c;if(this._output=null,this._flags&=~c,this._stop(),i)if(n)for(let s of i)s(l,t);else i(l,t)}_start(){if(this._flags&x||!this._fn)return;this._flags|=x;let t=this._fn(this);this._cleanup=typeof t=="function"?t:void 0}_stop(){this._flags&x&&(this._flags&=~x,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&H&&(this._value=this._initial),this._flags&g||(this._flags=this._flags&~d|k))}source(t,i){if(t===f){let n=i;if(this._flags&g)if(this._flags&J&&this._output===null)this._flags=this._flags&~(g|d)|k;else{n(f,s=>{}),n(l);return}if(this._output===null)this._output=n;else if(this._flags&c)this._output.add(n);else{let s=new Set;s.add(this._output),s.add(n),this._output=s,this._flags|=c}n(f,s=>{if(s===T&&n(T,this._value),s===l){if(this._output===null)return;if(this._flags&c){let r=this._output;r.delete(n),r.size===1?(this._output=r.values().next().value,this._flags&=~c):r.size===0&&(this._output=null,this._flags&=~c,this._flags=this._flags&~d|k,this._stop())}else this._output===n&&(this._output=null,this._flags=this._flags&~d|k,this._stop())}}),z(()=>this._start())}}};function X(e,t){return new $(e,t)}function j(e,t,i){let n=null;q(),e.source(f,(r,o)=>{if(r===f&&(n=o),r===l){n=null,i?.onEnd?.(o);return}if(r===1){let u=o,a=s;s=u,t(u,a)}});let s=e.get();return G(),()=>n?.(l)}function de(e,t){return i=>{let n=X(({emit:s,error:r,complete:o})=>{let u=null,a=!1,p=!1;function R(_){a=!0,s(_.get()),_.source(f,(A,b)=>{A===f&&(u=b),A===1&&s(b),A===l&&(u=null,b!==void 0?r(b):(a=!1,p&&o()))})}let O=j(i,_=>{a||R(e(_))},{onEnd:_=>{_!==void 0?r(_):(p=!0,a||o())}});return()=>{u&&u(l),O()}},t&&"initial"in t?{initial:t.initial}:void 0);return E.register(n,{kind:"exhaustMap"}),n}}0&&(module.exports={exhaustMap});
3
+ //# sourceMappingURL=exhaustMap.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/exhaustMap.ts","../../src/core/protocol.ts","../../src/core/inspector.ts","../../src/core/producer.ts","../../src/core/subscribe.ts"],"sourcesContent":["import { Inspector } from \"../core/inspector\";\nimport { producer } from \"../core/producer\";\nimport { END, START } from \"../core/protocol\";\nimport type { Store, StoreOperator } from \"../core/types\";\nimport { subscribe } from \"./subscribe\";\n\n/**\n * Maps each upstream value to an inner store via `fn`. While an inner is active,\n * new outer values are ignored. The next outer value is accepted only after the\n * current inner completes (sends END).\n *\n * v5 (Option D3): Purely reactive — does NOT eagerly evaluate fn(outer.get()).\n * Inner subscription is only created when outer emits. get() returns `initial`\n * (if provided) or undefined before first inner emission.\n *\n * Tier 2 — dynamic subscription operator. Each inner is a cycle boundary;\n * each emit starts a new DIRTY+value cycle. No built-in dedup.\n * Forwards inner errors and upstream completion.\n */\nexport function exhaustMap<A, B>(fn: (value: A) => Store<B>): StoreOperator<A, B | undefined>;\nexport function exhaustMap<A, B>(\n\tfn: (value: A) => Store<B>,\n\topts: { initial: B },\n): StoreOperator<A, B>;\nexport function exhaustMap<A, B>(\n\tfn: (value: A) => Store<B>,\n\topts?: { initial?: B },\n): StoreOperator<A, B | undefined> {\n\treturn (outer: Store<A>) => {\n\t\tconst store = producer<B>(\n\t\t\t({ emit, error, complete }) => {\n\t\t\t\tlet innerTalkback: ((type: number) => void) | null = null;\n\t\t\t\tlet innerActive = false;\n\t\t\t\tlet outerDone = false;\n\n\t\t\t\tfunction subscribeInner(innerStore: Store<B>) {\n\t\t\t\t\tinnerActive = true;\n\t\t\t\t\temit(innerStore.get());\n\t\t\t\t\tinnerStore.source(START, (type: number, data: unknown) => {\n\t\t\t\t\t\tif (type === START) innerTalkback = data as (type: number) => void;\n\t\t\t\t\t\tif (type === 1) emit(data as B);\n\t\t\t\t\t\tif (type === END) {\n\t\t\t\t\t\t\tinnerTalkback = null;\n\t\t\t\t\t\t\tif (data !== undefined) {\n\t\t\t\t\t\t\t\terror(data);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinnerActive = false;\n\t\t\t\t\t\t\t\tif (outerDone) complete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst outerUnsub = subscribe(\n\t\t\t\t\touter,\n\t\t\t\t\t(v) => {\n\t\t\t\t\t\tif (!innerActive) subscribeInner(fn(v));\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tonEnd: (err) => {\n\t\t\t\t\t\t\tif (err !== undefined) {\n\t\t\t\t\t\t\t\terror(err);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\touterDone = true;\n\t\t\t\t\t\t\t\tif (!innerActive) complete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif (innerTalkback) innerTalkback(END);\n\t\t\t\t\touterUnsub();\n\t\t\t\t};\n\t\t\t},\n\t\t\topts && \"initial\" in opts ? { initial: opts.initial as B } : undefined,\n\t\t);\n\n\t\tInspector.register(store, { kind: \"exhaustMap\" });\n\t\treturn store;\n\t};\n}\n","// ---------------------------------------------------------------------------\n// Protocol — v3 type 3 control channel\n// ---------------------------------------------------------------------------\n// Type 3 (STATE) carries control signals: DIRTY, RESOLVED\n// Type 1 (DATA) carries only real values — never sentinels\n// ---------------------------------------------------------------------------\n\n/** Control signal: \"my value is about to change\" */\nexport const DIRTY = Symbol(\"DIRTY\");\n\n/** Control signal: \"I was dirty but my value didn't change\" */\nexport const RESOLVED = Symbol(\"RESOLVED\");\n\nexport type Signal = typeof DIRTY | typeof RESOLVED;\n\n/** Node status — tracks current lifecycle state (v4) */\nexport type NodeStatus =\n\t| \"DISCONNECTED\"\n\t| \"DIRTY\"\n\t| \"SETTLED\"\n\t| \"RESOLVED\"\n\t| \"COMPLETED\"\n\t| \"ERRORED\";\n\n// ---------------------------------------------------------------------------\n// Integer status constants — pack into _flags for hot-path performance.\n// 3 bits (7-9) encode 6 statuses. Use STATUS_MASK to read/write.\n// ---------------------------------------------------------------------------\nexport const S_DISCONNECTED = 0;\nexport const S_DIRTY = 1;\nexport const S_SETTLED = 2;\nexport const S_RESOLVED = 3;\nexport const S_COMPLETED = 4;\nexport const S_ERRORED = 5;\nexport const STATUS_SHIFT = 7;\nexport const STATUS_MASK = 0b111 << STATUS_SHIFT; // bits 7-9\n\nconst STATUS_STRINGS: NodeStatus[] = [\n\t\"DISCONNECTED\",\n\t\"DIRTY\",\n\t\"SETTLED\",\n\t\"RESOLVED\",\n\t\"COMPLETED\",\n\t\"ERRORED\",\n];\n\n/** Decode integer status bits back to string (for Inspector / tests) */\nexport function decodeStatus(flags: number): NodeStatus {\n\treturn STATUS_STRINGS[(flags & STATUS_MASK) >>> STATUS_SHIFT];\n}\n\n/** Callbag signal types */\nexport const START = 0;\nexport const DATA = 1;\nexport const END = 2;\nexport const STATE = 3;\n\n// ---------------------------------------------------------------------------\n// Batch — defers type 1 value emissions; type 3 DIRTY propagates immediately\n// ---------------------------------------------------------------------------\n\nlet batchDepth = 0;\nconst deferredEmissions: Array<() => void> = [];\n\n// `draining` prevents re-entrant drain when a nested batch() call ends while\n// the outer drain loop is already running. Without it, the inner batch's\n// finally block would see batchDepth===0 and start a second drain, racing the\n// outer loop — potentially double-processing items or clearing the array mid-\n// iteration. With draining=true, the inner batch skips its drain; any items it\n// pushes are picked up by the outer loop (the `for` condition re-evaluates\n// `deferredEmissions.length` on every iteration, so appends during drain are\n// naturally included in the same pass).\nlet draining = false;\n\nexport function batch<T>(fn: () => T): T {\n\tbatchDepth++;\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tbatchDepth--;\n\t\tif (batchDepth === 0 && !draining) {\n\t\t\tdraining = true;\n\t\t\tfor (let i = 0; i < deferredEmissions.length; i++) {\n\t\t\t\tdeferredEmissions[i]();\n\t\t\t}\n\t\t\tdeferredEmissions.length = 0;\n\t\t\tdraining = false;\n\t\t}\n\t}\n}\n\nexport function isBatching(): boolean {\n\treturn batchDepth > 0;\n}\n\nexport function deferEmission(fn: () => void): void {\n\tdeferredEmissions.push(fn);\n}\n\n// ---------------------------------------------------------------------------\n// Connection batching (producer start deferral) — unchanged from v2\n// ---------------------------------------------------------------------------\n\nlet connectDepth = 0;\nconst pendingStarts: Array<() => void> = [];\n\nexport function beginDeferredStart(): void {\n\tconnectDepth++;\n}\n\nexport function endDeferredStart(): void {\n\tconnectDepth--;\n\tif (connectDepth === 0) {\n\t\tfor (let i = 0; i < pendingStarts.length; i++) {\n\t\t\tpendingStarts[i]();\n\t\t}\n\t\tpendingStarts.length = 0;\n\t}\n}\n\nexport function deferStart(start: () => void): void {\n\tif (connectDepth > 0) {\n\t\tpendingStarts.push(start);\n\t} else {\n\t\tstart();\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// teardown — protocol-level graph destruction\n// ---------------------------------------------------------------------------\n// Sends END to all downstream sinks of a store node, cascading through the\n// entire subgraph. After teardown, the node is in COMPLETED state and won't\n// accept new values or subscriptions.\n//\n// Works with any node that uses the output slot model:\n// - ProducerImpl / StateImpl / OperatorImpl → calls .complete()\n// - DerivedImpl → calls ._handleEnd() (no public complete() on derived)\n// ---------------------------------------------------------------------------\n\nexport function teardown(store: { source: (type: number, payload?: any) => void }): void {\n\tconst node = store as any;\n\tif (typeof node.complete === \"function\") {\n\t\tnode.complete();\n\t} else if (typeof node._handleEnd === \"function\") {\n\t\tnode._handleEnd(undefined);\n\t}\n}\n","// ---------------------------------------------------------------------------\n// Inspector — static class for observability\n// ---------------------------------------------------------------------------\n// All debug metadata lives here in WeakMaps, not on the store objects.\n// Stores stay lean. Inspector is opt-in overhead.\n//\n// v5: Zero intrusion into primitives. No hooks in hot paths. All methods\n// are static — call directly as Inspector.observe(), Inspector.tap(), etc.\n// - register/registerEdge: metadata collection (called from constructors)\n// - inspect/graph/dumpGraph/snapshot: read-only graph queries\n// - observe/spy/trace: callbag sinks for debugging (subscribe externally)\n// - tap: transparent passthrough wrapper for graph visualization\n// ---------------------------------------------------------------------------\n\nimport type { NodeStatus, Signal } from \"./protocol\";\nimport { DATA, DIRTY, END, RESOLVED, START, STATE } from \"./protocol\";\nimport type { Store } from \"./types\";\n\nexport interface StoreInfo<T = unknown> {\n\tname: string | undefined;\n\tkind: string;\n\tvalue: T;\n\t/** v4: node lifecycle status */\n\tstatus: NodeStatus | undefined;\n}\n\nexport interface ObserveResult<T> {\n\t/** All DATA (type 1) values received, in order */\n\tvalues: T[];\n\t/** All STATE (type 3) payloads received (DIRTY, RESOLVED, or unknown) */\n\tsignals: Signal[];\n\t/** All events in protocol order: { type, data } */\n\tevents: Array<{ type: \"data\" | \"signal\" | \"end\"; data: unknown }>;\n\t/** Whether END (type 2) has been received */\n\tended: boolean;\n\t/** Error payload from END, if any */\n\tendError: unknown;\n\t/** Count of DIRTY signals received */\n\tdirtyCount: number;\n\t/** Count of RESOLVED signals received */\n\tresolvedCount: number;\n\t/** Store name (from Inspector, if registered) */\n\tname: string | undefined;\n\t/** Disconnect the observer */\n\tdispose: () => void;\n}\n\n// Static-only class is intentional API for Inspector namespace\n// biome-ignore lint/complexity/noStaticOnlyClass: public API surface\nexport class Inspector {\n\t// WeakMaps for metadata — keyed by any graph node (stores, effects, etc.)\n\tprivate static _names = new WeakMap<object, string>();\n\tprivate static _kinds = new WeakMap<object, string>();\n\tprivate static _keys = new WeakMap<object, string>();\n\n\t// WeakRef set for graph() — allows GC of unused nodes\n\tprivate static _stores = new Set<WeakRef<object>>();\n\n\t// Dependency edges: parent key → child keys\n\tprivate static _edges = new Map<string, string[]>();\n\n\t// Unique key generation\n\tprivate static _nextId = 0;\n\tprivate static _usedKeys = new Set<string>();\n\n\t// Enabled flag — when false, register/getName are no-ops\n\tprivate static _explicitEnabled: boolean | null = null;\n\tprivate static _cachedDefault: boolean | null = null;\n\n\tstatic get enabled(): boolean {\n\t\tif (Inspector._explicitEnabled !== null) return Inspector._explicitEnabled;\n\t\tif (Inspector._cachedDefault !== null) return Inspector._cachedDefault;\n\t\ttry {\n\t\t\tInspector._cachedDefault = (globalThis as any).process?.env?.NODE_ENV !== \"production\";\n\t\t} catch {\n\t\t\tInspector._cachedDefault = true;\n\t\t}\n\t\treturn Inspector._cachedDefault;\n\t}\n\n\tstatic set enabled(value: boolean) {\n\t\tInspector._explicitEnabled = value;\n\t}\n\n\t/** Compute a dep-name-based suffix for unique key generation */\n\tprivate static _depSuffix(deps?: object[]): string | undefined {\n\t\tif (!deps?.length) return undefined;\n\t\tconst names = deps.map((d) => Inspector._names.get(d) ?? \"?\");\n\t\tconst joined = names.join(\",\");\n\t\treturn joined.length > 40 ? `${joined.slice(0, 37)}...` : joined;\n\t}\n\n\t/** Resolve a node to its unique graph key */\n\tprivate static _resolveKey(node: object): string {\n\t\treturn Inspector._keys.get(node) ?? Inspector._names.get(node) ?? \"anonymous\";\n\t}\n\n\t/** Register a graph node (store, effect, etc.) with the inspector */\n\tstatic register(node: object, opts?: { name?: string; kind?: string; deps?: object[] }): void {\n\t\tif (!Inspector.enabled) return;\n\t\tif (opts?.name) Inspector._names.set(node, opts.name);\n\t\tif (opts?.kind) Inspector._kinds.set(node, opts.kind);\n\n\t\t// Compute unique key\n\t\tconst id = Inspector._nextId++;\n\t\tlet key = opts?.name;\n\t\tif (key && !Inspector._usedKeys.has(key)) {\n\t\t\t// Unique name — use as-is\n\t\t} else if (key) {\n\t\t\t// Name collision — differentiate with dep names or ID\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${key}(${depSuffix})` : `${key}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t} else {\n\t\t\t// Unnamed — use kind + dep names or ID\n\t\t\tconst kind = opts?.kind ?? \"store\";\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${kind}(${depSuffix})` : `${kind}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t}\n\n\t\tInspector._usedKeys.add(key);\n\t\tInspector._keys.set(node, key);\n\t\tInspector._stores.add(new WeakRef(node));\n\t}\n\n\t/** Register a dependency edge between parent and child nodes */\n\tstatic registerEdge(parent: object, child: object): void {\n\t\tif (!Inspector.enabled) return;\n\t\tconst parentKey = Inspector._resolveKey(parent);\n\t\tconst childKey = Inspector._resolveKey(child);\n\t\tconst children = Inspector._edges.get(parentKey);\n\t\tif (children) {\n\t\t\tif (!children.includes(childKey)) children.push(childKey);\n\t\t} else {\n\t\t\tInspector._edges.set(parentKey, [childKey]);\n\t\t}\n\t}\n\n\t/** Get dependency edges: parent → children */\n\tstatic getEdges(): Map<string, string[]> {\n\t\treturn new Map(Inspector._edges);\n\t}\n\n\t/** Get the name of a node */\n\tstatic getName(node: object): string | undefined {\n\t\tif (!Inspector.enabled) return undefined;\n\t\treturn Inspector._names.get(node);\n\t}\n\n\t/** Get the kind of a node */\n\tstatic getKind(node: object): string | undefined {\n\t\treturn Inspector._kinds.get(node);\n\t}\n\n\t/** Inspect a single graph node — includes status and value (if available) */\n\tstatic inspect<T = unknown>(node: object): StoreInfo<T> {\n\t\treturn {\n\t\t\tname: Inspector._names.get(node),\n\t\t\tkind: Inspector._kinds.get(node) ?? \"unknown\",\n\t\t\tvalue: (typeof (node as any).get === \"function\" ? (node as any).get() : undefined) as T,\n\t\t\tstatus: (node as any)._status,\n\t\t};\n\t}\n\n\t/** Get all living nodes as a Map. Also prunes dead edges from GC'd nodes. */\n\tstatic graph(): Map<string, StoreInfo> {\n\t\tconst result = new Map<string, StoreInfo>();\n\t\tconst livingKeys = new Set<string>();\n\t\tfor (const ref of Inspector._stores) {\n\t\t\tconst node = ref.deref();\n\t\t\tif (!node) {\n\t\t\t\tInspector._stores.delete(ref); // cleanup GC'd refs\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst key = Inspector._resolveKey(node);\n\t\t\tlivingKeys.add(key);\n\t\t\tresult.set(key, Inspector.inspect(node));\n\t\t}\n\t\t// Prune edges referencing GC'd stores\n\t\tfor (const [key, children] of Inspector._edges) {\n\t\t\tif (!livingKeys.has(key)) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t\tInspector._usedKeys.delete(key);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst alive = children.filter((c) => livingKeys.has(c));\n\t\t\tif (alive.length === 0) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t} else if (alive.length !== children.length) {\n\t\t\t\tInspector._edges.set(key, alive);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/** Trace a specific store's value changes (raw callbag — no extra/ dependency) */\n\tstatic trace<T>(store: Store<T>, cb: (value: T, prev: T | undefined) => void): () => void {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tlet prev: T | undefined = store.get();\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) talkback = data;\n\t\t\tif (type === END) {\n\t\t\t\ttalkback = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === 1) {\n\t\t\t\tconst next = data as T;\n\t\t\t\tif (!Object.is(next, prev)) {\n\t\t\t\t\tconst p = prev;\n\t\t\t\t\tprev = next;\n\t\t\t\t\tcb(next, p);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn () => talkback?.(END);\n\t}\n\n\t/** Pretty-print the entire store graph for console/CLI debugging */\n\tstatic dumpGraph(): string {\n\t\tconst g = Inspector.graph();\n\t\tconst edges = Inspector.getEdges();\n\n\t\t// Build reverse map: child key → parent keys (deps)\n\t\tconst depsMap = new Map<string, string[]>();\n\t\tfor (const [parent, children] of edges) {\n\t\t\tfor (const child of children) {\n\t\t\t\tconst deps = depsMap.get(child);\n\t\t\t\tif (deps) {\n\t\t\t\t\tif (!deps.includes(parent)) deps.push(parent);\n\t\t\t\t} else {\n\t\t\t\t\tdepsMap.set(child, [parent]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines: string[] = [];\n\t\tfor (const [key, info] of g) {\n\t\t\tconst deps = depsMap.get(key);\n\t\t\tconst children = edges.get(key);\n\t\t\tconst depsStr = deps?.length ? ` ← [${deps.join(\", \")}]` : \"\";\n\t\t\tconst childStr = children?.length ? ` → [${children.join(\", \")}]` : \"\";\n\t\t\tlines.push(\n\t\t\t\t` ${key} (${info.kind}) = ${JSON.stringify(info.value)} [${info.status ?? \"?\"}]${depsStr}${childStr}`,\n\t\t\t);\n\t\t}\n\t\tconst header = `Store Graph (${g.size} nodes):`;\n\t\treturn [header, ...lines].join(\"\\n\");\n\t}\n\n\t/**\n\t * Internal observe implementation shared by observe() and spy().\n\t */\n\tprivate static _observe<T>(\n\t\tstore: Store<T>,\n\t\tlabel?: string,\n\t\tlog?: (...args: any[]) => void,\n\t): ObserveResult<T> {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tconst name = label ?? Inspector.getName(store);\n\t\tconst result: ObserveResult<T> = {\n\t\t\tvalues: [],\n\t\t\tsignals: [],\n\t\t\tevents: [],\n\t\t\tended: false,\n\t\t\tendError: undefined,\n\t\t\tdirtyCount: 0,\n\t\t\tresolvedCount: 0,\n\t\t\tname,\n\t\t\tdispose: () => talkback?.(END),\n\t\t};\n\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) {\n\t\t\t\ttalkback = data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === DATA) {\n\t\t\t\tresult.values.push(data);\n\t\t\t\tresult.events.push({ type: \"data\", data });\n\t\t\t\tif (log) log(`[${name}] DATA:`, data);\n\t\t\t} else if (type === STATE) {\n\t\t\t\tresult.signals.push(data);\n\t\t\t\tresult.events.push({ type: \"signal\", data });\n\t\t\t\tif (data === DIRTY) result.dirtyCount++;\n\t\t\t\telse if (data === RESOLVED) result.resolvedCount++;\n\t\t\t\tif (log) log(`[${name}] STATE:`, data);\n\t\t\t} else if (type === END) {\n\t\t\t\tresult.ended = true;\n\t\t\t\tresult.endError = data;\n\t\t\t\tresult.events.push({ type: \"end\", data });\n\t\t\t\tif (log) log(`[${name}] END`, data !== undefined ? data : \"\");\n\t\t\t\ttalkback = null;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Observe a store's full callbag protocol — the test-friendly alternative\n\t * to hooks. Captures DATA values, STATE signals, END, and provides\n\t * convenience accessors.\n\t *\n\t * Returns a live observation object — arrays grow as the store emits.\n\t *\n\t * ```ts\n\t * const obs = Inspector.observe(myStore);\n\t * myState.set(5);\n\t * obs.values // [5]\n\t * obs.signals // [DIRTY]\n\t * obs.ended // false\n\t * obs.dirtyCount // 1\n\t * obs.dispose() // stop observing\n\t * ```\n\t */\n\tstatic observe<T>(store: Store<T>): ObserveResult<T> {\n\t\treturn Inspector._observe(store);\n\t}\n\n\t/**\n\t * Create a transparent passthrough wrapper for graph visualization.\n\t * The wrapper delegates `get()` and `source()` to the original store,\n\t * appearing as a distinct node in the Inspector graph. Zero overhead —\n\t * subscribers connect directly to the original store's source.\n\t */\n\tstatic tap<T>(store: Store<T>, name?: string): Store<T> {\n\t\tconst tapName = name ?? `tap(${Inspector.getName(store) ?? \"anon\"})`;\n\t\tconst wrapper: Store<T> = {\n\t\t\tget: () => store.get(),\n\t\t\tsource: store.source,\n\t\t};\n\t\tInspector.register(wrapper, { name: tapName, kind: \"tap\" });\n\t\tInspector.registerEdge(store, wrapper);\n\t\treturn wrapper;\n\t}\n\n\t/**\n\t * Enhanced observe() with logging — for interactive debugging.\n\t * Returns the same observation object as observe(), but also logs each\n\t * event as it happens. Pass a custom logger or defaults to console.log.\n\t */\n\tstatic spy<T>(\n\t\tstore: Store<T>,\n\t\topts?: { name?: string; log?: (...args: any[]) => void },\n\t): ObserveResult<T> {\n\t\tconst label = opts?.name ?? Inspector.getName(store) ?? \"spy\";\n\t\tconst log = opts?.log ?? console.log;\n\t\treturn Inspector._observe(store, label, log);\n\t}\n\n\t/**\n\t * JSON-serializable snapshot of the entire graph — nodes + edges.\n\t * Designed for AI consumption during debugging sessions.\n\t */\n\tstatic snapshot(): {\n\t\tnodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }>;\n\t\tedges: Array<{ from: string; to: string }>;\n\t} {\n\t\tconst g = Inspector.graph();\n\t\tconst edgeMap = Inspector.getEdges();\n\t\tconst nodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }> =\n\t\t\t[];\n\t\tfor (const [key, info] of g) {\n\t\t\tnodes.push({ name: key, kind: info.kind, value: info.value, status: info.status });\n\t\t}\n\t\tconst edges: Array<{ from: string; to: string }> = [];\n\t\tfor (const [parent, children] of edgeMap) {\n\t\t\tfor (const child of children) {\n\t\t\t\tedges.push({ from: parent, to: child });\n\t\t\t}\n\t\t}\n\t\treturn { nodes, edges };\n\t}\n\n\t/** Reset all state (for testing) */\n\tstatic _reset(): void {\n\t\tInspector._names = new WeakMap<object, string>();\n\t\tInspector._kinds = new WeakMap<object, string>();\n\t\tInspector._keys = new WeakMap<object, string>();\n\t\tInspector._stores = new Set<WeakRef<object>>();\n\t\tInspector._edges = new Map();\n\t\tInspector._usedKeys = new Set();\n\t\tInspector._nextId = 0;\n\t\tInspector._explicitEnabled = null;\n\t\tInspector._cachedDefault = null;\n\t}\n}\n","/**\n * General-purpose source primitive. Can emit values, send control signals,\n * complete, and error. Lazy start on first sink, auto-cleanup on last\n * sink disconnect.\n *\n * Stateful: maintains currentValue. get() returns currentValue (or\n * getter(currentValue) when getter option is provided).\n *\n * v4: Output slot model replaces _sinks Set. _output is null (no sinks),\n * a function (single sink — P0 optimization), or a Set (multi sink).\n * _status tracks node lifecycle. autoDirty (default true) sends DIRTY on\n * type 3 before each type 1 DATA. equals option guards emit();\n * resetOnTeardown resets value on stop.\n *\n * v5: _status packed into _flags bits 7-9 for hot-path performance.\n * String status exposed via getter for Inspector/test backward compat.\n *\n * Class-based for V8 hidden class optimization and prototype method sharing.\n * Boolean fields packed into _flags bitmask to reduce hidden class size.\n */\n\nimport { Inspector } from \"./inspector\";\nimport type { Signal } from \"./protocol\";\nimport {\n\tDATA,\n\tDIRTY,\n\tdecodeStatus,\n\tdeferEmission,\n\tdeferStart,\n\tEND,\n\tisBatching,\n\tRESOLVED,\n\tS_COMPLETED,\n\tS_DIRTY,\n\tS_DISCONNECTED,\n\tS_ERRORED,\n\tS_RESOLVED,\n\tS_SETTLED,\n\tSTART,\n\tSTATE,\n\tSTATUS_MASK,\n\tSTATUS_SHIFT,\n} from \"./protocol\";\nimport type { ProducerStore, SourceOptions, Store } from \"./types\";\n\nexport type ProducerFn<T> = (actions: {\n\temit: (value: T) => void;\n\tsignal: (s: Signal) => void;\n\tcomplete: () => void;\n\terror: (e: unknown) => void;\n}) => (() => void) | undefined;\n\nexport type ProducerOpts<T> = SourceOptions<T> & {\n\tautoDirty?: boolean;\n\t_skipInspect?: boolean;\n};\n\n// Flag bits for _flags bitmask (bits 0-6)\nconst P_STARTED = 1;\nconst P_MULTI = 64;\n\n// Exported for subclass fast paths (StateImpl)\nexport const P_COMPLETED = 2;\nexport const P_AUTO_DIRTY = 4;\nconst P_RESET = 8;\nconst P_RESUB = 16;\nexport const P_PENDING = 32;\n\n// Status bits (bits 7-9) — exported for StateImpl fast path\nexport const _STATUS_MASK = STATUS_MASK;\nexport const _S_DIRTY = S_DIRTY << STATUS_SHIFT;\nexport const _S_SETTLED = S_SETTLED << STATUS_SHIFT;\nexport const _S_DISCONNECTED = S_DISCONNECTED << STATUS_SHIFT;\nexport const _S_COMPLETED = S_COMPLETED << STATUS_SHIFT;\nexport const _S_ERRORED = S_ERRORED << STATUS_SHIFT;\nexport const _S_RESOLVED = S_RESOLVED << STATUS_SHIFT;\n\nexport class ProducerImpl<T> {\n\t_value: T | undefined;\n\t_output: ((type: number, data?: any) => void) | Set<any> | null = null;\n\t_flags: number;\n\n\tget _status() {\n\t\treturn decodeStatus(this._flags);\n\t}\n\t_cleanup: (() => void) | undefined;\n\t_fn: ProducerFn<T> | undefined;\n\t_eqFn: ((a: T, b: T) => boolean) | undefined;\n\t_getterFn: ((cached: T | undefined) => T) | undefined;\n\t_initial: T | undefined;\n\n\tconstructor(fn?: ProducerFn<T>, opts?: ProducerOpts<T>) {\n\t\tthis._value = opts?.initial;\n\t\tthis._fn = fn;\n\t\tthis._eqFn = opts?.equals;\n\t\tthis._getterFn = opts?.getter;\n\t\tthis._initial = opts?.initial;\n\n\t\tlet flags = 0;\n\t\tif (opts?.autoDirty !== false) flags |= P_AUTO_DIRTY;\n\t\tif (opts?.resetOnTeardown) flags |= P_RESET;\n\t\tif (opts?.resubscribable) flags |= P_RESUB;\n\t\t// S_DISCONNECTED = 0, so no need to set status bits\n\t\tthis._flags = flags;\n\n\t\t// Bind public API methods so they work when detached (callbag interop,\n\t\t// destructuring, etc.). Replaces per-instance closure functions.\n\t\tthis.source = this.source.bind(this);\n\t\tthis.emit = this.emit.bind(this);\n\t\tthis.signal = this.signal.bind(this);\n\t\tthis.complete = this.complete.bind(this);\n\t\tthis.error = this.error.bind(this);\n\n\t\tif (!opts?._skipInspect) Inspector.register(this as any, { kind: \"producer\", ...opts });\n\t}\n\n\tget(): T | undefined {\n\t\treturn this._getterFn ? this._getterFn(this._value) : this._value;\n\t}\n\n\t/**\n\t * Dispatch a signal to all current subscribers via the output slot.\n\t *\n\t * Safety: P_MULTI flag and _output type are always updated together.\n\t * No reentrancy can occur between the two assignments (source() doesn't\n\t * trigger dispatch, and dispatch doesn't trigger source()). The null-check\n\t * provides an additional guard for the MULTI→null transition path.\n\t */\n\t_dispatch(type: number, data?: any): void {\n\t\tconst output = this._output;\n\t\tif (!output) return;\n\t\tif (this._flags & P_MULTI) {\n\t\t\tfor (const sink of output as Set<any>) sink(type, data);\n\t\t} else {\n\t\t\t(output as (type: number, data?: any) => void)(type, data);\n\t\t}\n\t}\n\n\temit(value: T): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tif (this._eqFn && this._value !== undefined && this._eqFn(this._value as T, value)) return;\n\t\tthis._value = value;\n\t\tif (!this._output) return;\n\t\tif (isBatching()) {\n\t\t\tif (!(this._flags & P_PENDING)) {\n\t\t\t\tthis._flags |= P_PENDING;\n\t\t\t\tif (this._flags & P_AUTO_DIRTY) {\n\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\t\t\t\tthis._dispatch(STATE, DIRTY);\n\t\t\t\t}\n\t\t\t\tdeferEmission(() => {\n\t\t\t\t\tthis._flags &= ~P_PENDING;\n\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_SETTLED;\n\t\t\t\t\tthis._dispatch(DATA, this._value);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._flags & P_AUTO_DIRTY) {\n\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\t\t\tthis._dispatch(STATE, DIRTY);\n\t\t\t}\n\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_SETTLED;\n\t\t\tthis._dispatch(DATA, this._value);\n\t\t}\n\t}\n\n\tsignal(s: Signal): void {\n\t\tif (this._flags & P_COMPLETED || !this._output) return;\n\t\tif (s === DIRTY) this._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\telse if (s === RESOLVED) this._flags = (this._flags & ~_STATUS_MASK) | _S_RESOLVED;\n\t\t// Unknown signals: dispatch without _status change (v4 forward-compat)\n\t\tthis._dispatch(STATE, s);\n\t}\n\n\tcomplete(): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tthis._flags = ((this._flags | P_COMPLETED) & ~_STATUS_MASK) | _S_COMPLETED;\n\t\tconst output = this._output;\n\t\tconst wasMulti = this._flags & P_MULTI;\n\t\tthis._output = null;\n\t\tthis._flags &= ~P_MULTI;\n\t\tthis._stop();\n\t\tif (output) {\n\t\t\tif (wasMulti) {\n\t\t\t\tfor (const sink of output as Set<any>) sink(END);\n\t\t\t} else {\n\t\t\t\t(output as (type: number, data?: any) => void)(END);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(e: unknown): void {\n\t\tif (this._flags & P_COMPLETED) return;\n\t\tthis._flags = ((this._flags | P_COMPLETED) & ~_STATUS_MASK) | _S_ERRORED;\n\t\tconst output = this._output;\n\t\tconst wasMulti = this._flags & P_MULTI;\n\t\tthis._output = null;\n\t\tthis._flags &= ~P_MULTI;\n\t\tthis._stop();\n\t\tif (output) {\n\t\t\tif (wasMulti) {\n\t\t\t\tfor (const sink of output as Set<any>) sink(END, e);\n\t\t\t} else {\n\t\t\t\t(output as (type: number, data?: any) => void)(END, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t_start(): void {\n\t\tif (this._flags & P_STARTED || !this._fn) return;\n\t\tthis._flags |= P_STARTED;\n\t\tconst result = this._fn(this as any);\n\t\tthis._cleanup = typeof result === \"function\" ? result : undefined;\n\t}\n\n\t_stop(): void {\n\t\tif (!(this._flags & P_STARTED)) return;\n\t\tthis._flags &= ~P_STARTED;\n\t\tif (this._cleanup) this._cleanup();\n\t\tthis._cleanup = undefined;\n\t\tif (this._flags & P_RESET) this._value = this._initial;\n\t\tif (!(this._flags & P_COMPLETED)) this._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t}\n\n\tsource(type: number, payload?: any): void {\n\t\tif (type === START) {\n\t\t\tconst sink = payload;\n\t\t\tif (this._flags & P_COMPLETED) {\n\t\t\t\tif (this._flags & P_RESUB && this._output === null) {\n\t\t\t\t\tthis._flags = (this._flags & ~(P_COMPLETED | _STATUS_MASK)) | _S_DISCONNECTED;\n\t\t\t\t} else {\n\t\t\t\t\tsink(START, (_t: number) => {});\n\t\t\t\t\tsink(END);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._output === null) {\n\t\t\t\tthis._output = sink;\n\t\t\t} else if (!(this._flags & P_MULTI)) {\n\t\t\t\tconst set = new Set<any>();\n\t\t\t\tset.add(this._output);\n\t\t\t\tset.add(sink);\n\t\t\t\tthis._output = set;\n\t\t\t\tthis._flags |= P_MULTI;\n\t\t\t} else {\n\t\t\t\t(this._output as Set<any>).add(sink);\n\t\t\t}\n\t\t\tsink(START, (t: number) => {\n\t\t\t\tif (t === DATA) sink(DATA, this._value);\n\t\t\t\tif (t === END) {\n\t\t\t\t\tif (this._output === null) return;\n\t\t\t\t\tif (this._flags & P_MULTI) {\n\t\t\t\t\t\tconst set = this._output as Set<any>;\n\t\t\t\t\t\tset.delete(sink);\n\t\t\t\t\t\tif (set.size === 1) {\n\t\t\t\t\t\t\tthis._output = set.values().next().value;\n\t\t\t\t\t\t\tthis._flags &= ~P_MULTI;\n\t\t\t\t\t\t} else if (set.size === 0) {\n\t\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\t\tthis._flags &= ~P_MULTI;\n\t\t\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t\t\t\t\t\t\tthis._stop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this._output === sink) {\n\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t\t\t\t\t\tthis._stop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tdeferStart(() => this._start());\n\t\t}\n\t}\n}\n\nexport function producer<T>(\n\tfn: ProducerFn<T> | undefined,\n\topts: ProducerOpts<T> & { initial: T },\n): ProducerStore<T> & Store<T>;\nexport function producer<T>(fn?: ProducerFn<T>, opts?: ProducerOpts<T>): ProducerStore<T>;\nexport function producer<T>(fn?: ProducerFn<T>, opts?: ProducerOpts<T>): ProducerStore<T> {\n\treturn new ProducerImpl<T>(fn, opts) as any;\n}\n","/**\n * Core subscribe — reusable callbag sink connector.\n *\n * Used as the base for:\n * - External subscribe (extra/subscribe re-exports this)\n * - Derived's dep connections (STANDALONE mode)\n * - Effect's dep connections\n *\n * v4: Handles callbag START handshake, filters STATE for user callbacks,\n * provides prev-value tracking. Returns unsub function.\n */\n\nimport { beginDeferredStart, END, endDeferredStart, START } from \"./protocol\";\nimport type { Store } from \"./types\";\n\nexport function subscribe<T>(\n\tstore: Store<T>,\n\tcb: (value: T, prev: T | undefined) => void,\n\topts?: { onEnd?: (error?: unknown) => void },\n): () => void {\n\tlet talkback: ((type: number) => void) | null = null;\n\n\tbeginDeferredStart();\n\n\t// `prev` is declared after store.source() but the closure only reads it\n\t// after endDeferredStart() triggers producers. By that point prev is already\n\t// set to store.get(). Order: register sink → read baseline → start producers.\n\tstore.source(START, (type: number, data: any) => {\n\t\tif (type === START) talkback = data;\n\t\tif (type === END) {\n\t\t\ttalkback = null;\n\t\t\topts?.onEnd?.(data);\n\t\t\treturn;\n\t\t}\n\t\t// Transparent sink — forwards every DATA to the callback.\n\t\t// Dedup (if desired) belongs in the source (state's equals) or in\n\t\t// an explicit operator (distinctUntilChanged), not here.\n\t\tif (type === 1 /* DATA */) {\n\t\t\tconst next = data as T;\n\t\t\tconst p = prev;\n\t\t\tprev = next;\n\t\t\tcb(next, p);\n\t\t}\n\t});\n\n\t// Baseline: captures current value before producers start. Aligns with\n\t// RxJS Observable semantics — no initial-value callback on subscribe.\n\tlet prev: T | undefined = store.get();\n\n\tendDeferredStart();\n\n\treturn () => talkback?.(END);\n}\n"],"mappings":"ibAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,gBAAAE,KAAA,eAAAC,GAAAH,ICQO,IAAMI,EAAQ,OAAO,OAAO,EAGtBC,EAAW,OAAO,UAAU,EAiB5BC,EAAiB,EACjBC,EAAU,EACVC,EAAY,EACZC,EAAa,EACbC,EAAc,EACdC,EAAY,EACZC,EAAe,EACfC,EAAc,GAASD,EAE9BE,GAA+B,CACpC,eACA,QACA,UACA,WACA,YACA,SACD,EAGO,SAASC,EAAaC,EAA2B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O,GAChCD,IAAS,GAAGT,EAAKU,CAAS,EAC1BD,IAASE,IACZR,EAAgB,KACZO,IAAS,OACZT,EAAMS,CAAI,GAEVN,EAAc,GACVC,GAAWH,EAAS,GAG3B,CAAC,CACF,CAEA,IAAMU,EAAaC,EAClBhB,EACCiB,GAAM,CACDV,GAAaE,EAAeX,EAAGmB,CAAC,CAAC,CACvC,EACA,CACC,MAAQC,GAAQ,CACXA,IAAQ,OACXd,EAAMc,CAAG,GAETV,EAAY,GACPD,GAAaF,EAAS,EAE7B,CACD,CACD,EAEA,MAAO,IAAM,CACRC,GAAeA,EAAcQ,CAAG,EACpCC,EAAW,CACZ,CACD,EACAhB,GAAQ,YAAaA,EAAO,CAAE,QAASA,EAAK,OAAa,EAAI,MAC9D,EAEA,OAAAoB,EAAU,SAASlB,EAAO,CAAE,KAAM,YAAa,CAAC,EACzCA,CACR,CACD","names":["exhaustMap_exports","__export","exhaustMap","__toCommonJS","DIRTY","RESOLVED","S_DISCONNECTED","S_DIRTY","S_SETTLED","S_RESOLVED","S_COMPLETED","S_ERRORED","STATUS_SHIFT","STATUS_MASK","STATUS_STRINGS","decodeStatus","flags","START","DATA","END","STATE","batchDepth","deferredEmissions","isBatching","batchDepth","deferEmission","fn","deferredEmissions","connectDepth","pendingStarts","beginDeferredStart","endDeferredStart","i","deferStart","start","Inspector","_Inspector","value","deps","joined","d","node","opts","id","key","depSuffix","kind","parent","child","parentKey","childKey","children","result","livingKeys","ref","alive","c","store","cb","talkback","prev","START","type","data","END","next","p","g","edges","depsMap","lines","info","depsStr","childStr","label","log","name","DATA","STATE","DIRTY","RESOLVED","tapName","wrapper","edgeMap","nodes","P_STARTED","P_MULTI","P_COMPLETED","P_AUTO_DIRTY","P_RESET","P_RESUB","P_PENDING","_STATUS_MASK","STATUS_MASK","_S_DIRTY","S_DIRTY","STATUS_SHIFT","_S_SETTLED","S_SETTLED","_S_DISCONNECTED","S_DISCONNECTED","_S_COMPLETED","S_COMPLETED","_S_ERRORED","S_ERRORED","_S_RESOLVED","S_RESOLVED","ProducerImpl","decodeStatus","fn","opts","flags","Inspector","type","data","output","sink","value","isBatching","STATE","DIRTY","deferEmission","DATA","s","RESOLVED","wasMulti","END","e","result","payload","START","_t","set","t","deferStart","producer","subscribe","store","cb","opts","talkback","beginDeferredStart","START","type","data","END","next","p","prev","endDeferredStart","exhaustMap","fn","opts","outer","store","producer","emit","error","complete","innerTalkback","innerActive","outerDone","subscribeInner","innerStore","START","type","data","END","outerUnsub","subscribe","v","err","Inspector"]}
@@ -0,0 +1,21 @@
1
+ import { S as Store, a as StoreOperator } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Maps each upstream value to an inner store via `fn`. While an inner is active,
5
+ * new outer values are ignored. The next outer value is accepted only after the
6
+ * current inner completes (sends END).
7
+ *
8
+ * v5 (Option D3): Purely reactive — does NOT eagerly evaluate fn(outer.get()).
9
+ * Inner subscription is only created when outer emits. get() returns `initial`
10
+ * (if provided) or undefined before first inner emission.
11
+ *
12
+ * Tier 2 — dynamic subscription operator. Each inner is a cycle boundary;
13
+ * each emit starts a new DIRTY+value cycle. No built-in dedup.
14
+ * Forwards inner errors and upstream completion.
15
+ */
16
+ declare function exhaustMap<A, B>(fn: (value: A) => Store<B>): StoreOperator<A, B | undefined>;
17
+ declare function exhaustMap<A, B>(fn: (value: A) => Store<B>, opts: {
18
+ initial: B;
19
+ }): StoreOperator<A, B>;
20
+
21
+ export { exhaustMap };
@@ -0,0 +1,21 @@
1
+ import { S as Store, a as StoreOperator } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Maps each upstream value to an inner store via `fn`. While an inner is active,
5
+ * new outer values are ignored. The next outer value is accepted only after the
6
+ * current inner completes (sends END).
7
+ *
8
+ * v5 (Option D3): Purely reactive — does NOT eagerly evaluate fn(outer.get()).
9
+ * Inner subscription is only created when outer emits. get() returns `initial`
10
+ * (if provided) or undefined before first inner emission.
11
+ *
12
+ * Tier 2 — dynamic subscription operator. Each inner is a cycle boundary;
13
+ * each emit starts a new DIRTY+value cycle. No built-in dedup.
14
+ * Forwards inner errors and upstream completion.
15
+ */
16
+ declare function exhaustMap<A, B>(fn: (value: A) => Store<B>): StoreOperator<A, B | undefined>;
17
+ declare function exhaustMap<A, B>(fn: (value: A) => Store<B>, opts: {
18
+ initial: B;
19
+ }): StoreOperator<A, B>;
20
+
21
+ export { exhaustMap };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-X6UCLV7L.js";import"../chunk-E63D25PW.js";import"../chunk-OHGZIPRU.js";import"../chunk-LM26JNAK.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as exhaustMap};
2
+ //# sourceMappingURL=exhaustMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var D=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var Y=(n,t)=>{for(var i in t)D(n,i,{get:t[i],enumerable:!0})},W=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of U(t))!V.call(n,e)&&e!==i&&D(n,e,{get:()=>t[e],enumerable:!(s=K(t,e))||s.enumerable});return n};var F=n=>W(D({},"__esModule",{value:!0}),n);var X={};Y(X,{filter:()=>Q});module.exports=F(X);var E=Symbol("DIRTY"),h=Symbol("RESOLVED"),R=0,w=1,I=2,N=3,M=4,$=5,f=7,x=7<<f,P=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function j(n){return P[(n&x)>>>f]}var c=0,g=1,l=2,S=3;var m=class n{static _names=new WeakMap;static _kinds=new WeakMap;static _keys=new WeakMap;static _stores=new Set;static _edges=new Map;static _nextId=0;static _usedKeys=new Set;static _explicitEnabled=null;static _cachedDefault=null;static get enabled(){if(n._explicitEnabled!==null)return n._explicitEnabled;if(n._cachedDefault!==null)return n._cachedDefault;try{n._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{n._cachedDefault=!0}return n._cachedDefault}static set enabled(t){n._explicitEnabled=t}static _depSuffix(t){if(!t?.length)return;let s=t.map(e=>n._names.get(e)??"?").join(",");return s.length>40?`${s.slice(0,37)}...`:s}static _resolveKey(t){return n._keys.get(t)??n._names.get(t)??"anonymous"}static register(t,i){if(!n.enabled)return;i?.name&&n._names.set(t,i.name),i?.kind&&n._kinds.set(t,i.kind);let s=n._nextId++,e=i?.name;if(!(e&&!n._usedKeys.has(e)))if(e){let r=n._depSuffix(i?.deps);e=r?`${e}(${r})`:`${e}_${s}`,n._usedKeys.has(e)&&(e=`${e}_${s}`)}else{let r=i?.kind??"store",o=n._depSuffix(i?.deps);e=o?`${r}(${o})`:`${r}_${s}`,n._usedKeys.has(e)&&(e=`${e}_${s}`)}n._usedKeys.add(e),n._keys.set(t,e),n._stores.add(new WeakRef(t))}static registerEdge(t,i){if(!n.enabled)return;let s=n._resolveKey(t),e=n._resolveKey(i),r=n._edges.get(s);r?r.includes(e)||r.push(e):n._edges.set(s,[e])}static getEdges(){return new Map(n._edges)}static getName(t){if(n.enabled)return n._names.get(t)}static getKind(t){return n._kinds.get(t)}static inspect(t){return{name:n._names.get(t),kind:n._kinds.get(t)??"unknown",value:typeof t.get=="function"?t.get():void 0,status:t._status}}static graph(){let t=new Map,i=new Set;for(let s of n._stores){let e=s.deref();if(!e){n._stores.delete(s);continue}let r=n._resolveKey(e);i.add(r),t.set(r,n.inspect(e))}for(let[s,e]of n._edges){if(!i.has(s)){n._edges.delete(s),n._usedKeys.delete(s);continue}let r=e.filter(o=>i.has(o));r.length===0?n._edges.delete(s):r.length!==e.length&&n._edges.set(s,r)}return t}static trace(t,i){let s=null,e=t.get();return t.source(c,(r,o)=>{if(r===c&&(s=o),r===l){s=null;return}if(r===1){let a=o;if(!Object.is(a,e)){let u=e;e=a,i(a,u)}}}),()=>s?.(l)}static dumpGraph(){let t=n.graph(),i=n.getEdges(),s=new Map;for(let[o,a]of i)for(let u of a){let p=s.get(u);p?p.includes(o)||p.push(o):s.set(u,[o])}let e=[];for(let[o,a]of t){let u=s.get(o),p=i.get(o),A=u?.length?` \u2190 [${u.join(", ")}]`:"",T=p?.length?` \u2192 [${p.join(", ")}]`:"";e.push(` ${o} (${a.kind}) = ${JSON.stringify(a.value)} [${a.status??"?"}]${A}${T}`)}return[`Store Graph (${t.size} nodes):`,...e].join(`
2
+ `)}static _observe(t,i,s){let e=null,r=i??n.getName(t),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>e?.(l)};return t.source(c,(a,u)=>{if(a===c){e=u;return}a===g?(o.values.push(u),o.events.push({type:"data",data:u}),s&&s(`[${r}] DATA:`,u)):a===S?(o.signals.push(u),o.events.push({type:"signal",data:u}),u===E?o.dirtyCount++:u===h&&o.resolvedCount++,s&&s(`[${r}] STATE:`,u)):a===l&&(o.ended=!0,o.endError=u,o.events.push({type:"end",data:u}),s&&s(`[${r}] END`,u!==void 0?u:""),e=null)}),o}static observe(t){return n._observe(t)}static tap(t,i){let s=i??`tap(${n.getName(t)??"anon"})`,e={get:()=>t.get(),source:t.source};return n.register(e,{name:s,kind:"tap"}),n.registerEdge(t,e),e}static spy(t,i){let s=i?.name??n.getName(t)??"spy",e=i?.log??console.log;return n._observe(t,s,e)}static snapshot(){let t=n.graph(),i=n.getEdges(),s=[];for(let[r,o]of t)s.push({name:r,kind:o.kind,value:o.value,status:o.status});let e=[];for(let[r,o]of i)for(let a of o)e.push({from:r,to:a});return{nodes:s,edges:e}}static _reset(){n._names=new WeakMap,n._kinds=new WeakMap,n._keys=new WeakMap,n._stores=new Set,n._edges=new Map,n._usedKeys=new Set,n._nextId=0,n._explicitEnabled=null,n._cachedDefault=null}};var b=1,k=2,L=4,d=8,B=R<<f,z=w<<f,G=I<<f,q=N<<f,H=M<<f,J=$<<f,_=x,O=class{_value;_output=null;_upstreamTalkbacks=[];_handler=null;_flags;_deps;_init;_getterFn;_initial;get _status(){return j(this._flags)}constructor(t,i,s){this._value=s?.initial,this._initial=s?.initial,this._deps=t,this._init=i,this._getterFn=s?.getter;let e=0;s?.resetOnTeardown&&(e|=k),s?.resubscribable&&(e|=L),this._flags=e,this.source=this.source.bind(this),m.register(this,{kind:s?.kind??"operator",...s,deps:t});for(let r of t)m.registerEdge(r,this)}_dispatch(t,i){let s=this._output;if(s)if(this._flags&d)for(let e of s)e(t,i);else s(t,i)}_connectUpstream(){let t=new Array(this._deps.length).fill(null);this._upstreamTalkbacks=t;let i=!1,s={seed:e=>{i||(this._value=e)},emit:e=>{i||(this._value=e,this._flags=this._flags&~_|G,this._dispatch(g,e))},signal:e=>{i||(e===E?this._flags=this._flags&~_|z:e===h&&(this._flags=this._flags&~_|q),this._dispatch(S,e))},complete:()=>{if(i)return;i=!0,this._flags=(this._flags|b)&~_|H,this._handler=null;for(let o of t)o?.(l);t.fill(null),this._flags&k&&(this._value=this._initial);let e=this._output,r=this._flags&d;if(this._output=null,this._flags&=~d,e)if(r)for(let o of e)o(l);else e(l)},error:e=>{if(i)return;i=!0,this._flags=(this._flags|b)&~_|J,this._handler=null;for(let a of t)a?.(l);t.fill(null),this._flags&k&&(this._value=this._initial);let r=this._output,o=this._flags&d;if(this._output=null,this._flags&=~d,r)if(o)for(let a of r)a(l,e);else r(l,e)},disconnect:e=>{if(e!==void 0)t[e]?.(l),t[e]=null;else{for(let r of t)r?.(l);t.fill(null)}}};this._handler=this._init(s);for(let e=0;e<this._deps.length&&!i;e++){let r=e;this._deps[r].source(c,(o,a)=>{if(o===c){t[r]=a;return}this._handler?.(r,o,a)})}}_disconnectUpstream(){for(let t of this._upstreamTalkbacks)t?.(l);this._upstreamTalkbacks=[],this._handler=null,this._flags=this._flags&~_|B,this._flags&k&&(this._value=this._initial)}get(){if(this._getterFn&&!this._output){let t=this._getterFn(this._value);return this._value=t,t}return this._value}source(t,i){if(t===c){let s=i;if(this._flags&b)if(this._flags&L&&this._output===null)this._flags=this._flags&~(b|_)|B;else{s(c,r=>{}),s(l);return}let e=this._output===null;if(this._output===null)this._output=s;else if(this._flags&d)this._output.add(s);else{let r=new Set;r.add(this._output),r.add(s),this._output=r,this._flags|=d}s(c,r=>{if(r===g&&s(g,this._value),r===l){if(this._output===null)return;if(this._flags&d){let o=this._output;o.delete(s),o.size===1?(this._output=o.values().next().value,this._flags&=~d):o.size===0&&(this._output=null,this._flags&=~d,this._disconnectUpstream())}else this._output===s&&(this._output=null,this._disconnectUpstream())}}),e&&this._connectUpstream()}}};function C(n,t,i){return new O(n,t,i)}function Q(n,t){return i=>{let s=t?.equals,e,r=i.get();return n(r)&&(e=r),C([i],({emit:o,signal:a,complete:u,error:p})=>(A,T,y)=>{if(T===S&&a(y),T===g){let v=y;if(n(v)){if(s?.(e,v)){a(h);return}e=v,o(v)}else a(h)}T===l&&(y!==void 0?p(y):u())},{kind:"filter",name:t?.name??"filter",initial:e,getter:()=>{let o=i.get();return n(o)&&(e=o),e}})}}0&&(module.exports={filter});
3
+ //# sourceMappingURL=filter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/filter.ts","../../src/core/protocol.ts","../../src/core/inspector.ts","../../src/core/operator.ts"],"sourcesContent":["import { operator } from \"../core/operator\";\nimport { DATA, END, RESOLVED, STATE } from \"../core/protocol\";\nimport type { Store, StoreOperator, StoreOptions } from \"../core/types\";\n\n/**\n * Conditionally forwards upstream values. When the predicate returns false,\n * holds the last passing value.\n *\n * Stateful: maintains last passing value via operator()'s cache.\n * get() returns the last value that passed the predicate, or undefined.\n *\n * v3: Tier 1 — uses operator() with single dep. When predicate is false and\n * lastPassing is unchanged, sends RESOLVED (subtree skipping) instead of\n * re-emitting. Pull-based get() when disconnected re-evaluates predicate.\n */\nexport function filter<A>(\n\tpredicate: (value: A) => boolean,\n\topts?: StoreOptions,\n): StoreOperator<A, A | undefined> {\n\treturn (input) => {\n\t\tconst eqFn = opts?.equals;\n\t\t// Shared state between handler (push) and getter (pull)\n\t\tlet lastPassing: A | undefined;\n\t\tconst v0 = input.get();\n\t\tif (predicate(v0)) lastPassing = v0;\n\n\t\treturn operator<A | undefined>(\n\t\t\t[input] as Store<unknown>[],\n\t\t\t({ emit, signal, complete, error }) => {\n\t\t\t\treturn (_dep, type, data) => {\n\t\t\t\t\tif (type === STATE) {\n\t\t\t\t\t\tsignal(data);\n\t\t\t\t\t}\n\t\t\t\t\tif (type === DATA) {\n\t\t\t\t\t\tconst val = data as A;\n\t\t\t\t\t\tif (predicate(val)) {\n\t\t\t\t\t\t\tif (eqFn?.(lastPassing as A, val)) {\n\t\t\t\t\t\t\t\tsignal(RESOLVED);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlastPassing = val;\n\t\t\t\t\t\t\temit(val);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Predicate failed — value didn't change for downstream\n\t\t\t\t\t\t\tsignal(RESOLVED);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (type === END) {\n\t\t\t\t\t\tif (data !== undefined) error(data);\n\t\t\t\t\t\telse complete();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"filter\",\n\t\t\t\tname: opts?.name ?? \"filter\",\n\t\t\t\tinitial: lastPassing,\n\t\t\t\tgetter: () => {\n\t\t\t\t\tconst v = input.get();\n\t\t\t\t\tif (predicate(v)) lastPassing = v;\n\t\t\t\t\treturn lastPassing;\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n}\n","// ---------------------------------------------------------------------------\n// Protocol — v3 type 3 control channel\n// ---------------------------------------------------------------------------\n// Type 3 (STATE) carries control signals: DIRTY, RESOLVED\n// Type 1 (DATA) carries only real values — never sentinels\n// ---------------------------------------------------------------------------\n\n/** Control signal: \"my value is about to change\" */\nexport const DIRTY = Symbol(\"DIRTY\");\n\n/** Control signal: \"I was dirty but my value didn't change\" */\nexport const RESOLVED = Symbol(\"RESOLVED\");\n\nexport type Signal = typeof DIRTY | typeof RESOLVED;\n\n/** Node status — tracks current lifecycle state (v4) */\nexport type NodeStatus =\n\t| \"DISCONNECTED\"\n\t| \"DIRTY\"\n\t| \"SETTLED\"\n\t| \"RESOLVED\"\n\t| \"COMPLETED\"\n\t| \"ERRORED\";\n\n// ---------------------------------------------------------------------------\n// Integer status constants — pack into _flags for hot-path performance.\n// 3 bits (7-9) encode 6 statuses. Use STATUS_MASK to read/write.\n// ---------------------------------------------------------------------------\nexport const S_DISCONNECTED = 0;\nexport const S_DIRTY = 1;\nexport const S_SETTLED = 2;\nexport const S_RESOLVED = 3;\nexport const S_COMPLETED = 4;\nexport const S_ERRORED = 5;\nexport const STATUS_SHIFT = 7;\nexport const STATUS_MASK = 0b111 << STATUS_SHIFT; // bits 7-9\n\nconst STATUS_STRINGS: NodeStatus[] = [\n\t\"DISCONNECTED\",\n\t\"DIRTY\",\n\t\"SETTLED\",\n\t\"RESOLVED\",\n\t\"COMPLETED\",\n\t\"ERRORED\",\n];\n\n/** Decode integer status bits back to string (for Inspector / tests) */\nexport function decodeStatus(flags: number): NodeStatus {\n\treturn STATUS_STRINGS[(flags & STATUS_MASK) >>> STATUS_SHIFT];\n}\n\n/** Callbag signal types */\nexport const START = 0;\nexport const DATA = 1;\nexport const END = 2;\nexport const STATE = 3;\n\n// ---------------------------------------------------------------------------\n// Batch — defers type 1 value emissions; type 3 DIRTY propagates immediately\n// ---------------------------------------------------------------------------\n\nlet batchDepth = 0;\nconst deferredEmissions: Array<() => void> = [];\n\n// `draining` prevents re-entrant drain when a nested batch() call ends while\n// the outer drain loop is already running. Without it, the inner batch's\n// finally block would see batchDepth===0 and start a second drain, racing the\n// outer loop — potentially double-processing items or clearing the array mid-\n// iteration. With draining=true, the inner batch skips its drain; any items it\n// pushes are picked up by the outer loop (the `for` condition re-evaluates\n// `deferredEmissions.length` on every iteration, so appends during drain are\n// naturally included in the same pass).\nlet draining = false;\n\nexport function batch<T>(fn: () => T): T {\n\tbatchDepth++;\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tbatchDepth--;\n\t\tif (batchDepth === 0 && !draining) {\n\t\t\tdraining = true;\n\t\t\tfor (let i = 0; i < deferredEmissions.length; i++) {\n\t\t\t\tdeferredEmissions[i]();\n\t\t\t}\n\t\t\tdeferredEmissions.length = 0;\n\t\t\tdraining = false;\n\t\t}\n\t}\n}\n\nexport function isBatching(): boolean {\n\treturn batchDepth > 0;\n}\n\nexport function deferEmission(fn: () => void): void {\n\tdeferredEmissions.push(fn);\n}\n\n// ---------------------------------------------------------------------------\n// Connection batching (producer start deferral) — unchanged from v2\n// ---------------------------------------------------------------------------\n\nlet connectDepth = 0;\nconst pendingStarts: Array<() => void> = [];\n\nexport function beginDeferredStart(): void {\n\tconnectDepth++;\n}\n\nexport function endDeferredStart(): void {\n\tconnectDepth--;\n\tif (connectDepth === 0) {\n\t\tfor (let i = 0; i < pendingStarts.length; i++) {\n\t\t\tpendingStarts[i]();\n\t\t}\n\t\tpendingStarts.length = 0;\n\t}\n}\n\nexport function deferStart(start: () => void): void {\n\tif (connectDepth > 0) {\n\t\tpendingStarts.push(start);\n\t} else {\n\t\tstart();\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// teardown — protocol-level graph destruction\n// ---------------------------------------------------------------------------\n// Sends END to all downstream sinks of a store node, cascading through the\n// entire subgraph. After teardown, the node is in COMPLETED state and won't\n// accept new values or subscriptions.\n//\n// Works with any node that uses the output slot model:\n// - ProducerImpl / StateImpl / OperatorImpl → calls .complete()\n// - DerivedImpl → calls ._handleEnd() (no public complete() on derived)\n// ---------------------------------------------------------------------------\n\nexport function teardown(store: { source: (type: number, payload?: any) => void }): void {\n\tconst node = store as any;\n\tif (typeof node.complete === \"function\") {\n\t\tnode.complete();\n\t} else if (typeof node._handleEnd === \"function\") {\n\t\tnode._handleEnd(undefined);\n\t}\n}\n","// ---------------------------------------------------------------------------\n// Inspector — static class for observability\n// ---------------------------------------------------------------------------\n// All debug metadata lives here in WeakMaps, not on the store objects.\n// Stores stay lean. Inspector is opt-in overhead.\n//\n// v5: Zero intrusion into primitives. No hooks in hot paths. All methods\n// are static — call directly as Inspector.observe(), Inspector.tap(), etc.\n// - register/registerEdge: metadata collection (called from constructors)\n// - inspect/graph/dumpGraph/snapshot: read-only graph queries\n// - observe/spy/trace: callbag sinks for debugging (subscribe externally)\n// - tap: transparent passthrough wrapper for graph visualization\n// ---------------------------------------------------------------------------\n\nimport type { NodeStatus, Signal } from \"./protocol\";\nimport { DATA, DIRTY, END, RESOLVED, START, STATE } from \"./protocol\";\nimport type { Store } from \"./types\";\n\nexport interface StoreInfo<T = unknown> {\n\tname: string | undefined;\n\tkind: string;\n\tvalue: T;\n\t/** v4: node lifecycle status */\n\tstatus: NodeStatus | undefined;\n}\n\nexport interface ObserveResult<T> {\n\t/** All DATA (type 1) values received, in order */\n\tvalues: T[];\n\t/** All STATE (type 3) payloads received (DIRTY, RESOLVED, or unknown) */\n\tsignals: Signal[];\n\t/** All events in protocol order: { type, data } */\n\tevents: Array<{ type: \"data\" | \"signal\" | \"end\"; data: unknown }>;\n\t/** Whether END (type 2) has been received */\n\tended: boolean;\n\t/** Error payload from END, if any */\n\tendError: unknown;\n\t/** Count of DIRTY signals received */\n\tdirtyCount: number;\n\t/** Count of RESOLVED signals received */\n\tresolvedCount: number;\n\t/** Store name (from Inspector, if registered) */\n\tname: string | undefined;\n\t/** Disconnect the observer */\n\tdispose: () => void;\n}\n\n// Static-only class is intentional API for Inspector namespace\n// biome-ignore lint/complexity/noStaticOnlyClass: public API surface\nexport class Inspector {\n\t// WeakMaps for metadata — keyed by any graph node (stores, effects, etc.)\n\tprivate static _names = new WeakMap<object, string>();\n\tprivate static _kinds = new WeakMap<object, string>();\n\tprivate static _keys = new WeakMap<object, string>();\n\n\t// WeakRef set for graph() — allows GC of unused nodes\n\tprivate static _stores = new Set<WeakRef<object>>();\n\n\t// Dependency edges: parent key → child keys\n\tprivate static _edges = new Map<string, string[]>();\n\n\t// Unique key generation\n\tprivate static _nextId = 0;\n\tprivate static _usedKeys = new Set<string>();\n\n\t// Enabled flag — when false, register/getName are no-ops\n\tprivate static _explicitEnabled: boolean | null = null;\n\tprivate static _cachedDefault: boolean | null = null;\n\n\tstatic get enabled(): boolean {\n\t\tif (Inspector._explicitEnabled !== null) return Inspector._explicitEnabled;\n\t\tif (Inspector._cachedDefault !== null) return Inspector._cachedDefault;\n\t\ttry {\n\t\t\tInspector._cachedDefault = (globalThis as any).process?.env?.NODE_ENV !== \"production\";\n\t\t} catch {\n\t\t\tInspector._cachedDefault = true;\n\t\t}\n\t\treturn Inspector._cachedDefault;\n\t}\n\n\tstatic set enabled(value: boolean) {\n\t\tInspector._explicitEnabled = value;\n\t}\n\n\t/** Compute a dep-name-based suffix for unique key generation */\n\tprivate static _depSuffix(deps?: object[]): string | undefined {\n\t\tif (!deps?.length) return undefined;\n\t\tconst names = deps.map((d) => Inspector._names.get(d) ?? \"?\");\n\t\tconst joined = names.join(\",\");\n\t\treturn joined.length > 40 ? `${joined.slice(0, 37)}...` : joined;\n\t}\n\n\t/** Resolve a node to its unique graph key */\n\tprivate static _resolveKey(node: object): string {\n\t\treturn Inspector._keys.get(node) ?? Inspector._names.get(node) ?? \"anonymous\";\n\t}\n\n\t/** Register a graph node (store, effect, etc.) with the inspector */\n\tstatic register(node: object, opts?: { name?: string; kind?: string; deps?: object[] }): void {\n\t\tif (!Inspector.enabled) return;\n\t\tif (opts?.name) Inspector._names.set(node, opts.name);\n\t\tif (opts?.kind) Inspector._kinds.set(node, opts.kind);\n\n\t\t// Compute unique key\n\t\tconst id = Inspector._nextId++;\n\t\tlet key = opts?.name;\n\t\tif (key && !Inspector._usedKeys.has(key)) {\n\t\t\t// Unique name — use as-is\n\t\t} else if (key) {\n\t\t\t// Name collision — differentiate with dep names or ID\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${key}(${depSuffix})` : `${key}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t} else {\n\t\t\t// Unnamed — use kind + dep names or ID\n\t\t\tconst kind = opts?.kind ?? \"store\";\n\t\t\tconst depSuffix = Inspector._depSuffix(opts?.deps);\n\t\t\tkey = depSuffix ? `${kind}(${depSuffix})` : `${kind}_${id}`;\n\t\t\tif (Inspector._usedKeys.has(key)) key = `${key}_${id}`;\n\t\t}\n\n\t\tInspector._usedKeys.add(key);\n\t\tInspector._keys.set(node, key);\n\t\tInspector._stores.add(new WeakRef(node));\n\t}\n\n\t/** Register a dependency edge between parent and child nodes */\n\tstatic registerEdge(parent: object, child: object): void {\n\t\tif (!Inspector.enabled) return;\n\t\tconst parentKey = Inspector._resolveKey(parent);\n\t\tconst childKey = Inspector._resolveKey(child);\n\t\tconst children = Inspector._edges.get(parentKey);\n\t\tif (children) {\n\t\t\tif (!children.includes(childKey)) children.push(childKey);\n\t\t} else {\n\t\t\tInspector._edges.set(parentKey, [childKey]);\n\t\t}\n\t}\n\n\t/** Get dependency edges: parent → children */\n\tstatic getEdges(): Map<string, string[]> {\n\t\treturn new Map(Inspector._edges);\n\t}\n\n\t/** Get the name of a node */\n\tstatic getName(node: object): string | undefined {\n\t\tif (!Inspector.enabled) return undefined;\n\t\treturn Inspector._names.get(node);\n\t}\n\n\t/** Get the kind of a node */\n\tstatic getKind(node: object): string | undefined {\n\t\treturn Inspector._kinds.get(node);\n\t}\n\n\t/** Inspect a single graph node — includes status and value (if available) */\n\tstatic inspect<T = unknown>(node: object): StoreInfo<T> {\n\t\treturn {\n\t\t\tname: Inspector._names.get(node),\n\t\t\tkind: Inspector._kinds.get(node) ?? \"unknown\",\n\t\t\tvalue: (typeof (node as any).get === \"function\" ? (node as any).get() : undefined) as T,\n\t\t\tstatus: (node as any)._status,\n\t\t};\n\t}\n\n\t/** Get all living nodes as a Map. Also prunes dead edges from GC'd nodes. */\n\tstatic graph(): Map<string, StoreInfo> {\n\t\tconst result = new Map<string, StoreInfo>();\n\t\tconst livingKeys = new Set<string>();\n\t\tfor (const ref of Inspector._stores) {\n\t\t\tconst node = ref.deref();\n\t\t\tif (!node) {\n\t\t\t\tInspector._stores.delete(ref); // cleanup GC'd refs\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst key = Inspector._resolveKey(node);\n\t\t\tlivingKeys.add(key);\n\t\t\tresult.set(key, Inspector.inspect(node));\n\t\t}\n\t\t// Prune edges referencing GC'd stores\n\t\tfor (const [key, children] of Inspector._edges) {\n\t\t\tif (!livingKeys.has(key)) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t\tInspector._usedKeys.delete(key);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst alive = children.filter((c) => livingKeys.has(c));\n\t\t\tif (alive.length === 0) {\n\t\t\t\tInspector._edges.delete(key);\n\t\t\t} else if (alive.length !== children.length) {\n\t\t\t\tInspector._edges.set(key, alive);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/** Trace a specific store's value changes (raw callbag — no extra/ dependency) */\n\tstatic trace<T>(store: Store<T>, cb: (value: T, prev: T | undefined) => void): () => void {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tlet prev: T | undefined = store.get();\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) talkback = data;\n\t\t\tif (type === END) {\n\t\t\t\ttalkback = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === 1) {\n\t\t\t\tconst next = data as T;\n\t\t\t\tif (!Object.is(next, prev)) {\n\t\t\t\t\tconst p = prev;\n\t\t\t\t\tprev = next;\n\t\t\t\t\tcb(next, p);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn () => talkback?.(END);\n\t}\n\n\t/** Pretty-print the entire store graph for console/CLI debugging */\n\tstatic dumpGraph(): string {\n\t\tconst g = Inspector.graph();\n\t\tconst edges = Inspector.getEdges();\n\n\t\t// Build reverse map: child key → parent keys (deps)\n\t\tconst depsMap = new Map<string, string[]>();\n\t\tfor (const [parent, children] of edges) {\n\t\t\tfor (const child of children) {\n\t\t\t\tconst deps = depsMap.get(child);\n\t\t\t\tif (deps) {\n\t\t\t\t\tif (!deps.includes(parent)) deps.push(parent);\n\t\t\t\t} else {\n\t\t\t\t\tdepsMap.set(child, [parent]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines: string[] = [];\n\t\tfor (const [key, info] of g) {\n\t\t\tconst deps = depsMap.get(key);\n\t\t\tconst children = edges.get(key);\n\t\t\tconst depsStr = deps?.length ? ` ← [${deps.join(\", \")}]` : \"\";\n\t\t\tconst childStr = children?.length ? ` → [${children.join(\", \")}]` : \"\";\n\t\t\tlines.push(\n\t\t\t\t` ${key} (${info.kind}) = ${JSON.stringify(info.value)} [${info.status ?? \"?\"}]${depsStr}${childStr}`,\n\t\t\t);\n\t\t}\n\t\tconst header = `Store Graph (${g.size} nodes):`;\n\t\treturn [header, ...lines].join(\"\\n\");\n\t}\n\n\t/**\n\t * Internal observe implementation shared by observe() and spy().\n\t */\n\tprivate static _observe<T>(\n\t\tstore: Store<T>,\n\t\tlabel?: string,\n\t\tlog?: (...args: any[]) => void,\n\t): ObserveResult<T> {\n\t\tlet talkback: ((type: number) => void) | null = null;\n\t\tconst name = label ?? Inspector.getName(store);\n\t\tconst result: ObserveResult<T> = {\n\t\t\tvalues: [],\n\t\t\tsignals: [],\n\t\t\tevents: [],\n\t\t\tended: false,\n\t\t\tendError: undefined,\n\t\t\tdirtyCount: 0,\n\t\t\tresolvedCount: 0,\n\t\t\tname,\n\t\t\tdispose: () => talkback?.(END),\n\t\t};\n\n\t\tstore.source(START, (type: number, data: any) => {\n\t\t\tif (type === START) {\n\t\t\t\ttalkback = data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === DATA) {\n\t\t\t\tresult.values.push(data);\n\t\t\t\tresult.events.push({ type: \"data\", data });\n\t\t\t\tif (log) log(`[${name}] DATA:`, data);\n\t\t\t} else if (type === STATE) {\n\t\t\t\tresult.signals.push(data);\n\t\t\t\tresult.events.push({ type: \"signal\", data });\n\t\t\t\tif (data === DIRTY) result.dirtyCount++;\n\t\t\t\telse if (data === RESOLVED) result.resolvedCount++;\n\t\t\t\tif (log) log(`[${name}] STATE:`, data);\n\t\t\t} else if (type === END) {\n\t\t\t\tresult.ended = true;\n\t\t\t\tresult.endError = data;\n\t\t\t\tresult.events.push({ type: \"end\", data });\n\t\t\t\tif (log) log(`[${name}] END`, data !== undefined ? data : \"\");\n\t\t\t\ttalkback = null;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Observe a store's full callbag protocol — the test-friendly alternative\n\t * to hooks. Captures DATA values, STATE signals, END, and provides\n\t * convenience accessors.\n\t *\n\t * Returns a live observation object — arrays grow as the store emits.\n\t *\n\t * ```ts\n\t * const obs = Inspector.observe(myStore);\n\t * myState.set(5);\n\t * obs.values // [5]\n\t * obs.signals // [DIRTY]\n\t * obs.ended // false\n\t * obs.dirtyCount // 1\n\t * obs.dispose() // stop observing\n\t * ```\n\t */\n\tstatic observe<T>(store: Store<T>): ObserveResult<T> {\n\t\treturn Inspector._observe(store);\n\t}\n\n\t/**\n\t * Create a transparent passthrough wrapper for graph visualization.\n\t * The wrapper delegates `get()` and `source()` to the original store,\n\t * appearing as a distinct node in the Inspector graph. Zero overhead —\n\t * subscribers connect directly to the original store's source.\n\t */\n\tstatic tap<T>(store: Store<T>, name?: string): Store<T> {\n\t\tconst tapName = name ?? `tap(${Inspector.getName(store) ?? \"anon\"})`;\n\t\tconst wrapper: Store<T> = {\n\t\t\tget: () => store.get(),\n\t\t\tsource: store.source,\n\t\t};\n\t\tInspector.register(wrapper, { name: tapName, kind: \"tap\" });\n\t\tInspector.registerEdge(store, wrapper);\n\t\treturn wrapper;\n\t}\n\n\t/**\n\t * Enhanced observe() with logging — for interactive debugging.\n\t * Returns the same observation object as observe(), but also logs each\n\t * event as it happens. Pass a custom logger or defaults to console.log.\n\t */\n\tstatic spy<T>(\n\t\tstore: Store<T>,\n\t\topts?: { name?: string; log?: (...args: any[]) => void },\n\t): ObserveResult<T> {\n\t\tconst label = opts?.name ?? Inspector.getName(store) ?? \"spy\";\n\t\tconst log = opts?.log ?? console.log;\n\t\treturn Inspector._observe(store, label, log);\n\t}\n\n\t/**\n\t * JSON-serializable snapshot of the entire graph — nodes + edges.\n\t * Designed for AI consumption during debugging sessions.\n\t */\n\tstatic snapshot(): {\n\t\tnodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }>;\n\t\tedges: Array<{ from: string; to: string }>;\n\t} {\n\t\tconst g = Inspector.graph();\n\t\tconst edgeMap = Inspector.getEdges();\n\t\tconst nodes: Array<{ name: string; kind: string; value: unknown; status: string | undefined }> =\n\t\t\t[];\n\t\tfor (const [key, info] of g) {\n\t\t\tnodes.push({ name: key, kind: info.kind, value: info.value, status: info.status });\n\t\t}\n\t\tconst edges: Array<{ from: string; to: string }> = [];\n\t\tfor (const [parent, children] of edgeMap) {\n\t\t\tfor (const child of children) {\n\t\t\t\tedges.push({ from: parent, to: child });\n\t\t\t}\n\t\t}\n\t\treturn { nodes, edges };\n\t}\n\n\t/** Reset all state (for testing) */\n\tstatic _reset(): void {\n\t\tInspector._names = new WeakMap<object, string>();\n\t\tInspector._kinds = new WeakMap<object, string>();\n\t\tInspector._keys = new WeakMap<object, string>();\n\t\tInspector._stores = new Set<WeakRef<object>>();\n\t\tInspector._edges = new Map();\n\t\tInspector._usedKeys = new Set();\n\t\tInspector._nextId = 0;\n\t\tInspector._explicitEnabled = null;\n\t\tInspector._cachedDefault = null;\n\t}\n}\n","/**\n * General-purpose transform primitive. Receives all signal types from upstream\n * deps and decides what to forward.\n *\n * v5: _status packed into _flags bits 7-9 for hot-path performance.\n * String status exposed via getter for Inspector/test backward compat.\n *\n * Class-based for V8 hidden class optimization and prototype method sharing.\n * Boolean fields packed into _flags bitmask to reduce hidden class size.\n */\n\nimport { Inspector } from \"./inspector\";\nimport type { Signal } from \"./protocol\";\nimport {\n\tDATA,\n\tDIRTY,\n\tdecodeStatus,\n\tEND,\n\tRESOLVED,\n\tS_COMPLETED,\n\tS_DIRTY,\n\tS_DISCONNECTED,\n\tS_ERRORED,\n\tS_RESOLVED,\n\tS_SETTLED,\n\tSTART,\n\tSTATE,\n\tSTATUS_MASK,\n\tSTATUS_SHIFT,\n} from \"./protocol\";\nimport type { Actions, SourceOptions, Store } from \"./types\";\n\nexport type OperatorOpts<B> = SourceOptions<B>;\n\n// Flag bits for _flags bitmask (bits 0-6)\nconst O_COMPLETED = 1;\nconst O_RESET = 2;\nconst O_RESUB = 4;\nconst O_MULTI = 8;\n\n// Pre-shifted status constants for hot-path writes\nconst _S_DISCONNECTED = S_DISCONNECTED << STATUS_SHIFT;\nconst _S_DIRTY = S_DIRTY << STATUS_SHIFT;\nconst _S_SETTLED = S_SETTLED << STATUS_SHIFT;\nconst _S_RESOLVED = S_RESOLVED << STATUS_SHIFT;\nconst _S_COMPLETED = S_COMPLETED << STATUS_SHIFT;\nconst _S_ERRORED = S_ERRORED << STATUS_SHIFT;\nconst _STATUS_MASK = STATUS_MASK;\n\nexport class OperatorImpl<B> {\n\t_value: B | undefined;\n\t_output: ((type: number, data?: any) => void) | Set<any> | null = null;\n\t_upstreamTalkbacks: Array<((type: number) => void) | null> = [];\n\t_handler: ((depIndex: number, type: number, data: any) => void) | null = null;\n\t_flags: number;\n\t_deps: Store<unknown>[];\n\t_init: (actions: Actions<B>) => (depIndex: number, type: number, data: any) => void;\n\t_getterFn: ((cached: B | undefined) => B) | undefined;\n\t_initial: B | undefined;\n\n\tget _status() {\n\t\treturn decodeStatus(this._flags);\n\t}\n\n\tconstructor(\n\t\tdeps: Store<unknown>[],\n\t\tinit: (actions: Actions<B>) => (depIndex: number, type: number, data: any) => void,\n\t\topts?: OperatorOpts<B>,\n\t) {\n\t\tthis._value = opts?.initial;\n\t\tthis._initial = opts?.initial;\n\t\tthis._deps = deps;\n\t\tthis._init = init;\n\t\tthis._getterFn = opts?.getter;\n\n\t\tlet flags = 0;\n\t\tif (opts?.resetOnTeardown) flags |= O_RESET;\n\t\tif (opts?.resubscribable) flags |= O_RESUB;\n\t\t// S_DISCONNECTED = 0, so no status bits needed\n\t\tthis._flags = flags;\n\n\t\tthis.source = this.source.bind(this);\n\n\t\tInspector.register(this as any, { kind: opts?.kind ?? \"operator\", ...opts, deps });\n\t\tfor (const dep of deps) Inspector.registerEdge(dep, this as any);\n\t}\n\n\t_dispatch(type: number, data?: any): void {\n\t\tconst output = this._output;\n\t\tif (!output) return;\n\t\tif (this._flags & O_MULTI) {\n\t\t\tfor (const sink of output as Set<any>) sink(type, data);\n\t\t} else {\n\t\t\t(output as (type: number, data?: any) => void)(type, data);\n\t\t}\n\t}\n\n\t_connectUpstream(): void {\n\t\tconst localTalkbacks: Array<((type: number) => void) | null> = new Array(\n\t\t\tthis._deps.length,\n\t\t).fill(null);\n\t\tthis._upstreamTalkbacks = localTalkbacks;\n\n\t\tlet completed = false;\n\n\t\tconst actions: Actions<B> = {\n\t\t\tseed: (value: B) => {\n\t\t\t\tif (completed) return;\n\t\t\t\tthis._value = value;\n\t\t\t},\n\t\t\temit: (value: B) => {\n\t\t\t\tif (completed) return;\n\t\t\t\tthis._value = value;\n\t\t\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_SETTLED;\n\t\t\t\tthis._dispatch(DATA, value);\n\t\t\t},\n\t\t\tsignal: (s: Signal) => {\n\t\t\t\tif (completed) return;\n\t\t\t\tif (s === DIRTY) this._flags = (this._flags & ~_STATUS_MASK) | _S_DIRTY;\n\t\t\t\telse if (s === RESOLVED) this._flags = (this._flags & ~_STATUS_MASK) | _S_RESOLVED;\n\t\t\t\tthis._dispatch(STATE, s);\n\t\t\t},\n\t\t\tcomplete: () => {\n\t\t\t\tif (completed) return;\n\t\t\t\tcompleted = true;\n\t\t\t\tthis._flags = ((this._flags | O_COMPLETED) & ~_STATUS_MASK) | _S_COMPLETED;\n\t\t\t\tthis._handler = null;\n\t\t\t\tfor (const tb of localTalkbacks) tb?.(END);\n\t\t\t\tlocalTalkbacks.fill(null);\n\t\t\t\tif (this._flags & O_RESET) this._value = this._initial;\n\t\t\t\tconst output = this._output;\n\t\t\t\tconst wasMulti = this._flags & O_MULTI;\n\t\t\t\tthis._output = null;\n\t\t\t\tthis._flags &= ~O_MULTI;\n\t\t\t\tif (output) {\n\t\t\t\t\tif (wasMulti) {\n\t\t\t\t\t\tfor (const sink of output as Set<any>) sink(END);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t(output as (type: number, data?: any) => void)(END);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: (e: unknown) => {\n\t\t\t\tif (completed) return;\n\t\t\t\tcompleted = true;\n\t\t\t\tthis._flags = ((this._flags | O_COMPLETED) & ~_STATUS_MASK) | _S_ERRORED;\n\t\t\t\tthis._handler = null;\n\t\t\t\tfor (const tb of localTalkbacks) tb?.(END);\n\t\t\t\tlocalTalkbacks.fill(null);\n\t\t\t\tif (this._flags & O_RESET) this._value = this._initial;\n\t\t\t\tconst output = this._output;\n\t\t\t\tconst wasMulti = this._flags & O_MULTI;\n\t\t\t\tthis._output = null;\n\t\t\t\tthis._flags &= ~O_MULTI;\n\t\t\t\tif (output) {\n\t\t\t\t\tif (wasMulti) {\n\t\t\t\t\t\tfor (const sink of output as Set<any>) sink(END, e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t(output as (type: number, data?: any) => void)(END, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdisconnect: (dep?: number) => {\n\t\t\t\tif (dep !== undefined) {\n\t\t\t\t\tlocalTalkbacks[dep]?.(END);\n\t\t\t\t\tlocalTalkbacks[dep] = null;\n\t\t\t\t} else {\n\t\t\t\t\tfor (const tb of localTalkbacks) tb?.(END);\n\t\t\t\t\tlocalTalkbacks.fill(null);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tthis._handler = this._init(actions);\n\n\t\tfor (let i = 0; i < this._deps.length; i++) {\n\t\t\tif (completed) break;\n\t\t\tconst depIndex = i;\n\t\t\tthis._deps[depIndex].source(START, (type: number, data: any) => {\n\t\t\t\tif (type === START) {\n\t\t\t\t\tlocalTalkbacks[depIndex] = data;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._handler?.(depIndex, type, data);\n\t\t\t});\n\t\t}\n\t}\n\n\t_disconnectUpstream(): void {\n\t\tfor (const tb of this._upstreamTalkbacks) tb?.(END);\n\t\tthis._upstreamTalkbacks = [];\n\t\tthis._handler = null;\n\t\tthis._flags = (this._flags & ~_STATUS_MASK) | _S_DISCONNECTED;\n\t\tif (this._flags & O_RESET) this._value = this._initial;\n\t}\n\n\tget(): B {\n\t\tif (this._getterFn && !this._output) {\n\t\t\tconst v = this._getterFn(this._value);\n\t\t\tthis._value = v;\n\t\t\treturn v;\n\t\t}\n\t\treturn this._value as B;\n\t}\n\n\tsource(type: number, payload?: any): void {\n\t\tif (type === START) {\n\t\t\tconst sink = payload;\n\t\t\tif (this._flags & O_COMPLETED) {\n\t\t\t\tif (this._flags & O_RESUB && this._output === null) {\n\t\t\t\t\tthis._flags = (this._flags & ~(O_COMPLETED | _STATUS_MASK)) | _S_DISCONNECTED;\n\t\t\t\t} else {\n\t\t\t\t\tsink(START, (_t: number) => {});\n\t\t\t\t\tsink(END);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst wasEmpty = this._output === null;\n\t\t\tif (this._output === null) {\n\t\t\t\tthis._output = sink;\n\t\t\t} else if (!(this._flags & O_MULTI)) {\n\t\t\t\tconst set = new Set<any>();\n\t\t\t\tset.add(this._output);\n\t\t\t\tset.add(sink);\n\t\t\t\tthis._output = set;\n\t\t\t\tthis._flags |= O_MULTI;\n\t\t\t} else {\n\t\t\t\t(this._output as Set<any>).add(sink);\n\t\t\t}\n\t\t\tsink(START, (t: number) => {\n\t\t\t\tif (t === DATA) sink(DATA, this._value);\n\t\t\t\tif (t === END) {\n\t\t\t\t\tif (this._output === null) return;\n\t\t\t\t\tif (this._flags & O_MULTI) {\n\t\t\t\t\t\tconst set = this._output as Set<any>;\n\t\t\t\t\t\tset.delete(sink);\n\t\t\t\t\t\tif (set.size === 1) {\n\t\t\t\t\t\t\tthis._output = set.values().next().value;\n\t\t\t\t\t\t\tthis._flags &= ~O_MULTI;\n\t\t\t\t\t\t} else if (set.size === 0) {\n\t\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\t\tthis._flags &= ~O_MULTI;\n\t\t\t\t\t\t\tthis._disconnectUpstream();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this._output === sink) {\n\t\t\t\t\t\tthis._output = null;\n\t\t\t\t\t\tthis._disconnectUpstream();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (wasEmpty) {\n\t\t\t\tthis._connectUpstream();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function operator<B>(\n\tdeps: Store<unknown>[],\n\tinit: (actions: Actions<B>) => (depIndex: number, type: number, data: any) => void,\n\topts?: OperatorOpts<B>,\n): Store<B> {\n\treturn new OperatorImpl<B>(deps, init, opts) as any;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GCQO,IAAMI,EAAQ,OAAO,OAAO,EAGtBC,EAAW,OAAO,UAAU,EAiB5BC,EAAiB,EACjBC,EAAU,EACVC,EAAY,EACZC,EAAa,EACbC,EAAc,EACdC,EAAY,EACZC,EAAe,EACfC,EAAc,GAASD,EAE9BE,EAA+B,CACpC,eACA,QACA,UACA,WACA,YACA,SACD,EAGO,SAASC,EAAaC,EAA2B,CACvD,OAAOF,GAAgBE,EAAQH,KAAiBD,CAAY,CAC7D,CAGO,IAAMK,EAAQ,EACRC,EAAO,EACPC,EAAM,EACNC,EAAQ,ECNd,IAAMC,EAAN,MAAMC,CAAU,CAEtB,OAAe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QC,GAAU,CACjB,IAAMC,EAAOF,GAAM,OAEfG,EACEC,EAAKH,EAAM,IAAI,EACrB,OAAIF,EAAUK,CAAE,IAAGD,EAAcC,GAE1BC,EACN,CAACJ,CAAK,EACN,CAAC,CAAE,KAAAK,EAAM,OAAAC,EAAQ,SAAAC,EAAU,MAAAC,CAAM,IACzB,CAACC,EAAMC,EAAMC,IAAS,CAI5B,GAHID,IAASE,GACZN,EAAOK,CAAI,EAERD,IAASG,EAAM,CAClB,IAAMC,EAAMH,EACZ,GAAIb,EAAUgB,CAAG,EAAG,CACnB,GAAIb,IAAOC,EAAkBY,CAAG,EAAG,CAClCR,EAAOS,CAAQ,EACf,MACD,CACAb,EAAcY,EACdT,EAAKS,CAAG,CACT,MAECR,EAAOS,CAAQ,CAEjB,CACIL,IAASM,IACRL,IAAS,OAAWH,EAAMG,CAAI,EAC7BJ,EAAS,EAEhB,EAED,CACC,KAAM,SACN,KAAMR,GAAM,MAAQ,SACpB,QAASG,EACT,OAAQ,IAAM,CACb,IAAMe,EAAIjB,EAAM,IAAI,EACpB,OAAIF,EAAUmB,CAAC,IAAGf,EAAce,GACzBf,CACR,CACD,CACD,CACD,CACD","names":["filter_exports","__export","filter","__toCommonJS","DIRTY","RESOLVED","S_DISCONNECTED","S_DIRTY","S_SETTLED","S_RESOLVED","S_COMPLETED","S_ERRORED","STATUS_SHIFT","STATUS_MASK","STATUS_STRINGS","decodeStatus","flags","START","DATA","END","STATE","Inspector","_Inspector","value","deps","joined","d","node","opts","id","key","depSuffix","kind","parent","child","parentKey","childKey","children","result","livingKeys","ref","alive","c","store","cb","talkback","prev","START","type","data","END","next","p","g","edges","depsMap","lines","info","depsStr","childStr","label","log","name","DATA","STATE","DIRTY","RESOLVED","tapName","wrapper","edgeMap","nodes","O_COMPLETED","O_RESET","O_RESUB","O_MULTI","_S_DISCONNECTED","S_DISCONNECTED","STATUS_SHIFT","_S_DIRTY","S_DIRTY","_S_SETTLED","S_SETTLED","_S_RESOLVED","S_RESOLVED","_S_COMPLETED","S_COMPLETED","_S_ERRORED","S_ERRORED","_STATUS_MASK","STATUS_MASK","OperatorImpl","decodeStatus","deps","init","opts","flags","Inspector","dep","type","data","output","sink","localTalkbacks","completed","actions","value","DATA","s","DIRTY","RESOLVED","STATE","tb","END","wasMulti","i","depIndex","START","v","payload","_t","wasEmpty","set","t","operator","filter","predicate","opts","input","eqFn","lastPassing","v0","operator","emit","signal","complete","error","_dep","type","data","STATE","DATA","val","RESOLVED","END","v"]}
@@ -0,0 +1,16 @@
1
+ import { b as StoreOptions, a as StoreOperator } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Conditionally forwards upstream values. When the predicate returns false,
5
+ * holds the last passing value.
6
+ *
7
+ * Stateful: maintains last passing value via operator()'s cache.
8
+ * get() returns the last value that passed the predicate, or undefined.
9
+ *
10
+ * v3: Tier 1 — uses operator() with single dep. When predicate is false and
11
+ * lastPassing is unchanged, sends RESOLVED (subtree skipping) instead of
12
+ * re-emitting. Pull-based get() when disconnected re-evaluates predicate.
13
+ */
14
+ declare function filter<A>(predicate: (value: A) => boolean, opts?: StoreOptions): StoreOperator<A, A | undefined>;
15
+
16
+ export { filter };
@@ -0,0 +1,16 @@
1
+ import { b as StoreOptions, a as StoreOperator } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Conditionally forwards upstream values. When the predicate returns false,
5
+ * holds the last passing value.
6
+ *
7
+ * Stateful: maintains last passing value via operator()'s cache.
8
+ * get() returns the last value that passed the predicate, or undefined.
9
+ *
10
+ * v3: Tier 1 — uses operator() with single dep. When predicate is false and
11
+ * lastPassing is unchanged, sends RESOLVED (subtree skipping) instead of
12
+ * re-emitting. Pull-based get() when disconnected re-evaluates predicate.
13
+ */
14
+ declare function filter<A>(predicate: (value: A) => boolean, opts?: StoreOptions): StoreOperator<A, A | undefined>;
15
+
16
+ export { filter };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-XHUZ4TRE.js";import"../chunk-2BINVZ33.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as filter};
2
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var v=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var U=(n,t)=>{for(var i in t)v(n,i,{get:t[i],enumerable:!0})},V=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of C(t))!K.call(n,e)&&e!==i&&v(n,e,{get:()=>t[e],enumerable:!(s=B(t,e))||s.enumerable});return n};var Y=n=>V(v({},"__esModule",{value:!0}),n);var q={};U(q,{find:()=>J});module.exports=Y(q);var m=Symbol("DIRTY"),S=Symbol("RESOLVED"),x=0,A=1,R=2,O=3,w=4,I=5,p=7,k=7<<p,W=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function N(n){return W[(n&k)>>>p]}var d=0,g=1,l=2,T=3;var y=class n{static _names=new WeakMap;static _kinds=new WeakMap;static _keys=new WeakMap;static _stores=new Set;static _edges=new Map;static _nextId=0;static _usedKeys=new Set;static _explicitEnabled=null;static _cachedDefault=null;static get enabled(){if(n._explicitEnabled!==null)return n._explicitEnabled;if(n._cachedDefault!==null)return n._cachedDefault;try{n._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{n._cachedDefault=!0}return n._cachedDefault}static set enabled(t){n._explicitEnabled=t}static _depSuffix(t){if(!t?.length)return;let s=t.map(e=>n._names.get(e)??"?").join(",");return s.length>40?`${s.slice(0,37)}...`:s}static _resolveKey(t){return n._keys.get(t)??n._names.get(t)??"anonymous"}static register(t,i){if(!n.enabled)return;i?.name&&n._names.set(t,i.name),i?.kind&&n._kinds.set(t,i.kind);let s=n._nextId++,e=i?.name;if(!(e&&!n._usedKeys.has(e)))if(e){let r=n._depSuffix(i?.deps);e=r?`${e}(${r})`:`${e}_${s}`,n._usedKeys.has(e)&&(e=`${e}_${s}`)}else{let r=i?.kind??"store",o=n._depSuffix(i?.deps);e=o?`${r}(${o})`:`${r}_${s}`,n._usedKeys.has(e)&&(e=`${e}_${s}`)}n._usedKeys.add(e),n._keys.set(t,e),n._stores.add(new WeakRef(t))}static registerEdge(t,i){if(!n.enabled)return;let s=n._resolveKey(t),e=n._resolveKey(i),r=n._edges.get(s);r?r.includes(e)||r.push(e):n._edges.set(s,[e])}static getEdges(){return new Map(n._edges)}static getName(t){if(n.enabled)return n._names.get(t)}static getKind(t){return n._kinds.get(t)}static inspect(t){return{name:n._names.get(t),kind:n._kinds.get(t)??"unknown",value:typeof t.get=="function"?t.get():void 0,status:t._status}}static graph(){let t=new Map,i=new Set;for(let s of n._stores){let e=s.deref();if(!e){n._stores.delete(s);continue}let r=n._resolveKey(e);i.add(r),t.set(r,n.inspect(e))}for(let[s,e]of n._edges){if(!i.has(s)){n._edges.delete(s),n._usedKeys.delete(s);continue}let r=e.filter(o=>i.has(o));r.length===0?n._edges.delete(s):r.length!==e.length&&n._edges.set(s,r)}return t}static trace(t,i){let s=null,e=t.get();return t.source(d,(r,o)=>{if(r===d&&(s=o),r===l){s=null;return}if(r===1){let a=o;if(!Object.is(a,e)){let u=e;e=a,i(a,u)}}}),()=>s?.(l)}static dumpGraph(){let t=n.graph(),i=n.getEdges(),s=new Map;for(let[o,a]of i)for(let u of a){let c=s.get(u);c?c.includes(o)||c.push(o):s.set(u,[o])}let e=[];for(let[o,a]of t){let u=s.get(o),c=i.get(o),h=u?.length?` \u2190 [${u.join(", ")}]`:"",L=c?.length?` \u2192 [${c.join(", ")}]`:"";e.push(` ${o} (${a.kind}) = ${JSON.stringify(a.value)} [${a.status??"?"}]${h}${L}`)}return[`Store Graph (${t.size} nodes):`,...e].join(`
2
+ `)}static _observe(t,i,s){let e=null,r=i??n.getName(t),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>e?.(l)};return t.source(d,(a,u)=>{if(a===d){e=u;return}a===g?(o.values.push(u),o.events.push({type:"data",data:u}),s&&s(`[${r}] DATA:`,u)):a===T?(o.signals.push(u),o.events.push({type:"signal",data:u}),u===m?o.dirtyCount++:u===S&&o.resolvedCount++,s&&s(`[${r}] STATE:`,u)):a===l&&(o.ended=!0,o.endError=u,o.events.push({type:"end",data:u}),s&&s(`[${r}] END`,u!==void 0?u:""),e=null)}),o}static observe(t){return n._observe(t)}static tap(t,i){let s=i??`tap(${n.getName(t)??"anon"})`,e={get:()=>t.get(),source:t.source};return n.register(e,{name:s,kind:"tap"}),n.registerEdge(t,e),e}static spy(t,i){let s=i?.name??n.getName(t)??"spy",e=i?.log??console.log;return n._observe(t,s,e)}static snapshot(){let t=n.graph(),i=n.getEdges(),s=[];for(let[r,o]of t)s.push({name:r,kind:o.kind,value:o.value,status:o.status});let e=[];for(let[r,o]of i)for(let a of o)e.push({from:r,to:a});return{nodes:s,edges:e}}static _reset(){n._names=new WeakMap,n._kinds=new WeakMap,n._keys=new WeakMap,n._stores=new Set,n._edges=new Map,n._usedKeys=new Set,n._nextId=0,n._explicitEnabled=null,n._cachedDefault=null}};var E=1,b=2,M=4,f=8,$=x<<p,F=A<<p,P=R<<p,z=O<<p,G=w<<p,H=I<<p,_=k,D=class{_value;_output=null;_upstreamTalkbacks=[];_handler=null;_flags;_deps;_init;_getterFn;_initial;get _status(){return N(this._flags)}constructor(t,i,s){this._value=s?.initial,this._initial=s?.initial,this._deps=t,this._init=i,this._getterFn=s?.getter;let e=0;s?.resetOnTeardown&&(e|=b),s?.resubscribable&&(e|=M),this._flags=e,this.source=this.source.bind(this),y.register(this,{kind:s?.kind??"operator",...s,deps:t});for(let r of t)y.registerEdge(r,this)}_dispatch(t,i){let s=this._output;if(s)if(this._flags&f)for(let e of s)e(t,i);else s(t,i)}_connectUpstream(){let t=new Array(this._deps.length).fill(null);this._upstreamTalkbacks=t;let i=!1,s={seed:e=>{i||(this._value=e)},emit:e=>{i||(this._value=e,this._flags=this._flags&~_|P,this._dispatch(g,e))},signal:e=>{i||(e===m?this._flags=this._flags&~_|F:e===S&&(this._flags=this._flags&~_|z),this._dispatch(T,e))},complete:()=>{if(i)return;i=!0,this._flags=(this._flags|E)&~_|G,this._handler=null;for(let o of t)o?.(l);t.fill(null),this._flags&b&&(this._value=this._initial);let e=this._output,r=this._flags&f;if(this._output=null,this._flags&=~f,e)if(r)for(let o of e)o(l);else e(l)},error:e=>{if(i)return;i=!0,this._flags=(this._flags|E)&~_|H,this._handler=null;for(let a of t)a?.(l);t.fill(null),this._flags&b&&(this._value=this._initial);let r=this._output,o=this._flags&f;if(this._output=null,this._flags&=~f,r)if(o)for(let a of r)a(l,e);else r(l,e)},disconnect:e=>{if(e!==void 0)t[e]?.(l),t[e]=null;else{for(let r of t)r?.(l);t.fill(null)}}};this._handler=this._init(s);for(let e=0;e<this._deps.length&&!i;e++){let r=e;this._deps[r].source(d,(o,a)=>{if(o===d){t[r]=a;return}this._handler?.(r,o,a)})}}_disconnectUpstream(){for(let t of this._upstreamTalkbacks)t?.(l);this._upstreamTalkbacks=[],this._handler=null,this._flags=this._flags&~_|$,this._flags&b&&(this._value=this._initial)}get(){if(this._getterFn&&!this._output){let t=this._getterFn(this._value);return this._value=t,t}return this._value}source(t,i){if(t===d){let s=i;if(this._flags&E)if(this._flags&M&&this._output===null)this._flags=this._flags&~(E|_)|$;else{s(d,r=>{}),s(l);return}let e=this._output===null;if(this._output===null)this._output=s;else if(this._flags&f)this._output.add(s);else{let r=new Set;r.add(this._output),r.add(s),this._output=r,this._flags|=f}s(d,r=>{if(r===g&&s(g,this._value),r===l){if(this._output===null)return;if(this._flags&f){let o=this._output;o.delete(s),o.size===1?(this._output=o.values().next().value,this._flags&=~f):o.size===0&&(this._output=null,this._flags&=~f,this._disconnectUpstream())}else this._output===s&&(this._output=null,this._disconnectUpstream())}}),e&&this._connectUpstream()}}};function j(n,t,i){return new D(n,t,i)}function J(n){return t=>j([t],({emit:i,signal:s,complete:e,error:r,disconnect:o})=>{let a=!1;return(u,c,h)=>{c===T&&(a||s(h)),c===g&&(a||(n(h)?(a=!0,i(h),o(),e()):s(S))),c===l&&(a||(a=!0,h!==void 0?r(h):e()))}})}0&&(module.exports={find});
3
+ //# sourceMappingURL=find.cjs.map