@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/merge.ts","../../src/core/bitmask.ts","../../src/core/protocol.ts","../../src/core/inspector.ts","../../src/core/operator.ts"],"sourcesContent":["import { Bitmask } from \"../core/bitmask\";\nimport { operator } from \"../core/operator\";\nimport { DATA, DIRTY, END, RESOLVED, STATE } from \"../core/protocol\";\nimport type { Store } from \"../core/types\";\n\n/**\n * Merges multiple sources into one. The resulting store's value is the latest\n * emission from whichever source changed most recently.\n *\n * Stateful: maintains last emitted value via operator()'s internal cache.\n * get() returns the most recent value from any source.\n *\n * v3: uses operator() with multi-dep dirty tracking via bitmask. Forwards\n * DIRTY on first dirty dep; forwards RESOLVED when all pending-dirty deps\n * have resolved. Emits immediately on each type 1 DATA from any source.\n *\n * Note: when multiple deps are dirty simultaneously, each dep's DATA triggers\n * a separate emission. The second emission has no preceding DIRTY from merge\n * (only one DIRTY is forwarded per batch). Downstream nodes handle the extra\n * DATA via the \"unexpected DATA = immediate trigger\" rule (Option 3).\n */\nexport function merge<T>(...sources: Store<T>[]): Store<T | undefined> {\n\treturn operator<T | undefined>(\n\t\tsources as Store<unknown>[],\n\t\t({ emit, signal, complete, error }) => {\n\t\t\tconst dirtyDeps = new Bitmask(sources.length);\n\t\t\tlet activeCount = sources.length;\n\n\t\t\treturn (dep, type, data) => {\n\t\t\t\tif (type === STATE) {\n\t\t\t\t\tif (data === DIRTY) {\n\t\t\t\t\t\tconst wasClean = dirtyDeps.empty();\n\t\t\t\t\t\tdirtyDeps.set(dep);\n\t\t\t\t\t\tif (wasClean) signal(DIRTY);\n\t\t\t\t\t} else if (data === RESOLVED) {\n\t\t\t\t\t\tif (dirtyDeps.test(dep)) {\n\t\t\t\t\t\t\tdirtyDeps.clear(dep);\n\t\t\t\t\t\t\tif (dirtyDeps.empty()) signal(RESOLVED);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsignal(data); // Forward unknown STATE signals (v4 forward-compat)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (type === DATA) {\n\t\t\t\t\tdirtyDeps.clear(dep);\n\t\t\t\t\temit(data as T);\n\t\t\t\t}\n\t\t\t\tif (type === END) {\n\t\t\t\t\tdirtyDeps.clear(dep);\n\t\t\t\t\tif (data !== undefined) {\n\t\t\t\t\t\terror(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tactiveCount--;\n\t\t\t\t\t\tif (activeCount === 0) complete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t{ kind: \"merge\", name: \"merge\" },\n\t);\n}\n","/**\n * Dirty-dep bitmask — safe for any number of deps.\n *\n * ≤32 deps: stores bitmask as a plain number in `_v` (zero overhead).\n * >32 deps: stores bits in a Uint32Array `_w`, with `_v` tracking the\n * count of set bits for O(1) emptiness checks.\n *\n * In both cases, `empty()` is a single `_v === 0` comparison — no typeof\n * dispatch, no array scan. Method calls on the class prototype are\n * monomorphic (one hidden class for all instances).\n *\n * Used by derived, effect, merge, combine — anywhere dirty-dep tracking\n * needs per-dep bit flags.\n */\n\nexport class Bitmask {\n\t/** Narrow (≤32): bitmask value. Wide (>32): count of set bits. */\n\t_v: number;\n\t/** Uint32Array for >32 deps, null otherwise. */\n\t_w: Uint32Array | null;\n\n\tconstructor(size: number) {\n\t\tthis._v = 0;\n\t\tthis._w = size > 32 ? new Uint32Array(((size - 1) >>> 5) + 1) : null;\n\t}\n\n\tset(i: number): void {\n\t\tconst w = this._w;\n\t\tif (w === null) {\n\t\t\tthis._v |= 1 << i;\n\t\t} else {\n\t\t\tconst idx = i >>> 5;\n\t\t\tconst bit = 1 << (i & 31);\n\t\t\tif (!(w[idx] & bit)) {\n\t\t\t\tw[idx] |= bit;\n\t\t\t\tthis._v++;\n\t\t\t}\n\t\t}\n\t}\n\n\tclear(i: number): void {\n\t\tconst w = this._w;\n\t\tif (w === null) {\n\t\t\tthis._v &= ~(1 << i);\n\t\t} else {\n\t\t\tconst idx = i >>> 5;\n\t\t\tconst bit = 1 << (i & 31);\n\t\t\tif (w[idx] & bit) {\n\t\t\t\tw[idx] &= ~bit;\n\t\t\t\tthis._v--;\n\t\t\t}\n\t\t}\n\t}\n\n\ttest(i: number): boolean {\n\t\tconst w = this._w;\n\t\tif (w === null) return (this._v & (1 << i)) !== 0;\n\t\treturn (w[i >>> 5] & (1 << (i & 31))) !== 0;\n\t}\n\n\t/** O(1) in both narrow and wide paths. */\n\tempty(): boolean {\n\t\treturn this._v === 0;\n\t}\n\n\treset(): void {\n\t\tthis._v = 0;\n\t\tthis._w?.fill(0);\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,WAAAE,IAAA,eAAAC,EAAAH,GCeO,IAAMI,EAAN,KAAc,CAEpB,GAEA,GAEA,YAAYC,EAAc,CACzB,KAAK,GAAK,EACV,KAAK,GAAKA,EAAO,GAAK,IAAI,aAAcA,EAAO,IAAO,GAAK,CAAC,EAAI,IACjE,CAEA,IAAIC,EAAiB,CACpB,IAAMC,EAAI,KAAK,GACf,GAAIA,IAAM,KACT,KAAK,IAAM,GAAKD,MACV,CACN,IAAME,EAAMF,IAAM,EACZG,EAAM,IAAMH,EAAI,IAChBC,EAAEC,CAAG,EAAIC,IACdF,EAAEC,CAAG,GAAKC,EACV,KAAK,KAEP,CACD,CAEA,MAAMH,EAAiB,CACtB,IAAMC,EAAI,KAAK,GACf,GAAIA,IAAM,KACT,KAAK,IAAM,EAAE,GAAKD,OACZ,CACN,IAAME,EAAMF,IAAM,EACZG,EAAM,IAAMH,EAAI,IAClBC,EAAEC,CAAG,EAAIC,IACZF,EAAEC,CAAG,GAAK,CAACC,EACX,KAAK,KAEP,CACD,CAEA,KAAKH,EAAoB,CACxB,IAAMC,EAAI,KAAK,GACf,OAAIA,IAAM,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,EACA,CAAE,KAAM,QAAS,KAAM,OAAQ,CAChC,CACD","names":["merge_exports","__export","merge","__toCommonJS","Bitmask","size","i","w","idx","bit","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","e","i","depIndex","START","v","payload","_t","wasEmpty","set","t","operator","merge","sources","operator","emit","signal","complete","error","dirtyDeps","Bitmask","activeCount","dep","type","data","STATE","DIRTY","wasClean","RESOLVED","DATA","END"]}
@@ -0,0 +1,21 @@
1
+ import { S as Store } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Merges multiple sources into one. The resulting store's value is the latest
5
+ * emission from whichever source changed most recently.
6
+ *
7
+ * Stateful: maintains last emitted value via operator()'s internal cache.
8
+ * get() returns the most recent value from any source.
9
+ *
10
+ * v3: uses operator() with multi-dep dirty tracking via bitmask. Forwards
11
+ * DIRTY on first dirty dep; forwards RESOLVED when all pending-dirty deps
12
+ * have resolved. Emits immediately on each type 1 DATA from any source.
13
+ *
14
+ * Note: when multiple deps are dirty simultaneously, each dep's DATA triggers
15
+ * a separate emission. The second emission has no preceding DIRTY from merge
16
+ * (only one DIRTY is forwarded per batch). Downstream nodes handle the extra
17
+ * DATA via the "unexpected DATA = immediate trigger" rule (Option 3).
18
+ */
19
+ declare function merge<T>(...sources: Store<T>[]): Store<T | undefined>;
20
+
21
+ export { merge };
@@ -0,0 +1,21 @@
1
+ import { S as Store } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Merges multiple sources into one. The resulting store's value is the latest
5
+ * emission from whichever source changed most recently.
6
+ *
7
+ * Stateful: maintains last emitted value via operator()'s internal cache.
8
+ * get() returns the most recent value from any source.
9
+ *
10
+ * v3: uses operator() with multi-dep dirty tracking via bitmask. Forwards
11
+ * DIRTY on first dirty dep; forwards RESOLVED when all pending-dirty deps
12
+ * have resolved. Emits immediately on each type 1 DATA from any source.
13
+ *
14
+ * Note: when multiple deps are dirty simultaneously, each dep's DATA triggers
15
+ * a separate emission. The second emission has no preceding DIRTY from merge
16
+ * (only one DIRTY is forwarded per batch). Downstream nodes handle the extra
17
+ * DATA via the "unexpected DATA = immediate trigger" rule (Option 3).
18
+ */
19
+ declare function merge<T>(...sources: Store<T>[]): Store<T | undefined>;
20
+
21
+ export { merge };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-KDB2NMLA.js";import"../chunk-2BINVZ33.js";import"../chunk-PYRVYHZG.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as merge};
2
+ //# sourceMappingURL=merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var b=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(t,e)=>{for(var i in e)b(t,i,{get:e[i],enumerable:!0})},H=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of G(e))!z.call(t,n)&&n!==i&&b(t,n,{get:()=>e[n],enumerable:!(s=q(e,n))||s.enumerable});return t};var J=t=>H(b({},"__esModule",{value:!0}),t);var oe={};B(oe,{never:()=>re});module.exports=J(oe);var T=Symbol("DIRTY"),v=Symbol("RESOLVED"),w=0,A=1,N=2,P=3,I=4,M=5,c=7,D=7<<c,Q=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function $(t){return Q[(t&D)>>>c]}var p=0,g=1,l=2,S=3,X=0,Z=[];function j(){return X>0}function C(t){Z.push(t)}var ee=0,te=[];function L(t){ee>0?te.push(t):t()}var E=class t{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(t._explicitEnabled!==null)return t._explicitEnabled;if(t._cachedDefault!==null)return t._cachedDefault;try{t._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{t._cachedDefault=!0}return t._cachedDefault}static set enabled(e){t._explicitEnabled=e}static _depSuffix(e){if(!e?.length)return;let s=e.map(n=>t._names.get(n)??"?").join(",");return s.length>40?`${s.slice(0,37)}...`:s}static _resolveKey(e){return t._keys.get(e)??t._names.get(e)??"anonymous"}static register(e,i){if(!t.enabled)return;i?.name&&t._names.set(e,i.name),i?.kind&&t._kinds.set(e,i.kind);let s=t._nextId++,n=i?.name;if(!(n&&!t._usedKeys.has(n)))if(n){let r=t._depSuffix(i?.deps);n=r?`${n}(${r})`:`${n}_${s}`,t._usedKeys.has(n)&&(n=`${n}_${s}`)}else{let r=i?.kind??"store",o=t._depSuffix(i?.deps);n=o?`${r}(${o})`:`${r}_${s}`,t._usedKeys.has(n)&&(n=`${n}_${s}`)}t._usedKeys.add(n),t._keys.set(e,n),t._stores.add(new WeakRef(e))}static registerEdge(e,i){if(!t.enabled)return;let s=t._resolveKey(e),n=t._resolveKey(i),r=t._edges.get(s);r?r.includes(n)||r.push(n):t._edges.set(s,[n])}static getEdges(){return new Map(t._edges)}static getName(e){if(t.enabled)return t._names.get(e)}static getKind(e){return t._kinds.get(e)}static inspect(e){return{name:t._names.get(e),kind:t._kinds.get(e)??"unknown",value:typeof e.get=="function"?e.get():void 0,status:e._status}}static graph(){let e=new Map,i=new Set;for(let s of t._stores){let n=s.deref();if(!n){t._stores.delete(s);continue}let r=t._resolveKey(n);i.add(r),e.set(r,t.inspect(n))}for(let[s,n]of t._edges){if(!i.has(s)){t._edges.delete(s),t._usedKeys.delete(s);continue}let r=n.filter(o=>i.has(o));r.length===0?t._edges.delete(s):r.length!==n.length&&t._edges.set(s,r)}return e}static trace(e,i){let s=null,n=e.get();return e.source(p,(r,o)=>{if(r===p&&(s=o),r===l){s=null;return}if(r===1){let u=o;if(!Object.is(u,n)){let a=n;n=u,i(u,a)}}}),()=>s?.(l)}static dumpGraph(){let e=t.graph(),i=t.getEdges(),s=new Map;for(let[o,u]of i)for(let a of u){let _=s.get(a);_?_.includes(o)||_.push(o):s.set(a,[o])}let n=[];for(let[o,u]of e){let a=s.get(o),_=i.get(o),U=a?.length?` \u2190 [${a.join(", ")}]`:"",W=_?.length?` \u2192 [${_.join(", ")}]`:"";n.push(` ${o} (${u.kind}) = ${JSON.stringify(u.value)} [${u.status??"?"}]${U}${W}`)}return[`Store Graph (${e.size} nodes):`,...n].join(`
2
+ `)}static _observe(e,i,s){let n=null,r=i??t.getName(e),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>n?.(l)};return e.source(p,(u,a)=>{if(u===p){n=a;return}u===g?(o.values.push(a),o.events.push({type:"data",data:a}),s&&s(`[${r}] DATA:`,a)):u===S?(o.signals.push(a),o.events.push({type:"signal",data:a}),a===T?o.dirtyCount++:a===v&&o.resolvedCount++,s&&s(`[${r}] STATE:`,a)):u===l&&(o.ended=!0,o.endError=a,o.events.push({type:"end",data:a}),s&&s(`[${r}] END`,a!==void 0?a:""),n=null)}),o}static observe(e){return t._observe(e)}static tap(e,i){let s=i??`tap(${t.getName(e)??"anon"})`,n={get:()=>e.get(),source:e.source};return t.register(n,{name:s,kind:"tap"}),t.registerEdge(e,n),n}static spy(e,i){let s=i?.name??t.getName(e)??"spy",n=i?.log??console.log;return t._observe(e,s,n)}static snapshot(){let e=t.graph(),i=t.getEdges(),s=[];for(let[r,o]of e)s.push({name:r,kind:o.kind,value:o.value,status:o.status});let n=[];for(let[r,o]of i)for(let u of o)n.push({from:r,to:u});return{nodes:s,edges:n}}static _reset(){t._names=new WeakMap,t._kinds=new WeakMap,t._keys=new WeakMap,t._stores=new Set,t._edges=new Map,t._usedKeys=new Set,t._nextId=0,t._explicitEnabled=null,t._cachedDefault=null}};var y=1,f=64,h=2,x=4,K=8,F=16,k=32,d=D,R=A<<c,V=N<<c,m=w<<c,se=I<<c,ne=M<<c,ie=P<<c,O=class{_value;_output=null;_flags;get _status(){return $(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;constructor(e,i){this._value=i?.initial,this._fn=e,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let s=0;i?.autoDirty!==!1&&(s|=x),i?.resetOnTeardown&&(s|=K),i?.resubscribable&&(s|=F),this._flags=s,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(e,i){let s=this._output;if(s)if(this._flags&f)for(let n of s)n(e,i);else s(e,i)}emit(e){this._flags&h||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(j()?this._flags&k||(this._flags|=k,this._flags&x&&(this._flags=this._flags&~d|R,this._dispatch(S,T)),C(()=>{this._flags&=~k,this._flags=this._flags&~d|V,this._dispatch(g,this._value)})):(this._flags&x&&(this._flags=this._flags&~d|R,this._dispatch(S,T)),this._flags=this._flags&~d|V,this._dispatch(g,this._value))))}signal(e){this._flags&h||!this._output||(e===T?this._flags=this._flags&~d|R:e===v&&(this._flags=this._flags&~d|ie),this._dispatch(S,e))}complete(){if(this._flags&h)return;this._flags=(this._flags|h)&~d|se;let e=this._output,i=this._flags&f;if(this._output=null,this._flags&=~f,this._stop(),e)if(i)for(let s of e)s(l);else e(l)}error(e){if(this._flags&h)return;this._flags=(this._flags|h)&~d|ne;let i=this._output,s=this._flags&f;if(this._output=null,this._flags&=~f,this._stop(),i)if(s)for(let n of i)n(l,e);else i(l,e)}_start(){if(this._flags&y||!this._fn)return;this._flags|=y;let e=this._fn(this);this._cleanup=typeof e=="function"?e:void 0}_stop(){this._flags&y&&(this._flags&=~y,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&K&&(this._value=this._initial),this._flags&h||(this._flags=this._flags&~d|m))}source(e,i){if(e===p){let s=i;if(this._flags&h)if(this._flags&F&&this._output===null)this._flags=this._flags&~(h|d)|m;else{s(p,n=>{}),s(l);return}if(this._output===null)this._output=s;else if(this._flags&f)this._output.add(s);else{let n=new Set;n.add(this._output),n.add(s),this._output=n,this._flags|=f}s(p,n=>{if(n===g&&s(g,this._value),n===l){if(this._output===null)return;if(this._flags&f){let r=this._output;r.delete(s),r.size===1?(this._output=r.values().next().value,this._flags&=~f):r.size===0&&(this._output=null,this._flags&=~f,this._flags=this._flags&~d|m,this._stop())}else this._output===s&&(this._output=null,this._flags=this._flags&~d|m,this._stop())}}),L(()=>this._start())}}};function Y(t,e){return new O(t,e)}function re(){return Y(()=>{})}0&&(module.exports={never});
3
+ //# sourceMappingURL=never.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/never.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 never emits, never errors, and never completes.\n *\n * Stateful: get() always returns undefined — no values are ever emitted.\n *\n * v3: Tier 2 Producer — starts but never calls emit/complete/error.\n * Cleanup function is a no-op. Tests verify no leaks from idle sources.\n */\nexport function never<T = never>(): ProducerStore<T> {\n\treturn producer<T>(() => {\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,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,EAMjBC,EAAa,EACXC,EAAuC,CAAC,EA6BvC,SAASC,GAAsB,CACrC,OAAOC,EAAa,CACrB,CAEO,SAASC,EAAcC,EAAsB,CACnDC,EAAkB,KAAKD,CAAE,CAC1B,CAMA,IAAIE,GAAe,EACbC,GAAmC,CAAC,EAgBnC,SAASC,EAAWC,EAAyB,CAC/CC,GAAe,EAClBC,GAAc,KAAKF,CAAK,EAExBA,EAAM,CAER,CC7EO,IAAMG,EAAN,MAAMC,CAAU,CAEtB,OAAe,OAAS,IAAI,QAC5B,OAAe,OAAS,IAAI,QAC5B,OAAe,MA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,EAAcK,GAAiBO,MACxD,CACNiB,EAAKa,EAAQC,GAAe,CAAC,CAAC,EAC9Bd,EAAKU,CAAG,EACR,MACD,CAED,GAAI,KAAK,UAAY,KACpB,KAAK,QAAUV,UACH,KAAK,OAAS9B,EAOzB,KAAK,QAAqB,IAAI8B,CAAI,MAPC,CACpC,IAAMe,EAAM,IAAI,IAChBA,EAAI,IAAI,KAAK,OAAO,EACpBA,EAAI,IAAIf,CAAI,EACZ,KAAK,QAAUe,EACf,KAAK,QAAU7C,CAChB,CAGA8B,EAAKa,EAAQG,GAAc,CAE1B,GADIA,IAAMV,GAAMN,EAAKM,EAAM,KAAK,MAAM,EAClCU,IAAMN,EAAK,CACd,GAAI,KAAK,UAAY,KAAM,OAC3B,GAAI,KAAK,OAASxC,EAAS,CAC1B,IAAM6C,EAAM,KAAK,QACjBA,EAAI,OAAOf,CAAI,EACXe,EAAI,OAAS,GAChB,KAAK,QAAUA,EAAI,OAAO,EAAE,KAAK,EAAE,MACnC,KAAK,QAAU,CAAC7C,GACN6C,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,IAAM,CAEzB,CAAC,CACF","names":["never_exports","__export","never","__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","never","producer"]}
@@ -0,0 +1,13 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Creates a source that never emits, never errors, and never completes.
5
+ *
6
+ * Stateful: get() always returns undefined — no values are ever emitted.
7
+ *
8
+ * v3: Tier 2 Producer — starts but never calls emit/complete/error.
9
+ * Cleanup function is a no-op. Tests verify no leaks from idle sources.
10
+ */
11
+ declare function never<T = never>(): ProducerStore<T>;
12
+
13
+ export { never };
@@ -0,0 +1,13 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Creates a source that never emits, never errors, and never completes.
5
+ *
6
+ * Stateful: get() always returns undefined — no values are ever emitted.
7
+ *
8
+ * v3: Tier 2 Producer — starts but never calls emit/complete/error.
9
+ * Cleanup function is a no-op. Tests verify no leaks from idle sources.
10
+ */
11
+ declare function never<T = never>(): ProducerStore<T>;
12
+
13
+ export { never };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-2IM76CX3.js";import"../chunk-LM26JNAK.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as never};
2
+ //# sourceMappingURL=never.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var b=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(t,e)=>{for(var i in e)b(t,i,{get:e[i],enumerable:!0})},H=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of G(e))!z.call(t,n)&&n!==i&&b(t,n,{get:()=>e[n],enumerable:!(s=q(e,n))||s.enumerable});return t};var J=t=>H(b({},"__esModule",{value:!0}),t);var oe={};B(oe,{of:()=>re});module.exports=J(oe);var T=Symbol("DIRTY"),v=Symbol("RESOLVED"),w=0,A=1,N=2,P=3,I=4,M=5,c=7,D=7<<c,Q=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function $(t){return Q[(t&D)>>>c]}var p=0,g=1,l=2,S=3,X=0,Z=[];function j(){return X>0}function C(t){Z.push(t)}var ee=0,te=[];function L(t){ee>0?te.push(t):t()}var E=class t{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(t._explicitEnabled!==null)return t._explicitEnabled;if(t._cachedDefault!==null)return t._cachedDefault;try{t._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{t._cachedDefault=!0}return t._cachedDefault}static set enabled(e){t._explicitEnabled=e}static _depSuffix(e){if(!e?.length)return;let s=e.map(n=>t._names.get(n)??"?").join(",");return s.length>40?`${s.slice(0,37)}...`:s}static _resolveKey(e){return t._keys.get(e)??t._names.get(e)??"anonymous"}static register(e,i){if(!t.enabled)return;i?.name&&t._names.set(e,i.name),i?.kind&&t._kinds.set(e,i.kind);let s=t._nextId++,n=i?.name;if(!(n&&!t._usedKeys.has(n)))if(n){let r=t._depSuffix(i?.deps);n=r?`${n}(${r})`:`${n}_${s}`,t._usedKeys.has(n)&&(n=`${n}_${s}`)}else{let r=i?.kind??"store",o=t._depSuffix(i?.deps);n=o?`${r}(${o})`:`${r}_${s}`,t._usedKeys.has(n)&&(n=`${n}_${s}`)}t._usedKeys.add(n),t._keys.set(e,n),t._stores.add(new WeakRef(e))}static registerEdge(e,i){if(!t.enabled)return;let s=t._resolveKey(e),n=t._resolveKey(i),r=t._edges.get(s);r?r.includes(n)||r.push(n):t._edges.set(s,[n])}static getEdges(){return new Map(t._edges)}static getName(e){if(t.enabled)return t._names.get(e)}static getKind(e){return t._kinds.get(e)}static inspect(e){return{name:t._names.get(e),kind:t._kinds.get(e)??"unknown",value:typeof e.get=="function"?e.get():void 0,status:e._status}}static graph(){let e=new Map,i=new Set;for(let s of t._stores){let n=s.deref();if(!n){t._stores.delete(s);continue}let r=t._resolveKey(n);i.add(r),e.set(r,t.inspect(n))}for(let[s,n]of t._edges){if(!i.has(s)){t._edges.delete(s),t._usedKeys.delete(s);continue}let r=n.filter(o=>i.has(o));r.length===0?t._edges.delete(s):r.length!==n.length&&t._edges.set(s,r)}return e}static trace(e,i){let s=null,n=e.get();return e.source(p,(r,o)=>{if(r===p&&(s=o),r===l){s=null;return}if(r===1){let u=o;if(!Object.is(u,n)){let a=n;n=u,i(u,a)}}}),()=>s?.(l)}static dumpGraph(){let e=t.graph(),i=t.getEdges(),s=new Map;for(let[o,u]of i)for(let a of u){let _=s.get(a);_?_.includes(o)||_.push(o):s.set(a,[o])}let n=[];for(let[o,u]of e){let a=s.get(o),_=i.get(o),U=a?.length?` \u2190 [${a.join(", ")}]`:"",W=_?.length?` \u2192 [${_.join(", ")}]`:"";n.push(` ${o} (${u.kind}) = ${JSON.stringify(u.value)} [${u.status??"?"}]${U}${W}`)}return[`Store Graph (${e.size} nodes):`,...n].join(`
2
+ `)}static _observe(e,i,s){let n=null,r=i??t.getName(e),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>n?.(l)};return e.source(p,(u,a)=>{if(u===p){n=a;return}u===g?(o.values.push(a),o.events.push({type:"data",data:a}),s&&s(`[${r}] DATA:`,a)):u===S?(o.signals.push(a),o.events.push({type:"signal",data:a}),a===T?o.dirtyCount++:a===v&&o.resolvedCount++,s&&s(`[${r}] STATE:`,a)):u===l&&(o.ended=!0,o.endError=a,o.events.push({type:"end",data:a}),s&&s(`[${r}] END`,a!==void 0?a:""),n=null)}),o}static observe(e){return t._observe(e)}static tap(e,i){let s=i??`tap(${t.getName(e)??"anon"})`,n={get:()=>e.get(),source:e.source};return t.register(n,{name:s,kind:"tap"}),t.registerEdge(e,n),n}static spy(e,i){let s=i?.name??t.getName(e)??"spy",n=i?.log??console.log;return t._observe(e,s,n)}static snapshot(){let e=t.graph(),i=t.getEdges(),s=[];for(let[r,o]of e)s.push({name:r,kind:o.kind,value:o.value,status:o.status});let n=[];for(let[r,o]of i)for(let u of o)n.push({from:r,to:u});return{nodes:s,edges:n}}static _reset(){t._names=new WeakMap,t._kinds=new WeakMap,t._keys=new WeakMap,t._stores=new Set,t._edges=new Map,t._usedKeys=new Set,t._nextId=0,t._explicitEnabled=null,t._cachedDefault=null}};var y=1,f=64,h=2,x=4,K=8,F=16,k=32,d=D,R=A<<c,V=N<<c,m=w<<c,se=I<<c,ne=M<<c,ie=P<<c,O=class{_value;_output=null;_flags;get _status(){return $(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;constructor(e,i){this._value=i?.initial,this._fn=e,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let s=0;i?.autoDirty!==!1&&(s|=x),i?.resetOnTeardown&&(s|=K),i?.resubscribable&&(s|=F),this._flags=s,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(e,i){let s=this._output;if(s)if(this._flags&f)for(let n of s)n(e,i);else s(e,i)}emit(e){this._flags&h||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(j()?this._flags&k||(this._flags|=k,this._flags&x&&(this._flags=this._flags&~d|R,this._dispatch(S,T)),C(()=>{this._flags&=~k,this._flags=this._flags&~d|V,this._dispatch(g,this._value)})):(this._flags&x&&(this._flags=this._flags&~d|R,this._dispatch(S,T)),this._flags=this._flags&~d|V,this._dispatch(g,this._value))))}signal(e){this._flags&h||!this._output||(e===T?this._flags=this._flags&~d|R:e===v&&(this._flags=this._flags&~d|ie),this._dispatch(S,e))}complete(){if(this._flags&h)return;this._flags=(this._flags|h)&~d|se;let e=this._output,i=this._flags&f;if(this._output=null,this._flags&=~f,this._stop(),e)if(i)for(let s of e)s(l);else e(l)}error(e){if(this._flags&h)return;this._flags=(this._flags|h)&~d|ne;let i=this._output,s=this._flags&f;if(this._output=null,this._flags&=~f,this._stop(),i)if(s)for(let n of i)n(l,e);else i(l,e)}_start(){if(this._flags&y||!this._fn)return;this._flags|=y;let e=this._fn(this);this._cleanup=typeof e=="function"?e:void 0}_stop(){this._flags&y&&(this._flags&=~y,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&K&&(this._value=this._initial),this._flags&h||(this._flags=this._flags&~d|m))}source(e,i){if(e===p){let s=i;if(this._flags&h)if(this._flags&F&&this._output===null)this._flags=this._flags&~(h|d)|m;else{s(p,n=>{}),s(l);return}if(this._output===null)this._output=s;else if(this._flags&f)this._output.add(s);else{let n=new Set;n.add(this._output),n.add(s),this._output=n,this._flags|=f}s(p,n=>{if(n===g&&s(g,this._value),n===l){if(this._output===null)return;if(this._flags&f){let r=this._output;r.delete(s),r.size===1?(this._output=r.values().next().value,this._flags&=~f):r.size===0&&(this._output=null,this._flags&=~f,this._flags=this._flags&~d|m,this._stop())}else this._output===s&&(this._output=null,this._flags=this._flags&~d|m,this._stop())}}),L(()=>this._start())}}};function Y(t,e){return new O(t,e)}function re(...t){return Y(({emit:e,complete:i})=>{for(let s of t)e(s);i()})}0&&(module.exports={of});
3
+ //# sourceMappingURL=of.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/of.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 synchronously emits each provided value, then completes.\n *\n * Stateful: maintains last emitted value via producer. get() returns the last\n * value after start (the final argument), or undefined before subscription.\n *\n * v3: Tier 2 Producer — event source, no upstream deps. Each emit() sends\n * DIRTY on type 3 then the value on type 1, synchronously. Completes with END.\n */\nexport function of<T>(...values: T[]): ProducerStore<T> {\n\treturn producer<T>(({ emit, complete }) => {\n\t\tfor (const value of values) {\n\t\t\temit(value);\n\t\t}\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,QAAAE,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,CH9QO,SAASyB,MAASC,EAA+B,CACvD,OAAOC,EAAY,CAAC,CAAE,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC1C,QAAWC,KAASJ,EACnBE,EAAKE,CAAK,EAEXD,EAAS,CAEV,CAAC,CACF","names":["of_exports","__export","of","__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","of","values","producer","emit","complete","value"]}
@@ -0,0 +1,14 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.cjs';
2
+
3
+ /**
4
+ * Creates a source that synchronously emits each provided value, then completes.
5
+ *
6
+ * Stateful: maintains last emitted value via producer. get() returns the last
7
+ * value after start (the final argument), or undefined before subscription.
8
+ *
9
+ * v3: Tier 2 Producer — event source, no upstream deps. Each emit() sends
10
+ * DIRTY on type 3 then the value on type 1, synchronously. Completes with END.
11
+ */
12
+ declare function of<T>(...values: T[]): ProducerStore<T>;
13
+
14
+ export { of };
@@ -0,0 +1,14 @@
1
+ import { P as ProducerStore } from '../types-DsAN6Hga.js';
2
+
3
+ /**
4
+ * Creates a source that synchronously emits each provided value, then completes.
5
+ *
6
+ * Stateful: maintains last emitted value via producer. get() returns the last
7
+ * value after start (the final argument), or undefined before subscription.
8
+ *
9
+ * v3: Tier 2 Producer — event source, no upstream deps. Each emit() sends
10
+ * DIRTY on type 3 then the value on type 1, synchronously. Completes with END.
11
+ */
12
+ declare function of<T>(...values: T[]): ProducerStore<T>;
13
+
14
+ export { of };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-UEA4RIP5.js";import"../chunk-LM26JNAK.js";import"../chunk-7WTS4C5R.js";import"../chunk-QYUTDL4D.js";export{a as of};
2
+ //# sourceMappingURL=of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ "use strict";var b=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var U=(n,t)=>{for(var r in t)b(n,r,{get:t[r],enumerable:!0})},V=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of C(t))!K.call(n,e)&&e!==r&&b(n,e,{get:()=>t[e],enumerable:!(s=B(t,e))||s.enumerable});return n};var Y=n=>V(b({},"__esModule",{value:!0}),n);var q={};U(q,{pairwise:()=>J});module.exports=Y(q);var _=Symbol("DIRTY"),S=Symbol("RESOLVED"),A=0,x=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 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,r){if(!n.enabled)return;r?.name&&n._names.set(t,r.name),r?.kind&&n._kinds.set(t,r.kind);let s=n._nextId++,e=r?.name;if(!(e&&!n._usedKeys.has(e)))if(e){let i=n._depSuffix(r?.deps);e=i?`${e}(${i})`:`${e}_${s}`,n._usedKeys.has(e)&&(e=`${e}_${s}`)}else{let i=r?.kind??"store",o=n._depSuffix(r?.deps);e=o?`${i}(${o})`:`${i}_${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,r){if(!n.enabled)return;let s=n._resolveKey(t),e=n._resolveKey(r),i=n._edges.get(s);i?i.includes(e)||i.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,r=new Set;for(let s of n._stores){let e=s.deref();if(!e){n._stores.delete(s);continue}let i=n._resolveKey(e);r.add(i),t.set(i,n.inspect(e))}for(let[s,e]of n._edges){if(!r.has(s)){n._edges.delete(s),n._usedKeys.delete(s);continue}let i=e.filter(o=>r.has(o));i.length===0?n._edges.delete(s):i.length!==e.length&&n._edges.set(s,i)}return t}static trace(t,r){let s=null,e=t.get();return t.source(d,(i,o)=>{if(i===d&&(s=o),i===l){s=null;return}if(i===1){let u=o;if(!Object.is(u,e)){let a=e;e=u,r(u,a)}}}),()=>s?.(l)}static dumpGraph(){let t=n.graph(),r=n.getEdges(),s=new Map;for(let[o,u]of r)for(let a of u){let c=s.get(a);c?c.includes(o)||c.push(o):s.set(a,[o])}let e=[];for(let[o,u]of t){let a=s.get(o),c=r.get(o),E=a?.length?` \u2190 [${a.join(", ")}]`:"",L=c?.length?` \u2192 [${c.join(", ")}]`:"";e.push(` ${o} (${u.kind}) = ${JSON.stringify(u.value)} [${u.status??"?"}]${E}${L}`)}return[`Store Graph (${t.size} nodes):`,...e].join(`
2
+ `)}static _observe(t,r,s){let e=null,i=r??n.getName(t),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:i,dispose:()=>e?.(l)};return t.source(d,(u,a)=>{if(u===d){e=a;return}u===g?(o.values.push(a),o.events.push({type:"data",data:a}),s&&s(`[${i}] DATA:`,a)):u===T?(o.signals.push(a),o.events.push({type:"signal",data:a}),a===_?o.dirtyCount++:a===S&&o.resolvedCount++,s&&s(`[${i}] STATE:`,a)):u===l&&(o.ended=!0,o.endError=a,o.events.push({type:"end",data:a}),s&&s(`[${i}] END`,a!==void 0?a:""),e=null)}),o}static observe(t){return n._observe(t)}static tap(t,r){let s=r??`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,r){let s=r?.name??n.getName(t)??"spy",e=r?.log??console.log;return n._observe(t,s,e)}static snapshot(){let t=n.graph(),r=n.getEdges(),s=[];for(let[i,o]of t)s.push({name:i,kind:o.kind,value:o.value,status:o.status});let e=[];for(let[i,o]of r)for(let u of o)e.push({from:i,to:u});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 y=1,v=2,M=4,f=8,$=A<<p,P=x<<p,F=R<<p,z=O<<p,G=w<<p,H=I<<p,h=k,D=class{_value;_output=null;_upstreamTalkbacks=[];_handler=null;_flags;_deps;_init;_getterFn;_initial;get _status(){return N(this._flags)}constructor(t,r,s){this._value=s?.initial,this._initial=s?.initial,this._deps=t,this._init=r,this._getterFn=s?.getter;let e=0;s?.resetOnTeardown&&(e|=v),s?.resubscribable&&(e|=M),this._flags=e,this.source=this.source.bind(this),m.register(this,{kind:s?.kind??"operator",...s,deps:t});for(let i of t)m.registerEdge(i,this)}_dispatch(t,r){let s=this._output;if(s)if(this._flags&f)for(let e of s)e(t,r);else s(t,r)}_connectUpstream(){let t=new Array(this._deps.length).fill(null);this._upstreamTalkbacks=t;let r=!1,s={seed:e=>{r||(this._value=e)},emit:e=>{r||(this._value=e,this._flags=this._flags&~h|F,this._dispatch(g,e))},signal:e=>{r||(e===_?this._flags=this._flags&~h|P:e===S&&(this._flags=this._flags&~h|z),this._dispatch(T,e))},complete:()=>{if(r)return;r=!0,this._flags=(this._flags|y)&~h|G,this._handler=null;for(let o of t)o?.(l);t.fill(null),this._flags&v&&(this._value=this._initial);let e=this._output,i=this._flags&f;if(this._output=null,this._flags&=~f,e)if(i)for(let o of e)o(l);else e(l)},error:e=>{if(r)return;r=!0,this._flags=(this._flags|y)&~h|H,this._handler=null;for(let u of t)u?.(l);t.fill(null),this._flags&v&&(this._value=this._initial);let i=this._output,o=this._flags&f;if(this._output=null,this._flags&=~f,i)if(o)for(let u of i)u(l,e);else i(l,e)},disconnect:e=>{if(e!==void 0)t[e]?.(l),t[e]=null;else{for(let i of t)i?.(l);t.fill(null)}}};this._handler=this._init(s);for(let e=0;e<this._deps.length&&!r;e++){let i=e;this._deps[i].source(d,(o,u)=>{if(o===d){t[i]=u;return}this._handler?.(i,o,u)})}}_disconnectUpstream(){for(let t of this._upstreamTalkbacks)t?.(l);this._upstreamTalkbacks=[],this._handler=null,this._flags=this._flags&~h|$,this._flags&v&&(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,r){if(t===d){let s=r;if(this._flags&y)if(this._flags&M&&this._output===null)this._flags=this._flags&~(y|h)|$;else{s(d,i=>{}),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 i=new Set;i.add(this._output),i.add(s),this._output=i,this._flags|=f}s(d,i=>{if(i===g&&s(g,this._value),i===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,r){return new D(n,t,r)}function J(){return n=>j([n],({emit:t,signal:r,complete:s,error:e})=>{let i,o=!1;return(u,a,c)=>{if(a===T&&(c===_||c===S?o&&r(c):r(c)),a===g)if(o){let E=[i,c];i=c,t(E)}else i=c,o=!0;a===l&&(c!==void 0?e(c):s())}},{kind:"pairwise",name:"pairwise"})}0&&(module.exports={pairwise});
3
+ //# sourceMappingURL=pairwise.cjs.map