@graphrefly/ts 0.0.2 → 0.0.3

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/README.md +197 -117
  2. package/dist/{actions-types-wl9Mgkmr.d.cts → actions-types-CH-XCU9O.d.cts} +4 -4
  3. package/dist/{actions-types-CSC3NMDl.d.ts → actions-types-w2iPQTkv.d.ts} +4 -4
  4. package/dist/adapters/index.cjs.map +1 -1
  5. package/dist/adapters/index.d.cts +10 -10
  6. package/dist/adapters/index.d.ts +10 -10
  7. package/dist/adapters/index.js +7 -7
  8. package/dist/adapters/nestjs/microservices.d.cts +3 -3
  9. package/dist/adapters/nestjs/microservices.d.ts +3 -3
  10. package/dist/adapters/nestjs/native.cjs.map +1 -1
  11. package/dist/adapters/nestjs/native.d.cts +4 -4
  12. package/dist/adapters/nestjs/native.d.ts +4 -4
  13. package/dist/adapters/nestjs/native.js +3 -3
  14. package/dist/adapters/nestjs/websockets.d.cts +3 -3
  15. package/dist/adapters/nestjs/websockets.d.ts +3 -3
  16. package/dist/adapters/nestjs.d.cts +3 -3
  17. package/dist/adapters/nestjs.d.ts +3 -3
  18. package/dist/adapters/observe-storage.d.cts +3 -3
  19. package/dist/adapters/observe-storage.d.ts +3 -3
  20. package/dist/adapters/react.d.cts +2 -2
  21. package/dist/adapters/react.d.ts +2 -2
  22. package/dist/adapters/solid.d.cts +2 -2
  23. package/dist/adapters/solid.d.ts +2 -2
  24. package/dist/adapters/svelte.d.cts +2 -2
  25. package/dist/adapters/svelte.d.ts +2 -2
  26. package/dist/adapters/vue.d.cts +2 -2
  27. package/dist/adapters/vue.d.ts +2 -2
  28. package/dist/{agent-runtime-types-core-hU299uIC.d.ts → agent-runtime-types-core-CKwrBDyi.d.ts} +1 -1
  29. package/dist/{agent-runtime-types-core-CaXfKNtY.d.cts → agent-runtime-types-core-bfl4m0vM.d.cts} +1 -1
  30. package/dist/{agent-runtime-types-tool-DninPEzk.d.cts → agent-runtime-types-tool-BLPV3azj.d.cts} +4 -4
  31. package/dist/{agent-runtime-types-tool-BEpSINol.d.ts → agent-runtime-types-tool-hwqvVqNt.d.ts} +4 -4
  32. package/dist/{agentic-memory-retention-BmGX368S.d.ts → agentic-memory-retention-CLwI76JK.d.ts} +2 -2
  33. package/dist/{agentic-memory-retention-Ih1qhX9Z.d.cts → agentic-memory-retention-Cz8GR6ie.d.cts} +2 -2
  34. package/dist/{agentic-memory-types-FnnYlVUs.d.cts → agentic-memory-types-JDr7MPhh.d.cts} +2 -2
  35. package/dist/{agentic-memory-types-CVSUS6XR.d.ts → agentic-memory-types-khYJgzKL.d.ts} +2 -2
  36. package/dist/{capability-admission-lwSecxXs.d.cts → capability-admission-B8RNFyaZ.d.cts} +3 -3
  37. package/dist/{capability-admission-BW2CziT6.d.ts → capability-admission-Dkw1Xz3r.d.ts} +3 -3
  38. package/dist/{chunk-SIDJO2T4.js → chunk-3J7UPZL5.js} +6 -6
  39. package/dist/{chunk-ECURQ3HD.js → chunk-3LYI6ADX.js} +4 -4
  40. package/dist/chunk-3LYI6ADX.js.map +1 -0
  41. package/dist/{chunk-M7J6Z4IJ.js → chunk-4M37FH2I.js} +2 -2
  42. package/dist/chunk-4M37FH2I.js.map +1 -0
  43. package/dist/{chunk-CJIFGJQG.js → chunk-54WPEODM.js} +2 -2
  44. package/dist/chunk-54WPEODM.js.map +1 -0
  45. package/dist/{chunk-CX6B6PO2.js → chunk-DKFWDTVY.js} +2 -2
  46. package/dist/chunk-DKFWDTVY.js.map +1 -0
  47. package/dist/{chunk-SHZDP2MQ.js → chunk-GXU6WFEJ.js} +1 -1
  48. package/dist/chunk-GXU6WFEJ.js.map +1 -0
  49. package/dist/{chunk-YDWBXXQZ.js → chunk-KFURM6FM.js} +3 -3
  50. package/dist/{chunk-STXRMPW4.js → chunk-MCOFHMUU.js} +2 -2
  51. package/dist/{chunk-EOKT4QFF.js → chunk-NNDIFUKX.js} +3 -3
  52. package/dist/chunk-NNDIFUKX.js.map +1 -0
  53. package/dist/{chunk-TPND5MJS.js → chunk-PUSRRALM.js} +3 -3
  54. package/dist/{chunk-7HZRJMN6.js → chunk-UEMN5URK.js} +2 -2
  55. package/dist/{chunk-2NJP6GO4.js → chunk-WOS7RJYZ.js} +2 -2
  56. package/dist/composition/index.cjs.map +1 -1
  57. package/dist/composition/index.d.cts +3 -3
  58. package/dist/composition/index.d.ts +3 -3
  59. package/dist/composition/index.js +3 -3
  60. package/dist/core/index.cjs.map +1 -1
  61. package/dist/core/index.d.cts +23 -2
  62. package/dist/core/index.d.ts +23 -2
  63. package/dist/core/index.js +1 -1
  64. package/dist/cqrs/index.d.cts +3 -3
  65. package/dist/cqrs/index.d.ts +3 -3
  66. package/dist/cqrs/messaging.d.cts +4 -4
  67. package/dist/cqrs/messaging.d.ts +4 -4
  68. package/dist/cqrs/work-queue.d.cts +5 -5
  69. package/dist/cqrs/work-queue.d.ts +5 -5
  70. package/dist/data-structures/index.cjs.map +1 -1
  71. package/dist/data-structures/index.d.cts +8 -8
  72. package/dist/data-structures/index.d.ts +8 -8
  73. package/dist/data-structures/index.js +4 -4
  74. package/dist/{describe-CQRrkv-Q.d.cts → describe-BumQ-3_0.d.cts} +1 -1
  75. package/dist/{describe-B_A5fbXH.d.ts → describe-cYr_Z5zm.d.ts} +1 -1
  76. package/dist/executors/tool-provider-adapters.d.cts +7 -7
  77. package/dist/executors/tool-provider-adapters.d.ts +7 -7
  78. package/dist/executors/tool-provider-adapters.js +5 -5
  79. package/dist/executors/tool-provider-runtime.cjs.map +1 -1
  80. package/dist/executors/tool-provider-runtime.d.cts +8 -8
  81. package/dist/executors/tool-provider-runtime.d.ts +8 -8
  82. package/dist/executors/tool-provider-runtime.js +2 -2
  83. package/dist/executors/tool-provider.cjs.map +1 -1
  84. package/dist/executors/tool-provider.d.cts +7 -7
  85. package/dist/executors/tool-provider.d.ts +7 -7
  86. package/dist/executors/tool-provider.js +2 -2
  87. package/dist/executors/work-queue.d.cts +6 -6
  88. package/dist/executors/work-queue.d.ts +6 -6
  89. package/dist/graph/index.cjs.map +1 -1
  90. package/dist/graph/index.d.cts +9 -9
  91. package/dist/graph/index.d.ts +9 -9
  92. package/dist/graph/index.js +7 -7
  93. package/dist/{graph-CWK3HLPB.d.cts → graph-C1C-wb0L.d.cts} +135 -8
  94. package/dist/{graph-ho5sotHP.d.ts → graph-CS0b4V9B.d.ts} +135 -8
  95. package/dist/{index-CQWcE0Dw.d.ts → index-DLrNopda.d.cts} +135 -8
  96. package/dist/{index-DHA1i67c.d.cts → index-DzJni3_6.d.ts} +135 -8
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.cts +12 -12
  99. package/dist/index.d.ts +12 -12
  100. package/dist/index.js +13 -13
  101. package/dist/inspection/boundary.d.cts +4 -4
  102. package/dist/inspection/boundary.d.ts +4 -4
  103. package/dist/{measurements-OMpCeBwh.d.ts → measurements-BWAnochv.d.ts} +139 -9
  104. package/dist/{measurements-C0mAvWU1.d.cts → measurements-B_gJfD8h.d.cts} +139 -9
  105. package/dist/messaging/index.d.cts +5 -5
  106. package/dist/messaging/index.d.ts +5 -5
  107. package/dist/operators/index.cjs.map +1 -1
  108. package/dist/operators/index.d.cts +5 -5
  109. package/dist/operators/index.d.ts +5 -5
  110. package/dist/operators/index.js +4 -4
  111. package/dist/orchestration/index.cjs.map +1 -1
  112. package/dist/orchestration/index.d.cts +12 -12
  113. package/dist/orchestration/index.d.ts +12 -12
  114. package/dist/orchestration/index.js +5 -5
  115. package/dist/orchestration/messaging.d.cts +5 -5
  116. package/dist/orchestration/messaging.d.ts +5 -5
  117. package/dist/orchestration/work-queue.d.cts +8 -8
  118. package/dist/orchestration/work-queue.d.ts +8 -8
  119. package/dist/patterns/event-flow.d.cts +4 -4
  120. package/dist/patterns/event-flow.d.ts +4 -4
  121. package/dist/patterns/index.d.cts +6 -6
  122. package/dist/patterns/index.d.ts +6 -6
  123. package/dist/{process-types-h3uRlzDc.d.cts → process-types-BB7oRhX3.d.cts} +1 -1
  124. package/dist/{process-types-C9uMYz3i.d.ts → process-types-QNhyoYJ8.d.ts} +1 -1
  125. package/dist/{reactive-collection-B9R0Bl1P.d.cts → reactive-collection-BYlWvtnp.d.cts} +3 -3
  126. package/dist/{reactive-collection-BXFrH0U2.d.ts → reactive-collection-efOEdGFN.d.ts} +3 -3
  127. package/dist/{reactive-collection-storage-BLGv8Xp8.d.cts → reactive-collection-storage-BjoLsoiC.d.cts} +5 -5
  128. package/dist/{reactive-collection-storage-a4zD3665.d.ts → reactive-collection-storage-DwW6UuK_.d.ts} +5 -5
  129. package/dist/{reactive-map-jle5dnok.d.ts → reactive-map-BHacbIqz.d.cts} +7 -3
  130. package/dist/{reactive-map-C_8sOfdS.d.cts → reactive-map-DN4Jyqnf.d.ts} +7 -3
  131. package/dist/render/index.d.cts +2 -2
  132. package/dist/render/index.d.ts +2 -2
  133. package/dist/{scheduled-readiness-5rwQlyjV.d.ts → scheduled-readiness-BmqXxnzX.d.ts} +3 -3
  134. package/dist/{scheduled-readiness-DpRY8jI0.d.cts → scheduled-readiness-CYSw7KDE.d.cts} +3 -3
  135. package/dist/{semantic-memory-graph-DlZBD_Eu.d.cts → semantic-memory-graph-B_LwbM-E.d.cts} +2 -2
  136. package/dist/{semantic-memory-graph-C2ZUwIlq.d.ts → semantic-memory-graph-rsFNNhwn.d.ts} +2 -2
  137. package/dist/{semantic-memory-graph-types-BvzdqmkY.d.cts → semantic-memory-graph-types-Y73bbwVI.d.cts} +1 -1
  138. package/dist/{semantic-memory-graph-types-Ci-OtahO.d.ts → semantic-memory-graph-types-safmPkuX.d.ts} +1 -1
  139. package/dist/solutions/index.cjs.map +1 -1
  140. package/dist/solutions/index.d.cts +11 -11
  141. package/dist/solutions/index.d.ts +11 -11
  142. package/dist/solutions/index.js +2 -2
  143. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -1
  144. package/dist/solutions/reactive-layout/browser/index.d.cts +4 -4
  145. package/dist/solutions/reactive-layout/browser/index.d.ts +4 -4
  146. package/dist/solutions/reactive-layout/browser/index.js +2 -2
  147. package/dist/solutions/reactive-layout/index.cjs.map +1 -1
  148. package/dist/solutions/reactive-layout/index.d.cts +6 -6
  149. package/dist/solutions/reactive-layout/index.d.ts +6 -6
  150. package/dist/solutions/reactive-layout/index.js +2 -2
  151. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -1
  152. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +4 -4
  153. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +4 -4
  154. package/dist/solutions/reactive-layout/node-canvas/index.js +2 -2
  155. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -1
  156. package/dist/solutions/reactive-layout/react-native/index.d.cts +4 -4
  157. package/dist/solutions/reactive-layout/react-native/index.d.ts +4 -4
  158. package/dist/solutions/reactive-layout/react-native/index.js +2 -2
  159. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -1
  160. package/dist/solutions/reactive-layout/skia/index.d.cts +4 -4
  161. package/dist/solutions/reactive-layout/skia/index.d.ts +4 -4
  162. package/dist/solutions/reactive-layout/skia/index.js +2 -2
  163. package/dist/solutions/work-item/actions.d.cts +10 -10
  164. package/dist/solutions/work-item/actions.d.ts +10 -10
  165. package/dist/solutions/work-item/scheduling.d.cts +9 -9
  166. package/dist/solutions/work-item/scheduling.d.ts +9 -9
  167. package/dist/solutions/work-item/work-queue.d.cts +7 -7
  168. package/dist/solutions/work-item/work-queue.d.ts +7 -7
  169. package/dist/sources/browser.cjs.map +1 -1
  170. package/dist/sources/browser.d.cts +22 -6
  171. package/dist/sources/browser.d.ts +22 -6
  172. package/dist/sources/browser.js +3 -3
  173. package/dist/sources/browser.js.map +1 -1
  174. package/dist/sources/index.cjs.map +1 -1
  175. package/dist/sources/index.d.cts +4 -4
  176. package/dist/sources/index.d.ts +4 -4
  177. package/dist/sources/index.js +3 -3
  178. package/dist/sources/node.d.cts +3 -3
  179. package/dist/sources/node.d.ts +3 -3
  180. package/dist/storage/index.d.cts +5 -5
  181. package/dist/storage/index.d.ts +5 -5
  182. package/dist/{store-BmtEs9mG.d.ts → store-6_CHF6Ge.d.ts} +1 -1
  183. package/dist/{store-PAAsYvML.d.cts → store-BljX8RkQ.d.cts} +1 -1
  184. package/dist/{types-BhveCMg5.d.cts → types-BAw2QVVE.d.cts} +1 -1
  185. package/dist/{types-XDoqxYO9.d.cts → types-BUbbbh4f.d.cts} +1 -1
  186. package/dist/{types-BWK2ay3e.d.cts → types-CMnzoL54.d.cts} +2 -2
  187. package/dist/{types-BS6CyR-x.d.cts → types-CTN3XoMl.d.cts} +30 -0
  188. package/dist/{types-BXKSAoE1.d.cts → types-CV_ohy5T.d.cts} +2 -2
  189. package/dist/{types-C9NOgNJw.d.ts → types-DChxk1vK.d.ts} +30 -0
  190. package/dist/{types-CTsQ8Ww4.d.ts → types-DRu7SnLV.d.ts} +1 -1
  191. package/dist/{types-DL_05n2M.d.ts → types-DeID_FRl.d.ts} +1 -1
  192. package/dist/{types-BRNKoFHj.d.ts → types-IhKH0hGW.d.ts} +2 -2
  193. package/dist/{types-BaPpZItj.d.ts → types-ePlD2uyT.d.ts} +2 -2
  194. package/dist/{work-item-runtime-types-CHO03AKh.d.cts → work-item-runtime-types-BTxLskN5.d.cts} +2 -2
  195. package/dist/{work-item-runtime-types-BqtWnSCS.d.ts → work-item-runtime-types-DAsZbb2y.d.ts} +2 -2
  196. package/dist/work-queue/index.d.cts +6 -6
  197. package/dist/work-queue/index.d.ts +6 -6
  198. package/package.json +9 -1
  199. package/dist/chunk-CJIFGJQG.js.map +0 -1
  200. package/dist/chunk-CX6B6PO2.js.map +0 -1
  201. package/dist/chunk-ECURQ3HD.js.map +0 -1
  202. package/dist/chunk-EOKT4QFF.js.map +0 -1
  203. package/dist/chunk-M7J6Z4IJ.js.map +0 -1
  204. package/dist/chunk-SHZDP2MQ.js.map +0 -1
  205. /package/dist/{chunk-SIDJO2T4.js.map → chunk-3J7UPZL5.js.map} +0 -0
  206. /package/dist/{chunk-YDWBXXQZ.js.map → chunk-KFURM6FM.js.map} +0 -0
  207. /package/dist/{chunk-STXRMPW4.js.map → chunk-MCOFHMUU.js.map} +0 -0
  208. /package/dist/{chunk-TPND5MJS.js.map → chunk-PUSRRALM.js.map} +0 -0
  209. /package/dist/{chunk-7HZRJMN6.js.map → chunk-UEMN5URK.js.map} +0 -0
  210. /package/dist/{chunk-2NJP6GO4.js.map → chunk-WOS7RJYZ.js.map} +0 -0
@@ -1,10 +1,10 @@
1
- import { L as Operator } from '../graph-CWK3HLPB.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-BS6CyR-x.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-DHA1i67c.cjs';
1
+ import { L as Operator } from '../graph-C1C-wb0L.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-CTN3XoMl.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-DLrNopda.cjs';
4
4
  import '../core/index.cjs';
5
5
  import '../messages-CAzUPPJM.cjs';
6
6
  import '../codec-BB7p8fJc.cjs';
7
- import '../describe-CQRrkv-Q.cjs';
7
+ import '../describe-BumQ-3_0.cjs';
8
8
 
9
9
  /**
10
10
  * Browser-safe source factories. This subpath intentionally excludes
@@ -49,8 +49,24 @@ interface FromRafOptions {
49
49
  /**
50
50
  * Browser animation-frame source.
51
51
  *
52
- * This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp
53
- * enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.
52
+ * @param opts - Optional scheduler, fallback timer cadence, visibility document, and strict
53
+ * background parking flag.
54
+ * @returns An open-ended source operator that emits animation-frame timestamps as `DATA`.
55
+ * @example
56
+ * ```ts
57
+ * import { graph } from "@graphrefly/ts";
58
+ * import { fromRaf } from "@graphrefly/ts/sources/browser";
59
+ *
60
+ * const frames = graph().initNode(fromRaf({ pauseWhenHidden: true }), [], { name: "frames" });
61
+ * frames.subscribe((time) => {
62
+ * console.log("frame", time);
63
+ * });
64
+ * ```
65
+ * @remarks **Browser boundary:** Each frame timestamp enters the graph as `DATA` through `ctx.down`,
66
+ * and teardown cancels the pending host callback.
67
+ * @remarks **Hidden tabs:** `pauseWhenHidden: true` parks completely while the document is hidden;
68
+ * the default preserves the timer fallback behavior.
69
+ * @category sources
54
70
  */
55
71
  declare function fromRaf(opts?: FromRafOptions): Operator<never, number>;
56
72
  /** Wrap an IndexedDB request as a one-shot source. */
@@ -1,10 +1,10 @@
1
- import { L as Operator } from '../graph-ho5sotHP.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-C9NOgNJw.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-CQWcE0Dw.js';
1
+ import { L as Operator } from '../graph-CS0b4V9B.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-DChxk1vK.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-DzJni3_6.js';
4
4
  import '../core/index.js';
5
5
  import '../messages-CAzUPPJM.js';
6
6
  import '../codec-BB7p8fJc.js';
7
- import '../describe-B_A5fbXH.js';
7
+ import '../describe-cYr_Z5zm.js';
8
8
 
9
9
  /**
10
10
  * Browser-safe source factories. This subpath intentionally excludes
@@ -49,8 +49,24 @@ interface FromRafOptions {
49
49
  /**
50
50
  * Browser animation-frame source.
51
51
  *
52
- * This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp
53
- * enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.
52
+ * @param opts - Optional scheduler, fallback timer cadence, visibility document, and strict
53
+ * background parking flag.
54
+ * @returns An open-ended source operator that emits animation-frame timestamps as `DATA`.
55
+ * @example
56
+ * ```ts
57
+ * import { graph } from "@graphrefly/ts";
58
+ * import { fromRaf } from "@graphrefly/ts/sources/browser";
59
+ *
60
+ * const frames = graph().initNode(fromRaf({ pauseWhenHidden: true }), [], { name: "frames" });
61
+ * frames.subscribe((time) => {
62
+ * console.log("frame", time);
63
+ * });
64
+ * ```
65
+ * @remarks **Browser boundary:** Each frame timestamp enters the graph as `DATA` through `ctx.down`,
66
+ * and teardown cancels the pending host callback.
67
+ * @remarks **Hidden tabs:** `pauseWhenHidden: true` parks completely while the document is hidden;
68
+ * the default preserves the timer fallback behavior.
69
+ * @category sources
54
70
  */
55
71
  declare function fromRaf(opts?: FromRafOptions): Operator<never, number>;
56
72
  /** Wrap an IndexedDB request as a one-shot source. */
@@ -26,9 +26,9 @@ import {
26
26
  singleFromAny,
27
27
  throwError,
28
28
  timer
29
- } from "../chunk-CX6B6PO2.js";
30
- import "../chunk-CJIFGJQG.js";
31
- import "../chunk-SHZDP2MQ.js";
29
+ } from "../chunk-DKFWDTVY.js";
30
+ import "../chunk-54WPEODM.js";
31
+ import "../chunk-GXU6WFEJ.js";
32
32
  import "../chunk-WQIA3GFB.js";
33
33
  import {
34
34
  errorPayload
@@ -1 +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\nexport type AnimationFrameHandle = number | ReturnType<typeof setTimeout>;\n\nexport interface AnimationFrameScheduler {\n\trequestAnimationFrame(callback: (time: number) => void): AnimationFrameHandle;\n\tcancelAnimationFrame(handle: AnimationFrameHandle): void;\n}\n\nexport interface VisibilityDocumentLike {\n\treadonly visibilityState?: \"hidden\" | \"visible\" | \"prerender\" | string;\n\taddEventListener?(type: \"visibilitychange\", listener: () => void): void;\n\tremoveEventListener?(type: \"visibilitychange\", listener: () => void): void;\n}\n\nexport interface FromRafOptions {\n\t/** Custom scheduler for tests or host wrappers. Defaults to browser rAF, then a timer fallback. */\n\treadonly scheduler?: AnimationFrameScheduler;\n\t/** Timer fallback cadence when requestAnimationFrame is unavailable. Default: 16ms. */\n\treadonly fallbackMs?: number;\n\t/** Fully park while the provided/browser document is hidden. Default: false. */\n\treadonly pauseWhenHidden?: boolean;\n\t/** Document-like visibility source for tests or embedded browser hosts. */\n\treadonly document?: VisibilityDocumentLike;\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\nfunction defaultAnimationFrameScheduler(fallbackMs: number): AnimationFrameScheduler {\n\tconst host = globalThis as {\n\t\trequestAnimationFrame?: (callback: (time: number) => void) => number;\n\t\tcancelAnimationFrame?: (handle: number) => void;\n\t};\n\tif (\n\t\ttypeof host.requestAnimationFrame === \"function\" &&\n\t\ttypeof host.cancelAnimationFrame === \"function\"\n\t) {\n\t\treturn {\n\t\t\trequestAnimationFrame: (callback) => host.requestAnimationFrame?.(callback) ?? 0,\n\t\t\tcancelAnimationFrame: (handle) => {\n\t\t\t\tif (typeof handle === \"number\") host.cancelAnimationFrame?.(handle);\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\trequestAnimationFrame(callback) {\n\t\t\treturn setTimeout(() => callback(Date.now()), fallbackMs);\n\t\t},\n\t\tcancelAnimationFrame(handle) {\n\t\t\tclearTimeout(handle);\n\t\t},\n\t};\n}\n\nfunction defaultVisibilityDocument(): VisibilityDocumentLike | undefined {\n\treturn (globalThis as { document?: VisibilityDocumentLike }).document;\n}\n\n/**\n * Browser animation-frame source.\n *\n * This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp\n * enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.\n */\nexport function fromRaf(opts: FromRafOptions = {}): Operator<never, number> {\n\tconst fallbackMsOpt = opts.fallbackMs;\n\tconst fallbackMs =\n\t\tNumber.isFinite(fallbackMsOpt) && fallbackMsOpt !== undefined && fallbackMsOpt > 0\n\t\t\t? fallbackMsOpt\n\t\t\t: 16;\n\tconst scheduler = opts.scheduler ?? defaultAnimationFrameScheduler(fallbackMs);\n\tconst visibilityDocument = opts.document ?? defaultVisibilityDocument();\n\treturn {\n\t\tfactory: \"fromRaf\",\n\t\topts: { pool: \"sync\", pausable: false },\n\t\tbody: (ctx) => {\n\t\t\tlet active = true;\n\t\t\tlet frame: AnimationFrameHandle | undefined;\n\t\t\tconst cancelPending = () => {\n\t\t\t\tif (frame === undefined) return;\n\t\t\t\tscheduler.cancelAnimationFrame(frame);\n\t\t\t\tframe = undefined;\n\t\t\t};\n\t\t\tconst isHidden = () =>\n\t\t\t\topts.pauseWhenHidden === true && visibilityDocument?.visibilityState === \"hidden\";\n\t\t\tconst schedule = () => {\n\t\t\t\tif (!active || frame !== undefined || isHidden()) return;\n\t\t\t\tframe = scheduler.requestAnimationFrame((time) => {\n\t\t\t\t\tframe = undefined;\n\t\t\t\t\tif (!active || isHidden()) return;\n\t\t\t\t\tctx.down([[\"DATA\", Number.isFinite(time) ? time : Date.now()]]);\n\t\t\t\t\tschedule();\n\t\t\t\t});\n\t\t\t};\n\t\t\tconst onVisibilityChange = () => {\n\t\t\t\tif (!active) return;\n\t\t\t\tif (isHidden()) cancelPending();\n\t\t\t\telse schedule();\n\t\t\t};\n\t\t\tif (\n\t\t\t\topts.pauseWhenHidden === true &&\n\t\t\t\tvisibilityDocument?.addEventListener &&\n\t\t\t\tvisibilityDocument.removeEventListener\n\t\t\t) {\n\t\t\t\tvisibilityDocument.addEventListener(\"visibilitychange\", onVisibilityChange);\n\t\t\t}\n\t\t\tctx.onDeactivation(() => {\n\t\t\t\tactive = false;\n\t\t\t\tcancelPending();\n\t\t\t\tvisibilityDocument?.removeEventListener?.(\"visibilitychange\", onVisibilityChange);\n\t\t\t});\n\t\t\tschedule();\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":";;;;;;;;;;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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":[]}
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\nexport type AnimationFrameHandle = number | ReturnType<typeof setTimeout>;\n\nexport interface AnimationFrameScheduler {\n\trequestAnimationFrame(callback: (time: number) => void): AnimationFrameHandle;\n\tcancelAnimationFrame(handle: AnimationFrameHandle): void;\n}\n\nexport interface VisibilityDocumentLike {\n\treadonly visibilityState?: \"hidden\" | \"visible\" | \"prerender\" | string;\n\taddEventListener?(type: \"visibilitychange\", listener: () => void): void;\n\tremoveEventListener?(type: \"visibilitychange\", listener: () => void): void;\n}\n\nexport interface FromRafOptions {\n\t/** Custom scheduler for tests or host wrappers. Defaults to browser rAF, then a timer fallback. */\n\treadonly scheduler?: AnimationFrameScheduler;\n\t/** Timer fallback cadence when requestAnimationFrame is unavailable. Default: 16ms. */\n\treadonly fallbackMs?: number;\n\t/** Fully park while the provided/browser document is hidden. Default: false. */\n\treadonly pauseWhenHidden?: boolean;\n\t/** Document-like visibility source for tests or embedded browser hosts. */\n\treadonly document?: VisibilityDocumentLike;\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\nfunction defaultAnimationFrameScheduler(fallbackMs: number): AnimationFrameScheduler {\n\tconst host = globalThis as {\n\t\trequestAnimationFrame?: (callback: (time: number) => void) => number;\n\t\tcancelAnimationFrame?: (handle: number) => void;\n\t};\n\tif (\n\t\ttypeof host.requestAnimationFrame === \"function\" &&\n\t\ttypeof host.cancelAnimationFrame === \"function\"\n\t) {\n\t\treturn {\n\t\t\trequestAnimationFrame: (callback) => host.requestAnimationFrame?.(callback) ?? 0,\n\t\t\tcancelAnimationFrame: (handle) => {\n\t\t\t\tif (typeof handle === \"number\") host.cancelAnimationFrame?.(handle);\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\trequestAnimationFrame(callback) {\n\t\t\treturn setTimeout(() => callback(Date.now()), fallbackMs);\n\t\t},\n\t\tcancelAnimationFrame(handle) {\n\t\t\tclearTimeout(handle);\n\t\t},\n\t};\n}\n\nfunction defaultVisibilityDocument(): VisibilityDocumentLike | undefined {\n\treturn (globalThis as { document?: VisibilityDocumentLike }).document;\n}\n\n/**\n * Browser animation-frame source.\n *\n * @param opts - Optional scheduler, fallback timer cadence, visibility document, and strict\n * background parking flag.\n * @returns An open-ended source operator that emits animation-frame timestamps as `DATA`.\n * @example\n * ```ts\n * import { graph } from \"@graphrefly/ts\";\n * import { fromRaf } from \"@graphrefly/ts/sources/browser\";\n *\n * const frames = graph().initNode(fromRaf({ pauseWhenHidden: true }), [], { name: \"frames\" });\n * frames.subscribe((time) => {\n * console.log(\"frame\", time);\n * });\n * ```\n * @remarks **Browser boundary:** Each frame timestamp enters the graph as `DATA` through `ctx.down`,\n * and teardown cancels the pending host callback.\n * @remarks **Hidden tabs:** `pauseWhenHidden: true` parks completely while the document is hidden;\n * the default preserves the timer fallback behavior.\n * @category sources\n */\nexport function fromRaf(opts: FromRafOptions = {}): Operator<never, number> {\n\tconst fallbackMsOpt = opts.fallbackMs;\n\tconst fallbackMs =\n\t\tNumber.isFinite(fallbackMsOpt) && fallbackMsOpt !== undefined && fallbackMsOpt > 0\n\t\t\t? fallbackMsOpt\n\t\t\t: 16;\n\tconst scheduler = opts.scheduler ?? defaultAnimationFrameScheduler(fallbackMs);\n\tconst visibilityDocument = opts.document ?? defaultVisibilityDocument();\n\treturn {\n\t\tfactory: \"fromRaf\",\n\t\topts: { pool: \"sync\", pausable: false },\n\t\tbody: (ctx) => {\n\t\t\tlet active = true;\n\t\t\tlet frame: AnimationFrameHandle | undefined;\n\t\t\tconst cancelPending = () => {\n\t\t\t\tif (frame === undefined) return;\n\t\t\t\tscheduler.cancelAnimationFrame(frame);\n\t\t\t\tframe = undefined;\n\t\t\t};\n\t\t\tconst isHidden = () =>\n\t\t\t\topts.pauseWhenHidden === true && visibilityDocument?.visibilityState === \"hidden\";\n\t\t\tconst schedule = () => {\n\t\t\t\tif (!active || frame !== undefined || isHidden()) return;\n\t\t\t\tframe = scheduler.requestAnimationFrame((time) => {\n\t\t\t\t\tframe = undefined;\n\t\t\t\t\tif (!active || isHidden()) return;\n\t\t\t\t\tctx.down([[\"DATA\", Number.isFinite(time) ? time : Date.now()]]);\n\t\t\t\t\tschedule();\n\t\t\t\t});\n\t\t\t};\n\t\t\tconst onVisibilityChange = () => {\n\t\t\t\tif (!active) return;\n\t\t\t\tif (isHidden()) cancelPending();\n\t\t\t\telse schedule();\n\t\t\t};\n\t\t\tif (\n\t\t\t\topts.pauseWhenHidden === true &&\n\t\t\t\tvisibilityDocument?.addEventListener &&\n\t\t\t\tvisibilityDocument.removeEventListener\n\t\t\t) {\n\t\t\t\tvisibilityDocument.addEventListener(\"visibilitychange\", onVisibilityChange);\n\t\t\t}\n\t\t\tctx.onDeactivation(() => {\n\t\t\t\tactive = false;\n\t\t\t\tcancelPending();\n\t\t\t\tvisibilityDocument?.removeEventListener?.(\"visibilitychange\", onVisibilityChange);\n\t\t\t});\n\t\t\tschedule();\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAS,OACR,SACA,OACqB;AACrB,SAAO;AAAA,IACN;AAAA,IACA,MAAM,CAAC,QAAQ;AACd,YAAM,UAAU,MAAM,GAAG;AACzB,UAAI,OAAO,YAAY,W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