@graphrefly/graphrefly 0.28.0 → 0.30.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.
- package/dist/{cascading-D9WG1-9L.d.ts → cascading-BszPheHD.d.ts} +1 -1
- package/dist/{cascading-B-5zmAUv.d.cts → cascading-dNCtjW8j.d.cts} +1 -1
- package/dist/{chunk-OAWLCNJJ.js → chunk-2GQREQ6C.js} +1 -1
- package/dist/{chunk-DBGGMN3D.js → chunk-33FA6V4B.js} +1 -1
- package/dist/chunk-3NEPQO2E.js +43 -0
- package/dist/{chunk-UWJE5FQA.js → chunk-4C2OR2GH.js} +11 -11
- package/dist/chunk-4JJCCD5S.js +2 -0
- package/dist/{chunk-GHJJR5P4.js → chunk-4OFIQ66T.js} +1 -1
- package/dist/{chunk-PIOGHC63.js → chunk-567NWZ3T.js} +1 -1
- package/dist/chunk-5JDE5JHE.js +1 -0
- package/dist/{chunk-ETWTCCJI.js → chunk-5Z4HDCO6.js} +1 -1
- package/dist/{chunk-Y2EMPB3I.js → chunk-73Z3W2RN.js} +1 -1
- package/dist/{chunk-CRXTH3SH.js → chunk-7JDLFI6N.js} +1 -1
- package/dist/{chunk-DQA3UIQ2.js → chunk-7TDOES3L.js} +1 -1
- package/dist/{chunk-LBTDSCCO.js → chunk-AMBYCIOH.js} +1 -1
- package/dist/{chunk-D7A7DBE4.js → chunk-AUY2YKCO.js} +1 -1
- package/dist/{chunk-FNYWM6JC.js → chunk-AV3PIDFQ.js} +1 -1
- package/dist/{chunk-UMBIDLJ4.js → chunk-BA5URFYW.js} +1 -1
- package/dist/chunk-BKPLTBL5.js +1 -0
- package/dist/{chunk-UPXUCFMX.js → chunk-BZP5T4X6.js} +1 -1
- package/dist/{chunk-WQ2BN6X6.js → chunk-DDPYNMGG.js} +1 -1
- package/dist/{chunk-LQ3Y5NJS.js → chunk-GJR3P6JG.js} +1 -1
- package/dist/{chunk-3R5HFPX7.js → chunk-GLSM33ZM.js} +1 -1
- package/dist/{chunk-2FOAM3OR.js → chunk-GNCBXARM.js} +1 -1
- package/dist/{chunk-K2GNMCQT.js → chunk-ISCENNXS.js} +1 -1
- package/dist/{chunk-UPHHLMHE.js → chunk-IUK4EFCE.js} +1 -1
- package/dist/{chunk-ERLIRFPA.js → chunk-KA6MMXIY.js} +1 -1
- package/dist/{chunk-2PMCKKRK.js → chunk-KASHOCF5.js} +1 -1
- package/dist/chunk-LI3E75VE.js +64 -0
- package/dist/chunk-MGKAO4EK.js +7 -0
- package/dist/{chunk-ZV2DXV5A.js → chunk-NSG4C6BF.js} +1 -1
- package/dist/{chunk-4GKB4OUJ.js → chunk-OL33ZI6R.js} +1 -1
- package/dist/{chunk-76A3HVQE.js → chunk-P7JXGKDO.js} +1 -1
- package/dist/{chunk-U3AICJKU.js → chunk-RD52SNH2.js} +1 -1
- package/dist/{chunk-CWLN3X3N.js → chunk-SHYH5SXV.js} +1 -1
- package/dist/{chunk-VTPVOGHH.js → chunk-SLMYTGTU.js} +1 -1
- package/dist/{chunk-OYHGKYQM.js → chunk-T5SHIKJD.js} +1 -1
- package/dist/{chunk-VPYBOXVT.js → chunk-TWMEGG45.js} +1 -1
- package/dist/chunk-VIEUJSTT.js +1 -0
- package/dist/{chunk-SC3U7ETD.js → chunk-VWPRPPKR.js} +1 -1
- package/dist/chunk-W4TSQ6RJ.js +1 -0
- package/dist/{chunk-OBKQQA5I.js → chunk-WANIEEKV.js} +1 -1
- package/dist/{chunk-XAUNPIMX.js → chunk-XHVB6G6M.js} +1 -1
- package/dist/{chunk-MIQTDPY4.js → chunk-XQAXYVXX.js} +1 -1
- package/dist/{chunk-MTTAAPCK.js → chunk-Y32RJO24.js} +1 -1
- package/dist/{chunk-S35VARIR.js → chunk-Y36UZ5VS.js} +1 -1
- package/dist/compat/index.cjs +13 -12
- package/dist/compat/index.d.cts +14 -14
- package/dist/compat/index.d.ts +14 -14
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.cjs +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -1
- package/dist/compat/nanostores/index.cjs +1 -1
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -1
- package/dist/compat/nestjs/index.cjs +13 -12
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +7 -6
- package/dist/compat/zustand/index.d.cts +4 -4
- package/dist/compat/zustand/index.d.ts +4 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-BhbKHbOS.d.ts → composite-DGspwCqk.d.ts} +2 -2
- package/dist/{composite-B-xqw4Kk.d.cts → composite-nrRumJ7l.d.cts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -1
- package/dist/extra/browser.cjs +1 -1
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/browser.js +1 -1
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.d.cts +9 -9
- package/dist/extra/index.d.ts +9 -9
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +3 -3
- package/dist/extra/node.d.cts +1 -1
- package/dist/extra/node.d.ts +1 -1
- package/dist/extra/node.js +1 -1
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.cjs +1 -1
- package/dist/extra/storage-browser.d.cts +1 -1
- package/dist/extra/storage-browser.d.ts +1 -1
- package/dist/extra/storage-browser.js +1 -1
- package/dist/graph/index.cjs +7 -6
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-D48Qw9Cg.d.cts → graph-C4Uxwv0T.d.cts} +22 -6
- package/dist/{graph-BZGRXwOm.d.ts → graph-CWeI0aHd.d.ts} +22 -6
- package/dist/{index-u15meRxL.d.cts → index-9iguV3bF.d.cts} +2 -2
- package/dist/{index-DyxjtScX.d.cts → index-B-z8WaSd.d.cts} +2 -2
- package/dist/{index-BgyGlizc.d.ts → index-B2HBxvMb.d.ts} +4 -4
- package/dist/{index-CzobVSMr.d.ts → index-B5iVOD7w.d.ts} +2 -2
- package/dist/{index-rX8HBM5h.d.cts → index-B8Aj_z8S.d.cts} +2 -2
- package/dist/{index-D-YB-Vl3.d.ts → index-BANwzwBV.d.ts} +3 -3
- package/dist/{index-HDpJe9hX.d.ts → index-BBINVimG.d.ts} +3 -3
- package/dist/{index-8FSVk4Uf.d.ts → index-BEpRsvhg.d.ts} +4 -4
- package/dist/{index-CHEswufn.d.cts → index-BHu_Wba0.d.cts} +4 -4
- package/dist/{index-ZftwfxJM.d.ts → index-BJHQUCZx.d.ts} +7 -7
- package/dist/{index-DUqMOlKZ.d.cts → index-BS220yqj.d.cts} +7 -7
- package/dist/{index-BWJV63ti.d.ts → index-BX22kvjh.d.ts} +1 -1
- package/dist/{index-DfyOkTvs.d.ts → index-BXbQUn4n.d.ts} +2 -2
- package/dist/{index-O6TgGUBV.d.cts → index-BpFWP7Bq.d.cts} +3 -3
- package/dist/{index-BxJ86YZZ.d.cts → index-Bs3-LC83.d.cts} +3 -3
- package/dist/{index-DiOXyAwt.d.ts → index-Bvi5uJxX.d.ts} +1 -1
- package/dist/{index-Bqachn9_.d.ts → index-ByPnK85n.d.ts} +1 -1
- package/dist/{index-CRO83MmV.d.cts → index-BydMDMf7.d.cts} +1 -1
- package/dist/{index-ROpQmGjE.d.ts → index-C5Ghnp5B.d.ts} +3 -3
- package/dist/{index-umtoWT8K.d.ts → index-C6NBfXj-.d.ts} +6 -5
- package/dist/{index-pXrDMpRO.d.cts → index-C98oJsEs.d.cts} +2 -2
- package/dist/{index-B2pwesl9.d.cts → index-CDK5RsV5.d.cts} +1 -1
- package/dist/{index-Czq6ynh8.d.ts → index-CFW32Dy1.d.ts} +3 -3
- package/dist/{index-Cyojz0AE.d.cts → index-CIXaiYDE.d.cts} +1 -1
- package/dist/{index-Oi8d8w4R.d.cts → index-CRAkoq-y.d.cts} +1 -1
- package/dist/{index-CpgYhnrG.d.ts → index-Cc8VQIgL.d.ts} +2 -2
- package/dist/{index-vscRDkjW.d.cts → index-CcpEvuPl.d.cts} +2 -2
- package/dist/{index-BpA5c4G9.d.ts → index-CfFYyLR8.d.ts} +4 -4
- package/dist/{index-9oDeHH2u.d.cts → index-ClB7TCfL.d.cts} +2 -2
- package/dist/{index-BHvIquRZ.d.ts → index-ClgKmOHe.d.ts} +592 -492
- package/dist/{index-DpHe5e0Q.d.ts → index-CotRMjtJ.d.ts} +2 -2
- package/dist/{index-B1AmmSlb.d.ts → index-CrC7urhX.d.ts} +1 -1
- package/dist/{index-B0c4cmIO.d.ts → index-CvS9IuTG.d.ts} +2 -2
- package/dist/{index-rHJSKsU8.d.cts → index-Cy7eFeIX.d.cts} +2 -2
- package/dist/{index-BVHOrDwO.d.ts → index-D0C_USMR.d.ts} +1 -1
- package/dist/{index-DEwTb_fm.d.cts → index-D6ajK8Mh.d.cts} +592 -492
- package/dist/{index-DL-rYJrx.d.cts → index-D7XxY1Ff.d.cts} +1 -1
- package/dist/{index-DAlweici.d.ts → index-D9HrBx2J.d.ts} +2 -2
- package/dist/{index-fM6y00vT.d.cts → index-D9Y_u6BG.d.cts} +3 -3
- package/dist/{index-DcXZBF5a.d.cts → index-DBQUKh59.d.cts} +4 -4
- package/dist/{index-D_NwnRYS.d.cts → index-DDo-eqQ4.d.cts} +1 -1
- package/dist/{index-m-yHof5p.d.ts → index-DGb1awva.d.ts} +4 -4
- package/dist/{index-DxsnAMWD.d.cts → index-DR3gf_DG.d.cts} +9 -9
- package/dist/{index-dtN7YA2x.d.cts → index-DVNLe3pS.d.cts} +3 -3
- package/dist/{index-Btib9rsU.d.ts → index-Dljd76bC.d.ts} +275 -9
- package/dist/{index-DP4ZTkdw.d.ts → index-DnrZghBB.d.ts} +3 -3
- package/dist/{index-DaLJvH8Z.d.ts → index-Docdiu9a.d.ts} +3 -3
- package/dist/{index-BpIFjILY.d.cts → index-DylQCKEL.d.cts} +4 -4
- package/dist/{index-B_agccPe.d.cts → index-FBqTfL_S.d.cts} +1 -1
- package/dist/{index-DraikLjn.d.ts → index-FrYrV-Vf.d.ts} +2 -2
- package/dist/{index-sm373fsH.d.ts → index-IZ3l_vQ9.d.ts} +2 -2
- package/dist/{index-BwM9BEkt.d.ts → index-Ip3q9T9x.d.ts} +1 -1
- package/dist/{index-CloUk1kY.d.ts → index-RQg6lTrN.d.ts} +9 -9
- package/dist/{index-CEXXwWVH.d.cts → index-SSGqF8mI.d.cts} +2 -2
- package/dist/{index-rnwQly8X.d.cts → index-UZO988ox.d.cts} +6 -5
- package/dist/{index-C73n7lo-.d.cts → index-iBp74eGU.d.cts} +3 -3
- package/dist/{index-tbf2gKHd.d.cts → index-lKuLYmHO.d.cts} +3 -3
- package/dist/{index-CMn8S8Hw.d.ts → index-wIx1Jisk.d.ts} +1 -1
- package/dist/{index-cByzxQIC.d.cts → index-yIdWFo2b.d.cts} +4 -4
- package/dist/{index-RukJ4DLS.d.cts → index-ybtSyjWB.d.cts} +275 -9
- package/dist/index.cjs +53 -52
- package/dist/index.d.cts +42 -42
- package/dist/index.d.ts +42 -42
- package/dist/index.js +1 -1
- package/dist/{meta-CwesDrMD.d.ts → meta-BMwx3ExI.d.ts} +1 -1
- package/dist/{meta-Cgj6zeji.d.cts → meta-COtmHLwT.d.cts} +1 -1
- package/dist/{node-Cc1TniY8.d.ts → node-BVV7G1bq.d.cts} +59 -2
- package/dist/{node-Cc1TniY8.d.cts → node-BVV7G1bq.d.ts} +59 -2
- package/dist/{observable-glXQoGj2.d.cts → observable-BrUAPeH_.d.cts} +1 -1
- package/dist/{observable-Ct-gJ9jI.d.ts → observable-ITikPXz3.d.ts} +1 -1
- package/dist/patterns/ai/browser.d.cts +3 -3
- package/dist/patterns/ai/browser.d.ts +3 -3
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +25 -24
- package/dist/patterns/ai/index.d.cts +15 -15
- package/dist/patterns/ai/index.d.ts +15 -15
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.d.cts +1 -1
- package/dist/patterns/ai/node.d.ts +1 -1
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +7 -6
- package/dist/patterns/audit/index.d.cts +5 -5
- package/dist/patterns/audit/index.d.ts +5 -5
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +7 -6
- package/dist/patterns/cqrs/index.d.cts +4 -4
- package/dist/patterns/cqrs/index.d.ts +4 -4
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +8 -7
- package/dist/patterns/demo-shell/index.d.cts +5 -5
- package/dist/patterns/demo-shell/index.d.ts +5 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +7 -6
- package/dist/patterns/domain-templates/index.d.cts +4 -4
- package/dist/patterns/domain-templates/index.d.ts +4 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +26 -25
- package/dist/patterns/graphspec/index.d.cts +4 -4
- package/dist/patterns/graphspec/index.d.ts +4 -4
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -6
- package/dist/patterns/guarded-execution/index.d.cts +6 -6
- package/dist/patterns/guarded-execution/index.d.ts +6 -6
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +11 -10
- package/dist/patterns/harness/index.d.cts +10 -7
- package/dist/patterns/harness/index.d.ts +10 -7
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -6
- package/dist/patterns/job-queue/index.d.cts +4 -4
- package/dist/patterns/job-queue/index.d.ts +4 -4
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +7 -6
- package/dist/patterns/lens/index.d.cts +6 -6
- package/dist/patterns/lens/index.d.ts +6 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +7 -6
- package/dist/patterns/memory/index.d.cts +4 -4
- package/dist/patterns/memory/index.d.ts +4 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +7 -6
- package/dist/patterns/messaging/index.d.cts +4 -4
- package/dist/patterns/messaging/index.d.ts +4 -4
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +7 -6
- package/dist/patterns/orchestration/index.d.cts +5 -5
- package/dist/patterns/orchestration/index.d.ts +5 -5
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +8 -7
- package/dist/patterns/reactive-layout/index.d.cts +5 -5
- package/dist/patterns/reactive-layout/index.d.ts +5 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +7 -6
- package/dist/patterns/reduction/index.d.cts +4 -4
- package/dist/patterns/reduction/index.d.ts +4 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +9 -8
- package/dist/patterns/refine-loop/index.d.cts +5 -5
- package/dist/patterns/refine-loop/index.d.ts +5 -5
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
- package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +14 -13
- package/dist/patterns/surface/index.d.cts +5 -5
- package/dist/patterns/surface/index.d.ts +5 -5
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{reactive-layout-CpYb5qLP.d.cts → reactive-layout-5oEn8lHM.d.cts} +2 -2
- package/dist/{reactive-layout-D8u4wuUR.d.ts → reactive-layout-BAr6-_o5.d.ts} +2 -2
- package/dist/{reactive-log-DPzuUDj5.d.cts → reactive-log-5jFeNRmd.d.cts} +1 -1
- package/dist/{reactive-log-YuH9VYN8.d.ts → reactive-log-BOJDCI5x.d.ts} +1 -1
- package/dist/{reactive-map-CdbNoSgP.d.ts → reactive-map-BvDrRuwt.d.ts} +1 -1
- package/dist/{reactive-map-DUeRmb9d.d.cts → reactive-map-CmlPPKHN.d.cts} +1 -1
- package/dist/{resilience-CGRzhnD3.d.ts → resilience-CludlzcP.d.ts} +1 -1
- package/dist/{resilience-Ba5-b4WD.d.cts → resilience-Q6Bt_7y0.d.cts} +1 -1
- package/dist/{resilience-QAHKANT5.js → resilience-XRUF267O.js} +1 -1
- package/dist/{sugar-BV0htudb.d.cts → sugar-BHbAACDG.d.ts} +10 -12
- package/dist/{sugar-Dtyrq2_q.d.ts → sugar-CqR6DJ7v.d.cts} +10 -12
- package/dist/{topology-tree-DROUdq5B.d.cts → topology-tree-CVREibAc.d.cts} +1 -1
- package/dist/{topology-tree-CYHOwQZ_.d.ts → topology-tree-CkjojcB6.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-6V3SEX2I.js +0 -1
- package/dist/chunk-7H6LGFUG.js +0 -64
- package/dist/chunk-CKCSDI7T.js +0 -6
- package/dist/chunk-QWAPKG3O.js +0 -2
- package/dist/chunk-RHESUC3V.js +0 -43
- package/dist/chunk-V6YQICXZ.js +0 -1
- package/dist/chunk-Z4HDAS2Q.js +0 -1
- package/dist/chunk-ZB5EHBIO.js +0 -1
package/dist/compat/index.d.cts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { i as jotai } from '../index-
|
|
2
|
-
export { i as nanostores } from '../index-
|
|
3
|
-
export { i as nestjs } from '../index-
|
|
4
|
-
export { i as react } from '../index-
|
|
5
|
-
export { a as signals } from '../index-
|
|
6
|
-
export { i as solid } from '../index-
|
|
7
|
-
export { i as svelte } from '../index-
|
|
8
|
-
export { i as vue } from '../index-
|
|
9
|
-
export { i as zustand } from '../index-
|
|
10
|
-
import '../node-
|
|
11
|
-
import '../observable-
|
|
1
|
+
export { i as jotai } from '../index-BydMDMf7.cjs';
|
|
2
|
+
export { i as nanostores } from '../index-CIXaiYDE.cjs';
|
|
3
|
+
export { i as nestjs } from '../index-yIdWFo2b.cjs';
|
|
4
|
+
export { i as react } from '../index-D7XxY1Ff.cjs';
|
|
5
|
+
export { a as signals } from '../index-DR3gf_DG.cjs';
|
|
6
|
+
export { i as solid } from '../index-FBqTfL_S.cjs';
|
|
7
|
+
export { i as svelte } from '../index-CDK5RsV5.cjs';
|
|
8
|
+
export { i as vue } from '../index-DDo-eqQ4.cjs';
|
|
9
|
+
export { i as zustand } from '../index-CRAkoq-y.cjs';
|
|
10
|
+
import '../node-BVV7G1bq.cjs';
|
|
11
|
+
import '../observable-BrUAPeH_.cjs';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import '@nestjs/common';
|
|
14
14
|
import '@nestjs/core';
|
|
15
|
-
import '../graph-
|
|
16
|
-
import '../meta-
|
|
15
|
+
import '../graph-C4Uxwv0T.cjs';
|
|
16
|
+
import '../meta-COtmHLwT.cjs';
|
|
17
17
|
import '../extra/storage-core.cjs';
|
|
18
|
-
import '../index-
|
|
18
|
+
import '../index-SSGqF8mI.cjs';
|
|
19
19
|
import 'vue';
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { i as jotai } from '../index-
|
|
2
|
-
export { i as nanostores } from '../index-
|
|
3
|
-
export { i as nestjs } from '../index-
|
|
4
|
-
export { i as react } from '../index-
|
|
5
|
-
export { a as signals } from '../index-
|
|
6
|
-
export { i as solid } from '../index-
|
|
7
|
-
export { i as svelte } from '../index-
|
|
8
|
-
export { i as vue } from '../index-
|
|
9
|
-
export { i as zustand } from '../index-
|
|
10
|
-
import '../node-
|
|
11
|
-
import '../observable-
|
|
1
|
+
export { i as jotai } from '../index-ByPnK85n.js';
|
|
2
|
+
export { i as nanostores } from '../index-wIx1Jisk.js';
|
|
3
|
+
export { i as nestjs } from '../index-DGb1awva.js';
|
|
4
|
+
export { i as react } from '../index-D0C_USMR.js';
|
|
5
|
+
export { a as signals } from '../index-RQg6lTrN.js';
|
|
6
|
+
export { i as solid } from '../index-CrC7urhX.js';
|
|
7
|
+
export { i as svelte } from '../index-BX22kvjh.js';
|
|
8
|
+
export { i as vue } from '../index-Ip3q9T9x.js';
|
|
9
|
+
export { i as zustand } from '../index-Bvi5uJxX.js';
|
|
10
|
+
import '../node-BVV7G1bq.js';
|
|
11
|
+
import '../observable-ITikPXz3.js';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import '@nestjs/common';
|
|
14
14
|
import '@nestjs/core';
|
|
15
|
-
import '../graph-
|
|
16
|
-
import '../meta-
|
|
15
|
+
import '../graph-CWeI0aHd.js';
|
|
16
|
+
import '../meta-BMwx3ExI.js';
|
|
17
17
|
import '../extra/storage-core.js';
|
|
18
|
-
import '../index-
|
|
18
|
+
import '../index-IZ3l_vQ9.js';
|
|
19
19
|
import 'vue';
|
package/dist/compat/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../chunk-
|
|
1
|
+
import{a as e}from"../chunk-WANIEEKV.js";import{d}from"../chunk-VJLMUKOI.js";import{d as f}from"../chunk-VIMF6LGM.js";import{d as g}from"../chunk-6QZNQS5B.js";import{d as h}from"../chunk-GPW2V3RE.js";import{b as i}from"../chunk-AV3PIDFQ.js";import{b as a}from"../chunk-BA5URFYW.js";import{i as b}from"../chunk-BZP5T4X6.js";import{G as c}from"../chunk-P7JXGKDO.js";import"../chunk-VIEUJSTT.js";import"../chunk-5Z4HDCO6.js";import"../chunk-GNCBXARM.js";import"../chunk-Y32RJO24.js";import"../chunk-5QDBSZBV.js";import"../chunk-MGKAO4EK.js";import"../chunk-ESMPEKEV.js";import"../chunk-TWMEGG45.js";import"../chunk-AUY2YKCO.js";import"../chunk-KASHOCF5.js";import"../chunk-W4TSQ6RJ.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as jotai,b as nanostores,c as nestjs,d as react,e as signals,f as solid,g as svelte,h as vue,i as zustand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Fe=(s,e)=>{for(var t in e)J(s,t,{get:e[t],enumerable:!0})},Ge=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ce(e))!De.call(s,r)&&r!==t&&J(s,r,{get:()=>e[r],enumerable:!(n=Oe(e,r))||n.enumerable});return s};var Ie=s=>Ge(J({},"__esModule",{value:!0}),s);var Ze={};Fe(Ze,{atom:()=>Je});module.exports=Ie(Ze);var I=Symbol.for("graphrefly/START"),_=Symbol.for("graphrefly/DATA"),k=Symbol.for("graphrefly/DIRTY"),v=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),E=Symbol.for("graphrefly/PAUSE"),V=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),S=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),R=Object.freeze([k]),X=Object.freeze([v]),Ve=Object.freeze([M]),Z=Object.freeze([I]),He=Object.freeze([S]),Le=Object.freeze([N]),Q=Object.freeze([R]),de=Object.freeze([X]),le=Object.freeze([Ve]),ce=Object.freeze([He]),ee=Object.freeze([Le]);var Pe={name:"json",version:1,contentType:"application/json",encode(s){let e=JSON.stringify(s);return new TextEncoder().encode(e)},decode(s,e){let t=new TextDecoder().decode(s);return JSON.parse(t)}};function ue(s){s.registerCodec(Pe)}var We={type:"system",id:""};function B(s){if(s==null)return We;let{type:e,id:t,...n}=s;return{type:e??"system",id:t??"",...n}}var te=0,Ue=!1,fe=[],he=[],pe=[],Be=[];function ge(){return te>0||Ue}function _e(){return te>0}function ye(s){te>0?Be.push(s):s()}function j(s,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!ge()){s(e);return}(l>=5?pe:l===4?he:fe).push(()=>s(e));return}let n=e.length,r=n,a=n,i=n,o=0;for(;o<n&&t(e[o][0])<3;)o++;for(r=o;o<n&&t(e[o][0])===3;)o++;for(a=o;o<n&&t(e[o][0])===4;)o++;i=o;let d=ge();if(r>0){let l=e.slice(0,r);s(l)}if(a>r){let l=e.slice(r,a);d?fe.push(()=>s(l)):s(l)}if(i>a){let l=e.slice(a,i);d?he.push(()=>s(l)):s(l)}if(n>i){let l=e.slice(i,n);d?pe.push(()=>s(l)):s(l)}}function me(){return Date.now()*1e6}var z=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let n=this._messageTypes.get(t);return n!=null?n.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function be(s){s.registerMessageType(I,{tier:0,wireCrossing:!1}),s.registerMessageType(k,{tier:1,wireCrossing:!1}),s.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),s.registerMessageType(E,{tier:2,wireCrossing:!1}),s.registerMessageType(V,{tier:2,wireCrossing:!1}),s.registerMessageType(_,{tier:3,wireCrossing:!0}),s.registerMessageType(v,{tier:3,wireCrossing:!0}),s.registerMessageType(S,{tier:4,wireCrossing:!0,metaPassthrough:!1}),s.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),s.registerMessageType(N,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var O=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function ne(s){if(s===void 0)return null;if(typeof s=="number"){if(!Number.isFinite(s))throw new TypeError(`Cannot hash non-finite number: ${s}`);if(Number.isInteger(s)&&!Number.isSafeInteger(s))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${s}. Cross-language cid parity is not guaranteed for unsafe integers.`);return s}if(typeof s=="string"||typeof s=="boolean"||s===null)return s;if(Array.isArray(s))return s.map(ne);if(typeof s=="object"&&s!==null){let e={};for(let t of Object.keys(s).sort())e[t]=ne(s[t]);return e}return null}var je=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new TextEncoder;function $e(s){let e=ze.encode(s),t=e.length,n=t*8,r=t+9+63&-64,a=new Uint8Array(r);a.set(e),a[t]=128;let i=new DataView(a.buffer);i.setUint32(r-4,n>>>0,!1),i.setUint32(r-8,Math.floor(n/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,u=1359893119,f=2600822924,g=528734635,y=1541459225,A=new Uint32Array(64),b=(w,m)=>w>>>m|w<<32-m;for(let w=0;w<r;w+=64){for(let h=0;h<16;h++)A[h]=i.getUint32(w+h*4,!1);for(let h=16;h<64;h++){let F=A[h-15],G=A[h-2],U=b(F,7)^b(F,18)^F>>>3,K=b(G,17)^b(G,19)^G>>>10;A[h]=A[h-16]+U+A[h-7]+K>>>0}let m=o,C=d,D=l,q=c,x=u,P=f,W=g,Y=y;for(let h=0;h<64;h++){let F=b(x,6)^b(x,11)^b(x,25),G=x&P^~x&W,U=Y+F+G+je[h]+A[h]>>>0,K=b(m,2)^b(m,13)^b(m,22),Se=m&C^m&D^C&D,Re=K+Se>>>0;Y=W,W=P,P=x,x=q+U>>>0,q=D,D=C,C=m,m=U+Re>>>0}o=o+m>>>0,d=d+C>>>0,l=l+D>>>0,c=c+q>>>0,u=u+x>>>0,f=f+P>>>0,g=g+W>>>0,y=y+Y>>>0}let T=w=>w.toString(16).padStart(8,"0");return T(o)+T(d)+T(l)+T(c)+T(u)+T(f)+T(g)+T(y)}function se(s){let e=ne(s??null),t=JSON.stringify(e);return $e(t).slice(0,16)}function qe(){let s=globalThis.crypto;if(s?.randomUUID)return s.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function re(s,e,t){let n=t?.id??qe();if(s===0)return{id:n,version:0};let a=(t?.hash??se)(e);return{id:n,version:0,cid:a,prev:null}}function ve(s,e,t){s.version+=1,"cid"in s&&(s.prev=s.cid,s.cid=t(e))}var Te=()=>{},we=100;function xe(s){return{node:s,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function oe(s){s.prevData=void 0,s.dirty=!1,s.involvedThisWave=!1,s.dataBatch.length=0,s.terminal=void 0}function $(s){return s.length===0?s:typeof s[0]=="symbol"?[s]:s}var Ye=(s,e,t,n)=>{t.direction==="down-in"&&s._onDepMessage(t.depIndex,e)},Ke=(s,e,t,n)=>{let r=s;if(r._status==="completed"||r._status==="errored")return;let a=r._cached,i=a===void 0?[Z]:[Z,[_,a]];r._status==="dirty"&&i.push(R),j(e,i,r._config.tierOf)},ae=new z({onMessage:Ye,onSubscribe:Ke});be(ae);ue(ae);var H=class s{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,n){this._config=n.config??ae,this._config.onMessage,this._optsName=n.name,this._describeKind=n.describeKind,this._equals=n.equals??Object.is,this._resubscribable=n.resubscribable??!1,this._resetOnTeardown=n.resetOnTeardown??!1,this._autoComplete=n.completeWhenDepsComplete??!0,this._autoError=n.errorWhenDepsError??!0,this._pausable=n.pausable??!0,this._guard=n.guard,this._fn=t,this._cached=n.initial!==void 0?n.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=n.versioningHash??this._config.defaultHashFn??se;let r=n.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?re(r,this._cached===void 0?void 0:this._cached,{id:n.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(xe);let a={};for(let[o,d]of Object.entries(n.meta??{})){let l={initial:d,name:`${n.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};n.guard!=null&&(l.guard=n.guard),a[o]=new s([],void 0,l)}Object.freeze(a),this.meta=a,this._hasMeta=Object.keys(a).length>0;let i=this;this._actions={emit(o){i._emit([[_,o]])},down(o){i._emit($(o))},up(o){i._emitUp($(o))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let n=this._versioningLevel;if(n!=null&&e<=n)return;let r=t?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let a=this._cached===void 0?void 0:this._cached,i=this._versioning,o=i?.id??t?.id,d=i?.version??0,l=re(e,a,{id:o,hash:r});l.version=d,this._versioning=l,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=B(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let n of this._extraGuards)if(!n(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,n=e?.actor!=null;if(!t&&!n)return;let r=B(e?.actor),a=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,a))throw new O({actor:r,action:a,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(r,a))throw new O({actor:r,action:a,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:me()}}down(e,t){let n=$(e);n.length!==0&&(this._checkGuard(t),this._emit(n))}emit(e,t){this._checkGuard(t),this._emit([[_,e]])}up(e,t){if(this._deps.length===0)return;let n=$(e);if(n.length===0)return;this._checkGuard(t);let r=t??{internal:!0};this._validateUpTiers(n);for(let a of this._deps)a.node.up?.(n,r)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let n of e){let r=t(n[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=B(t);if(!this._guard(d,"observe"))throw new O({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)oe(d)}this._sinkCount+=1;let a;try{a=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof a=="function")try{a()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof a=="function"&&a(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let n=0;n<e;n++){let r=n,a=this._deps[n];a.unsub=Te,a.unsub=a.node.subscribe(i=>{if(a.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of i)o(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(n){this._deps[t].unsub=null;for(let r=0;r<t;r++){let a=this._deps[r];if(a.unsub!=null){let i=a.unsub;a.unsub=null;try{i()}catch{}oe(a)}}throw this._dirtyDepCount=0,n}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let t=this._deps.length,n=xe(e);if(this._deps.push(n),this._sinks==null)return t;n.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Q),n.unsub=Te;try{n.unsub=e.subscribe(r=>{if(n.unsub===null)return;let a=this._config.tierOf,i=!1;for(let o of r)a(o[0])>=3&&(i=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(r){throw n.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(n){this._emit([[p,this._wrapFnError("cleanup threw",n)]])}else if(t!=null&&typeof t=="object"){let n=t.deactivate;if(typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let n of this._deps){if(n.unsub!=null){let r=n.unsub;n.unsub=null;try{r()}catch{}}oe(n)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let n=this._deps[e],r=t[0];if(this._inspectorHooks!=null){let a={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(a)}if(r!==I){if(r===k){this._depDirtied(n);return}if(r===M){this._depInvalidated(n),this._emit(le);return}if(r===E||r===V){this._emit([t]);return}if(r===N){this._emit(ee);return}if(r===_)this._depSettledAsData(n,t[1]);else if(r===v)this._depSettledAsResolved(n);else if(r===S)this._depSettledAsTerminal(n,!0);else if(r===p)this._depSettledAsTerminal(n,t[1]);else{this._emit([t]);return}if(!this._fn){(r===_||r===v)&&this._emit([t]),(r===S||r===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Q))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(de),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(ce)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(i){this._emit([[p,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(o){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),n=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let o=t[i];o!=null&&o.length>0&&(this._deps[i].prevData=o[o.length-1])}let r=this._deps.map(i=>i.terminal),a={prevData:n,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:n};for(let o of this._inspectorHooks)o(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,a);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let o=i;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[p,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>we?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${we} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let n=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${n}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[R,e[0]]:e;let n=!0,r=!1,a=!1,i=-1;for(let d of e){let l=t(d[0]);l<i&&(n=!1),l===3&&(r=!0),d[0]===k&&(a=!0),i=l}let o=e;if(!n){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),o=d.map(l=>l.m)}if(r&&!a&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[R,...o]:[...o.slice(0,d),R,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;let t=e;if(this._isTerminal&&!this._resubscribable){let o=e.filter(d=>d[0]===N||d[0]===M);if(o.length===0)return;t=o}t=this._frameBatch(t);let r=null;for(let o=0;o<t.length;o++){let d=t[o],l=d[0];if(l!==E&&l!==V){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===E?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let u=d[1];if(l===E)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))c=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let f=this._pauseBuffer;this._pauseBuffer=[],this._emit(f)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(d):r==null&&(r=t.slice(0,o))}if(r!=null){if(r.length===0)return;t=r}if(this._hasMeta&&t.some(o=>o[0]===N))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(ee)}catch{}let{finalMessages:a,equalsError:i}=this._updateState(t);if(a.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:a})}catch{}}if(a.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of a){let c=o(l[0]);c<3||c===5?d.push(l):this._pauseBuffer.push(l)}d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(a);i!=null&&this._emit([[p,i]])}_updateState(e){let t=this._config.tierOf,n,r,a=-1,i=0;for(let c of e)t(c[0])===3&&i++;let o=i<=1,d=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===_){d=c;break}}for(let c=0;c<e.length;c++){let u=e[c],f=u[0];if(f===_){if(u.length>=2){let g=!1;if(o&&this._cached!==void 0)try{g=this._equals(this._cached,u[1])}catch(y){r=this._wrapFnError("equals threw",y),a=c;break}if(g){n==null&&(n=e.slice(0,c)),n.push(X),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(d<0||c===d)&&ve(this._versioning,u[1],this._hashFn)}this._status="settled",n?.push(u)}else if(n?.push(u),f===k)this._status="dirty";else if(f===v)this._status="resolved";else if(f===S)this._status="completed";else if(f===p)this._status="errored";else if(f===M){this._cached=void 0,this._status="dirty";let g=this._cleanup;if(typeof g=="function"){this._cleanup=void 0;try{g()}catch{}}else if(g!=null&&typeof g=="object"){let y=g.invalidate;if(typeof y=="function")try{y()}catch{}}}else f===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=a>=0?n??e.slice(0,a):n??e;return r!=null?{finalMessages:l,equalsError:r}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let n of t)n(e)};_dispatchOrAccumulate(e){if(_e()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ye(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}j(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);j(this._deliverToSinks,t,this._config.tierOf)}},Ne=s=>Array.isArray(s),ie=s=>typeof s=="object"&&s!=null&&!Array.isArray(s);function Ae(s,e,t){let n=Ne(s)?s:[],r=typeof s=="function"?s:typeof e=="function"?e:void 0,a={};return Ne(s)?a=(ie(e)?e:t)??{}:ie(s)?a=s:a=(ie(e)?e:t)??{},new H(n,r,a)}function ke(s,e){return Ae([],{...e,initial:s})}function Me(s,e){let t,n=new Map,r=e?.partial??!1,a=(i,o,d)=>{let l=!1,c=u=>{let f=n.get(u);if(f!==void 0){if(f<i.length){let y=i[f];return y!=null&&y.length>0?y.at(-1):d.prevData[f]}return u.cache}l=!0;let g=t._addDep(u);return n.set(u,g),u.cache};if(!r&&n.size>0){for(let[,u]of n)if(u<i.length){let f=i[u];if(!(f!=null&&f.length>0)&&d.prevData[u]===void 0){o.down([[v]]);return}}}try{let u=s(c,d);l||(o.emit(u),d.store.__autoTrackLastDiscoveryError!=null&&delete d.store.__autoTrackLastDiscoveryError)}catch(u){if(!l)throw u;d.store.__autoTrackLastDiscoveryError=u}};return t=new H([],a,{describeKind:"derived",...e}),t}function Je(s,e,t){if(typeof s=="function"){let n=s;return typeof e=="function"?Ee(n,e,t):Ee(n,void 0,e)}return Xe(s,e)}function L(s){let e=s.cache,t;if(s.subscribe(r=>{for(let[a,i]of r)a===_&&(e=i),a===p&&(t=i)})(),t)throw t;return e}function Xe(s,e){let t=ke(s,{...e,resubscribable:!0,resetOnTeardown:!0});return{get:()=>t.status==="sentinel"?L(t):t.cache,set:n=>t.emit(n),update:n=>{let r=t.status==="sentinel"?L(t):t.cache;t.emit(n(r))},subscribe:n=>{let r=!0;return t.subscribe(a=>{for(let[i,o]of a)if(i===_){if(r){r=!1;continue}n(o)}})},meta:t.meta,_node:t}}function Ee(s,e,t){let n=Me(a=>s(i=>{let o=i._node;return o.status==="sentinel"&&L(o),a(o)}),{...t,resubscribable:!0,resetOnTeardown:!0}),r={get:()=>n.status==="sentinel"?L(n):n.cache,subscribe:a=>{let i=!0;return n.subscribe(o=>{for(let[d,l]of o)if(d===_){if(i){i=!1;continue}a(l)}})},meta:n.meta,_node:n};if(e){let a=d=>d.get(),i=(d,l)=>d.set(l),o=r;return o.set=d=>e(a,i,d),o.update=d=>{let l=n.status==="sentinel"?L(n):n.cache;return e(a,i,d(l))},o}return r}0&&(module.exports={atom});
|
|
1
|
+
"use strict";var J=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Ce=Object.prototype.hasOwnProperty;var Fe=(s,e)=>{for(var t in e)J(s,t,{get:e[t],enumerable:!0})},Ge=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!Ce.call(s,r)&&r!==t&&J(s,r,{get:()=>e[r],enumerable:!(n=Oe(e,r))||n.enumerable});return s};var Ie=s=>Ge(J({},"__esModule",{value:!0}),s);var Ze={};Fe(Ze,{atom:()=>Je});module.exports=Ie(Ze);var I=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),A=Symbol.for("graphrefly/DIRTY"),k=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),E=Symbol.for("graphrefly/PAUSE"),V=Symbol.for("graphrefly/RESUME"),w=Symbol.for("graphrefly/TEARDOWN"),S=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),R=Object.freeze([A]),X=Object.freeze([k]),Ve=Object.freeze([M]),Z=Object.freeze([I]),He=Object.freeze([S]),Le=Object.freeze([w]),Q=Object.freeze([R]),de=Object.freeze([X]),le=Object.freeze([Ve]),ce=Object.freeze([He]),ee=Object.freeze([Le]);var Pe={name:"json",version:1,contentType:"application/json",encode(s){let e=JSON.stringify(s);return new TextEncoder().encode(e)},decode(s,e){let t=new TextDecoder().decode(s);return JSON.parse(t)}};function ue(s){s.registerCodec(Pe)}var We={type:"system",id:""};function B(s){if(s==null)return We;let{type:e,id:t,...n}=s;return{type:e??"system",id:t??"",...n}}var te=0,Ue=!1,fe=[],he=[],pe=[],Be=[];function _e(){return te>0||Ue}function ge(){return te>0}function ye(s){te>0?Be.push(s):s()}function j(s,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!_e()){s(e);return}(l>=5?pe:l===4?he:fe).push(()=>s(e));return}let n=e.length,r=n,a=n,i=n,o=0;for(;o<n&&t(e[o][0])<3;)o++;for(r=o;o<n&&t(e[o][0])===3;)o++;for(a=o;o<n&&t(e[o][0])===4;)o++;i=o;let d=_e();if(r>0){let l=e.slice(0,r);s(l)}if(a>r){let l=e.slice(r,a);d?fe.push(()=>s(l)):s(l)}if(i>a){let l=e.slice(a,i);d?he.push(()=>s(l)):s(l)}if(n>i){let l=e.slice(i,n);d?pe.push(()=>s(l)):s(l)}}function me(){return Date.now()*1e6}var z=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let n=this._messageTypes.get(t);return n!=null?n.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function be(s){s.registerMessageType(I,{tier:0,wireCrossing:!1}),s.registerMessageType(A,{tier:1,wireCrossing:!1}),s.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),s.registerMessageType(E,{tier:2,wireCrossing:!1}),s.registerMessageType(V,{tier:2,wireCrossing:!1}),s.registerMessageType(g,{tier:3,wireCrossing:!0}),s.registerMessageType(k,{tier:3,wireCrossing:!0}),s.registerMessageType(S,{tier:4,wireCrossing:!0,metaPassthrough:!1}),s.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),s.registerMessageType(w,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var O=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function ne(s){if(s===void 0)return null;if(typeof s=="number"){if(!Number.isFinite(s))throw new TypeError(`Cannot hash non-finite number: ${s}`);if(Number.isInteger(s)&&!Number.isSafeInteger(s))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${s}. Cross-language cid parity is not guaranteed for unsafe integers.`);return s}if(typeof s=="string"||typeof s=="boolean"||s===null)return s;if(Array.isArray(s))return s.map(ne);if(typeof s=="object"&&s!==null){let e={};for(let t of Object.keys(s).sort())e[t]=ne(s[t]);return e}return null}var je=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new TextEncoder;function $e(s){let e=ze.encode(s),t=e.length,n=t*8,r=t+9+63&-64,a=new Uint8Array(r);a.set(e),a[t]=128;let i=new DataView(a.buffer);i.setUint32(r-4,n>>>0,!1),i.setUint32(r-8,Math.floor(n/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,u=1359893119,_=2600822924,f=528734635,b=1541459225,N=new Uint32Array(64),m=(T,y)=>T>>>y|T<<32-y;for(let T=0;T<r;T+=64){for(let h=0;h<16;h++)N[h]=i.getUint32(T+h*4,!1);for(let h=16;h<64;h++){let F=N[h-15],G=N[h-2],U=m(F,7)^m(F,18)^F>>>3,K=m(G,17)^m(G,19)^G>>>10;N[h]=N[h-16]+U+N[h-7]+K>>>0}let y=o,D=d,C=l,q=c,x=u,P=_,W=f,Y=b;for(let h=0;h<64;h++){let F=m(x,6)^m(x,11)^m(x,25),G=x&P^~x&W,U=Y+F+G+je[h]+N[h]>>>0,K=m(y,2)^m(y,13)^m(y,22),Se=y&D^y&C^D&C,Re=K+Se>>>0;Y=W,W=P,P=x,x=q+U>>>0,q=C,C=D,D=y,y=U+Re>>>0}o=o+y>>>0,d=d+D>>>0,l=l+C>>>0,c=c+q>>>0,u=u+x>>>0,_=_+P>>>0,f=f+W>>>0,b=b+Y>>>0}let v=T=>T.toString(16).padStart(8,"0");return v(o)+v(d)+v(l)+v(c)+v(u)+v(_)+v(f)+v(b)}function se(s){let e=ne(s??null),t=JSON.stringify(e);return $e(t).slice(0,16)}function qe(){let s=globalThis.crypto;if(s?.randomUUID)return s.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function re(s,e,t){let n=t?.id??qe();if(s===0)return{id:n,version:0};let a=(t?.hash??se)(e);return{id:n,version:0,cid:a,prev:null}}function ve(s,e,t){s.version+=1,"cid"in s&&(s.prev=s.cid,s.cid=t(e))}var Te=()=>{},xe=100;function we(s){return{node:s,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function oe(s){s.prevData=void 0,s.dirty=!1,s.involvedThisWave=!1,s.dataBatch.length=0,s.terminal=void 0}function $(s){return s.length===0?s:typeof s[0]=="symbol"?[s]:s}var Ye=(s,e,t,n)=>{t.direction==="down-in"&&s._onDepMessage(t.depIndex,e)},Ke=(s,e,t,n)=>{let r=s;if(r._status==="completed"||r._status==="errored")return;let a=r._cached,i=a===void 0?[Z]:[Z,[g,a]];r._status==="dirty"&&i.push(R),j(e,i,r._config.tierOf)},ae=new z({onMessage:Ye,onSubscribe:Ke});be(ae);ue(ae);var H=class s{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,n){this._config=n.config??ae,this._config.onMessage,this._optsName=n.name,this._describeKind=n.describeKind,this._equals=n.equals??Object.is,this._resubscribable=n.resubscribable??!1,this._resetOnTeardown=n.resetOnTeardown??!1,this._autoComplete=n.completeWhenDepsComplete??!0,this._autoError=n.errorWhenDepsError??!0,this._pausable=n.pausable??!0,this._guard=n.guard,this._fn=t,this._partial=n.partial??!1,this._cached=n.initial!==void 0?n.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=n.versioningHash??this._config.defaultHashFn??se;let r=n.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?re(r,this._cached===void 0?void 0:this._cached,{id:n.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(we);let a={};for(let[o,d]of Object.entries(n.meta??{})){let l={initial:d,name:`${n.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};n.guard!=null&&(l.guard=n.guard),a[o]=new s([],void 0,l)}Object.freeze(a),this.meta=a,this._hasMeta=Object.keys(a).length>0;let i=this;this._actions={emit(o){i._emit([[g,o]])},down(o){i._emit($(o))},up(o){i._emitUp($(o))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let n=this._versioningLevel;if(n!=null&&e<=n)return;let r=t?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let a=this._cached===void 0?void 0:this._cached,i=this._versioning,o=i?.id??t?.id,d=i?.version??0,l=re(e,a,{id:o,hash:r});l.version=d,this._versioning=l,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=B(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let n of this._extraGuards)if(!n(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,n=e?.actor!=null;if(!t&&!n)return;let r=B(e?.actor),a=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,a))throw new O({actor:r,action:a,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(r,a))throw new O({actor:r,action:a,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:me()}}down(e,t){let n=$(e);n.length!==0&&(this._checkGuard(t),this._emit(n))}emit(e,t){this._checkGuard(t),this._emit([[g,e]])}up(e,t){if(this._deps.length===0)return;let n=$(e);if(n.length===0)return;this._checkGuard(t);let r=t??{internal:!0};this._validateUpTiers(n);for(let a of this._deps)a.node.up?.(n,r)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let n of e){let r=t(n[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=B(t);if(!this._guard(d,"observe"))throw new O({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)oe(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let a;try{a=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof a=="function")try{a()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof a=="function"&&a(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let n=0;n<e;n++){let r=n,a=this._deps[n];a.unsub=Te,a.unsub=a.node.subscribe(i=>{if(a.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of i)o(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(n){this._deps[t].unsub=null;for(let r=0;r<t;r++){let a=this._deps[r];if(a.unsub!=null){let i=a.unsub;a.unsub=null;try{i()}catch{}oe(a)}}throw this._dirtyDepCount=0,n}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let t=this._deps.length,n=we(e);if(this._deps.push(n),this._sinks==null)return t;n.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Q),n.unsub=Te;try{n.unsub=e.subscribe(r=>{if(n.unsub===null)return;let a=this._config.tierOf,i=!1;for(let o of r)a(o[0])>=3&&(i=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(r){throw n.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(n){this._emit([[p,this._wrapFnError("cleanup threw",n)]])}else if(t!=null&&typeof t=="object"){let n=t.deactivate;if(typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let n of this._deps){if(n.unsub!=null){let r=n.unsub;n.unsub=null;try{r()}catch{}}oe(n)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let n=this._deps[e],r=t[0];if(this._inspectorHooks!=null){let a={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(a)}if(r!==I){if(r===A){this._depDirtied(n);return}if(r===M){this._depInvalidated(n),this._emit(le);return}if(r===E||r===V){this._emit([t]);return}if(r===w){this._emit(ee);return}if(r===g)this._depSettledAsData(n,t[1]);else if(r===k)this._depSettledAsResolved(n);else if(r===S)this._depSettledAsTerminal(n,!0);else if(r===p)this._depSettledAsTerminal(n,t[1]);else{this._emit([t]);return}if(!this._fn){(r===g||r===k)&&this._emit([t]),(r===S||r===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Q))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(de),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(ce)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(i){this._emit([[p,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(o){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),n=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let o=t[i];o!=null&&o.length>0&&(this._deps[i].prevData=o[o.length-1])}let r=this._deps.map(i=>i.terminal),a={prevData:n,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:n};for(let o of this._inspectorHooks)o(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,a);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let o=i;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[p,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>xe?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${xe} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let n=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${n}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[R,e[0]]:e;let n=!0,r=!1,a=!1,i=-1;for(let d of e){let l=t(d[0]);l<i&&(n=!1),l===3&&(r=!0),d[0]===A&&(a=!0),i=l}let o=e;if(!n){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),o=d.map(l=>l.m)}if(r&&!a&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[R,...o]:[...o.slice(0,d),R,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;for(let o=0;o<e.length;o++){let d=e[o];if(d[0]===p&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let o=e.filter(d=>d[0]===w||d[0]===M);if(o.length===0)return;t=o}t=this._frameBatch(t);let r=null;for(let o=0;o<t.length;o++){let d=t[o],l=d[0];if(l!==E&&l!==V){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===E?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let u=d[1];if(l===E)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))c=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let _=this._pauseBuffer;this._pauseBuffer=[],this._emit(_)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(d):r==null&&(r=t.slice(0,o))}if(r!=null){if(r.length===0)return;t=r}if(this._hasMeta&&t.some(o=>o[0]===w))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(ee)}catch{}let{finalMessages:a,equalsError:i}=this._updateState(t);if(a.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:a})}catch{}}if(a.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of a)o(l[0])===3?this._pauseBuffer.push(l):d.push(l);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(a);i!=null&&this._emit([[p,i]])}_updateState(e){let t=this._config.tierOf,n,r,a=-1,i=0;for(let c of e)t(c[0])===3&&i++;let o=i<=1,d=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===g){d=c;break}}for(let c=0;c<e.length;c++){let u=e[c],_=u[0];if(_===g){if(u.length>=2){let f=!1;if(o&&this._cached!==void 0)try{f=this._equals(this._cached,u[1])}catch(b){r=this._wrapFnError("equals threw",b),a=c;break}if(f){n==null&&(n=e.slice(0,c)),n.push(X),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(d<0||c===d)&&ve(this._versioning,u[1],this._hashFn)}this._status="settled",n?.push(u)}else if(n?.push(u),_===A)this._status="dirty";else if(_===k)this._status="resolved";else if(_===S)this._status="completed";else if(_===p)this._status="errored";else if(_===M){this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let b=f.invalidate;if(typeof b=="function")try{b()}catch{}}}else _===w&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=a>=0?n??e.slice(0,a):n??e;return r!=null?{finalMessages:l,equalsError:r}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let n of t)n(e)};_dispatchOrAccumulate(e){if(ge()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ye(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}j(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);j(this._deliverToSinks,t,this._config.tierOf)}},Ne=s=>Array.isArray(s),ie=s=>typeof s=="object"&&s!=null&&!Array.isArray(s);function Ae(s,e,t){let n=Ne(s)?s:[],r=typeof s=="function"?s:typeof e=="function"?e:void 0,a={};return Ne(s)?a=(ie(e)?e:t)??{}:ie(s)?a=s:a=(ie(e)?e:t)??{},new H(n,r,a)}function ke(s,e){return Ae([],{...e,initial:s})}function Me(s,e){let t,n=new Map,r=(a,i,o)=>{let d=!1,l=c=>{let u=n.get(c);if(u!==void 0){if(u<a.length){let f=a[u];return f!=null&&f.length>0?f.at(-1):o.prevData[u]}return c.cache}d=!0;let _=t._addDep(c);return n.set(c,_),c.cache};try{let c=s(l,o);d||(i.emit(c),o.store.__autoTrackLastDiscoveryError!=null&&delete o.store.__autoTrackLastDiscoveryError)}catch(c){if(!d)throw c;o.store.__autoTrackLastDiscoveryError=c}};return t=new H([],r,{describeKind:"derived",...e}),t}function Je(s,e,t){if(typeof s=="function"){let n=s;return typeof e=="function"?Ee(n,e,t):Ee(n,void 0,e)}return Xe(s,e)}function L(s){let e=s.cache,t;if(s.subscribe(r=>{for(let[a,i]of r)a===g&&(e=i),a===p&&(t=i)})(),t)throw t;return e}function Xe(s,e){let t=ke(s,{...e,resubscribable:!0,resetOnTeardown:!0});return{get:()=>t.status==="sentinel"?L(t):t.cache,set:n=>t.emit(n),update:n=>{let r=t.status==="sentinel"?L(t):t.cache;t.emit(n(r))},subscribe:n=>{let r=!0;return t.subscribe(a=>{for(let[i,o]of a)if(i===g){if(r){r=!1;continue}n(o)}})},meta:t.meta,_node:t}}function Ee(s,e,t){let n=Me(a=>s(i=>{let o=i._node;return o.status==="sentinel"&&L(o),a(o)}),{...t,resubscribable:!0,resetOnTeardown:!0}),r={get:()=>n.status==="sentinel"?L(n):n.cache,subscribe:a=>{let i=!0;return n.subscribe(o=>{for(let[d,l]of o)if(d===g){if(i){i=!1;continue}a(l)}})},meta:n.meta,_node:n};if(e){let a=d=>d.get(),i=(d,l)=>d.set(l),o=r;return o.set=d=>e(a,i,d),o.update=d=>{let l=n.status==="sentinel"?L(n):n.cache;return e(a,i,d(l))},o}return r}0&&(module.exports={atom});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
export { A as AtomOptions, G as GetFn, R as ReadFn, a as ReadableAtom, S as SetFn, W as WritableAtom, b as WriteFn, c as atom } from '../../index-
|
|
1
|
+
import '../../node-BVV7G1bq.cjs';
|
|
2
|
+
export { A as AtomOptions, G as GetFn, R as ReadFn, a as ReadableAtom, S as SetFn, W as WritableAtom, b as WriteFn, c as atom } from '../../index-BydMDMf7.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
export { A as AtomOptions, G as GetFn, R as ReadFn, a as ReadableAtom, S as SetFn, W as WritableAtom, b as WriteFn, c as atom } from '../../index-
|
|
1
|
+
import '../../node-BVV7G1bq.js';
|
|
2
|
+
export { A as AtomOptions, G as GetFn, R as ReadFn, a as ReadableAtom, S as SetFn, W as WritableAtom, b as WriteFn, c as atom } from '../../index-ByPnK85n.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-BA5URFYW.js";import"../../chunk-W4TSQ6RJ.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{a as atom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var Be=(n,e)=>{for(var t in e)oe(n,t,{get:e[t],enumerable:!0})},je=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ue(e))!We.call(n,o)&&o!==t&&oe(n,o,{get:()=>e[o],enumerable:!(s=Pe(e,o))||s.enumerable});return n};var ze=n=>je(oe({},"__esModule",{value:!0}),n);var ft={};Be(ft,{action:()=>ut,atom:()=>it,computed:()=>at,getValue:()=>lt,map:()=>dt,onMount:()=>ct,onStart:()=>Ge,onStop:()=>Le});module.exports=ze(ft);var R=0,P=!1,k=[],M=[],D=[],U=[];function me(){return R>0||P}function be(){return R>0}function ve(n){R>0?U.push(n):n()}function Te(n){R+=1;let e=!1;try{n()}catch(t){throw e=!0,t}finally{if(R-=1,R===0)if(e){if(!P){let t=U.splice(0);for(let s of t)try{s()}catch{}k.length=0,M.length=0,D.length=0}}else $e()}}function $e(){let n=!P;n&&(P=!0);let e=[],t=0;try{for(;k.length>0||M.length>0||D.length>0||n&&U.length>0;){if(n&&U.length>0){let r=U.splice(0);for(let a of r)try{a()}catch(i){e.push(i)}continue}if(t+=1,t>1e3)throw k.length=0,M.length=0,D.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(k.length>0?k:M.length>0?M:D).splice(0);for(let r of o)try{r()}catch(a){e.push(a)}}}finally{n&&(P=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function q(n,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!me()){n(e);return}(l>=5?D:l===4?M:k).push(()=>n(e));return}let s=e.length,o=s,r=s,a=s,i=0;for(;i<s&&t(e[i][0])<3;)i++;for(o=i;i<s&&t(e[i][0])===3;)i++;for(r=i;i<s&&t(e[i][0])===4;)i++;a=i;let d=me();if(o>0){let l=e.slice(0,o);n(l)}if(r>o){let l=e.slice(o,r);d?k.push(()=>n(l)):n(l)}if(a>r){let l=e.slice(r,a);d?M.push(()=>n(l)):n(l)}if(s>a){let l=e.slice(a,s);d?D.push(()=>n(l)):n(l)}}var W=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),E=Symbol.for("graphrefly/DIRTY"),v=Symbol.for("graphrefly/RESOLVED"),S=Symbol.for("graphrefly/INVALIDATE"),C=Symbol.for("graphrefly/PAUSE"),B=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),O=Symbol.for("graphrefly/COMPLETE"),h=Symbol.for("graphrefly/ERROR"),F=Object.freeze([E]),re=Object.freeze([v]),qe=Object.freeze([S]),ie=Object.freeze([W]),Ke=Object.freeze([O]),Ye=Object.freeze([N]),ae=Object.freeze([F]),we=Object.freeze([re]),xe=Object.freeze([qe]),Ne=Object.freeze([Ke]),de=Object.freeze([Ye]);var Je={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}};function Ae(n){n.registerCodec(Je)}var Xe={type:"system",id:""};function K(n){if(n==null)return Xe;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}function ke(){return Date.now()*1e6}var Y=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let s=this._messageTypes.get(t);return s!=null?s.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function Me(n){n.registerMessageType(W,{tier:0,wireCrossing:!1}),n.registerMessageType(E,{tier:1,wireCrossing:!1}),n.registerMessageType(S,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(C,{tier:2,wireCrossing:!1}),n.registerMessageType(B,{tier:2,wireCrossing:!1}),n.registerMessageType(g,{tier:3,wireCrossing:!0}),n.registerMessageType(v,{tier:3,wireCrossing:!0}),n.registerMessageType(O,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(h,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(N,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var I=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function le(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(le);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=le(n[t]);return e}return null}var Ze=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qe=new TextEncoder;function et(n){let e=Qe.encode(n),t=e.length,s=t*8,o=t+9+63&-64,r=new Uint8Array(o);r.set(e),r[t]=128;let a=new DataView(r.buffer);a.setUint32(o-4,s>>>0,!1),a.setUint32(o-8,Math.floor(s/4294967296)>>>0,!1);let i=1779033703,d=3144134277,l=1013904242,c=2773480762,f=1359893119,p=2600822924,_=528734635,b=1541459225,A=new Uint32Array(64),m=(w,y)=>w>>>y|w<<32-y;for(let w=0;w<o;w+=64){for(let u=0;u<16;u++)A[u]=a.getUint32(w+u*4,!1);for(let u=16;u<64;u++){let H=A[u-15],V=A[u-2],$=m(H,7)^m(H,18)^H>>>3,se=m(V,17)^m(V,19)^V>>>10;A[u]=A[u-16]+$+A[u-7]+se>>>0}let y=i,G=d,L=l,te=c,x=f,j=p,z=_,ne=b;for(let u=0;u<64;u++){let H=m(x,6)^m(x,11)^m(x,25),V=x&j^~x&z,$=ne+H+V+Ze[u]+A[u]>>>0,se=m(y,2)^m(y,13)^m(y,22),He=y&G^y&L^G&L,Ve=se+He>>>0;ne=z,z=j,j=x,x=te+$>>>0,te=L,L=G,G=y,y=$+Ve>>>0}i=i+y>>>0,d=d+G>>>0,l=l+L>>>0,c=c+te>>>0,f=f+x>>>0,p=p+j>>>0,_=_+z>>>0,b=b+ne>>>0}let T=w=>w.toString(16).padStart(8,"0");return T(i)+T(d)+T(l)+T(c)+T(f)+T(p)+T(_)+T(b)}function ce(n){let e=le(n??null),t=JSON.stringify(e);return et(t).slice(0,16)}function tt(){let n=globalThis.crypto;if(n?.randomUUID)return n.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function ue(n,e,t){let s=t?.id??tt();if(n===0)return{id:s,version:0};let r=(t?.hash??ce)(e);return{id:s,version:0,cid:r,prev:null}}function Ee(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var Se=()=>{},Ce=100;function Oe(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function fe(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function J(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}var nt=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},st=(n,e,t,s)=>{let o=n;if(o._status==="completed"||o._status==="errored")return;let r=o._cached,a=r===void 0?[ie]:[ie,[g,r]];o._status==="dirty"&&a.push(F),q(e,a,o._config.tierOf)},pe=new Y({onMessage:nt,onSubscribe:st});Me(pe);Ae(pe);var X=class n{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,s){this._config=s.config??pe,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=t,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??ce;let o=s.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?ue(o,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Oe);let r={};for(let[i,d]of Object.entries(s.meta??{})){let l={initial:d,name:`${s.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};s.guard!=null&&(l.guard=s.guard),r[i]=new n([],void 0,l)}Object.freeze(r),this.meta=r,this._hasMeta=Object.keys(r).length>0;let a=this;this._actions={emit(i){a._emit([[g,i]])},down(i){a._emit(J(i))},up(i){a._emitUp(J(i))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let s=this._versioningLevel;if(s!=null&&e<=s)return;let o=t?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let r=this._cached===void 0?void 0:this._cached,a=this._versioning,i=a?.id??t?.id,d=a?.version??0,l=ue(e,r,{id:i,hash:o});l.version=d,this._versioning=l,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=K(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!t&&!s)return;let o=K(e?.actor),r=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,r))throw new I({actor:o,action:r,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(o,r))throw new I({actor:o,action:r,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:ke()}}down(e,t){let s=J(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[g,e]])}up(e,t){if(this._deps.length===0)return;let s=J(e);if(s.length===0)return;this._checkGuard(t);let o=t??{internal:!0};this._validateUpTiers(s);for(let r of this._deps)r.node.up?.(s,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let s of e){let o=t(s[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=K(t);if(!this._guard(d,"observe"))throw new I({actor:d,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)fe(d)}this._sinkCount+=1;let r;try{r=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof r=="function")try{r()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof r=="function"&&r(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let s=0;s<e;s++){let o=s,r=this._deps[s];r.unsub=Se,r.unsub=r.node.subscribe(a=>{if(r.unsub===null)return;let i=this._config.tierOf,d=!1;for(let l of a)i(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:o},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(s){this._deps[t].unsub=null;for(let o=0;o<t;o++){let r=this._deps[o];if(r.unsub!=null){let a=r.unsub;r.unsub=null;try{a()}catch{}fe(r)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let t=this._deps.length,s=Oe(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ae),s.unsub=Se;try{s.unsub=e.subscribe(o=>{if(s.unsub===null)return;let r=this._config.tierOf,a=!1;for(let i of o)r(i[0])>=3&&(a=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(o){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(s){this._emit([[h,this._wrapFnError("cleanup threw",s)]])}else if(t!=null&&typeof t=="object"){let s=t.deactivate;if(typeof s=="function")try{s()}catch(o){this._emit([[h,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let s of this._deps){if(s.unsub!=null){let o=s.unsub;s.unsub=null;try{o()}catch{}}fe(s)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let s=this._deps[e],o=t[0];if(this._inspectorHooks!=null){let r={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(r)}if(o!==W){if(o===E){this._depDirtied(s);return}if(o===S){this._depInvalidated(s),this._emit(xe);return}if(o===C||o===B){this._emit([t]);return}if(o===N){this._emit(de);return}if(o===g)this._depSettledAsData(s,t[1]);else if(o===v)this._depSettledAsResolved(s);else if(o===O)this._depSettledAsTerminal(s,!0);else if(o===h)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(o===g||o===v)&&this._emit([t]),(o===O||o===h)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ae))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(we),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[h,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Ne)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(a){this._emit([[h,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(i){this._emit([[h,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),s=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let i=t[a];i!=null&&i.length>0&&(this._deps[a].prevData=i[i.length-1])}let o=this._deps.map(a=>a.terminal),r={prevData:s,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:s};for(let i of this._inspectorHooks)i(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,r);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let i=a;(typeof i.beforeRun=="function"||typeof i.deactivate=="function"||typeof i.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[h,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ce?(this._rerunDepth=0,this._emit([[h,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ce} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let s=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[F,e[0]]:e;let s=!0,o=!1,r=!1,a=-1;for(let d of e){let l=t(d[0]);l<a&&(s=!1),l===3&&(o=!0),d[0]===E&&(r=!0),a=l}let i=e;if(!s){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),i=d.map(l=>l.m)}if(o&&!r&&this._status!=="dirty"){let d=0;for(;d<i.length&&t(i[d][0])===0;)d++;return d===0?[F,...i]:[...i.slice(0,d),F,...i.slice(d)]}return i}_emit(e){if(e.length===0)return;let t=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(d=>d[0]===N||d[0]===S);if(i.length===0)return;t=i}t=this._frameBatch(t);let o=null;for(let i=0;i<t.length;i++){let d=t[i],l=d[0];if(l!==C&&l!==B){o?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===C?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let f=d[1];if(l===C)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))c=!1;else if(this._pauseLocks.delete(f),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?o?.push(d):o==null&&(o=t.slice(0,i))}if(o!=null){if(o.length===0)return;t=o}if(this._hasMeta&&t.some(i=>i[0]===N))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(de)}catch{}let{finalMessages:r,equalsError:a}=this._updateState(t);if(r.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:r})}catch{}}if(r.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,d=[];for(let l of r){let c=i(l[0]);c<3||c===5?d.push(l):this._pauseBuffer.push(l)}d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(r);a!=null&&this._emit([[h,a]])}_updateState(e){let t=this._config.tierOf,s,o,r=-1,a=0;for(let c of e)t(c[0])===3&&a++;let i=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===g){d=c;break}}for(let c=0;c<e.length;c++){let f=e[c],p=f[0];if(p===g){if(f.length>=2){let _=!1;if(i&&this._cached!==void 0)try{_=this._equals(this._cached,f[1])}catch(b){o=this._wrapFnError("equals threw",b),r=c;break}if(_){s==null&&(s=e.slice(0,c)),s.push(re),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(d<0||c===d)&&Ee(this._versioning,f[1],this._hashFn)}this._status="settled",s?.push(f)}else if(s?.push(f),p===E)this._status="dirty";else if(p===v)this._status="resolved";else if(p===O)this._status="completed";else if(p===h)this._status="errored";else if(p===S){this._cached=void 0,this._status="dirty";let _=this._cleanup;if(typeof _=="function"){this._cleanup=void 0;try{_()}catch{}}else if(_!=null&&typeof _=="object"){let b=_.invalidate;if(typeof b=="function")try{b()}catch{}}}else p===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=r>=0?s??e.slice(0,r):s??e;return o!=null?{finalMessages:l,equalsError:o}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let s of t)s(e)};_dispatchOrAccumulate(e){if(be()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ve(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}q(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);q(this._deliverToSinks,t,this._config.tierOf)}},Re=n=>Array.isArray(n),he=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function ge(n,e,t){let s=Re(n)?n:[],o=typeof n=="function"?n:typeof e=="function"?e:void 0,r={};return Re(n)?r=(he(e)?e:t)??{}:he(n)?r=n:r=(he(e)?e:t)??{},new X(s,o,r)}function ot(n,e,t){return t?!1:n.some((s,o)=>!(s!=null&&s.length>0)&&e.prevData[o]===void 0)}function _e(n,e){return ge([],{...e,initial:n})}function rt(n,e,t){let s=t?.partial??!1;return ge(n,(r,a,i)=>{if(ot(r,i,s)){a.down([[v]]);return}let d=r.map((l,c)=>l!=null&&l.length>0?l.at(-1):i.prevData[c]);a.emit(e(d,i))},{describeKind:"derived",...t})}function De(n,e,t){let s=new Map;return n.forEach((o,r)=>{s.set(o,r)}),rt(n,(o,r)=>e(i=>{let d=s.get(i);if(d==null)throw new Error(`dynamicNode: untracked dep "${i.name??"<unnamed>"}"`);return o[d]},r),t)}var Q=new WeakMap,ee=new WeakMap;function Z(n,e){let t=e.get(n);if(t)for(let s of t)s()}function ye(n,e={}){let t=0;return{...e,get:()=>Ie(n),subscribe:o=>{t===0&&Z(n,Q),t++;let r=n.subscribe(a=>{for(let[i,d]of a)i===g&&o(d)});return()=>{r(),t--,t===0&&Z(n,ee)}},listen:o=>{t===0&&Z(n,Q),t++;let r=!0,a=n.subscribe(i=>{for(let[d,l]of i)if(d===g){if(r){r=!1;continue}o(l)}});return()=>{a(),t--,t===0&&Z(n,ee)}},_node:n}}function Fe(n){let e=n.cache,t;if(n.subscribe(o=>{for(let[r,a]of o)r===g&&(e=a),r===h&&(t=a)})(),t)throw t;return e}function Ie(n){return n.status==="sentinel"?Fe(n):n.cache}function it(n){let e=_e(n,{resubscribable:!0,resetOnTeardown:!0});return ye(e,{set:t=>e.emit(t)})}function at(n,e){let t=Array.isArray(n)?n:[n],s=t.map(r=>r._node),o=De(s,r=>{let a=t.map(i=>{let d=i._node;return d.status==="sentinel"&&Fe(d),r(d)});return e(...a)},{resubscribable:!0,resetOnTeardown:!0,equals:Object.is});return ye(o)}function dt(n){let e=_e(n,{resubscribable:!0,resetOnTeardown:!0,equals:()=>!1});return ye(e,{set:t=>e.emit(t),setKey:(t,s)=>{let o=Ie(e);e.emit({...o,[t]:s})}})}function lt(n){return n.get()}function Ge(n,e){let t=n._node,s=Q.get(t);s||(s=new Set,Q.set(t,s)),s.add(e)}function Le(n,e){let t=n._node,s=ee.get(t);s||(s=new Set,ee.set(t,s)),s.add(e)}function ct(n,e){Ge(n,()=>{let t=e();typeof t=="function"&&Le(n,t)})}function ut(n,e,t){return(...s)=>{let o;return Te(()=>{o=t(...s)}),o}}0&&(module.exports={action,atom,computed,getValue,map,onMount,onStart,onStop});
|
|
1
|
+
"use strict";var re=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var We=(n,e)=>{for(var t in e)re(n,t,{get:e[t],enumerable:!0})},je=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ue(e))!Be.call(n,r)&&r!==t&&re(n,r,{get:()=>e[r],enumerable:!(s=Pe(e,r))||s.enumerable});return n};var ze=n=>je(re({},"__esModule",{value:!0}),n);var ut={};We(ut,{action:()=>lt,atom:()=>ot,computed:()=>it,getValue:()=>dt,map:()=>at,onMount:()=>ct,onStart:()=>Ge,onStop:()=>He});module.exports=ze(ut);var O=0,P=!1,A=[],k=[],D=[],U=[];function me(){return O>0||P}function be(){return O>0}function ve(n){O>0?U.push(n):n()}function Te(n){O+=1;let e=!1;try{n()}catch(t){throw e=!0,t}finally{if(O-=1,O===0)if(e){if(!P){let t=U.splice(0);for(let s of t)try{s()}catch{}A.length=0,k.length=0,D.length=0}}else $e()}}function $e(){let n=!P;n&&(P=!0);let e=[],t=0;try{for(;A.length>0||k.length>0||D.length>0||n&&U.length>0;){if(n&&U.length>0){let i=U.splice(0);for(let a of i)try{a()}catch(o){e.push(o)}continue}if(t+=1,t>1e3)throw A.length=0,k.length=0,D.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let r=(A.length>0?A:k.length>0?k:D).splice(0);for(let i of r)try{i()}catch(a){e.push(a)}}}finally{n&&(P=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function q(n,e,t){if(e.length===0)return;if(e.length===1){let c=t(e[0][0]);if(c<3||!me()){n(e);return}(c>=5?D:c===4?k:A).push(()=>n(e));return}let s=e.length,r=s,i=s,a=s,o=0;for(;o<s&&t(e[o][0])<3;)o++;for(r=o;o<s&&t(e[o][0])===3;)o++;for(i=o;o<s&&t(e[o][0])===4;)o++;a=o;let d=me();if(r>0){let c=e.slice(0,r);n(c)}if(i>r){let c=e.slice(r,i);d?A.push(()=>n(c)):n(c)}if(a>i){let c=e.slice(i,a);d?k.push(()=>n(c)):n(c)}if(s>a){let c=e.slice(a,s);d?D.push(()=>n(c)):n(c)}}var B=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),M=Symbol.for("graphrefly/DIRTY"),E=Symbol.for("graphrefly/RESOLVED"),S=Symbol.for("graphrefly/INVALIDATE"),C=Symbol.for("graphrefly/PAUSE"),W=Symbol.for("graphrefly/RESUME"),w=Symbol.for("graphrefly/TEARDOWN"),R=Symbol.for("graphrefly/COMPLETE"),f=Symbol.for("graphrefly/ERROR"),F=Object.freeze([M]),oe=Object.freeze([E]),qe=Object.freeze([S]),ie=Object.freeze([B]),Ke=Object.freeze([R]),Ye=Object.freeze([w]),ae=Object.freeze([F]),xe=Object.freeze([oe]),we=Object.freeze([qe]),Ne=Object.freeze([Ke]),de=Object.freeze([Ye]);var Je={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}};function Ae(n){n.registerCodec(Je)}var Xe={type:"system",id:""};function K(n){if(n==null)return Xe;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}function ke(){return Date.now()*1e6}var Y=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let s=this._messageTypes.get(t);return s!=null?s.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function Me(n){n.registerMessageType(B,{tier:0,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1}),n.registerMessageType(S,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(C,{tier:2,wireCrossing:!1}),n.registerMessageType(W,{tier:2,wireCrossing:!1}),n.registerMessageType(g,{tier:3,wireCrossing:!0}),n.registerMessageType(E,{tier:3,wireCrossing:!0}),n.registerMessageType(R,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(f,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(w,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var I=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function ce(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(ce);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=ce(n[t]);return e}return null}var Ze=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qe=new TextEncoder;function et(n){let e=Qe.encode(n),t=e.length,s=t*8,r=t+9+63&-64,i=new Uint8Array(r);i.set(e),i[t]=128;let a=new DataView(i.buffer);a.setUint32(r-4,s>>>0,!1),a.setUint32(r-8,Math.floor(s/4294967296)>>>0,!1);let o=1779033703,d=3144134277,c=1013904242,l=2773480762,h=1359893119,p=2600822924,_=528734635,b=1541459225,N=new Uint32Array(64),m=(T,y)=>T>>>y|T<<32-y;for(let T=0;T<r;T+=64){for(let u=0;u<16;u++)N[u]=a.getUint32(T+u*4,!1);for(let u=16;u<64;u++){let L=N[u-15],V=N[u-2],$=m(L,7)^m(L,18)^L>>>3,se=m(V,17)^m(V,19)^V>>>10;N[u]=N[u-16]+$+N[u-7]+se>>>0}let y=o,G=d,H=c,te=l,x=h,j=p,z=_,ne=b;for(let u=0;u<64;u++){let L=m(x,6)^m(x,11)^m(x,25),V=x&j^~x&z,$=ne+L+V+Ze[u]+N[u]>>>0,se=m(y,2)^m(y,13)^m(y,22),Le=y&G^y&H^G&H,Ve=se+Le>>>0;ne=z,z=j,j=x,x=te+$>>>0,te=H,H=G,G=y,y=$+Ve>>>0}o=o+y>>>0,d=d+G>>>0,c=c+H>>>0,l=l+te>>>0,h=h+x>>>0,p=p+j>>>0,_=_+z>>>0,b=b+ne>>>0}let v=T=>T.toString(16).padStart(8,"0");return v(o)+v(d)+v(c)+v(l)+v(h)+v(p)+v(_)+v(b)}function le(n){let e=ce(n??null),t=JSON.stringify(e);return et(t).slice(0,16)}function tt(){let n=globalThis.crypto;if(n?.randomUUID)return n.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function ue(n,e,t){let s=t?.id??tt();if(n===0)return{id:s,version:0};let i=(t?.hash??le)(e);return{id:s,version:0,cid:i,prev:null}}function Ee(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var Se=()=>{},Ce=100;function Re(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function fe(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function J(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}var nt=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},st=(n,e,t,s)=>{let r=n;if(r._status==="completed"||r._status==="errored")return;let i=r._cached,a=i===void 0?[ie]:[ie,[g,i]];r._status==="dirty"&&a.push(F),q(e,a,r._config.tierOf)},pe=new Y({onMessage:nt,onSubscribe:st});Me(pe);Ae(pe);var X=class n{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,s){this._config=s.config??pe,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=t,this._partial=s.partial??!1,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??le;let r=s.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?ue(r,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Re);let i={};for(let[o,d]of Object.entries(s.meta??{})){let c={initial:d,name:`${s.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};s.guard!=null&&(c.guard=s.guard),i[o]=new n([],void 0,c)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let a=this;this._actions={emit(o){a._emit([[g,o]])},down(o){a._emit(J(o))},up(o){a._emitUp(J(o))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let s=this._versioningLevel;if(s!=null&&e<=s)return;let r=t?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let i=this._cached===void 0?void 0:this._cached,a=this._versioning,o=a?.id??t?.id,d=a?.version??0,c=ue(e,i,{id:o,hash:r});c.version=d,this._versioning=c,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=K(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!t&&!s)return;let r=K(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,i))throw new I({actor:r,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(r,i))throw new I({actor:r,action:i,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:ke()}}down(e,t){let s=J(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[g,e]])}up(e,t){if(this._deps.length===0)return;let s=J(e);if(s.length===0)return;this._checkGuard(t);let r=t??{internal:!0};this._validateUpTiers(s);for(let i of this._deps)i.node.up?.(s,r)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let s of e){let r=t(s[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=K(t);if(!this._guard(d,"observe"))throw new I({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)fe(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let s=0;s<e;s++){let r=s,i=this._deps[s];i.unsub=Se,i.unsub=i.node.subscribe(a=>{if(i.unsub===null)return;let o=this._config.tierOf,d=!1;for(let c of a)o(c[0])>=3&&(d=!0),this._config.onMessage(this,c,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(s){this._deps[t].unsub=null;for(let r=0;r<t;r++){let i=this._deps[r];if(i.unsub!=null){let a=i.unsub;i.unsub=null;try{a()}catch{}fe(i)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let t=this._deps.length,s=Re(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ae),s.unsub=Se;try{s.unsub=e.subscribe(r=>{if(s.unsub===null)return;let i=this._config.tierOf,a=!1;for(let o of r)i(o[0])>=3&&(a=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(r){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(s){this._emit([[f,this._wrapFnError("cleanup threw",s)]])}else if(t!=null&&typeof t=="object"){let s=t.deactivate;if(typeof s=="function")try{s()}catch(r){this._emit([[f,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let s of this._deps){if(s.unsub!=null){let r=s.unsub;s.unsub=null;try{r()}catch{}}fe(s)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let s=this._deps[e],r=t[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(i)}if(r!==B){if(r===M){this._depDirtied(s);return}if(r===S){this._depInvalidated(s),this._emit(we);return}if(r===C||r===W){this._emit([t]);return}if(r===w){this._emit(de);return}if(r===g)this._depSettledAsData(s,t[1]);else if(r===E)this._depSettledAsResolved(s);else if(r===R)this._depSettledAsTerminal(s,!0);else if(r===f)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(r===g||r===E)&&this._emit([t]),(r===R||r===f)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ae))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(xe),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[f,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Ne)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(a){this._emit([[f,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(o){this._emit([[f,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),s=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let o=t[a];o!=null&&o.length>0&&(this._deps[a].prevData=o[o.length-1])}let r=this._deps.map(a=>a.terminal),i={prevData:s,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:s};for(let o of this._inspectorHooks)o(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,i);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let o=a;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[f,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ce?(this._rerunDepth=0,this._emit([[f,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ce} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let s=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[F,e[0]]:e;let s=!0,r=!1,i=!1,a=-1;for(let d of e){let c=t(d[0]);c<a&&(s=!1),c===3&&(r=!0),d[0]===M&&(i=!0),a=c}let o=e;if(!s){let d=e.map((c,l)=>({m:c,i:l,tier:t(c[0])}));d.sort((c,l)=>c.tier-l.tier||c.i-l.i),o=d.map(c=>c.m)}if(r&&!i&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[F,...o]:[...o.slice(0,d),F,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;for(let o=0;o<e.length;o++){let d=e[o];if(d[0]===f&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let o=e.filter(d=>d[0]===w||d[0]===S);if(o.length===0)return;t=o}t=this._frameBatch(t);let r=null;for(let o=0;o<t.length;o++){let d=t[o],c=d[0];if(c!==C&&c!==W){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${c===C?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let h=d[1];if(c===C)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(h),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(h))l=!1;else if(this._pauseLocks.delete(h),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?r?.push(d):r==null&&(r=t.slice(0,o))}if(r!=null){if(r.length===0)return;t=r}if(this._hasMeta&&t.some(o=>o[0]===w))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(de)}catch{}let{finalMessages:i,equalsError:a}=this._updateState(t);if(i.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let c of i)o(c[0])===3?this._pauseBuffer.push(c):d.push(c);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(i);a!=null&&this._emit([[f,a]])}_updateState(e){let t=this._config.tierOf,s,r,i=-1,a=0;for(let l of e)t(l[0])===3&&a++;let o=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===g){d=l;break}}for(let l=0;l<e.length;l++){let h=e[l],p=h[0];if(p===g){if(h.length>=2){let _=!1;if(o&&this._cached!==void 0)try{_=this._equals(this._cached,h[1])}catch(b){r=this._wrapFnError("equals threw",b),i=l;break}if(_){s==null&&(s=e.slice(0,l)),s.push(oe),this._status="resolved";continue}this._cached=h[1],this._versioning!=null&&(d<0||l===d)&&Ee(this._versioning,h[1],this._hashFn)}this._status="settled",s?.push(h)}else if(s?.push(h),p===M)this._status="dirty";else if(p===E)this._status="resolved";else if(p===R)this._status="completed";else if(p===f)this._status="errored";else if(p===S){this._cached=void 0,this._status="dirty";let _=this._cleanup;if(typeof _=="function"){this._cleanup=void 0;try{_()}catch{}}else if(_!=null&&typeof _=="object"){let b=_.invalidate;if(typeof b=="function")try{b()}catch{}}}else p===w&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let c=i>=0?s??e.slice(0,i):s??e;return r!=null?{finalMessages:c,equalsError:r}:{finalMessages:c}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let s of t)s(e)};_dispatchOrAccumulate(e){if(be()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ve(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}q(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);q(this._deliverToSinks,t,this._config.tierOf)}},Oe=n=>Array.isArray(n),he=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function ge(n,e,t){let s=Oe(n)?n:[],r=typeof n=="function"?n:typeof e=="function"?e:void 0,i={};return Oe(n)?i=(he(e)?e:t)??{}:he(n)?i=n:i=(he(e)?e:t)??{},new X(s,r,i)}function _e(n,e){return ge([],{...e,initial:n})}function rt(n,e,t){return ge(n,(r,i,a)=>{let o=r.map((d,c)=>d!=null&&d.length>0?d.at(-1):a.prevData[c]);i.emit(e(o,a))},{describeKind:"derived",...t})}function De(n,e,t){let s=new Map;return n.forEach((r,i)=>{s.set(r,i)}),rt(n,(r,i)=>e(o=>{let d=s.get(o);if(d==null)throw new Error(`dynamicNode: untracked dep "${o.name??"<unnamed>"}"`);return r[d]},i),t)}var Q=new WeakMap,ee=new WeakMap;function Z(n,e){let t=e.get(n);if(t)for(let s of t)s()}function ye(n,e={}){let t=0;return{...e,get:()=>Ie(n),subscribe:r=>{t===0&&Z(n,Q),t++;let i=n.subscribe(a=>{for(let[o,d]of a)o===g&&r(d)});return()=>{i(),t--,t===0&&Z(n,ee)}},listen:r=>{t===0&&Z(n,Q),t++;let i=!0,a=n.subscribe(o=>{for(let[d,c]of o)if(d===g){if(i){i=!1;continue}r(c)}});return()=>{a(),t--,t===0&&Z(n,ee)}},_node:n}}function Fe(n){let e=n.cache,t;if(n.subscribe(r=>{for(let[i,a]of r)i===g&&(e=a),i===f&&(t=a)})(),t)throw t;return e}function Ie(n){return n.status==="sentinel"?Fe(n):n.cache}function ot(n){let e=_e(n,{resubscribable:!0,resetOnTeardown:!0});return ye(e,{set:t=>e.emit(t)})}function it(n,e){let t=Array.isArray(n)?n:[n],s=t.map(i=>i._node),r=De(s,i=>{let a=t.map(o=>{let d=o._node;return d.status==="sentinel"&&Fe(d),i(d)});return e(...a)},{resubscribable:!0,resetOnTeardown:!0,equals:Object.is});return ye(r)}function at(n){let e=_e(n,{resubscribable:!0,resetOnTeardown:!0,equals:()=>!1});return ye(e,{set:t=>e.emit(t),setKey:(t,s)=>{let r=Ie(e);e.emit({...r,[t]:s})}})}function dt(n){return n.get()}function Ge(n,e){let t=n._node,s=Q.get(t);s||(s=new Set,Q.set(t,s)),s.add(e)}function He(n,e){let t=n._node,s=ee.get(t);s||(s=new Set,ee.set(t,s)),s.add(e)}function ct(n,e){Ge(n,()=>{let t=e();typeof t=="function"&&He(n,t)})}function lt(n,e,t){return(...s)=>{let r;return Te(()=>{r=t(...s)}),r}}0&&(module.exports={action,atom,computed,getValue,map,onMount,onStart,onStop});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
export { N as NanoAtom, a as NanoComputed, b as NanoMap, c as action, d as atom, e as computed, g as getValue, m as map, o as onMount, f as onStart, h as onStop } from '../../index-
|
|
1
|
+
import '../../node-BVV7G1bq.cjs';
|
|
2
|
+
export { N as NanoAtom, a as NanoComputed, b as NanoMap, c as action, d as atom, e as computed, g as getValue, m as map, o as onMount, f as onStart, h as onStop } from '../../index-CIXaiYDE.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
export { N as NanoAtom, a as NanoComputed, b as NanoMap, c as action, d as atom, e as computed, g as getValue, m as map, o as onMount, f as onStart, h as onStop } from '../../index-
|
|
1
|
+
import '../../node-BVV7G1bq.js';
|
|
2
|
+
export { N as NanoAtom, a as NanoComputed, b as NanoMap, c as action, d as atom, e as computed, g as getValue, m as map, o as onMount, f as onStart, h as onStop } from '../../index-wIx1Jisk.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../../chunk-BZP5T4X6.js";import"../../chunk-W4TSQ6RJ.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{h as action,a as atom,b as computed,d as getValue,c as map,g as onMount,e as onStart,f as onStop};
|