@graphrefly/ts 0.0.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 (210) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/index.cjs +9015 -0
  3. package/dist/adapters/index.cjs.map +1 -0
  4. package/dist/adapters/index.d.cts +678 -0
  5. package/dist/adapters/index.d.ts +678 -0
  6. package/dist/adapters/index.js +2894 -0
  7. package/dist/adapters/index.js.map +1 -0
  8. package/dist/adapters/observe-storage.cjs +260 -0
  9. package/dist/adapters/observe-storage.cjs.map +1 -0
  10. package/dist/adapters/observe-storage.d.cts +77 -0
  11. package/dist/adapters/observe-storage.d.ts +77 -0
  12. package/dist/adapters/observe-storage.js +161 -0
  13. package/dist/adapters/observe-storage.js.map +1 -0
  14. package/dist/append-log-DisvEReb.d.cts +189 -0
  15. package/dist/append-log-DzKMmjxx.d.ts +189 -0
  16. package/dist/chunk-2ILL7HQI.js +1189 -0
  17. package/dist/chunk-2ILL7HQI.js.map +1 -0
  18. package/dist/chunk-4VLAQHZI.js +330 -0
  19. package/dist/chunk-4VLAQHZI.js.map +1 -0
  20. package/dist/chunk-6PHB5CJS.js +229 -0
  21. package/dist/chunk-6PHB5CJS.js.map +1 -0
  22. package/dist/chunk-COHO25CZ.js +2449 -0
  23. package/dist/chunk-COHO25CZ.js.map +1 -0
  24. package/dist/chunk-D6BG7U6A.js +161 -0
  25. package/dist/chunk-D6BG7U6A.js.map +1 -0
  26. package/dist/chunk-DJC4CHLQ.js +818 -0
  27. package/dist/chunk-DJC4CHLQ.js.map +1 -0
  28. package/dist/chunk-DK554R7P.js +67 -0
  29. package/dist/chunk-DK554R7P.js.map +1 -0
  30. package/dist/chunk-DKP56CSW.js +322 -0
  31. package/dist/chunk-DKP56CSW.js.map +1 -0
  32. package/dist/chunk-G4M3NHRJ.js +688 -0
  33. package/dist/chunk-G4M3NHRJ.js.map +1 -0
  34. package/dist/chunk-GAJW5I5P.js +1 -0
  35. package/dist/chunk-GAJW5I5P.js.map +1 -0
  36. package/dist/chunk-GDL26N2T.js +282 -0
  37. package/dist/chunk-GDL26N2T.js.map +1 -0
  38. package/dist/chunk-GTPCOEOZ.js +741 -0
  39. package/dist/chunk-GTPCOEOZ.js.map +1 -0
  40. package/dist/chunk-H2HTHFVN.js +1 -0
  41. package/dist/chunk-H2HTHFVN.js.map +1 -0
  42. package/dist/chunk-HDRL4VQQ.js +218 -0
  43. package/dist/chunk-HDRL4VQQ.js.map +1 -0
  44. package/dist/chunk-I3IHOHCJ.js +2267 -0
  45. package/dist/chunk-I3IHOHCJ.js.map +1 -0
  46. package/dist/chunk-JIMUDQN3.js +965 -0
  47. package/dist/chunk-JIMUDQN3.js.map +1 -0
  48. package/dist/chunk-JR4IKCR2.js +462 -0
  49. package/dist/chunk-JR4IKCR2.js.map +1 -0
  50. package/dist/chunk-K3FXTC3I.js +165 -0
  51. package/dist/chunk-K3FXTC3I.js.map +1 -0
  52. package/dist/chunk-OOEN33FB.js +65 -0
  53. package/dist/chunk-OOEN33FB.js.map +1 -0
  54. package/dist/chunk-PKVBHGBM.js +554 -0
  55. package/dist/chunk-PKVBHGBM.js.map +1 -0
  56. package/dist/chunk-RIIOUTGM.js +1857 -0
  57. package/dist/chunk-RIIOUTGM.js.map +1 -0
  58. package/dist/chunk-SCRFRCGR.js +33 -0
  59. package/dist/chunk-SCRFRCGR.js.map +1 -0
  60. package/dist/chunk-SWTLEQL6.js +53 -0
  61. package/dist/chunk-SWTLEQL6.js.map +1 -0
  62. package/dist/chunk-SZAETNNA.js +1 -0
  63. package/dist/chunk-SZAETNNA.js.map +1 -0
  64. package/dist/chunk-TEW47IVR.js +49 -0
  65. package/dist/chunk-TEW47IVR.js.map +1 -0
  66. package/dist/chunk-Y3ZLRGHC.js +1482 -0
  67. package/dist/chunk-Y3ZLRGHC.js.map +1 -0
  68. package/dist/chunk-Z2ANQ6JW.js +149 -0
  69. package/dist/chunk-Z2ANQ6JW.js.map +1 -0
  70. package/dist/codec-BB7p8fJc.d.cts +38 -0
  71. package/dist/codec-BB7p8fJc.d.ts +38 -0
  72. package/dist/composition/index.cjs +2505 -0
  73. package/dist/composition/index.cjs.map +1 -0
  74. package/dist/composition/index.d.cts +95 -0
  75. package/dist/composition/index.d.ts +95 -0
  76. package/dist/composition/index.js +19 -0
  77. package/dist/composition/index.js.map +1 -0
  78. package/dist/core/index.cjs +2475 -0
  79. package/dist/core/index.cjs.map +1 -0
  80. package/dist/core/index.d.cts +25 -0
  81. package/dist/core/index.d.ts +25 -0
  82. package/dist/core/index.js +74 -0
  83. package/dist/core/index.js.map +1 -0
  84. package/dist/cqrs/index.cjs +595 -0
  85. package/dist/cqrs/index.cjs.map +1 -0
  86. package/dist/cqrs/index.d.cts +200 -0
  87. package/dist/cqrs/index.d.ts +200 -0
  88. package/dist/cqrs/index.js +557 -0
  89. package/dist/cqrs/index.js.map +1 -0
  90. package/dist/data-structures/index.cjs +4277 -0
  91. package/dist/data-structures/index.cjs.map +1 -0
  92. package/dist/data-structures/index.d.cts +22 -0
  93. package/dist/data-structures/index.d.ts +22 -0
  94. package/dist/data-structures/index.js +31 -0
  95. package/dist/data-structures/index.js.map +1 -0
  96. package/dist/describe-BZb7AS2y.d.ts +57 -0
  97. package/dist/describe-Ciu8SUnN.d.cts +57 -0
  98. package/dist/graph/index.cjs +7832 -0
  99. package/dist/graph/index.cjs.map +1 -0
  100. package/dist/graph/index.d.cts +251 -0
  101. package/dist/graph/index.d.ts +251 -0
  102. package/dist/graph/index.js +131 -0
  103. package/dist/graph/index.js.map +1 -0
  104. package/dist/graph-DfdF9zy4.d.ts +666 -0
  105. package/dist/graph-s23RbbFO.d.cts +666 -0
  106. package/dist/index-CAEmLCYF.d.cts +166 -0
  107. package/dist/index-SnzZu3x7.d.ts +166 -0
  108. package/dist/index.cjs +15409 -0
  109. package/dist/index.cjs.map +1 -0
  110. package/dist/index.d.cts +23 -0
  111. package/dist/index.d.ts +23 -0
  112. package/dist/index.js +582 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/messages-BZqrGGm1.d.cts +55 -0
  115. package/dist/messages-BZqrGGm1.d.ts +55 -0
  116. package/dist/messaging/index.cjs +818 -0
  117. package/dist/messaging/index.cjs.map +1 -0
  118. package/dist/messaging/index.d.cts +235 -0
  119. package/dist/messaging/index.d.ts +235 -0
  120. package/dist/messaging/index.js +767 -0
  121. package/dist/messaging/index.js.map +1 -0
  122. package/dist/observe-event-log-0SVsx7JG.d.cts +88 -0
  123. package/dist/observe-event-log-Dnm76owp.d.ts +88 -0
  124. package/dist/operators/index.cjs +3774 -0
  125. package/dist/operators/index.cjs.map +1 -0
  126. package/dist/operators/index.d.cts +308 -0
  127. package/dist/operators/index.d.ts +308 -0
  128. package/dist/operators/index.js +112 -0
  129. package/dist/operators/index.js.map +1 -0
  130. package/dist/orchestration/index.cjs +3541 -0
  131. package/dist/orchestration/index.cjs.map +1 -0
  132. package/dist/orchestration/index.d.cts +302 -0
  133. package/dist/orchestration/index.d.ts +302 -0
  134. package/dist/orchestration/index.js +1004 -0
  135. package/dist/orchestration/index.js.map +1 -0
  136. package/dist/patterns/index.cjs +1045 -0
  137. package/dist/patterns/index.cjs.map +1 -0
  138. package/dist/patterns/index.d.cts +39 -0
  139. package/dist/patterns/index.d.ts +39 -0
  140. package/dist/patterns/index.js +33 -0
  141. package/dist/patterns/index.js.map +1 -0
  142. package/dist/reactive-collection-BxBqtIOE.d.cts +344 -0
  143. package/dist/reactive-collection-Cb1II1Fi.d.ts +344 -0
  144. package/dist/reactive-collection-storage-BNiEc-Gd.d.ts +217 -0
  145. package/dist/reactive-collection-storage-D-KmjE0J.d.cts +217 -0
  146. package/dist/reactive-map-BcB4KsQR.d.ts +256 -0
  147. package/dist/reactive-map-D-g3dv8I.d.cts +256 -0
  148. package/dist/read-through-B1CYPfq_.d.cts +82 -0
  149. package/dist/read-through-DwyJhGs1.d.ts +82 -0
  150. package/dist/render/index.cjs +250 -0
  151. package/dist/render/index.cjs.map +1 -0
  152. package/dist/render/index.d.cts +58 -0
  153. package/dist/render/index.d.ts +58 -0
  154. package/dist/render/index.js +20 -0
  155. package/dist/render/index.js.map +1 -0
  156. package/dist/resilience-Dig3Q7n0.d.cts +45 -0
  157. package/dist/resilience-Dig3Q7n0.d.ts +45 -0
  158. package/dist/semantic-memory-graph-BYoIlP35.d.cts +356 -0
  159. package/dist/semantic-memory-graph-CxyXLms3.d.ts +356 -0
  160. package/dist/solutions/index.cjs +3249 -0
  161. package/dist/solutions/index.cjs.map +1 -0
  162. package/dist/solutions/index.d.cts +520 -0
  163. package/dist/solutions/index.d.ts +520 -0
  164. package/dist/solutions/index.js +31 -0
  165. package/dist/solutions/index.js.map +1 -0
  166. package/dist/sources/browser.cjs +3095 -0
  167. package/dist/sources/browser.cjs.map +1 -0
  168. package/dist/sources/browser.d.cts +39 -0
  169. package/dist/sources/browser.d.ts +39 -0
  170. package/dist/sources/browser.js +137 -0
  171. package/dist/sources/browser.js.map +1 -0
  172. package/dist/sources/index.cjs +3021 -0
  173. package/dist/sources/index.cjs.map +1 -0
  174. package/dist/sources/index.d.cts +7 -0
  175. package/dist/sources/index.d.ts +7 -0
  176. package/dist/sources/index.js +63 -0
  177. package/dist/sources/index.js.map +1 -0
  178. package/dist/sources/node.cjs +675 -0
  179. package/dist/sources/node.cjs.map +1 -0
  180. package/dist/sources/node.d.cts +109 -0
  181. package/dist/sources/node.d.ts +109 -0
  182. package/dist/sources/node.js +639 -0
  183. package/dist/sources/node.js.map +1 -0
  184. package/dist/storage/browser.cjs +777 -0
  185. package/dist/storage/browser.cjs.map +1 -0
  186. package/dist/storage/browser.d.cts +40 -0
  187. package/dist/storage/browser.d.ts +40 -0
  188. package/dist/storage/browser.js +275 -0
  189. package/dist/storage/browser.js.map +1 -0
  190. package/dist/storage/index.cjs +1989 -0
  191. package/dist/storage/index.cjs.map +1 -0
  192. package/dist/storage/index.d.cts +92 -0
  193. package/dist/storage/index.d.ts +92 -0
  194. package/dist/storage/index.js +161 -0
  195. package/dist/storage/index.js.map +1 -0
  196. package/dist/storage/node.cjs +898 -0
  197. package/dist/storage/node.cjs.map +1 -0
  198. package/dist/storage/node.d.cts +66 -0
  199. package/dist/storage/node.d.ts +66 -0
  200. package/dist/storage/node.js +402 -0
  201. package/dist/storage/node.js.map +1 -0
  202. package/dist/testing/index.cjs +95 -0
  203. package/dist/testing/index.cjs.map +1 -0
  204. package/dist/testing/index.d.cts +20 -0
  205. package/dist/testing/index.d.ts +20 -0
  206. package/dist/testing/index.js +8 -0
  207. package/dist/testing/index.js.map +1 -0
  208. package/dist/types-bNMSWKqF.d.cts +732 -0
  209. package/dist/types-h12mNYbq.d.ts +732 -0
  210. package/package.json +250 -0
@@ -0,0 +1,39 @@
1
+ import { L as Operator } from '../graph-s23RbbFO.cjs';
2
+ export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-bNMSWKqF.cjs';
3
+ export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-CAEmLCYF.cjs';
4
+ import '../core/index.cjs';
5
+ import '../messages-BZqrGGm1.cjs';
6
+ import '../codec-BB7p8fJc.cjs';
7
+ import '../describe-Ciu8SUnN.cjs';
8
+
9
+ /**
10
+ * Browser-safe source factories. This subpath intentionally excludes
11
+ * Node-only adapters such as fromFSWatch.
12
+ */
13
+
14
+ type IDBEventHandler<TThis> = {
15
+ bivarianceHack(this: TThis, event: unknown): unknown;
16
+ }["bivarianceHack"];
17
+ interface IDBRequestLike<T> {
18
+ result: T;
19
+ error?: unknown;
20
+ onsuccess: null | IDBEventHandler<IDBRequestLike<T>>;
21
+ onerror: null | IDBEventHandler<IDBRequestLike<T>>;
22
+ }
23
+ interface IDBTransactionLike {
24
+ error?: unknown;
25
+ oncomplete: null | IDBEventHandler<IDBTransactionLike>;
26
+ onerror: null | IDBEventHandler<IDBTransactionLike>;
27
+ onabort: null | IDBEventHandler<IDBTransactionLike>;
28
+ }
29
+ /** Wrap an IndexedDB request as a one-shot source. */
30
+ declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T>;
31
+ /**
32
+ * Wrap an IndexedDB transaction lifecycle as a terminal-only source.
33
+ *
34
+ * Success emits COMPLETE without DATA: undefined is the TypeScript SENTINEL and cannot be a DATA
35
+ * payload under R-data-payload.
36
+ */
37
+ declare function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never>;
38
+
39
+ export { type IDBRequestLike, type IDBTransactionLike, fromIDBRequest, fromIDBTransaction };
@@ -0,0 +1,39 @@
1
+ import { L as Operator } from '../graph-DfdF9zy4.js';
2
+ export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-h12mNYbq.js';
3
+ export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-SnzZu3x7.js';
4
+ import '../core/index.js';
5
+ import '../messages-BZqrGGm1.js';
6
+ import '../codec-BB7p8fJc.js';
7
+ import '../describe-BZb7AS2y.js';
8
+
9
+ /**
10
+ * Browser-safe source factories. This subpath intentionally excludes
11
+ * Node-only adapters such as fromFSWatch.
12
+ */
13
+
14
+ type IDBEventHandler<TThis> = {
15
+ bivarianceHack(this: TThis, event: unknown): unknown;
16
+ }["bivarianceHack"];
17
+ interface IDBRequestLike<T> {
18
+ result: T;
19
+ error?: unknown;
20
+ onsuccess: null | IDBEventHandler<IDBRequestLike<T>>;
21
+ onerror: null | IDBEventHandler<IDBRequestLike<T>>;
22
+ }
23
+ interface IDBTransactionLike {
24
+ error?: unknown;
25
+ oncomplete: null | IDBEventHandler<IDBTransactionLike>;
26
+ onerror: null | IDBEventHandler<IDBTransactionLike>;
27
+ onabort: null | IDBEventHandler<IDBTransactionLike>;
28
+ }
29
+ /** Wrap an IndexedDB request as a one-shot source. */
30
+ declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T>;
31
+ /**
32
+ * Wrap an IndexedDB transaction lifecycle as a terminal-only source.
33
+ *
34
+ * Success emits COMPLETE without DATA: undefined is the TypeScript SENTINEL and cannot be a DATA
35
+ * payload under R-data-payload.
36
+ */
37
+ declare function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never>;
38
+
39
+ export { type IDBRequestLike, type IDBTransactionLike, fromIDBRequest, fromIDBTransaction };
@@ -0,0 +1,137 @@
1
+ import "../chunk-SZAETNNA.js";
2
+ import {
3
+ empty,
4
+ firstValueFrom,
5
+ fromAny,
6
+ fromAsyncIter,
7
+ fromCron,
8
+ fromEvent,
9
+ fromHttp,
10
+ fromHttpWithOptions,
11
+ fromIter,
12
+ fromPromise,
13
+ fromPushNotification,
14
+ fromSSE,
15
+ fromSSEWithOptions,
16
+ fromTimer,
17
+ fromWebSocket,
18
+ fromWebSocketWithOptions,
19
+ fromWebhook,
20
+ fromWebhookWithOptions,
21
+ interval,
22
+ matchesCron,
23
+ never,
24
+ of,
25
+ parseCron,
26
+ singleFromAny,
27
+ throwError,
28
+ timer
29
+ } from "../chunk-G4M3NHRJ.js";
30
+ import "../chunk-PKVBHGBM.js";
31
+ import "../chunk-I3IHOHCJ.js";
32
+ import "../chunk-4VLAQHZI.js";
33
+ import "../chunk-SWTLEQL6.js";
34
+ import {
35
+ errorPayload
36
+ } from "../chunk-DK554R7P.js";
37
+
38
+ // src/sources/browser.ts
39
+ function source(factory, setup) {
40
+ return {
41
+ factory,
42
+ body: (ctx) => {
43
+ const cleanup = setup(ctx);
44
+ if (typeof cleanup === "function") ctx.onDeactivation(cleanup);
45
+ }
46
+ };
47
+ }
48
+ function fromIDBRequest(request) {
49
+ return source("fromIDBRequest", (ctx) => {
50
+ let done = false;
51
+ const clear = () => {
52
+ request.onsuccess = null;
53
+ request.onerror = null;
54
+ };
55
+ request.onsuccess = () => {
56
+ if (done) return;
57
+ done = true;
58
+ clear();
59
+ if (request.result === void 0) {
60
+ ctx.down([
61
+ ["ERROR", new TypeError("fromIDBRequest: request.result is the substrate SENTINEL")]
62
+ ]);
63
+ return;
64
+ }
65
+ ctx.down([["DATA", request.result], ["COMPLETE"]]);
66
+ };
67
+ request.onerror = () => {
68
+ if (done) return;
69
+ done = true;
70
+ clear();
71
+ ctx.down([["ERROR", errorPayload(request.error ?? new Error("IndexedDB request failed"))]]);
72
+ };
73
+ return () => {
74
+ done = true;
75
+ clear();
76
+ };
77
+ });
78
+ }
79
+ function fromIDBTransaction(transaction) {
80
+ return source("fromIDBTransaction", (ctx) => {
81
+ let done = false;
82
+ const clear = () => {
83
+ transaction.oncomplete = null;
84
+ transaction.onerror = null;
85
+ transaction.onabort = null;
86
+ };
87
+ const fail = (fallback) => {
88
+ if (done) return;
89
+ done = true;
90
+ clear();
91
+ ctx.down([["ERROR", errorPayload(transaction.error ?? new Error(fallback))]]);
92
+ };
93
+ transaction.oncomplete = () => {
94
+ if (done) return;
95
+ done = true;
96
+ clear();
97
+ ctx.down([["COMPLETE"]]);
98
+ };
99
+ transaction.onerror = () => fail("IndexedDB transaction failed");
100
+ transaction.onabort = () => fail("IndexedDB transaction aborted");
101
+ return () => {
102
+ done = true;
103
+ clear();
104
+ };
105
+ });
106
+ }
107
+ export {
108
+ empty,
109
+ firstValueFrom,
110
+ fromAny,
111
+ fromAsyncIter,
112
+ fromCron,
113
+ fromEvent,
114
+ fromHttp,
115
+ fromHttpWithOptions,
116
+ fromIDBRequest,
117
+ fromIDBTransaction,
118
+ fromIter,
119
+ fromPromise,
120
+ fromPushNotification,
121
+ fromSSE,
122
+ fromSSEWithOptions,
123
+ fromTimer,
124
+ fromWebSocket,
125
+ fromWebSocketWithOptions,
126
+ fromWebhook,
127
+ fromWebhookWithOptions,
128
+ interval,
129
+ matchesCron,
130
+ never,
131
+ of,
132
+ parseCron,
133
+ singleFromAny,
134
+ throwError,
135
+ timer
136
+ };
137
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/sources/browser.ts"],"sourcesContent":["/**\n * Browser-safe source factories. This subpath intentionally excludes\n * Node-only adapters such as fromFSWatch.\n */\n\nimport type { Ctx } from \"../ctx/types.js\";\nimport type { Operator } from \"../graph/operators.js\";\nimport { errorPayload } from \"../protocol/messages.js\";\n\nexport * from \"./index.js\";\n\ntype IDBEventHandler<TThis> = {\n\tbivarianceHack(this: TThis, event: unknown): unknown;\n}[\"bivarianceHack\"];\n\nexport interface IDBRequestLike<T> {\n\tresult: T;\n\terror?: unknown;\n\tonsuccess: null | IDBEventHandler<IDBRequestLike<T>>;\n\tonerror: null | IDBEventHandler<IDBRequestLike<T>>;\n}\n\nexport interface IDBTransactionLike {\n\terror?: unknown;\n\toncomplete: null | IDBEventHandler<IDBTransactionLike>;\n\tonerror: null | IDBEventHandler<IDBTransactionLike>;\n\tonabort: null | IDBEventHandler<IDBTransactionLike>;\n}\n\nfunction source<T>(\n\tfactory: string,\n\tsetup: (ctx: Ctx) => undefined | (() => void),\n): Operator<never, T> {\n\treturn {\n\t\tfactory,\n\t\tbody: (ctx) => {\n\t\t\tconst cleanup = setup(ctx);\n\t\t\tif (typeof cleanup === \"function\") ctx.onDeactivation(cleanup);\n\t\t},\n\t};\n}\n\n/** Wrap an IndexedDB request as a one-shot source. */\nexport function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T> {\n\treturn source<T>(\"fromIDBRequest\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\trequest.onsuccess = null;\n\t\t\trequest.onerror = null;\n\t\t};\n\t\trequest.onsuccess = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tif (request.result === undefined) {\n\t\t\t\tctx.down([\n\t\t\t\t\t[\"ERROR\", new TypeError(\"fromIDBRequest: request.result is the substrate SENTINEL\")],\n\t\t\t\t]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctx.down([[\"DATA\", request.result], [\"COMPLETE\"]]);\n\t\t};\n\t\trequest.onerror = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(request.error ?? new Error(\"IndexedDB request failed\"))]]);\n\t\t};\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n\n/**\n * Wrap an IndexedDB transaction lifecycle as a terminal-only source.\n *\n * Success emits COMPLETE without DATA: undefined is the TypeScript SENTINEL and cannot be a DATA\n * payload under R-data-payload.\n */\nexport function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never> {\n\treturn source<never>(\"fromIDBTransaction\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\ttransaction.oncomplete = null;\n\t\t\ttransaction.onerror = null;\n\t\t\ttransaction.onabort = null;\n\t\t};\n\t\tconst fail = (fallback: string) => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(transaction.error ?? new Error(fallback))]]);\n\t\t};\n\t\ttransaction.oncomplete = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"COMPLETE\"]]);\n\t\t};\n\t\ttransaction.onerror = () => fail(\"IndexedDB transaction failed\");\n\t\ttransaction.onabort = () => fail(\"IndexedDB transaction aborted\");\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,OACR,SACA,OACqB;AACrB,SAAO;AAAA,IACN;AAAA,IACA,MAAM,CAAC,QAAQ;AACd,YAAM,UAAU,MAAM,GAAG;AACzB,UAAI,OAAO,YAAY,WAAY,KAAI,eAAe,OAAO;AAAA,IAC9D;AAAA,EACD;AACD;AAGO,SAAS,eAAkB,SAAgD;AACjF,SAAO,OAAU,kBAAkB,CAAC,QAAQ;AAC3C,QAAI,OAAO;AACX,UAAM,QAAQ,MAAM;AACnB,cAAQ,YAAY;AACpB,cAAQ,UAAU;AAAA,IACnB;AACA,YAAQ,YAAY,MAAM;AACzB,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,QAAQ,WAAW,QAAW;AACjC,YAAI,KAAK;AAAA,UACR,CAAC,SAAS,IAAI,UAAU,0DAA0D,CAAC;AAAA,QACpF,CAAC;AACD;AAAA,MACD;AACA,UAAI,KAAK,CAAC,CAAC,QAAQ,QAAQ,MAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAAA,IAClD;AACA,YAAQ,UAAU,MAAM;AACvB,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,SAAS,aAAa,QAAQ,SAAS,IAAI,MAAM,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAAA,IAC3F;AACA,WAAO,MAAM;AACZ,aAAO;AACP,YAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAQO,SAAS,mBAAmB,aAAyD;AAC3F,SAAO,OAAc,sBAAsB,CAAC,QAAQ;AACnD,QAAI,OAAO;AACX,UAAM,QAAQ,MAAM;AACnB,kBAAY,aAAa;AACzB,kBAAY,UAAU;AACtB,kBAAY,UAAU;AAAA,IACvB;AACA,UAAM,OAAO,CAAC,aAAqB;AAClC,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,SAAS,aAAa,YAAY,SAAS,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAA,IAC7E;AACA,gBAAY,aAAa,MAAM;AAC9B,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;AAAA,IACxB;AACA,gBAAY,UAAU,MAAM,KAAK,8BAA8B;AAC/D,gBAAY,UAAU,MAAM,KAAK,+BAA+B;AAChE,WAAO,MAAM;AACZ,aAAO;AACP,YAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;","names":[]}