@graphrefly/graphrefly 0.37.0 → 0.38.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/{chunk-CZIQ6JCE.js → chunk-2YFDSYEF.js} +1 -1
- package/dist/{chunk-YVYSO5CW.js → chunk-4BDQXBXE.js} +1 -1
- package/dist/chunk-5BGFS2XH.js +1 -0
- package/dist/chunk-6773HURD.js +1 -0
- package/dist/{chunk-U3COB5WU.js → chunk-6KZZ6XQE.js} +1 -1
- package/dist/{chunk-5CPPC75H.js → chunk-6VFC334U.js} +1 -1
- package/dist/{chunk-KUVDFOJH.js → chunk-7KZZLWZ6.js} +1 -1
- package/dist/{chunk-Q7EUZ6NN.js → chunk-B5S7KTGP.js} +1 -1
- package/dist/chunk-CMTN3KPT.js +80 -0
- package/dist/chunk-DQJLC6YY.js +1 -0
- package/dist/chunk-DSOVKKTI.js +1 -0
- package/dist/chunk-FAYEMS5M.js +1 -0
- package/dist/chunk-FWGIZP3W.js +1 -0
- package/dist/{chunk-FMI4CWFL.js → chunk-G7JN6LCB.js} +1 -1
- package/dist/{chunk-PCD2MU7X.js → chunk-IBGE62GZ.js} +1 -1
- package/dist/{chunk-MYFR67PY.js → chunk-K5C67OGE.js} +1 -1
- package/dist/chunk-KJEAIIIY.js +43 -0
- package/dist/chunk-LV3ACS5J.js +1 -0
- package/dist/{chunk-LOQRPP4Y.js → chunk-NBGPXQSP.js} +1 -1
- package/dist/chunk-NN3QPJ6U.js +1 -0
- package/dist/{chunk-QWVQIL3T.js → chunk-NSAZ6PR6.js} +1 -1
- package/dist/{chunk-MC5LZG3U.js → chunk-NV63VQHI.js} +1 -1
- package/dist/{chunk-2C4NESZE.js → chunk-O245YLM5.js} +1 -1
- package/dist/{chunk-TLS7M7H4.js → chunk-O2BLVQU4.js} +1 -1
- package/dist/chunk-PHXZRR6C.js +1 -0
- package/dist/{chunk-K6ZFJ473.js → chunk-POCWFIJ7.js} +1 -1
- package/dist/{chunk-C5CBVOCB.js → chunk-QEVSIVSF.js} +1 -1
- package/dist/chunk-QMC2PLNM.js +7 -0
- package/dist/chunk-QOJFR6GS.js +1 -0
- package/dist/{chunk-MQZWA3DF.js → chunk-RZ5HKPGI.js} +1 -1
- package/dist/{chunk-WSLN4JFO.js → chunk-SFK7MN7S.js} +1 -1
- package/dist/{chunk-QP5TH523.js → chunk-SP5O2MIX.js} +1 -1
- package/dist/chunk-TB7JKSVS.js +61 -0
- package/dist/{chunk-T4U24DXX.js → chunk-TMVY7OWG.js} +1 -1
- package/dist/{chunk-UODQF4EY.js → chunk-UAXFKMAG.js} +1 -1
- package/dist/{chunk-TFK4P4CX.js → chunk-UVLZX2OU.js} +1 -1
- package/dist/chunk-XIMFHEKV.js +1 -0
- package/dist/{chunk-XIJKEXWR.js → chunk-XLMYQB6F.js} +1 -1
- package/dist/{chunk-4EATTNAE.js → chunk-XLYF4LBH.js} +1 -1
- package/dist/compat/index.cjs +9 -9
- package/dist/compat/index.d.cts +7 -7
- package/dist/compat/index.d.ts +7 -7
- package/dist/compat/index.js +1 -1
- package/dist/compat/nestjs/index.cjs +11 -11
- package/dist/compat/nestjs/index.d.cts +5 -5
- package/dist/compat/nestjs/index.d.ts +5 -5
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/zustand/index.cjs +7 -7
- package/dist/compat/zustand/index.d.cts +3 -3
- package/dist/compat/zustand/index.d.ts +3 -3
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-_XckYx2e.d.cts → composite-CgG0MqHm.d.cts} +8 -1
- package/dist/{composite-CT_mApQD.d.ts → composite-DTOlDuch.d.ts} +8 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/extra/index.cjs +19 -19
- package/dist/extra/index.d.cts +5 -5
- package/dist/extra/index.d.ts +5 -5
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -2
- package/dist/extra/node.d.cts +107 -1
- package/dist/extra/node.d.ts +107 -1
- package/dist/extra/node.js +2 -2
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.d.cts +1 -1
- package/dist/extra/reactive.d.ts +1 -1
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-tiers-browser.d.cts +76 -5
- package/dist/extra/storage-tiers-browser.d.ts +76 -5
- package/dist/extra/storage-tiers-node.d.cts +137 -13
- package/dist/extra/storage-tiers-node.d.ts +137 -13
- package/dist/extra/storage-tiers.d.cts +151 -23
- package/dist/extra/storage-tiers.d.ts +151 -23
- package/dist/graph/index.cjs +7 -7
- package/dist/graph/index.d.cts +4 -4
- package/dist/graph/index.d.ts +4 -4
- package/dist/graph/index.js +1 -1
- package/dist/{graph-YQXDndFy.d.ts → graph-BjW1taJl.d.ts} +217 -10
- package/dist/{graph-CaNXUc3c.d.cts → graph-CHsVwf9S.d.cts} +217 -10
- package/dist/{index-CUTHDZ7Q.d.ts → index-5dNRlW7J.d.ts} +3 -3
- package/dist/{index-Bpzw8hx3.d.ts → index-AUqWe_fX.d.ts} +7 -4
- package/dist/{index-fHKHdAso.d.ts → index-B-ORMr3k.d.ts} +2 -2
- package/dist/{index-DcWbx58m.d.cts → index-B2IUcH13.d.cts} +2 -2
- package/dist/{index-DuhOdNyg.d.ts → index-BFaALJxR.d.ts} +2 -2
- package/dist/{index-DPqR3wdW.d.ts → index-BI1wMfyc.d.ts} +2 -2
- package/dist/{index-D0ZxFXYl.d.ts → index-BUFCHvOR.d.ts} +2 -2
- package/dist/{index-CLPQyYY5.d.cts → index-BWUMIt7J.d.cts} +3 -3
- package/dist/{index-CkN8CZlT.d.cts → index-BaSy4L6w.d.cts} +37 -17
- package/dist/{index-B1IcU--K.d.cts → index-BgzPO43H.d.cts} +2 -2
- package/dist/{index-D6tRNEKz.d.cts → index-BhzwpIJc.d.cts} +1 -1
- package/dist/{index-4IwO4mH2.d.cts → index-BkQqf1EF.d.cts} +80 -7
- package/dist/{index-CajEOoAN.d.ts → index-BmWuVdER.d.ts} +2 -2
- package/dist/{index-0qOD-421.d.ts → index-Bn0uZEL4.d.ts} +2 -2
- package/dist/{index-DAKm44My.d.cts → index-BpMZzX9P.d.cts} +2 -2
- package/dist/{index-CrpjECS6.d.cts → index-Bpr0Pwgl.d.cts} +2 -2
- package/dist/{index-BECJ8M0T.d.cts → index-BqcgiSQg.d.cts} +2 -2
- package/dist/{index-DfAo9WKr.d.ts → index-BsZk9T8y.d.ts} +1 -1
- package/dist/{index-CU3z8Cel.d.cts → index-BsgxnHN8.d.cts} +2 -2
- package/dist/index-Bub6x_D4.d.cts +427 -0
- package/dist/{index-C-pFD_FV.d.ts → index-BwOsJfLJ.d.ts} +2 -2
- package/dist/{index-CRycrNfn.d.ts → index-Byp771zP.d.ts} +1 -1
- package/dist/{index-e1m3ZHgc.d.cts → index-C-3UXnHT.d.cts} +1 -1
- package/dist/{index-DTYIRT_v.d.cts → index-C56XZiDe.d.cts} +2 -2
- package/dist/{index-D11pGlaI.d.cts → index-CAV-3RpJ.d.cts} +2 -2
- package/dist/{index-D_DThl_J.d.cts → index-CAbHN_rP.d.cts} +1 -1
- package/dist/{index-BhLA9feT.d.ts → index-CEVzBWeB.d.ts} +2 -2
- package/dist/{index-Ci358GSC.d.cts → index-CM-i58FY.d.cts} +2 -2
- package/dist/{index-B9qJmmv3.d.cts → index-CQsqqEVz.d.cts} +1 -1
- package/dist/{index-C0tga1_x.d.ts → index-CijfwEWx.d.ts} +2 -2
- package/dist/{index-BwtIbzSV.d.cts → index-Ckil6miL.d.cts} +2 -2
- package/dist/{index-BokynmA4.d.cts → index-CpdnP-0y.d.cts} +1 -1
- package/dist/{index-BmLkcDlj.d.ts → index-CrlHFsiT.d.ts} +37 -17
- package/dist/{index-DCAuN9u5.d.cts → index-Czk3r0yA.d.cts} +37 -3
- package/dist/{index-C4N-dg5U.d.cts → index-D-B7U42V.d.cts} +2 -2
- package/dist/{index-CKcnuQ2c.d.ts → index-D-HZ7sP4.d.ts} +2 -2
- package/dist/{index-D6pwWiOc.d.cts → index-D7-RSD93.d.cts} +2 -2
- package/dist/{index-9mbs_PIG.d.ts → index-D9vBTuzo.d.ts} +2 -2
- package/dist/{index-C_qi0WlF.d.cts → index-DJNAWzcH.d.cts} +2 -2
- package/dist/{index-Ae6L8liv.d.ts → index-DJVQ-t07.d.ts} +2 -2
- package/dist/{index-D_d1erkR.d.ts → index-DKrIuF-r.d.ts} +2 -2
- package/dist/{index-DXz9uwcs.d.ts → index-DOU1Ee_k.d.ts} +1 -1
- package/dist/{index-D1E1tqHT.d.ts → index-DTDVDzhA.d.ts} +37 -3
- package/dist/{index-B5UR87KG.d.ts → index-DY2f2b9z.d.ts} +4 -2
- package/dist/{index-D8IyqHvT.d.cts → index-DeSsvHDD.d.cts} +4 -2
- package/dist/index-Di7OdwlO.d.ts +427 -0
- package/dist/{index-CzIWlnPp.d.ts → index-DqICM_I7.d.ts} +80 -7
- package/dist/{index-BOfHwQc1.d.ts → index-ML6vHKXK.d.ts} +1 -1
- package/dist/{index-DqtXA3yX.d.cts → index-UsU9ptzs.d.cts} +7 -4
- package/dist/{index-B46GWgk3.d.ts → index-Vz7KPfgz.d.ts} +1 -1
- package/dist/index.cjs +50 -50
- package/dist/index.d.cts +32 -32
- package/dist/index.d.ts +32 -32
- package/dist/index.js +1 -1
- package/dist/meta-BYqlATmg.d.ts +98 -0
- package/dist/meta-DreaEM_a.d.cts +98 -0
- package/dist/patterns/ai/browser.cjs +2 -2
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +21 -21
- package/dist/patterns/ai/index.d.cts +9 -9
- package/dist/patterns/ai/index.d.ts +9 -9
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +7 -7
- 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 -7
- 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 -8
- package/dist/patterns/demo-shell/index.d.cts +4 -4
- package/dist/patterns/demo-shell/index.d.ts +4 -4
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +7 -7
- package/dist/patterns/domain-templates/index.d.cts +3 -3
- package/dist/patterns/domain-templates/index.d.ts +3 -3
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +21 -21
- package/dist/patterns/graphspec/index.d.cts +3 -3
- package/dist/patterns/graphspec/index.d.ts +3 -3
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -7
- 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 +12 -12
- package/dist/patterns/harness/index.d.cts +8 -8
- package/dist/patterns/harness/index.d.ts +8 -8
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -7
- 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 -7
- package/dist/patterns/lens/index.d.cts +4 -4
- package/dist/patterns/lens/index.d.ts +4 -4
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +7 -7
- package/dist/patterns/memory/index.d.cts +6 -4
- package/dist/patterns/memory/index.d.ts +6 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +7 -7
- 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 -7
- package/dist/patterns/orchestration/index.d.cts +4 -4
- package/dist/patterns/orchestration/index.d.ts +4 -4
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.d.cts +5 -5
- package/dist/patterns/process/index.d.ts +5 -5
- package/dist/patterns/process/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +8 -8
- package/dist/patterns/reactive-layout/index.d.cts +4 -4
- package/dist/patterns/reactive-layout/index.d.ts +4 -4
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +7 -7
- package/dist/patterns/reduction/index.d.cts +3 -3
- package/dist/patterns/reduction/index.d.ts +3 -3
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +8 -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 +4 -4
- package/dist/patterns/resilient-pipeline/index.d.ts +4 -4
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +14 -14
- package/dist/patterns/surface/index.d.cts +4 -4
- package/dist/patterns/surface/index.d.ts +4 -4
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{pipeline-graph-DX2Twdj-.d.ts → pipeline-graph-9JBbmRxA.d.ts} +2 -2
- package/dist/{pipeline-graph-BrrYGjuZ.d.cts → pipeline-graph-DuHpXSOn.d.cts} +2 -2
- package/dist/{reactive-layout-DrGjuwyC.d.cts → reactive-layout-BMLDB4Vd.d.cts} +1 -1
- package/dist/{reactive-layout-BDdngW56.d.ts → reactive-layout-D-tRiNhg.d.ts} +1 -1
- package/dist/{reactive-log-jirQsxMY.d.ts → reactive-log-BgWSA1fg.d.ts} +28 -1
- package/dist/{reactive-log-ScpWyqny.d.cts → reactive-log-C3IMAGpT.d.cts} +28 -1
- package/dist/resilience-LGBK236C.js +1 -0
- package/dist/{topology-tree-BI665P0L.d.ts → topology-tree-D47-nI6Z.d.ts} +1 -1
- package/dist/{topology-tree-BkhmMg2a.d.cts → topology-tree-jrZue3ao.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-533RQFF6.js +0 -1
- package/dist/chunk-6SVKZ7VI.js +0 -1
- package/dist/chunk-A5HZZYRK.js +0 -1
- package/dist/chunk-B4L5X2QO.js +0 -7
- package/dist/chunk-FJ6IEMOS.js +0 -1
- package/dist/chunk-G6Q3DUMJ.js +0 -1
- package/dist/chunk-GDDPCDLG.js +0 -1
- package/dist/chunk-GFOT6UBB.js +0 -1
- package/dist/chunk-JJTF75VS.js +0 -1
- package/dist/chunk-K2WYIVHM.js +0 -1
- package/dist/chunk-KTWBUJO5.js +0 -61
- package/dist/chunk-M27MVZCP.js +0 -1
- package/dist/chunk-NKKUUKPD.js +0 -43
- package/dist/chunk-QKBCTKH7.js +0 -1
- package/dist/chunk-WGST56ZH.js +0 -80
- package/dist/index-BCq12BqB.d.ts +0 -139
- package/dist/index-DbWwMWiB.d.cts +0 -139
- package/dist/meta-BGO6C7K9.d.cts +0 -41
- package/dist/meta-CC6EPdpK.d.ts +0 -41
- package/dist/resilience-OBU472D2.js +0 -1
package/dist/extra/operators.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.prototype.hasOwnProperty;var A=(o,e)=>()=>(o&&(e=o(o=0)),e);var an=(o,e)=>{for(var t in e)oe(o,t,{get:e[t],enumerable:!0})},dn=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of on(e))!sn.call(o,n)&&n!==t&&oe(o,n,{get:()=>e[n],enumerable:!(r=rn(e,n))||r.enumerable});return o};var un=o=>dn(oe({},"__esModule",{value:!0}),o);function q(){return Math.trunc(performance.now()*1e6)}function ye(){return Date.now()*1e6}var se=A(()=>{"use strict"});var D,m,R,g,I,F,H,C,c,p,L,ie,ln,ae,cn,fn,de,ve,we,Ne,ue,W=A(()=>{"use strict";D=Symbol.for("graphrefly/START"),m=Symbol.for("graphrefly/DATA"),R=Symbol.for("graphrefly/DIRTY"),g=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),F=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),C=Symbol.for("graphrefly/TEARDOWN"),c=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),L=Object.freeze([R]),ie=Object.freeze([g]),ln=Object.freeze([I]),ae=Object.freeze([D]),cn=Object.freeze([c]),fn=Object.freeze([C]),de=Object.freeze([L]),ve=Object.freeze([ie]),we=Object.freeze([ln]),Ne=Object.freeze([cn]),ue=Object.freeze([fn])});function xe(o){o.registerCodec(pn)}var pn,Ee=A(()=>{"use strict";pn={name:"json",version:1,contentType:"application/json",encode(o){let e=JSON.stringify(o);return new TextEncoder().encode(e)},decode(o,e){let t=new TextDecoder().decode(o);return JSON.parse(t)}}});function K(o){if(o==null)return hn;let{type:e,id:t,...r}=o;return{type:e??"system",id:t??"",...r}}var hn,ke=A(()=>{"use strict";hn={type:"system",id:""}});function Me(){return le>0||mn}function Se(){return le>0}function De(o){le>0?gn.push(o):o()}function Y(o,e,t){if(e.length===0)return;if(e.length===1){let u=t(e[0][0]);if(u<3||!Me()){o(e);return}(u>=5?Re:u===4?Ae:Oe).push(()=>o(e));return}let r=e.length,n=r,s=r,a=r,i=0;for(;i<r&&t(e[i][0])<3;)i++;for(n=i;i<r&&t(e[i][0])===3;)i++;for(s=i;i<r&&t(e[i][0])===4;)i++;a=i;let d=Me();if(n>0){let u=e.slice(0,n);o(u)}if(s>n){let u=e.slice(n,s);d?Oe.push(()=>o(u)):o(u)}if(a>s){let u=e.slice(s,a);d?Ae.push(()=>o(u)):o(u)}if(r>a){let u=e.slice(a,r);d?Re.push(()=>o(u)):o(u)}}var le,mn,Oe,Ae,Re,gn,Ce=A(()=>{"use strict";le=0,mn=!1,Oe=[],Ae=[],Re=[],gn=[]});function Ie(o){o.registerMessageType(D,{tier:0,wireCrossing:!1}),o.registerMessageType(R,{tier:1,wireCrossing:!1}),o.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),o.registerMessageType(F,{tier:2,wireCrossing:!1}),o.registerMessageType(H,{tier:2,wireCrossing:!1}),o.registerMessageType(m,{tier:3,wireCrossing:!0}),o.registerMessageType(g,{tier:3,wireCrossing:!0}),o.registerMessageType(c,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(C,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var J,Fe=A(()=>{"use strict";W();J=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_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 r=this._messageTypes.get(t);return r!=null?r.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}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=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.")}}});var G,Le=A(()=>{"use strict";G=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(o){if(o===void 0)return null;if(typeof o=="number"){if(!Number.isFinite(o))throw new TypeError(`Cannot hash non-finite number: ${o}`);if(Number.isInteger(o)&&!Number.isSafeInteger(o))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${o}. Cross-language cid parity is not guaranteed for unsafe integers.`);return o}if(typeof o=="string"||typeof o=="boolean"||o===null)return o;if(Array.isArray(o))return o.map(ce);if(typeof o=="object"&&o!==null){let e={};for(let t of Object.keys(o).sort())e[t]=ce(o[t]);return e}return null}function _n(o){let e=Tn.encode(o),t=e.length,r=t*8,n=t+9+63&-64,s=new Uint8Array(n);s.set(e),s[t]=128;let a=new DataView(s.buffer);a.setUint32(n-4,r>>>0,!1),a.setUint32(n-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,d=3144134277,u=1013904242,l=2773480762,f=1359893119,_=2600822924,T=528734635,w=1541459225,k=new Uint32Array(64),v=(O,x)=>O>>>x|O<<32-x;for(let O=0;O<n;O+=64){for(let E=0;E<16;E++)k[E]=a.getUint32(O+E*4,!1);for(let E=16;E<64;E++){let V=k[E-15],U=k[E-2],z=v(V,7)^v(V,18)^V>>>3,re=v(U,17)^v(U,19)^U>>>10;k[E]=k[E-16]+z+k[E-7]+re>>>0}let x=i,M=d,P=u,ne=l,S=f,j=_,$=T,te=w;for(let E=0;E<64;E++){let V=v(S,6)^v(S,11)^v(S,25),U=S&j^~S&$,z=te+V+U+bn[E]+k[E]>>>0,re=v(x,2)^v(x,13)^v(x,22),nn=x&M^x&P^M&P,tn=re+nn>>>0;te=$,$=j,j=S,S=ne+z>>>0,ne=P,P=M,M=x,x=z+tn>>>0}i=i+x>>>0,d=d+M>>>0,u=u+P>>>0,l=l+ne>>>0,f=f+S>>>0,_=_+j>>>0,T=T+$>>>0,w=w+te>>>0}let N=O=>O.toString(16).padStart(8,"0");return N(i)+N(d)+N(u)+N(l)+N(f)+N(_)+N(T)+N(w)}function fe(o){let e=ce(o??null),t=JSON.stringify(e);return _n(t).slice(0,16)}function yn(){let o=globalThis.crypto;if(o?.randomUUID)return o.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 pe(o,e,t){let r=t?.id??yn();if(o===0)return{id:r,version:0};let s=(t?.hash??fe)(e);return{id:r,version:0,cid:s,prev:null}}function Ge(o,e,t){o.version+=1,"cid"in o&&(o.prev=o.cid,o.cid=t(e))}var bn,Tn,Pe=A(()=>{"use strict";bn=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]),Tn=new TextEncoder});function He(o){return{node:o,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function he(o){o.prevData=void 0,o.dirty=!1,o.involvedThisWave=!1,o.dataBatch.length=0,o.terminal=void 0}function X(o){return o.length===0?o:typeof o[0]=="symbol"?[o]:o}function y(o,e,t){let r=We(o)?o:[],n=typeof o=="function"?o:typeof e=="function"?e:void 0,s={};return We(o)?s=(me(e)?e:t)??{}:me(o)?s=o:s=(me(e)?e:t)??{},new Z(r,n,s)}var Ve,Ue,vn,wn,ge,Z,We,me,be=A(()=>{"use strict";Ee();ke();Ce();se();Fe();Le();W();Pe();Ve=()=>{},Ue=100;vn=(o,e,t,r)=>{t.direction==="down-in"&&o._onDepMessage(t.depIndex,e)},wn=(o,e,t,r)=>{let n=o;if(n._status==="completed"||n._status==="errored")return;let s=n._cached,a=s===void 0?[ae]:[ae,[m,s]];n._status==="dirty"&&a.push(L),Y(e,a,n._config.tierOf)},ge=new J({onMessage:vn,onSubscribe:wn});Ie(ge);xe(ge);Z=class o{_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,r){this._config=r.config??ge,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=t,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??fe;let n=r.versioning??this._config.defaultVersioning;this._versioningLevel=n,this._versioning=n!=null?pe(n,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(He);let s={};for(let[i,d]of Object.entries(r.meta??{})){let u={initial:d,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(u.guard=r.guard),s[i]=new o([],void 0,u)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let a=this;this._actions={emit(i){a._emit([[m,i]])},down(i){a._emit(X(i))},up(i){a._emitUp(X(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 r=this._versioningLevel;if(r!=null&&e<=r)return;let n=t?.hash??this._hashFn;n!==this._hashFn&&(this._hashFn=n);let s=this._cached===void 0?void 0:this._cached,a=this._versioning,i=a?.id??t?.id,d=a?.version??0,u=pe(e,s,{id:i,hash:n});u.version=d,this._versioning=u,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 r of this._extraGuards)if(!r(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!t&&!r)return;let n=K(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(n,s))throw new G({actor:n,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(n,s))throw new G({actor:n,action:s,nodeName:this.name})}this._lastMutation={actor:n,timestamp_ns:ye()}}down(e,t){let r=X(e);r.length!==0&&(this._checkGuard(t),this._emit(r))}emit(e,t){this._checkGuard(t),this._emit([[m,e]])}up(e,t){if(this._deps.length===0)return;let r=X(e);if(r.length===0)return;this._checkGuard(t);let n=t??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.node.up?.(r,n)}_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 r of e){let n=t(r[0]);if(n===3||n===4)throw new Error(`Node "${this.name}": tier-${n} 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 G({actor:d,action:"observe",nodeName:this.name})}let n=this._isTerminal&&this._resubscribable;if(n){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)he(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 s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:n},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 s=="function")try{s()}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 s=="function"&&s(),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 r=0;r<e;r++){let n=r,s=this._deps[r];s.unsub=Ve,s.unsub=s.node.subscribe(a=>{if(s.unsub===null)return;let i=this._config.tierOf,d=!1;for(let u of a)i(u[0])>=3&&(d=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:n},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(r){this._deps[t].unsub=null;for(let n=0;n<t;n++){let s=this._deps[n];if(s.unsub!=null){let a=s.unsub;s.unsub=null;try{a()}catch{}he(s)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let n=0;n<this._deps.length;n++)if(this._deps[n].node===e)return n;let t=this._deps.length,r=He(e);if(this._deps.push(r),this._sinks==null)return t;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de),r.unsub=Ve;try{r.unsub=e.subscribe(n=>{if(r.unsub===null)return;let s=this._config.tierOf,a=!1;for(let i of n)s(i[0])>=3&&(a=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(n){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,n}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(t!=null&&typeof t=="object"){let r=t.deactivate;if(typeof r=="function")try{r()}catch(n){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",n)]])}}for(let r of this._deps){if(r.unsub!=null){let n=r.unsub;r.unsub=null;try{n()}catch{}}he(r)}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 r=this._deps[e],n=t[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(s)}if(n!==D){if(n===R){this._depDirtied(r);return}if(n===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(we);return}if(n===F||n===H){this._emit([t]);return}if(n===C){this._emit(ue);return}if(n===m)this._depSettledAsData(r,t[1]);else if(n===g)this._depSettledAsResolved(r);else if(n===c)this._depSettledAsTerminal(r,!0);else if(n===p)this._depSettledAsTerminal(r,t[1]);else{this._emit([t]);return}if(!this._fn){(n===m||n===g)&&this._emit([t]),(n===c||n===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de))}_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(ve),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(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([[p,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([[p,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),r=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 n=this._deps.map(a=>a.terminal),s={prevData:r,terminalDeps:n,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:r};for(let i of this._inspectorHooks)i(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,s);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([[p,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ue?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ue} \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 r=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[L,e[0]]:e;let r=!0,n=!1,s=!1,a=-1;for(let d of e){let u=t(d[0]);u<a&&(r=!1),u===3&&(n=!0),d[0]===R&&(s=!0),a=u}let i=e;if(!r){let d=e.map((u,l)=>({m:u,i:l,tier:t(u[0])}));d.sort((u,l)=>u.tier-l.tier||u.i-l.i),i=d.map(u=>u.m)}if(n&&!s&&this._status!=="dirty"){let d=0;for(;d<i.length&&t(i[d][0])===0;)d++;return d===0?[L,...i]:[...i.slice(0,d),L,...i.slice(d)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let d=e[i];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 i=e.filter(d=>d[0]===C||d[0]===I);if(i.length===0)return;t=i}t=this._frameBatch(t);let n=null;for(let i=0;i<t.length;i++){let d=t[i],u=d[0];if(u!==F&&u!==H){n?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${u===F?"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 f=d[1];if(u===F)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))l=!1;else if(this._pauseLocks.delete(f),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())}}l?n?.push(d):n==null&&(n=t.slice(0,i))}if(n!=null){if(n.length===0)return;t=n}if(this._hasMeta&&t.some(i=>i[0]===C))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(ue)}catch{}let{finalMessages:s,equalsError:a}=this._updateState(t);if(s.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,d=[];for(let u of s)i(u[0])===3?this._pauseBuffer.push(u):d.push(u);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(s);a!=null&&this._emit([[p,a]])}_updateState(e){let t=this._config.tierOf,r,n,s=-1,a=0;for(let l of e)t(l[0])===3&&a++;let i=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===m){d=l;break}}for(let l=0;l<e.length;l++){let f=e[l],_=f[0];if(_===m){if(f.length>=2){let T=!1;if(i&&this._cached!==void 0)try{T=this._equals(this._cached,f[1])}catch(w){n=this._wrapFnError("equals threw",w),s=l;break}if(T){r==null&&(r=e.slice(0,l)),r.push(ie),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(d<0||l===d)&&Ge(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),_===R)this._status="dirty";else if(_===g)this._status="resolved";else if(_===c){this._status="completed";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===p){this._status="errored";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===I){if(this._cached!==void 0){let w=this._config.rigorRecorder;if(w!=null)try{w.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let T=this._cleanup;if(typeof T=="function"){this._cleanup=void 0;try{T()}catch{}}else if(T!=null&&typeof T=="object"){let w=T.invalidate;if(typeof w=="function")try{w()}catch{}}}else _===C&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=s>=0?r??e.slice(0,s):r??e;return n!=null?{finalMessages:u,equalsError:n}:{finalMessages:u}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let r of t)r(e)};_dispatchOrAccumulate(e){if(Se()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],De(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}Y(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);Y(this._deliverToSinks,t,this._config.tierOf)}},We=o=>Array.isArray(o),me=o=>typeof o=="object"&&o!=null&&!Array.isArray(o)});function b(o,e){return y((r,n,s)=>o(n,s)??void 0,{describeKind:"producer",...e})}function Be(o,e,t){return y(o,(n,s,a)=>{let i=n.map((d,u)=>d!=null&&d.length>0?d.at(-1):a.prevData[u]);s.emit(e(i,a))},{describeKind:"derived",...t})}var Te=A(()=>{"use strict";be()});function _e(o){return{describeKind:"producer",...o}}function je(o,e){return b(t=>{let r=!1;try{for(let n of o){if(r)return;t.emit(n)}r||t.down([[c]])}catch(n){r||t.down([[p,n]])}return()=>{r=!0}},_e(e))}function Nn(o){return o!=null&&typeof o.then=="function"}function xn(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=!1,a=()=>{s||(s=!0,n.down([[p,t.reason]]))};if(t?.aborted){a();return}return t?.addEventListener("abort",a,{once:!0}),Promise.resolve(o).then(i=>{s||(s=!0,t?.removeEventListener("abort",a),n.emit(i),n.down([[c]]))},i=>{s||(s=!0,t?.removeEventListener("abort",a),n.down([[p,i]]))}),()=>{s=!0,t?.removeEventListener("abort",a)}},_e(r))}function En(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=new AbortController,a=()=>s.abort(t?.reason);t?.aborted?s.abort(t.reason):t?.addEventListener("abort",a,{once:!0});let i=t??s.signal,d=!1,u=o[Symbol.asyncIterator](),l=()=>{d||i.aborted||Promise.resolve(u.next()).then(f=>{if(!(d||i.aborted)){if(f.done){n.down([[c]]);return}n.emit(f.value),l()}},f=>{!d&&!i.aborted&&n.down([[p,f]])})};return l(),()=>{d=!0,t?.removeEventListener("abort",a),s.abort(),Promise.resolve(u.return?.()).catch(()=>{})}},_e(r))}function kn(o){return o!=null&&typeof o=="object"&&"cache"in o&&typeof o.subscribe=="function"}function B(o,e){if(kn(o))return o;if(Nn(o))return xn(o,e);if(o!=null){let t=o;if(typeof t[Symbol.asyncIterator]=="function")return En(o,e);if(typeof t[Symbol.iterator]=="function")return je(o,e)}return On(o)}function On(...o){return je(o,void 0)}var $e=A(()=>{"use strict";W();Te()});var mt={};an(mt,{audit:()=>Qn,buffer:()=>nt,bufferCount:()=>tt,bufferTime:()=>ot,catchError:()=>ht,combine:()=>Je,combineLatest:()=>ct,concat:()=>$n,concatMap:()=>Yn,debounce:()=>Ze,debounceTime:()=>ft,delay:()=>Xn,distinctUntilChanged:()=>Un,elementAt:()=>Gn,exhaustMap:()=>Kn,filter:()=>qe,find:()=>Ln,first:()=>In,flatMap:()=>Jn,interval:()=>at,last:()=>Fn,map:()=>Rn,merge:()=>Bn,mergeMap:()=>Xe,onFirstData:()=>Ye,pairwise:()=>Hn,pausable:()=>ut,race:()=>zn,reduce:()=>Sn,repeat:()=>dt,rescue:()=>en,sample:()=>Zn,scan:()=>Mn,skip:()=>Ke,switchMap:()=>qn,take:()=>Q,takeUntil:()=>Cn,takeWhile:()=>Dn,tap:()=>Pn,tapFirst:()=>Vn,throttle:()=>Qe,throttleTime:()=>pt,timeout:()=>et,valve:()=>lt,window:()=>it,windowCount:()=>rt,windowTime:()=>st,withLatestFrom:()=>Wn,zip:()=>jn});module.exports=un(mt);se();W();be();Te();$e();function h(o){return{describeKind:"derived",...o}}function ze(o){return{describeKind:"derived",partial:!0,...o}}function Rn(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}for(let a of s)n.emit(e(a))},h(t))}function qe(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}let a=!1;for(let i of s)e(i)&&(n.emit(i),a=!0);a||n.down([[g]])},h(t))}function Mn(o,e,t,r){return y([o],(n,s,a)=>{"acc"in a.store||(a.store.acc=t);let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d),s.emit(a.store.acc)},{...h(r),initial:t,resetOnTeardown:!0})}function Sn(o,e,t,r){return y([o],(n,s,a)=>{if("acc"in a.store||(a.store.acc=t),a.terminalDeps[0]===!0){s.emit(a.store.acc),s.down([[c]]);return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d)},{...h(r),completeWhenDepsComplete:!1})}function Q(o,e,t){return e<=0?y([o],(r,n,s)=>{s.store.completed||(s.store.completed=!0,n.down([[c]]))},{...h(t),completeWhenDepsComplete:!1}):y([o],(r,n,s)=>{if("taken"in s.store||(s.store.taken=0),s.store.done){n.down([[g]]);return}if(s.terminalDeps[0]===!0){s.store.done=!0,n.down([[c]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a)if(s.store.taken++,n.emit(i),s.store.taken>=e){s.store.done=!0,n.down([[c]]);return}},{...h(t),completeWhenDepsComplete:!1})}function Ke(o,e,t){return y([o],(r,n,s)=>{"skipped"in s.store||(s.store.skipped=0);let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.skipped++,s.store.skipped<=e||(n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Dn(o,e,t){return y([o],(r,n,s)=>{if(s.store.done){n.down([[g]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a){if(!e(i)){s.store.done=!0,n.down([[c]]);return}n.emit(i)}},{...h(t),completeWhenDepsComplete:!1})}function Cn(o,e,t){let r=t?.predicate??(a=>a[0]===m),{predicate:n,...s}=t??{};return b(a=>{let i=!1,d=o.subscribe(l=>{if(!i)for(let f of l){if(i)return;f[0]===m?a.emit(f[1]):(f[0]===c||f[0]===p)&&(i=!0,a.down([f]))}}),u=e.subscribe(l=>{if(!i)for(let f of l){if(i)return;if(r(f)){i=!0,a.down([[c]]);return}}});return()=>{d(),u()}},h(s))}function In(o,e){return Q(o,1,e)}function Fn(o,e){let{defaultValue:t,...r}=e??{},n=e!=null&&Object.hasOwn(e,"defaultValue");return y([o],(s,a,i)=>{if(i.terminalDeps[0]===!0){i.store.has?a.emit(i.store.latest):n&&a.emit(t),a.down([[c]]);return}let d=s[0];if(d==null||d.length===0){a.down([[g]]);return}i.store.latest=d.at(-1),i.store.has=!0},{...h(r),completeWhenDepsComplete:!1})}function Ln(o,e,t){return Q(qe(o,e,t),1,t)}function Gn(o,e,t){return Q(Ke(o,e,t),1,t)}function Pn(o,e,t){if(typeof e=="function")return y([o],(n,s)=>{let a=n[0];if(a==null||a.length===0){s.down([[g]]);return}for(let i of a)e(i),s.emit(i)},h(t));let r=e;return y([o],(n,s,a)=>{if(a.terminalDeps[0]!==void 0){a.terminalDeps[0]===!0?(r.complete?.(),s.down([[c]])):(r.error?.(a.terminalDeps[0]),s.down([[p,a.terminalDeps[0]]]));return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)r.data?.(d),s.emit(d)},{...h(t),completeWhenDepsComplete:!1})}function Ye(o,e,t){let r=t?.where??(s=>s!=null),n=!1;return y([o],(s,a)=>{let i=s[0];if(i==null||i.length===0){a.down([[g]]);return}for(let d of i)!n&&r(d)&&(n=!0,e(d)),a.emit(d)},h(t))}var Vn=Ye;function Un(o,e=Object.is,t){return y([o],(r,n,s)=>{let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.hasPrev&&e(s.store.prev,d)||(s.store.prev=d,s.store.hasPrev=!0,n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Hn(o,e){return y([o],(t,r,n)=>{let s=t[0];if(s==null||s.length===0){r.down([[g]]);return}let a=!1;for(let i of s)if(!n.store.hasPrev)n.store.prev=i,n.store.hasPrev=!0;else{let d=[n.store.prev,i];n.store.prev=i,r.emit(d),a=!0}a||r.down([[g]])},h(e))}function Je(...o){let e=[...o];return Be(e,t=>t,{...h(),equals:(t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!Object.is(t[n],r[n]))return!1;return!0}})}function Wn(o,e,t){return y([o,e],(r,n,s)=>{let a=r[0],i=r[1],d=i!=null&&i.length>0?i.at(-1):s.prevData[1];if(a!=null&&a.length>0){if(!(i!=null&&i.length>0)&&s.prevData[1]===void 0){n.down([[g]]);return}for(let u of a)n.emit([u,d])}else n.down([[g]])},ze(t))}function Bn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):b(e=>{let t=o.length,r=0,n=[];for(let s of o){let a=s.subscribe(i=>{for(let d of i)d[0]===m?e.emit(d[1]):d[0]===c?(r+=1,r>=t&&e.down([[c]])):d[0]===p&&e.down([d])});n.push(a)}return()=>{for(let s of n)s()}},h())}function jn(...o){let e=o.length;return e===0?b(t=>{t.emit([]),t.down([[c]])},h()):b(t=>{let r=Array.from({length:e},()=>[]),n=e;function s(){for(;r.every(i=>i.length>0);){let i=r.map(d=>d.shift());t.emit(i)}}let a=[];for(let i=0;i<e;i++){let d=i,u=o[i].subscribe(l=>{for(let f of l)f[0]===m?(r[d].push(f[1]),s()):f[0]===c?(n-=1,(n===0||r[d].length===0)&&t.down([[c]])):f[0]===p&&t.down([f])});a.push(u)}return()=>{for(let i of a)i()}},h())}function $n(o,e,t){return b(r=>{let n=0,s=[],a,i;return i=e.subscribe(d=>{for(let u of d)n===0?u[0]===m?s.push(u[1]):u[0]===p&&r.down([u]):u[0]===m?r.emit(u[1]):(u[0]===c||u[0]===p)&&r.down([u])}),a=o.subscribe(d=>{for(let u of d)if(n===0)if(u[0]===m)r.emit(u[1]);else if(u[0]===c){n=1;for(let l of s)r.emit(l);s.length=0}else u[0]===p&&r.down([u])}),()=>{a?.(),i?.()}},h(t))}function zn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):o.length===1?y([o[0]],(e,t)=>{let r=e[0];if(r==null||r.length===0){t.down([[g]]);return}for(let n of r)t.emit(n)},h()):b(e=>{let t=null,r=[];for(let n=0;n<o.length;n++){let s=n,a=o[n].subscribe(i=>{for(let d of i){if(t!==null&&s!==t)return;d[0]===m?(t===null&&(t=s),e.emit(d[1])):(d[0]===c||d[0]===p)&&(t===null||s===t)&&e.down([d])}});r.push(a)}return()=>{for(let n of r)n()}},h())}function ee(o,e,t){let r,n=!1,s=()=>{n||(n=!0,t())};return r=o.subscribe(a=>{let i=!1,d=!1;for(let u of a)u[0]!==D&&(u[0]===m?e.emit(u[1]):u[0]===c?i=!0:u[0]===p?(d=!0,e.down([u])):(u[0]===R||u[0]===g)&&e.down([u]));d?(r?.(),r=void 0,s()):i&&s()}),()=>{r?.(),r=void 0}}function qn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return s(),r=ee(B(e(u[u.length-1])),i,()=>{s(),n&&i.down([[c]])}),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Kn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return r===void 0?r=ee(B(e(u[0])),i,()=>{s(),n&&i.down([[c]])}):i.down([[g]]),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Yn(o,e,t){let{maxBuffer:r,...n}=t??{},s=[],a,i=!1,d;function u(){a?.(),a=void 0}function l(){if(!d||a!==void 0)return;if(s.length===0){i&&d.down([[c]]);return}let _=s.shift();a=ee(B(e(_)),d,()=>{u(),l()})}function f(_){r&&r>0&&s.length>=r&&s.shift(),s.push(_),l()}return y([o],(_,T,w)=>{if(d=T,w.terminalDeps[0]!=null&&w.terminalDeps[0]!==!0){u(),s.length=0;return}if(w.terminalDeps[0]===!0){i=!0,l();return}let k=_[0];if(!(k==null||k.length===0)){for(let v of k)f(v);return{deactivate:()=>{u(),s.length=0,i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}function Xe(o,e,t){let{concurrent:r,...n}=t??{},s=r!=null&&r>0?r:Number.POSITIVE_INFINITY,a=0,i=!1,d=new Set,u=[],l;function f(){i&&a===0&&u.length===0&&l&&l.down([[c]])}function _(v){if(!l)return;a++;let N;N=ee(B(e(v)),l,()=>{N&&d.delete(N),a--,T(),f()}),d.add(N)}function T(){for(;u.length>0&&a<s;)_(u.shift())}function w(v){a<s?_(v):u.push(v)}function k(){for(let v of d)v();d.clear(),a=0,u.length=0}return y([o],(v,N,O)=>{if(l=N,O.terminalDeps[0]!=null&&O.terminalDeps[0]!==!0){k();return}if(O.terminalDeps[0]===!0){i=!0,f();return}let x=v[0];if(!(x==null||x.length===0)){for(let M of x)w(M);return{deactivate:()=>{k(),i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}var Jn=Xe;function Xn(o,e,t){return b(r=>{let n=new Set;function s(){for(let i of n)clearTimeout(i);n.clear()}let a=o.subscribe(i=>{for(let d of i)if(d[0]===m){let u=setTimeout(()=>{n.delete(u),r.emit(d[1])},e);n.add(u)}else if(d[0]===c){let u=setTimeout(()=>{n.delete(u),r.down([[c]])},e);n.add(u)}else d[0]===p&&(s(),r.down([d]))});return()=>{a(),s()}},h(t))}function Ze(o,e,t){return b(r=>{let n,s;function a(){n!==void 0&&(clearTimeout(n),n=void 0)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(a(),s=u[1],n=setTimeout(()=>{n=void 0,r.emit(s)},e)):u[0]===c?(n!==void 0&&(a(),r.emit(s)),r.down([[c]])):u[0]===p&&(a(),r.down([u]))});return()=>{i(),a()}},h(t))}function Qe(o,e,t){let{leading:r,trailing:n,...s}=t??{},a=r!==!1,i=n===!0,d=e*1e6;return b(u=>{let l,f=-1/0,_,T=!1;function w(){l!==void 0&&(clearTimeout(l),l=void 0)}let k=o.subscribe(v=>{for(let N of v)if(N[0]===m){let O=N[1],x=q();if(a&&x-f>=d)f=x,u.emit(O),w(),i&&(l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},e));else if(i&&(_=O,T=!0,l===void 0)){let M=(x-f)/1e6;l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},Math.max(0,e-M))}}else(N[0]===c||N[0]===p)&&(w(),u.down([N]))});return()=>{k(),w()}},h(s))}function Zn(o,e,t){return b(r=>{let n,s=!1,a=!1,i=o.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n={v:l[1]}:l[0]===p?(s=!0,r.down([l])):l[0]===c&&(a=!0,n=void 0)}}),d=e.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n!==void 0&&!a&&r.emit(n.v):l[0]===p?(s=!0,r.down([l])):l[0]===c&&(s=!0,r.down([[c]]))}});return()=>{i(),d()}},h(t))}function Qn(o,e,t){return b(r=>{let n,s,a=!1;function i(){n!==void 0&&(clearTimeout(n),n=void 0)}let d=o.subscribe(u=>{for(let l of u)l[0]===m?(s=l[1],a=!0,i(),n=setTimeout(()=>{n=void 0,a&&(a=!1,r.emit(s))},e)):(l[0]===c||l[0]===p)&&(i(),r.down([l]))});return()=>{d(),i()}},h(t))}function et(o,e,t){let{with:r,...n}=t??{},s=r??new Error("timeout");return b(a=>{let i;function d(){clearTimeout(i),i=setTimeout(()=>{i=void 0,a.down([[p,s]])},e)}d();let u=o.subscribe(l=>{for(let f of l)f[0]===m?(d(),a.emit(f[1])):(f[0]===c||f[0]===p)&&(clearTimeout(i),a.down([f]))});return()=>{u(),clearTimeout(i)}},h(n))}function nt(o,e,t){return b(r=>{let n=[],s=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&r.down([d])}),a=e.subscribe(i=>{for(let d of i)d[0]===m?n.length>0&&(r.emit([...n]),n.length=0):d[0]===c?r.down([[c]]):d[0]===p&&r.down([d])});return()=>{s(),a(),n.length=0}},h(t))}function tt(o,e,t){if(e<=0)throw new RangeError("bufferCount expects count > 0");return b(r=>{let n=[],s=o.subscribe(a=>{for(let i of a)i[0]===m?(n.push(i[1]),n.length>=e&&r.emit(n.splice(0,n.length))):i[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):i[0]===p&&r.down([i])});return()=>{s(),n.length=0}},h(t))}function rt(o,e,t){if(e<=0)throw new RangeError("windowCount expects count > 0");return b(r=>{let n,s=0;function a(){let d=b(u=>(n=u.down.bind(u),()=>{n=void 0}),h());s=0,r.emit(d)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(n||a(),n?.([[m,u[1]]]),s+=1,s>=e&&(n?.([[c]]),n=void 0)):u[0]===c?(n?.([[c]]),n=void 0,r.down([[c]])):u[0]===p&&(n?.([u]),n=void 0,r.down([u]))});return()=>{i(),n?.([[c]]),n=void 0}},h(t))}function ot(o,e,t){return b(r=>{let n=[],s=setInterval(()=>{n.length>0&&(r.emit([...n]),n.length=0)},e),a=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(clearInterval(s),n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&(clearInterval(s),r.down([d]))});return()=>{a(),clearInterval(s),n.length=0}},h(t))}function st(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}a();let i=setInterval(()=>{s(),a()},e),d=o.subscribe(u=>{for(let l of u)l[0]===m?n?.([[m,l[1]]]):l[0]===c?(clearInterval(i),s(),r.down([[c]])):l[0]===p&&(clearInterval(i),n?.([l]),s(),r.down([l]))});return()=>{d(),clearInterval(i),s()}},h(t))}function it(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}let i=o.subscribe(u=>{for(let l of u)l[0]===m?(n||a(),n?.([[m,l[1]]])):l[0]===c?(s(),r.down([[c]])):l[0]===p&&(n?.([l]),n=void 0,r.down([l]))}),d=e.subscribe(u=>{for(let l of u)l[0]===m&&(s(),a())});return()=>{i(),d(),s()}},h(t))}function at(o,e){return b((t,r)=>{"n"in r.store||(r.store.n=0);let n=setInterval(()=>{t.emit(r.store.n),r.store.n=r.store.n+1},o);return()=>clearInterval(n)},h(e))}function dt(o,e,t){if(e<=0)throw new RangeError("repeat expects count > 0");return b(r=>{let n=e,s,a=()=>{s?.(),s=o.subscribe(i=>{let d=!1,u=[];for(let l of i)l[0]===c?d=!0:u.push(l);u.length>0&&r.down(u),d&&(s?.(),s=void 0,n-=1,n>0?a():r.down([[c]]))})};return a(),()=>{s?.()}},h(t))}function ut(o,e){return y([o],(t,r)=>{let n=t[0];if(n==null||n.length===0){r.down([[g]]);return}for(let s of n)r.emit(s)},h(e))}function en(o,e,t){return b(r=>{let n=o.subscribe(s=>{for(let a of s)if(a[0]===m)r.emit(a[1]);else if(a[0]===p)try{r.emit(e(a[1]))}catch(i){r.down([[p,i]])}else a[0]===c&&r.down([[c]])});return()=>{n()}},h(t))}function lt(o,e,t){return y([o,e],(r,n,s)=>{let a=r[1];if(!(a!=null&&a.length>0?a.at(-1):s.prevData[1])){n.down([[g]]);return}let d=r[0];if(d!=null&&d.length>0){for(let u of d)n.emit(u);return}if(a!=null&&a.length>0&&s.prevData[0]!==void 0){n.emit(s.prevData[0]);return}n.down([[g]])},ze(t))}var ct=Je,ft=Ze,pt=Qe,ht=en;0&&(module.exports={audit,buffer,bufferCount,bufferTime,catchError,combine,combineLatest,concat,concatMap,debounce,debounceTime,delay,distinctUntilChanged,elementAt,exhaustMap,filter,find,first,flatMap,interval,last,map,merge,mergeMap,onFirstData,pairwise,pausable,race,reduce,repeat,rescue,sample,scan,skip,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,timeout,valve,window,windowCount,windowTime,withLatestFrom,zip});
|
|
1
|
+
"use strict";var se=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var at=Object.prototype.hasOwnProperty;var R=(o,e)=>()=>(o&&(e=o(o=0)),e);var ut=(o,e)=>{for(var n in e)se(o,n,{get:e[n],enumerable:!0})},dt=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of it(e))!at.call(o,t)&&t!==n&&se(o,t,{get:()=>e[t],enumerable:!(r=st(e,t))||r.enumerable});return o};var lt=o=>dt(se({},"__esModule",{value:!0}),o);function q(){return Math.trunc(performance.now()*1e6)}function ve(){return Date.now()*1e6}var ie=R(()=>{"use strict"});var C,m,M,g,F,L,W,I,c,p,G,ae,ct,ue,ft,pt,de,we,Ne,xe,le,B=R(()=>{"use strict";C=Symbol.for("graphrefly/START"),m=Symbol.for("graphrefly/DATA"),M=Symbol.for("graphrefly/DIRTY"),g=Symbol.for("graphrefly/RESOLVED"),F=Symbol.for("graphrefly/INVALIDATE"),L=Symbol.for("graphrefly/PAUSE"),W=Symbol.for("graphrefly/RESUME"),I=Symbol.for("graphrefly/TEARDOWN"),c=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),G=Object.freeze([M]),ae=Object.freeze([g]),ct=Object.freeze([F]),ue=Object.freeze([C]),ft=Object.freeze([c]),pt=Object.freeze([I]),de=Object.freeze([G]),we=Object.freeze([ae]),Ne=Object.freeze([ct]),xe=Object.freeze([ft]),le=Object.freeze([pt])});var P,ke=R(()=>{"use strict";P=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`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 Ee(o){o.registerCodec(ht)}var ht,Oe=R(()=>{"use strict";ht={name:"json",version:1,contentType:"application/json",encode(o){let e=JSON.stringify(o);return new TextEncoder().encode(e)},decode(o,e){let n=new TextDecoder().decode(o);return JSON.parse(n)}}});function Y(o){if(o==null)return mt;let{type:e,id:n,...r}=o;return{type:e??"system",id:n??"",...r}}var mt,Ae=R(()=>{"use strict";mt={type:"system",id:""}});function Se(){return ce>0||gt}function Ce(){return ce>0}function Ie(o){ce>0?bt.push(o):o()}function J(o,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!Se()){o(e);return}(d>=5?De:d===4?Me:Re).push(()=>o(e));return}let r=e.length,t=r,s=r,a=r,i=0;for(;i<r&&n(e[i][0])<3;)i++;for(t=i;i<r&&n(e[i][0])===3;)i++;for(s=i;i<r&&n(e[i][0])===4;)i++;a=i;let u=Se();if(t>0){let d=e.slice(0,t);o(d)}if(s>t){let d=e.slice(t,s);u?Re.push(()=>o(d)):o(d)}if(a>s){let d=e.slice(s,a);u?Me.push(()=>o(d)):o(d)}if(r>a){let d=e.slice(a,r);u?De.push(()=>o(d)):o(d)}}var ce,gt,Re,Me,De,bt,Fe=R(()=>{"use strict";ce=0,gt=!1,Re=[],Me=[],De=[],bt=[]});function Le(o){o.registerMessageType(C,{tier:0,wireCrossing:!1}),o.registerMessageType(M,{tier:1,wireCrossing:!1}),o.registerMessageType(F,{tier:1,wireCrossing:!1,metaPassthrough:!1}),o.registerMessageType(L,{tier:2,wireCrossing:!1}),o.registerMessageType(W,{tier:2,wireCrossing:!1}),o.registerMessageType(m,{tier:3,wireCrossing:!0}),o.registerMessageType(g,{tier:3,wireCrossing:!0}),o.registerMessageType(c,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(I,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var X,Ge=R(()=>{"use strict";B();X=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.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}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.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 fe(o){if(o===void 0)return null;if(typeof o=="number"){if(!Number.isFinite(o))throw new TypeError(`Cannot hash non-finite number: ${o}`);if(Number.isInteger(o)&&!Number.isSafeInteger(o))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${o}. Cross-language cid parity is not guaranteed for unsafe integers.`);return o}if(typeof o=="string"||typeof o=="boolean"||o===null)return o;if(Array.isArray(o))return o.map(fe);if(typeof o=="object"&&o!==null){let e={};for(let n of Object.keys(o).sort())e[n]=fe(o[n]);return e}return null}function yt(o){let e=_t.encode(o),n=e.length,r=n*8,t=n+9+63&-64,s=new Uint8Array(t);s.set(e),s[n]=128;let a=new DataView(s.buffer);a.setUint32(t-4,r>>>0,!1),a.setUint32(t-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,u=3144134277,d=1013904242,l=2773480762,f=1359893119,_=2600822924,T=528734635,w=1541459225,O=new Uint32Array(64),v=(A,x)=>A>>>x|A<<32-x;for(let A=0;A<t;A+=64){for(let k=0;k<16;k++)O[k]=a.getUint32(A+k*4,!1);for(let k=16;k<64;k++){let U=O[k-15],H=O[k-2],K=v(U,7)^v(U,18)^U>>>3,oe=v(H,17)^v(H,19)^H>>>10;O[k]=O[k-16]+K+O[k-7]+oe>>>0}let x=i,D=u,V=d,ne=l,S=f,z=_,$=T,re=w;for(let k=0;k<64;k++){let U=v(S,6)^v(S,11)^v(S,25),H=S&z^~S&$,K=re+U+H+Tt[k]+O[k]>>>0,oe=v(x,2)^v(x,13)^v(x,22),rt=x&D^x&V^D&V,ot=oe+rt>>>0;re=$,$=z,z=S,S=ne+K>>>0,ne=V,V=D,D=x,x=K+ot>>>0}i=i+x>>>0,u=u+D>>>0,d=d+V>>>0,l=l+ne>>>0,f=f+S>>>0,_=_+z>>>0,T=T+$>>>0,w=w+re>>>0}let N=A=>A.toString(16).padStart(8,"0");return N(i)+N(u)+N(d)+N(l)+N(f)+N(_)+N(T)+N(w)}function pe(o){let e=fe(o??null),n=JSON.stringify(e);return yt(n).slice(0,16)}function vt(){let o=globalThis.crypto;if(o?.randomUUID)return o.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function he(o,e,n){let r=n?.id??vt();if(o===0)return{id:r,version:0};let s=(n?.hash??pe)(e);return{id:r,version:0,cid:s,prev:null}}function Pe(o,e,n){o.version+=1,"cid"in o&&(o.prev=o.cid,o.cid=n(e))}var Tt,_t,Ve=R(()=>{"use strict";Tt=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]),_t=new TextEncoder});function We(o){return{node:o,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function me(o){o.prevData=void 0,o.dirty=!1,o.involvedThisWave=!1,o.dataBatch.length=0,o.terminal=void 0}function Z(o){return o.length===0?o:typeof o[0]=="symbol"?[o]:o}function y(o,e,n){let r=Be(o)?o:[],t=typeof o=="function"?o:typeof e=="function"?e:void 0,s={};return Be(o)?s=(ge(e)?e:n)??{}:ge(o)?s=o:s=(ge(e)?e:n)??{},new Q(r,t,s)}var Ue,He,wt,Nt,be,Q,Be,ge,Te=R(()=>{"use strict";Oe();Ae();Fe();ie();Ge();ke();B();Ve();Ue=()=>{},He=100;wt=(o,e,n,r)=>{n.direction==="down-in"&&o._onDepMessage(n.depIndex,e)},Nt=(o,e,n,r)=>{let t=o;if(t._status==="completed"||t._status==="errored")return;let s=t._cached,a=s===void 0?[ue]:[ue,[m,s]];t._status==="dirty"&&a.push(G),J(e,a,t._config.tierOf)},be=new X({onMessage:wt,onSubscribe:Nt});Le(be);Ee(be);Q=class o{_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,n,r){this._config=r.config??be,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??pe;let t=r.versioning??this._config.defaultVersioning;this._versioningLevel=t,this._versioning=t!=null?he(t,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(We);let s={};for(let[i,u]of Object.entries(r.meta??{})){let d={initial:u,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),s[i]=new o([],void 0,d)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let a=this;this._actions={emit(i){a._emit([[m,i]])},down(i){a._emit(Z(i))},up(i){a._emitUp(Z(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,n){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 r=this._versioningLevel;if(r!=null&&e<=r)return;let t=n?.hash??this._hashFn;t!==this._hashFn&&(this._hashFn=t);let s=this._cached===void 0?void 0:this._cached,a=this._versioning,i=a?.id??n?.id,u=a?.version??0,d=he(e,s,{id:i,hash:t});d.version=u,this._versioning=d,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 n=Y(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let t=Y(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(t,s))throw new P({actor:t,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(t,s))throw new P({actor:t,action:s,nodeName:this.name})}this._lastMutation={actor:t,timestamp_ns:ve()}}down(e,n){let r=Z(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[m,e]])}up(e,n){if(this._deps.length===0)return;let r=Z(e);if(r.length===0)return;this._checkGuard(n);let t=n??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.node.up?.(r,t)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let t=n(r[0]);if(t===3||t===4)throw new Error(`Node "${this.name}": tier-${t} 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,n){if(n!=null&&this._guard!=null){let u=Y(n);if(!this._guard(u,"observe"))throw new P({actor:u,action:"observe",nodeName:this.name})}let t=this._isTerminal&&this._resubscribable;if(t){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 u of this._deps)me(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:t},this._actions)}catch(u){throw this._sinkCount-=1,u}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(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),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[n]=this._sinks;this._sinks=n}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,n=0;try{for(let r=0;r<e;r++){let t=r,s=this._deps[r];s.unsub=Ue,s.unsub=s.node.subscribe(a=>{if(s.unsub===null)return;let i=this._config.tierOf,u=!1;for(let d of a)i(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:t},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let t=0;t<n;t++){let s=this._deps[t];if(s.unsub!=null){let a=s.unsub;s.unsub=null;try{a()}catch{}me(s)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let t=0;t<this._deps.length;t++)if(this._deps[t].node===e)return t;let n=this._deps.length,r=We(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de),r.unsub=Ue;try{r.unsub=e.subscribe(t=>{if(r.unsub===null)return;let s=this._config.tierOf,a=!1;for(let i of t)s(i[0])>=3&&(a=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:n},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(t){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,t}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(t){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",t)]])}}for(let r of this._deps){if(r.unsub!=null){let t=r.unsub;r.unsub=null;try{t()}catch{}}me(r)}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,n){let r=this._deps[e],t=n[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:n};for(let a of this._inspectorHooks)a(s)}if(t!==C){if(t===M){this._depDirtied(r);return}if(t===F){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Ne);return}if(t===L||t===W){this._emit([n]);return}if(t===I){this._emit(le);return}if(t===m)this._depSettledAsData(r,n[1]);else if(t===g)this._depSettledAsResolved(r);else if(t===c)this._depSettledAsTerminal(r,!0);else if(t===p)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(t===m||t===g)&&this._emit([n]),(t===c||t===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,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 n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}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(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(xe)}_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([[p,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([[p,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let n=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),r=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let i=n[a];i!=null&&i.length>0&&(this._deps[a].prevData=i[i.length-1])}let t=this._deps.map(a=>a.terminal),s={prevData:r,terminalDeps:t,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:n,prevData:r};for(let i of this._inspectorHooks)i(a)}this._isExecutingFn=!0;try{let a=this._fn(n,this._actions,s);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([[p,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>He?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${He} \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,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[G,e[0]]:e;let r=!0,t=!1,s=!1,a=-1;for(let u of e){let d=n(u[0]);d<a&&(r=!1),d===3&&(t=!0),u[0]===M&&(s=!0),a=d}let i=e;if(!r){let u=e.map((d,l)=>({m:d,i:l,tier:n(d[0])}));u.sort((d,l)=>d.tier-l.tier||d.i-l.i),i=u.map(d=>d.m)}if(t&&!s&&this._status!=="dirty"){let u=0;for(;u<i.length&&n(i[u][0])===0;)u++;return u===0?[G,...i]:[...i.slice(0,u),G,...i.slice(u)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let u=e[i];if(u[0]===p&&u[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 n=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(u=>u[0]===I||u[0]===F);if(i.length===0)return;n=i}n=this._frameBatch(n);let t=null;for(let i=0;i<n.length;i++){let u=n[i],d=u[0];if(d!==L&&d!==W){t?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===L?"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 f=u[1];if(d===L)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))l=!1;else if(this._pauseLocks.delete(f),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())}}l?t?.push(u):t==null&&(t=n.slice(0,i))}if(t!=null){if(t.length===0)return;n=t}if(this._hasMeta&&n.some(i=>i[0]===I))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(le)}catch{}let{finalMessages:s,equalsError:a}=this._updateState(n);if(s.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,u=[];for(let d of s)i(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(s);a!=null&&this._emit([[p,a]])}_updateState(e){let n=this._config.tierOf,r,t,s=-1,a=0;for(let l of e)n(l[0])===3&&a++;let i=a<=1,u=-1;if(this._versioning!=null&&a>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===m){u=l;break}}for(let l=0;l<e.length;l++){let f=e[l],_=f[0];if(_===m){if(f.length>=2){let T=!1;if(i&&this._cached!==void 0)try{T=this._equals(this._cached,f[1])}catch(w){t=this._wrapFnError("equals threw",w),s=l;break}if(T){r==null&&(r=e.slice(0,l)),r.push(ae),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(u<0||l===u)&&Pe(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),_===M)this._status="dirty";else if(_===g)this._status="resolved";else if(_===c){this._status="completed";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===p){this._status="errored";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===F){if(this._cached!==void 0){let w=this._config.rigorRecorder;if(w!=null)try{w.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let T=this._cleanup;if(typeof T=="function"){this._cleanup=void 0;try{T()}catch{}}else if(T!=null&&typeof T=="object"){let w=T.invalidate;if(typeof w=="function")try{w()}catch{}}}else _===I&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=s>=0?r??e.slice(0,s):r??e;return t!=null?{finalMessages:d,equalsError:t}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if(Ce()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Ie(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}J(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);J(this._deliverToSinks,n,this._config.tierOf)}},Be=o=>Array.isArray(o),ge=o=>typeof o=="object"&&o!=null&&!Array.isArray(o)});function E(o,e){let n={factory:o};return e!==void 0&&(n.factoryArgs=e),n}var je=R(()=>{"use strict"});function b(o,e){return y((r,t,s)=>o(t,s)??void 0,{describeKind:"producer",...e})}function ze(o,e,n){return y(o,(t,s,a)=>{let i=t.map((u,d)=>u!=null&&u.length>0?u.at(-1):a.prevData[d]);s.emit(e(i,a))},{describeKind:"derived",...n})}var _e=R(()=>{"use strict";Te()});function ye(o){return{describeKind:"producer",...o}}function $e(o,e){return b(n=>{let r=!1;try{for(let t of o){if(r)return;n.emit(t)}r||n.down([[c]])}catch(t){r||n.down([[p,t]])}return()=>{r=!0}},ye(e))}function xt(o){return o!=null&&typeof o.then=="function"}function kt(o,e){let{signal:n,...r}=e??{};return b(t=>{let s=!1,a=()=>{s||(s=!0,t.down([[p,n.reason]]))};if(n?.aborted){a();return}return n?.addEventListener("abort",a,{once:!0}),Promise.resolve(o).then(i=>{s||(s=!0,n?.removeEventListener("abort",a),t.emit(i),t.down([[c]]))},i=>{s||(s=!0,n?.removeEventListener("abort",a),t.down([[p,i]]))}),()=>{s=!0,n?.removeEventListener("abort",a)}},ye(r))}function Et(o,e){let{signal:n,...r}=e??{};return b(t=>{let s=new AbortController,a=()=>s.abort(n?.reason);n?.aborted?s.abort(n.reason):n?.addEventListener("abort",a,{once:!0});let i=n??s.signal,u=!1,d=o[Symbol.asyncIterator](),l=()=>{u||i.aborted||Promise.resolve(d.next()).then(f=>{if(!(u||i.aborted)){if(f.done){t.down([[c]]);return}t.emit(f.value),l()}},f=>{!u&&!i.aborted&&t.down([[p,f]])})};return l(),()=>{u=!0,n?.removeEventListener("abort",a),s.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},ye(r))}function Ot(o){return o!=null&&typeof o=="object"&&"cache"in o&&typeof o.subscribe=="function"}function j(o,e){if(Ot(o))return o;if(xt(o))return kt(o,e);if(o!=null){let n=o;if(typeof n[Symbol.asyncIterator]=="function")return Et(o,e);if(typeof n[Symbol.iterator]=="function")return $e(o,e)}return At(o)}function At(...o){return $e(o,void 0)}var Ke=R(()=>{"use strict";B();_e()});var bn={};ut(bn,{audit:()=>en,buffer:()=>nn,bufferCount:()=>rn,bufferTime:()=>sn,catchError:()=>gn,combine:()=>Ze,combineLatest:()=>pn,concat:()=>$t,concatMap:()=>Jt,debounce:()=>et,debounceTime:()=>hn,delay:()=>Zt,distinctUntilChanged:()=>Ht,elementAt:()=>Pt,exhaustMap:()=>Yt,filter:()=>Ye,find:()=>Gt,first:()=>Ft,flatMap:()=>Xt,interval:()=>dn,last:()=>Lt,map:()=>Mt,merge:()=>jt,mergeMap:()=>Qe,onFirstData:()=>Xe,pairwise:()=>Wt,pausable:()=>cn,race:()=>Kt,reduce:()=>St,repeat:()=>ln,rescue:()=>nt,sample:()=>Qt,scan:()=>Dt,skip:()=>Je,switchMap:()=>qt,take:()=>ee,takeUntil:()=>It,takeWhile:()=>Ct,tap:()=>Vt,tapFirst:()=>Ut,throttle:()=>tt,throttleTime:()=>mn,timeout:()=>tn,valve:()=>fn,window:()=>un,windowCount:()=>on,windowTime:()=>an,withLatestFrom:()=>Bt,zip:()=>zt});module.exports=lt(bn);ie();B();je();Te();_e();Ke();function h(o){return{describeKind:"derived",...o}}function qe(o){return{describeKind:"derived",partial:!0,...o}}function Mt(o,e,n){return y([o],(r,t)=>{let s=r[0];if(s==null||s.length===0){t.down([[g]]);return}for(let a of s)t.emit(e(a))},{...h(n),meta:{...E("map"),...n?.meta??{}}})}function Ye(o,e,n){return y([o],(r,t)=>{let s=r[0];if(s==null||s.length===0){t.down([[g]]);return}let a=!1;for(let i of s)e(i)&&(t.emit(i),a=!0);a||t.down([[g]])},{...h(n),meta:{...E("filter"),...n?.meta??{}}})}function Dt(o,e,n,r){return y([o],(t,s,a)=>{"acc"in a.store||(a.store.acc=n);let i=t[0];if(i==null||i.length===0){s.down([[g]]);return}for(let u of i)a.store.acc=e(a.store.acc,u),s.emit(a.store.acc)},{...h(r),initial:n,resetOnTeardown:!0,meta:{...E("scan",{initial:n}),...r?.meta??{}}})}function St(o,e,n,r){return y([o],(t,s,a)=>{if("acc"in a.store||(a.store.acc=n),a.terminalDeps[0]===!0){s.emit(a.store.acc),s.down([[c]]);return}let i=t[0];if(i==null||i.length===0){s.down([[g]]);return}for(let u of i)a.store.acc=e(a.store.acc,u)},{...h(r),completeWhenDepsComplete:!1,meta:{...E("reduce",{initial:n}),...r?.meta??{}}})}function ee(o,e,n){return e<=0?y([o],(r,t,s)=>{s.store.completed||(s.store.completed=!0,t.down([[c]]))},{...h(n),completeWhenDepsComplete:!1,meta:{...E("take",{count:e}),...n?.meta??{}}}):y([o],(r,t,s)=>{if("taken"in s.store||(s.store.taken=0),s.store.done){t.down([[g]]);return}if(s.terminalDeps[0]===!0){s.store.done=!0,t.down([[c]]);return}let a=r[0];if(a==null||a.length===0){t.down([[g]]);return}for(let i of a)if(s.store.taken++,t.emit(i),s.store.taken>=e){s.store.done=!0,t.down([[c]]);return}},{...h(n),completeWhenDepsComplete:!1,meta:{...E("take",{count:e}),...n?.meta??{}}})}function Je(o,e,n){return y([o],(r,t,s)=>{"skipped"in s.store||(s.store.skipped=0);let a=r[0];if(a==null||a.length===0){t.down([[g]]);return}let i=!1;for(let u of a)s.store.skipped++,s.store.skipped<=e||(t.emit(u),i=!0);i||t.down([[g]])},h(n))}function Ct(o,e,n){return y([o],(r,t,s)=>{if(s.store.done){t.down([[g]]);return}let a=r[0];if(a==null||a.length===0){t.down([[g]]);return}for(let i of a){if(!e(i)){s.store.done=!0,t.down([[c]]);return}t.emit(i)}},{...h(n),completeWhenDepsComplete:!1})}function It(o,e,n){let r=n?.predicate??(a=>a[0]===m),{predicate:t,...s}=n??{};return b(a=>{let i=!1,u=o.subscribe(l=>{if(!i)for(let f of l){if(i)return;f[0]===m?a.emit(f[1]):(f[0]===c||f[0]===p)&&(i=!0,a.down([f]))}}),d=e.subscribe(l=>{if(!i)for(let f of l){if(i)return;if(r(f)){i=!0,a.down([[c]]);return}}});return()=>{u(),d()}},h(s))}function Ft(o,e){return ee(o,1,e)}function Lt(o,e){let{defaultValue:n,...r}=e??{},t=e!=null&&Object.hasOwn(e,"defaultValue");return y([o],(s,a,i)=>{if(i.terminalDeps[0]===!0){i.store.has?a.emit(i.store.latest):t&&a.emit(n),a.down([[c]]);return}let u=s[0];if(u==null||u.length===0){a.down([[g]]);return}i.store.latest=u.at(-1),i.store.has=!0},{...h(r),completeWhenDepsComplete:!1})}function Gt(o,e,n){return ee(Ye(o,e,n),1,n)}function Pt(o,e,n){return ee(Je(o,e,n),1,n)}function Vt(o,e,n){if(typeof e=="function")return y([o],(t,s)=>{let a=t[0];if(a==null||a.length===0){s.down([[g]]);return}for(let i of a)e(i),s.emit(i)},{...h(n),meta:{...E("tap"),...n?.meta??{}}});let r=e;return y([o],(t,s,a)=>{if(a.terminalDeps[0]!==void 0){a.terminalDeps[0]===!0?(r.complete?.(),s.down([[c]])):(r.error?.(a.terminalDeps[0]),s.down([[p,a.terminalDeps[0]]]));return}let i=t[0];if(i==null||i.length===0){s.down([[g]]);return}for(let u of i)r.data?.(u),s.emit(u)},{...h(n),completeWhenDepsComplete:!1,meta:{...E("tap"),...n?.meta??{}}})}function Xe(o,e,n){let r=n?.where??(s=>s!=null),t=!1;return y([o],(s,a)=>{let i=s[0];if(i==null||i.length===0){a.down([[g]]);return}for(let u of i)!t&&r(u)&&(t=!0,e(u)),a.emit(u)},h(n))}var Ut=Xe;function Ht(o,e=Object.is,n){return y([o],(r,t,s)=>{let a=r[0];if(a==null||a.length===0){t.down([[g]]);return}let i=!1;for(let u of a)s.store.hasPrev&&e(s.store.prev,u)||(s.store.prev=u,s.store.hasPrev=!0,t.emit(u),i=!0);i||t.down([[g]])},{...h(n),meta:{...E("distinctUntilChanged"),...n?.meta??{}}})}function Wt(o,e){return y([o],(n,r,t)=>{let s=n[0];if(s==null||s.length===0){r.down([[g]]);return}let a=!1;for(let i of s)if(!t.store.hasPrev)t.store.prev=i,t.store.hasPrev=!0;else{let u=[t.store.prev,i];t.store.prev=i,r.emit(u),a=!0}a||r.down([[g]])},h(e))}function Ze(...o){let e=[...o];return ze(e,n=>n,{...h(),equals:(n,r)=>{if(n.length!==r.length)return!1;for(let t=0;t<n.length;t++)if(!Object.is(n[t],r[t]))return!1;return!0}})}function Bt(o,e,n){return y([o,e],(r,t,s)=>{let a=r[0],i=r[1],u=i!=null&&i.length>0?i.at(-1):s.prevData[1];if(a!=null&&a.length>0){if(!(i!=null&&i.length>0)&&s.prevData[1]===void 0){t.down([[g]]);return}for(let d of a)t.emit([d,u])}else t.down([[g]])},{...qe(n),meta:{...E("withLatestFrom"),...n?.meta??{}}})}function jt(...o){return o.length===0?b(e=>{e.down([[c]])},{...h(),meta:{...E("merge")}}):b(e=>{let n=o.length,r=0,t=[];for(let s of o){let a=s.subscribe(i=>{for(let u of i)u[0]===m?e.emit(u[1]):u[0]===c?(r+=1,r>=n&&e.down([[c]])):u[0]===p&&e.down([u])});t.push(a)}return()=>{for(let s of t)s()}},{...h(),meta:{...E("merge")}})}function zt(...o){let e=o.length;return e===0?b(n=>{n.emit([]),n.down([[c]])},h()):b(n=>{let r=Array.from({length:e},()=>[]),t=e;function s(){for(;r.every(i=>i.length>0);){let i=r.map(u=>u.shift());n.emit(i)}}let a=[];for(let i=0;i<e;i++){let u=i,d=o[i].subscribe(l=>{for(let f of l)f[0]===m?(r[u].push(f[1]),s()):f[0]===c?(t-=1,(t===0||r[u].length===0)&&n.down([[c]])):f[0]===p&&n.down([f])});a.push(d)}return()=>{for(let i of a)i()}},h())}function $t(o,e,n){return b(r=>{let t=0,s=[],a,i;return i=e.subscribe(u=>{for(let d of u)t===0?d[0]===m?s.push(d[1]):d[0]===p&&r.down([d]):d[0]===m?r.emit(d[1]):(d[0]===c||d[0]===p)&&r.down([d])}),a=o.subscribe(u=>{for(let d of u)if(t===0)if(d[0]===m)r.emit(d[1]);else if(d[0]===c){t=1;for(let l of s)r.emit(l);s.length=0}else d[0]===p&&r.down([d])}),()=>{a?.(),i?.()}},h(n))}function Kt(...o){return o.length===0?b(e=>{e.down([[c]])},h()):o.length===1?y([o[0]],(e,n)=>{let r=e[0];if(r==null||r.length===0){n.down([[g]]);return}for(let t of r)n.emit(t)},h()):b(e=>{let n=null,r=[];for(let t=0;t<o.length;t++){let s=t,a=o[t].subscribe(i=>{for(let u of i){if(n!==null&&s!==n)return;u[0]===m?(n===null&&(n=s),e.emit(u[1])):(u[0]===c||u[0]===p)&&(n===null||s===n)&&e.down([u])}});r.push(a)}return()=>{for(let t of r)t()}},h())}function te(o,e,n){let r,t=!1,s=()=>{t||(t=!0,n())};return r=o.subscribe(a=>{let i=!1,u=!1;for(let d of a)d[0]!==C&&(d[0]===m?e.emit(d[1]):d[0]===c?i=!0:d[0]===p?(u=!0,e.down([d])):(d[0]===M||d[0]===g)&&e.down([d]));u?(r?.(),r=void 0,s()):i&&s()}),()=>{r?.(),r=void 0}}function qt(o,e,n){let r,t=!1;function s(){r?.(),r=void 0}return y([o],(a,i,u)=>{if(u.terminalDeps[0]!=null&&u.terminalDeps[0]!==!0){s();return}if(u.terminalDeps[0]===!0){t=!0,r||i.down([[c]]);return}let d=a[0];if(!(d==null||d.length===0))return s(),r=te(j(e(d[d.length-1])),i,()=>{s(),t&&i.down([[c]])}),{deactivate:()=>{s(),t=!1}}},{...h(n),completeWhenDepsComplete:!1,meta:{...E("switchMap"),...n?.meta??{}}})}function Yt(o,e,n){let r,t=!1;function s(){r?.(),r=void 0}return y([o],(a,i,u)=>{if(u.terminalDeps[0]!=null&&u.terminalDeps[0]!==!0){s();return}if(u.terminalDeps[0]===!0){t=!0,r||i.down([[c]]);return}let d=a[0];if(!(d==null||d.length===0))return r===void 0?r=te(j(e(d[0])),i,()=>{s(),t&&i.down([[c]])}):i.down([[g]]),{deactivate:()=>{s(),t=!1}}},{...h(n),completeWhenDepsComplete:!1})}function Jt(o,e,n){let{maxBuffer:r,...t}=n??{},s=[],a,i=!1,u;function d(){a?.(),a=void 0}function l(){if(!u||a!==void 0)return;if(s.length===0){i&&u.down([[c]]);return}let _=s.shift();a=te(j(e(_)),u,()=>{d(),l()})}function f(_){r&&r>0&&s.length>=r&&s.shift(),s.push(_),l()}return y([o],(_,T,w)=>{if(u=T,w.terminalDeps[0]!=null&&w.terminalDeps[0]!==!0){d(),s.length=0;return}if(w.terminalDeps[0]===!0){i=!0,l();return}let O=_[0];if(!(O==null||O.length===0)){for(let v of O)f(v);return{deactivate:()=>{d(),s.length=0,i=!1}}}},{...h(t),completeWhenDepsComplete:!1})}function Qe(o,e,n){let{concurrent:r,...t}=n??{},s=r!=null&&r>0?r:Number.POSITIVE_INFINITY,a=0,i=!1,u=new Set,d=[],l;function f(){i&&a===0&&d.length===0&&l&&l.down([[c]])}function _(v){if(!l)return;a++;let N;N=te(j(e(v)),l,()=>{N&&u.delete(N),a--,T(),f()}),u.add(N)}function T(){for(;d.length>0&&a<s;)_(d.shift())}function w(v){a<s?_(v):d.push(v)}function O(){for(let v of u)v();u.clear(),a=0,d.length=0}return y([o],(v,N,A)=>{if(l=N,A.terminalDeps[0]!=null&&A.terminalDeps[0]!==!0){O();return}if(A.terminalDeps[0]===!0){i=!0,f();return}let x=v[0];if(!(x==null||x.length===0)){for(let D of x)w(D);return{deactivate:()=>{O(),i=!1}}}},{...h(t),completeWhenDepsComplete:!1})}var Xt=Qe;function Zt(o,e,n){return b(r=>{let t=new Set;function s(){for(let i of t)clearTimeout(i);t.clear()}let a=o.subscribe(i=>{for(let u of i)if(u[0]===m){let d=setTimeout(()=>{t.delete(d),r.emit(u[1])},e);t.add(d)}else if(u[0]===c){let d=setTimeout(()=>{t.delete(d),r.down([[c]])},e);t.add(d)}else u[0]===p&&(s(),r.down([u]))});return()=>{a(),s()}},h(n))}function et(o,e,n){return b(r=>{let t,s;function a(){t!==void 0&&(clearTimeout(t),t=void 0)}let i=o.subscribe(u=>{for(let d of u)d[0]===m?(a(),s=d[1],t=setTimeout(()=>{t=void 0,r.emit(s)},e)):d[0]===c?(t!==void 0&&(a(),r.emit(s)),r.down([[c]])):d[0]===p&&(a(),r.down([d]))});return()=>{i(),a()}},{...h(n),meta:{...E("debounce",{ms:e}),...n?.meta??{}}})}function tt(o,e,n){let{leading:r,trailing:t,...s}=n??{},a=r!==!1,i=t===!0,u=e*1e6;return b(d=>{let l,f=-1/0,_,T=!1;function w(){l!==void 0&&(clearTimeout(l),l=void 0)}let O=o.subscribe(v=>{for(let N of v)if(N[0]===m){let A=N[1],x=q();if(a&&x-f>=u)f=x,d.emit(A),w(),i&&(l=setTimeout(()=>{l=void 0,T&&(f=q(),d.emit(_),T=!1)},e));else if(i&&(_=A,T=!0,l===void 0)){let D=(x-f)/1e6;l=setTimeout(()=>{l=void 0,T&&(f=q(),d.emit(_),T=!1)},Math.max(0,e-D))}}else(N[0]===c||N[0]===p)&&(w(),d.down([N]))});return()=>{O(),w()}},{...h(s),meta:{...E("throttle",{ms:e,leading:a,trailing:i}),...s.meta??{}}})}function Qt(o,e,n){return b(r=>{let t,s=!1,a=!1,i=o.subscribe(d=>{if(!s)for(let l of d){if(s)return;l[0]===m?t={v:l[1]}:l[0]===p?(s=!0,r.down([l])):l[0]===c&&(a=!0,t=void 0)}}),u=e.subscribe(d=>{if(!s)for(let l of d){if(s)return;l[0]===m?t!==void 0&&!a&&r.emit(t.v):l[0]===p?(s=!0,r.down([l])):l[0]===c&&(s=!0,r.down([[c]]))}});return()=>{i(),u()}},h(n))}function en(o,e,n){return b(r=>{let t,s,a=!1;function i(){t!==void 0&&(clearTimeout(t),t=void 0)}let u=o.subscribe(d=>{for(let l of d)l[0]===m?(s=l[1],a=!0,i(),t=setTimeout(()=>{t=void 0,a&&(a=!1,r.emit(s))},e)):(l[0]===c||l[0]===p)&&(i(),r.down([l]))});return()=>{u(),i()}},h(n))}function tn(o,e,n){let{with:r,...t}=n??{},s=r??new Error("timeout");return b(a=>{let i;function u(){clearTimeout(i),i=setTimeout(()=>{i=void 0,a.down([[p,s]])},e)}u();let d=o.subscribe(l=>{for(let f of l)f[0]===m?(u(),a.emit(f[1])):(f[0]===c||f[0]===p)&&(clearTimeout(i),a.down([f]))});return()=>{d(),clearTimeout(i)}},h(t))}function nn(o,e,n){return b(r=>{let t=[],s=o.subscribe(i=>{for(let u of i)u[0]===m?t.push(u[1]):u[0]===c?(t.length>0&&r.emit([...t]),t.length=0,r.down([[c]])):u[0]===p&&r.down([u])}),a=e.subscribe(i=>{for(let u of i)u[0]===m?t.length>0&&(r.emit([...t]),t.length=0):u[0]===c?r.down([[c]]):u[0]===p&&r.down([u])});return()=>{s(),a(),t.length=0}},h(n))}function rn(o,e,n){if(e<=0)throw new RangeError("bufferCount expects count > 0");return b(r=>{let t=[],s=o.subscribe(a=>{for(let i of a)i[0]===m?(t.push(i[1]),t.length>=e&&r.emit(t.splice(0,t.length))):i[0]===c?(t.length>0&&r.emit([...t]),t.length=0,r.down([[c]])):i[0]===p&&r.down([i])});return()=>{s(),t.length=0}},h(n))}function on(o,e,n){if(e<=0)throw new RangeError("windowCount expects count > 0");return b(r=>{let t,s=0;function a(){let u=b(d=>(t=d.down.bind(d),()=>{t=void 0}),h());s=0,r.emit(u)}let i=o.subscribe(u=>{for(let d of u)d[0]===m?(t||a(),t?.([[m,d[1]]]),s+=1,s>=e&&(t?.([[c]]),t=void 0)):d[0]===c?(t?.([[c]]),t=void 0,r.down([[c]])):d[0]===p&&(t?.([d]),t=void 0,r.down([d]))});return()=>{i(),t?.([[c]]),t=void 0}},h(n))}function sn(o,e,n){return b(r=>{let t=[],s=setInterval(()=>{t.length>0&&(r.emit([...t]),t.length=0)},e),a=o.subscribe(i=>{for(let u of i)u[0]===m?t.push(u[1]):u[0]===c?(clearInterval(s),t.length>0&&r.emit([...t]),t.length=0,r.down([[c]])):u[0]===p&&(clearInterval(s),r.down([u]))});return()=>{a(),clearInterval(s),t.length=0}},{...h(n),meta:{...E("bufferTime",{ms:e}),...n?.meta??{}}})}function an(o,e,n){return b(r=>{let t;function s(){t?.([[c]]),t=void 0}function a(){let d=b(l=>(t=l.down.bind(l),()=>{t=void 0}),h());r.emit(d)}a();let i=setInterval(()=>{s(),a()},e),u=o.subscribe(d=>{for(let l of d)l[0]===m?t?.([[m,l[1]]]):l[0]===c?(clearInterval(i),s(),r.down([[c]])):l[0]===p&&(clearInterval(i),t?.([l]),s(),r.down([l]))});return()=>{u(),clearInterval(i),s()}},h(n))}function un(o,e,n){return b(r=>{let t;function s(){t?.([[c]]),t=void 0}function a(){let d=b(l=>(t=l.down.bind(l),()=>{t=void 0}),h());r.emit(d)}let i=o.subscribe(d=>{for(let l of d)l[0]===m?(t||a(),t?.([[m,l[1]]])):l[0]===c?(s(),r.down([[c]])):l[0]===p&&(t?.([l]),t=void 0,r.down([l]))}),u=e.subscribe(d=>{for(let l of d)l[0]===m&&(s(),a())});return()=>{i(),u(),s()}},h(n))}function dn(o,e){return b((n,r)=>{"n"in r.store||(r.store.n=0);let t=setInterval(()=>{n.emit(r.store.n),r.store.n=r.store.n+1},o);return()=>clearInterval(t)},h(e))}function ln(o,e,n){if(e<=0)throw new RangeError("repeat expects count > 0");return b(r=>{let t=e,s,a=()=>{s?.(),s=o.subscribe(i=>{let u=!1,d=[];for(let l of i)l[0]===c?u=!0:d.push(l);d.length>0&&r.down(d),u&&(s?.(),s=void 0,t-=1,t>0?a():r.down([[c]]))})};return a(),()=>{s?.()}},h(n))}function cn(o,e){return y([o],(n,r)=>{let t=n[0];if(t==null||t.length===0){r.down([[g]]);return}for(let s of t)r.emit(s)},h(e))}function nt(o,e,n){return b(r=>{let t=o.subscribe(s=>{for(let a of s)if(a[0]===m)r.emit(a[1]);else if(a[0]===p)try{r.emit(e(a[1]))}catch(i){r.down([[p,i]])}else a[0]===c&&r.down([[c]])});return()=>{t()}},h(n))}function fn(o,e,n){return y([o,e],(r,t,s)=>{let a=r[1];if(!(a!=null&&a.length>0?a.at(-1):s.prevData[1])){t.down([[g]]);return}let u=r[0];if(u!=null&&u.length>0){for(let d of u)t.emit(d);return}if(a!=null&&a.length>0&&s.prevData[0]!==void 0){t.emit(s.prevData[0]);return}t.down([[g]])},qe(n))}var pn=Ze,hn=et,mn=tt,gn=nt;0&&(module.exports={audit,buffer,bufferCount,bufferTime,catchError,combine,combineLatest,concat,concatMap,debounce,debounceTime,delay,distinctUntilChanged,elementAt,exhaustMap,filter,find,first,flatMap,interval,last,map,merge,mergeMap,onFirstData,pairwise,pausable,race,reduce,repeat,rescue,sample,scan,skip,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,timeout,valve,window,windowCount,windowTime,withLatestFrom,zip});
|
package/dist/extra/operators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-6773HURD.js";import"../chunk-4VVTGLXJ.js";import"../chunk-DQJLC6YY.js";import"../chunk-RZ5HKPGI.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{G as audit,I as buffer,J as bufferCount,L as bufferTime,W as catchError,r as combine,T as combineLatest,v as concat,z as concatMap,D as debounce,U as debounceTime,C as delay,p as distinctUntilChanged,l as elementAt,y as exhaustMap,b as filter,k as find,i as first,B as flatMap,O as interval,j as last,a as map,t as merge,A as mergeMap,n as onFirstData,q as pairwise,Q as pausable,w as race,d as reduce,P as repeat,R as rescue,F as sample,c as scan,f as skip,x as switchMap,e as take,h as takeUntil,g as takeWhile,m as tap,o as tapFirst,E as throttle,V as throttleTime,H as timeout,S as valve,N as window,K as windowCount,M as windowTime,s as withLatestFrom,u as zip};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as Node, V as VersioningLevel } from '../node-fSc-hCv8.cjs';
|
|
2
|
-
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-
|
|
2
|
+
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-C3IMAGpT.cjs';
|
|
3
3
|
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-DmgeADH8.cjs';
|
|
4
4
|
import './storage-tiers.cjs';
|
|
5
5
|
|
package/dist/extra/reactive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as Node, V as VersioningLevel } from '../node-fSc-hCv8.js';
|
|
2
|
-
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-
|
|
2
|
+
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-BgWSA1fg.js';
|
|
3
3
|
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-CHyeCf4D.js';
|
|
4
4
|
import './storage-tiers.js';
|
|
5
5
|
|
package/dist/extra/reactive.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as t}from"../chunk-NNKJUORL.js";import{a as x,b as a}from"../chunk-KGKJCHEK.js";import{a as f,b as m}from"../chunk-TZQPPQEQ.js";import{a as o,b as r,c as e}from"../chunk-
|
|
1
|
+
import{a as p,b as t}from"../chunk-NNKJUORL.js";import{a as x,b as a}from"../chunk-KGKJCHEK.js";import{a as f,b as m}from"../chunk-TZQPPQEQ.js";import{a as o,b as r,c as e}from"../chunk-7KZZLWZ6.js";import"../chunk-RZ5HKPGI.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{p as NativeIndexBackend,x as NativeListBackend,o as NativeLogBackend,f as NativeMapBackend,e as mergeReactiveLogs,t as reactiveIndex,a as reactiveList,r as reactiveLog,m as reactiveMap};
|
package/dist/extra/sources.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var E=(t,e)=>()=>(t&&(e=t(t=0)),e);var xe=(t,e)=>{for(var n in e)ve(t,n,{get:e[n],enumerable:!0})},Ct=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Mt(e))!Rt.call(t,o)&&o!==n&&ve(t,o,{get:()=>e[o],enumerable:!(r=Ot(e,o))||r.enumerable});return t};var Dt=t=>Ct(ve({},"__esModule",{value:!0}),t);function H(){return Math.trunc(performance.now()*1e6)}function se(){return Date.now()*1e6}var ie=E(()=>{"use strict"});var C,g,v,w,D,I,X,A,_,p,U,Ne,It,ke,Ft,Lt,Ee,Ue,We,$e,Se,Z=E(()=>{"use strict";C=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),v=Symbol.for("graphrefly/DIRTY"),w=Symbol.for("graphrefly/RESOLVED"),D=Symbol.for("graphrefly/INVALIDATE"),I=Symbol.for("graphrefly/PAUSE"),X=Symbol.for("graphrefly/RESUME"),A=Symbol.for("graphrefly/TEARDOWN"),_=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),U=Object.freeze([v]),Ne=Object.freeze([w]),It=Object.freeze([D]),ke=Object.freeze([C]),Ft=Object.freeze([_]),Lt=Object.freeze([A]),Ee=Object.freeze([U]),Ue=Object.freeze([Ne]),We=Object.freeze([It]),$e=Object.freeze([Ft]),Se=Object.freeze([Lt])});function je(t){t.registerCodec(Pt)}var Pt,ze=E(()=>{"use strict";Pt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function ae(t){if(t==null)return Bt;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Bt,qe=E(()=>{"use strict";Bt={type:"system",id:""}});function Ye(){return W>0||Q}function Ke(){return W>0}function Je(t){W>0?ee.push(t):t()}function Ae(t){W+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(W-=1,W===0)if(e){if(!Q){let n=ee.splice(0);for(let r of n)try{r()}catch{}F.length=0,L.length=0,$.length=0}}else Gt()}}function Gt(){let t=!Q;t&&(Q=!0);let e=[],n=0;try{for(;F.length>0||L.length>0||$.length>0||t&&ee.length>0;){if(t&&ee.length>0){let i=ee.splice(0);for(let s of i)try{s()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw F.length=0,L.length=0,$.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(F.length>0?F:L.length>0?L:$).splice(0);for(let i of o)try{i()}catch(s){e.push(s)}}}finally{t&&(Q=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function ue(t,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!Ye()){t(e);return}(d>=5?$:d===4?L:F).push(()=>t(e));return}let r=e.length,o=r,i=r,s=r,a=0;for(;a<r&&n(e[a][0])<3;)a++;for(o=a;a<r&&n(e[a][0])===3;)a++;for(i=a;a<r&&n(e[a][0])===4;)a++;s=a;let u=Ye();if(o>0){let d=e.slice(0,o);t(d)}if(i>o){let d=e.slice(o,i);u?F.push(()=>t(d)):t(d)}if(s>i){let d=e.slice(i,s);u?L.push(()=>t(d)):t(d)}if(r>s){let d=e.slice(s,r);u?$.push(()=>t(d)):t(d)}}var W,Q,F,L,$,ee,Oe=E(()=>{"use strict";W=0,Q=!1,F=[],L=[],$=[],ee=[]});function Xe(t){t.registerMessageType(C,{tier:0,wireCrossing:!1}),t.registerMessageType(v,{tier:1,wireCrossing:!1}),t.registerMessageType(D,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(I,{tier:2,wireCrossing:!1}),t.registerMessageType(X,{tier:2,wireCrossing:!1}),t.registerMessageType(g,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:3,wireCrossing:!0}),t.registerMessageType(_,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(A,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var de,Ze=E(()=>{"use strict";Z();de=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.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}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.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.")}}});var j,Qe=E(()=>{"use strict";j=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`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 Me(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Me);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Me(t[n]);return e}return null}function Ut(t){let e=Ht.encode(t),n=e.length,r=n*8,o=n+9+63&-64,i=new Uint8Array(o);i.set(e),i[n]=128;let s=new DataView(i.buffer);s.setUint32(o-4,r>>>0,!1),s.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,l=1359893119,f=2600822924,h=528734635,T=1541459225,y=new Uint32Array(64),b=(x,O)=>x>>>O|x<<32-O;for(let x=0;x<o;x+=64){for(let k=0;k<16;k++)y[k]=s.getUint32(x+k*4,!1);for(let k=16;k<64;k++){let K=y[k-15],J=y[k-2],oe=b(K,7)^b(K,18)^K>>>3,Te=b(J,17)^b(J,19)^J>>>10;y[k]=y[k-16]+oe+y[k-7]+Te>>>0}let O=a,q=u,Y=d,ye=c,R=l,ne=f,re=h,we=T;for(let k=0;k<64;k++){let K=b(R,6)^b(R,11)^b(R,25),J=R&ne^~R&re,oe=we+K+J+Vt[k]+y[k]>>>0,Te=b(O,2)^b(O,13)^b(O,22),St=O&q^O&Y^q&Y,At=Te+St>>>0;we=re,re=ne,ne=R,R=ye+oe>>>0,ye=Y,Y=q,q=O,O=oe+At>>>0}a=a+O>>>0,u=u+q>>>0,d=d+Y>>>0,c=c+ye>>>0,l=l+R>>>0,f=f+ne>>>0,h=h+re>>>0,T=T+we>>>0}let m=x=>x.toString(16).padStart(8,"0");return m(a)+m(u)+m(d)+m(c)+m(l)+m(f)+m(h)+m(T)}function Re(t){let e=Me(t??null),n=JSON.stringify(e);return Ut(n).slice(0,16)}function Wt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function Ce(t,e,n){let r=n?.id??Wt();if(t===0)return{id:r,version:0};let i=(n?.hash??Re)(e);return{id:r,version:0,cid:i,prev:null}}function et(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var Vt,Ht,tt=E(()=>{"use strict";Vt=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]),Ht=new TextEncoder});function ot(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function De(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function ce(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function M(t,e,n){let r=st(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return st(t)?i=(Ie(e)?e:n)??{}:Ie(t)?i=t:i=(Ie(e)?e:n)??{},new le(r,o,i)}var nt,rt,$t,jt,Fe,le,st,Ie,fe=E(()=>{"use strict";ze();qe();Oe();ie();Ze();Qe();Z();tt();nt=()=>{},rt=100;$t=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},jt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let i=o._cached,s=i===void 0?[ke]:[ke,[g,i]];o._status==="dirty"&&s.push(U),ue(e,s,o._config.tierOf)},Fe=new de({onMessage:$t,onSubscribe:jt});Xe(Fe);je(Fe);le=class t{_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,n,r){this._config=r.config??Fe,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Re;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?Ce(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(ot);let i={};for(let[a,u]of Object.entries(r.meta??{})){let d={initial:u,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),i[a]=new t([],void 0,d)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let s=this;this._actions={emit(a){s._emit([[g,a]])},down(a){s._emit(ce(a))},up(a){s._emitUp(ce(a))}},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,n){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 r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let i=this._cached===void 0?void 0:this._cached,s=this._versioning,a=s?.id??n?.id,u=s?.version??0,d=Ce(e,i,{id:a,hash:o});d.version=u,this._versioning=d,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 n=ae(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=ae(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,i))throw new j({actor:o,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(o,i))throw new j({actor:o,action:i,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:se()}}down(e,n){let r=ce(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[g,e]])}up(e,n){if(this._deps.length===0)return;let r=ce(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[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,n){if(n!=null&&this._guard!=null){let u=ae(n);if(!this._guard(u,"observe"))throw new j({actor:u,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 u of this._deps)De(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.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:o},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!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[n]=this._sinks;this._sinks=n}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,n=0;try{for(let r=0;r<e;r++){let o=r,i=this._deps[r];i.unsub=nt,i.unsub=i.node.subscribe(s=>{if(i.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of s)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let i=this._deps[o];if(i.unsub!=null){let s=i.unsub;i.unsub=null;try{s()}catch{}De(i)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=ot(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ee),r.unsub=nt;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let i=this._config.tierOf,s=!1;for(let a of o)i(a[0])>=3&&(s=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}De(r)}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,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(i)}if(o!==C){if(o===v){this._depDirtied(r);return}if(o===D){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(We);return}if(o===I||o===X){this._emit([n]);return}if(o===A){this._emit(Se);return}if(o===g)this._depSettledAsData(r,n[1]);else if(o===w)this._depSettledAsResolved(r);else if(o===_)this._depSettledAsTerminal(r,!0);else if(o===p)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===g||o===w)&&this._emit([n]),(o===_||o===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Ee))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,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 n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Ue),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit($e)}_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(s){this._emit([[p,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(a){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),r=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let a=n[s];a!=null&&a.length>0&&(this._deps[s].prevData=a[a.length-1])}let o=this._deps.map(s=>s.terminal),i={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:r};for(let a of this._inspectorHooks)a(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,i);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let a=s;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[p,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>rt?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${rt} \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,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[U,e[0]]:e;let r=!0,o=!1,i=!1,s=-1;for(let u of e){let d=n(u[0]);d<s&&(r=!1),d===3&&(o=!0),u[0]===v&&(i=!0),s=d}let a=e;if(!r){let u=e.map((d,c)=>({m:d,i:c,tier:n(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(o&&!i&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[U,...a]:[...a.slice(0,u),U,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===p&&u[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 n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===A||u[0]===D);if(a.length===0)return;n=a}n=this._frameBatch(n);let o=null;for(let a=0;a<n.length;a++){let u=n[a],d=u[0];if(d!==I&&d!==X){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===I?"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 l=u[1];if(d===I)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))c=!1;else if(this._pauseLocks.delete(l),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?o?.push(u):o==null&&(o=n.slice(0,a))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(a=>a[0]===A))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Se)}catch{}let{finalMessages:i,equalsError:s}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of i)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(i);s!=null&&this._emit([[p,s]])}_updateState(e){let n=this._config.tierOf,r,o,i=-1,s=0;for(let c of e)n(c[0])===3&&s++;let a=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===g){u=c;break}}for(let c=0;c<e.length;c++){let l=e[c],f=l[0];if(f===g){if(l.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,l[1])}catch(T){o=this._wrapFnError("equals threw",T),i=c;break}if(h){r==null&&(r=e.slice(0,c)),r.push(Ne),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||c===u)&&et(this._versioning,l[1],this._hashFn)}this._status="settled",r?.push(l)}else if(r?.push(l),f===v)this._status="dirty";else if(f===w)this._status="resolved";else if(f===_){this._status="completed";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===p){this._status="errored";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===D){if(this._cached!==void 0){let T=this._config.rigorRecorder;if(T!=null)try{T.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let h=this._cleanup;if(typeof h=="function"){this._cleanup=void 0;try{h()}catch{}}else if(h!=null&&typeof h=="object"){let T=h.invalidate;if(typeof T=="function")try{T()}catch{}}}else f===A&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=i>=0?r??e.slice(0,i):r??e;return o!=null?{finalMessages:d,equalsError:o}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if(Ke()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Je(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}ue(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);ue(this._deliverToSinks,n,this._config.tierOf)}},st=t=>Array.isArray(t),Ie=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function it(t,e){return M([],{...e,initial:t})}function N(t,e){return M((r,o,i)=>t(o,i)??void 0,{describeKind:"producer",...e})}var Le=E(()=>{"use strict";fe()});function te(t,e,n){let r=new Set;for(let o of t.split(",")){let[i,s]=o.split("/"),a=s?Number.parseInt(s,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let u,d;if(i==="*")u=e,d=n;else if(i.includes("-")){let[c,l]=i.split("-");u=Number.parseInt(c,10),d=Number.parseInt(l,10)}else u=Number.parseInt(i,10),d=u;if(Number.isNaN(u)||Number.isNaN(d))throw new Error(`Invalid cron field: ${t}`);if(u<e||d>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(u>d)throw new Error(`Invalid cron range: ${u}-${d} in ${t}`);for(let c=u;c<=d;c+=a)r.add(c)}return r}function at(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:te(e[0],0,59),hours:te(e[1],0,23),daysOfMonth:te(e[2],1,31),months:te(e[3],1,12),daysOfWeek:te(e[4],0,6)}}function ut(t,e){return t.minutes.has(e.getMinutes())&&t.hours.has(e.getHours())&&t.daysOfMonth.has(e.getDate())&&t.months.has(e.getMonth()+1)&&t.daysOfWeek.has(e.getDay())}var dt=E(()=>{"use strict"});var mt={};xe(mt,{NS_PER_MS:()=>B,NS_PER_SEC:()=>z,constant:()=>ct,decorrelatedJitter:()=>ht,exponential:()=>ft,fibonacci:()=>pt,linear:()=>lt,resolveBackoffPreset:()=>pe,withMaxAttempts:()=>Yt});function P(t){return t<0?0:t}function zt(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function qt(t,e){return t+Math.random()*(e-t)}function ct(t){let e=P(t);return()=>e}function lt(t,e){let n=P(t),r=e===void 0?n:P(e);return o=>n+r*Math.max(0,o)}function ft(t){let e=P(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,r=P(t?.maxDelayNs??30*1e9),o=t?.jitter??"none";return i=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let a=r/e,u=1;for(let d=0;d<Math.max(0,i);d++){if(u>=a){u=a;break}u*=n}s=e*u,s>r&&(s=r)}return zt(s,o)}}function pt(t=100*1e6,e=30*1e9){let n=P(t),r=P(e);function o(i){if(i<=0)return 1;let s=1,a=2;for(let u=1;u<i;u++){let d=s+a;s=a,a=d}return a}return i=>{let s=o(i)*n;return s<=r?s:r}}function ht(t=100*1e6,e=30*1e9){return(n,r,o)=>{let s=Math.min(e,(o??t)*3);return qt(t,s)}}function Yt(t,e){return(n,r,o)=>n>=e?null:t(n,r,o)}function pe(t){if(t==="constant")return ct(1*1e9);if(t==="linear")return lt(1*1e9);if(t==="exponential")return ft();if(t==="fibonacci")return pt();if(t==="decorrelatedJitter")return ht();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var B,z,Pe=E(()=>{"use strict";B=1e6,z=1e9});var G,bt=E(()=>{"use strict";G=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var yt={};xe(yt,{CircuitOpenError:()=>he,RateLimiterOverflowError:()=>me,TimeoutError:()=>be,circuitBreaker:()=>Qt,fallback:()=>an,rateLimiter:()=>tn,retry:()=>Jt,timeout:()=>un,tokenBucket:()=>_t,withBreaker:()=>en,withStatus:()=>nn});function V(t){return{describeKind:"derived",...t}}function Kt(t){return t<0?0:t}function ge(t){return t[1]}function gt(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function Jt(t,e){return typeof t=="function"?Zt(t,e):Xt(t,e)}function Xt(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?pe(r):r;return N(s=>{let a=0,u=!1,d=null,c,l=new G;function f(){c?.(),c=void 0}function h(y){if(u)return;if(a>=o){f(),s.down([[p,y]]);return}let b=i===null?0:i(a,y,d);if(b==null){f(),s.down([[p,y]]);return}let m;try{m=gt(b)}catch{f(),s.down([[p,y]]);return}d=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||T()})}function T(){l.cancel(),f(),c=t.subscribe(y=>{if(!u)for(let b of y){let m=b[0];if(m===v)s.down([[v]]);else if(m===g)a=0,d=null,s.emit(b[1]);else if(m===w)s.down([[w]]);else if(m===_)f(),s.down([[_]]);else if(m===p){h(ge(b));return}else s.down([b])}})}return T(),()=>{u=!0,l.cancel(),f()}},{...V(),initial:t.cache})}function Zt(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?pe(r):r;return N(s=>{let a=0,u=!1,d=null,c,l=new G;function f(){c?.(),c=void 0}function h(y){if(u)return;if(a>=o){f(),s.down([[p,y]]);return}let b=i===null?0:i(a,y,d);if(b==null){f(),s.down([[p,y]]);return}let m;try{m=gt(b)}catch{f(),s.down([[p,y]]);return}d=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||T()})}function T(){l.cancel(),f();let y;try{y=t()}catch(b){h(b);return}c=y.subscribe(b=>{if(!u)for(let m of b){let x=m[0];if(x===v)s.down([[v]]);else if(x===g)a=0,d=null,s.emit(m[1]);else if(x===w)s.down([[w]]);else if(x===_)f(),s.down([[_]]);else if(x===p){h(ge(m));return}else s.down([m])}})}return T(),()=>{u=!0,l.cancel(),f()}},{...V(),initial:e?.initial})}function Qt(t){let e=Math.max(1,t?.failureThreshold??5),n=Kt(t?.cooldownNs??30*1e9),r=t?.cooldown??null,o=Math.max(1,t?.halfOpenMax??1),i=t?.now??H,s="closed",a=0,u=0,d=0,c=n,l=0;function f(){if(!r)return n;let y=r(u);return y!==null?y:n}function h(){s="open",c=f(),d=i(),l=0}return{canExecute(){return s==="closed"?!0:s==="open"?i()-d>=c?(s="half-open",l=1,!0):!1:l<o?(l++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",a=0,u=0):s==="closed"&&(a=0)},recordFailure(y){if(s==="half-open"){u++,h();return}s==="closed"&&(a++,a>=e&&h())},get state(){return s},get failureCount(){return a},reset(){s="closed",a=0,u=0,l=0}}}function en(t,e){let n=e?.onOpen??"skip";return r=>{let o=M([],(i,s)=>{function a(){o.meta.breakerState.down([[g,t.state]])}let u=r.subscribe(d=>{for(let c of d){let l=c[0];l===v?s.down([[v]]):l===g?t.canExecute()?(a(),s.emit(c[1])):(a(),n==="error"?s.down([[p,new he]]):s.down([[w]])):l===w?s.down([[w]]):l===_?(t.recordSuccess(),a(),s.down([[_]])):l===p?(t.recordFailure(ge(c)),a(),s.down([c])):s.down([c])}});return a(),u},{...V(),meta:{breakerState:t.state},completeWhenDepsComplete:!1,initial:r.cache});return{node:o,breakerState:o.meta.breakerState}}}function _t(t,e){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let n=t,r=H();function o(i){if(e>0){let s=i-r;n=Math.min(t,n+s/1e9*e)}r=i}return{available(){return o(H()),n},tryConsume(i=1){if(i<=0)return!0;let s=H();return o(s),n>=i?(n-=i,!0):!1},putBack(i=1){i<=0||(o(H()),n=Math.min(t,n+i))}}}function tn(t,e){let{maxEvents:n,windowNs:r}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o!==void 0&&o<1)throw new RangeError("maxBuffer must be >= 1");let i=e.onOverflow??"drop-newest",s=n*1e9/r;return N(a=>{let u=_t(n,s),d=[],c=new G,l=!1,f=1e9/s;function h(){for(;d.length>0;)if(u.tryConsume(1))a.emit(d.shift());else{c.start(Math.max(1,f/1e6),h);return}}let T=t.subscribe(y=>{for(let b of y){if(l)return;let m=b[0];if(m===v)a.down([[v]]);else if(m===g){if(o!==void 0&&d.length>=o){if(i!=="drop-newest")if(i==="drop-oldest")d.shift(),d.push(b[1]);else{l=!0,c.cancel(),d.length=0,a.down([[p,new me(o)]]);return}}else d.push(b[1]);h()}else if(m===w)a.down([[w]]);else if(m===_)l=!0,c.cancel(),d.length=0,a.down([[_]]);else if(m===p)l=!0,c.cancel(),d.length=0,a.down([b]);else if(m===A){l=!0,c.cancel(),d.length=0,a.down([b]);return}else a.down([b])}});return()=>{l=!0,c.cancel(),T()}},{...V(),initial:t.cache})}function nn(t,e){let n=e?.initialStatus??"pending",r=M([],(o,i)=>{let s=n;return r.meta.status.down([[g,n]]),r.meta.error.down([[g,null]]),t.subscribe(u=>{for(let d of u){let c=d[0];if(c===v)i.down([[v]]);else if(c===g)s==="errored"?Ae(()=>{r.meta.error.down([[g,null]]),r.meta.status.down([[g,"active"]])}):r.meta.status.down([[g,"active"]]),s="active",i.emit(d[1]);else if(c===w)i.down([[w]]);else if(c===_)r.meta.status.down([[g,"completed"]]),s="completed",i.down([[_]]);else if(c===p){let l=ge(d);Ae(()=>{r.meta.error.down([[g,l]]),r.meta.status.down([[g,"errored"]])}),s="errored",i.down([d])}else i.down([d])}})},{...V(),meta:{status:n,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function rn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function on(t){return t!=null&&typeof t.then=="function"}function sn(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function an(t,e){return N(n=>{let r,o;function i(){o?.(),o=void 0,rn(e)||on(e)||sn(e)?r=_e(e).subscribe(a=>{n.down(a)}):(n.emit(e),n.down([[_]]))}return o=t.subscribe(s=>{for(let a of s){let u=a[0];if(u===v)n.down([[v]]);else if(u===g)n.emit(a[1]);else if(u===w)n.down([[w]]);else if(u===_)n.down([[_]]);else if(u===p){i();return}else if(u===A){r?.(),n.down([a]);return}else n.down([a])}}),()=>{o?.(),r?.()}},{...V(),initial:t.cache})}function un(t,e){if(e<=0)throw new RangeError("timeoutNs must be > 0");return N(n=>{let r=!1,o=new G;function i(){let a=e/1e6;o.start(a,()=>{r||(r=!0,s(),n.down([[p,new be(e)]]))})}let s=t.subscribe(a=>{for(let u of a){if(r)return;let d=u[0];if(d===v)n.down([[v]]);else if(d===g)i(),n.emit(u[1]);else if(d===w)n.down([[w]]);else if(d===_){o.cancel(),r=!0,n.down([[_]]);return}else if(d===p){o.cancel(),r=!0,n.down([u]);return}else if(d===A){o.cancel(),r=!0,n.down([u]);return}else n.down([u])}});return i(),()=>{r=!0,o.cancel(),s()}},{...V(),initial:t.cache})}var he,me,be,wt=E(()=>{"use strict";Oe();ie();Z();fe();Le();Pe();Tt();bt();he=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};me=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};be=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Cn={};xe(Cn,{awaitSettled:()=>Sn,cached:()=>kn,defer:()=>Tn,empty:()=>_n,escapeRegexChar:()=>xt,firstValueFrom:()=>En,firstWhere:()=>Ge,forEach:()=>vn,fromAny:()=>_e,fromAsyncIter:()=>kt,fromCron:()=>hn,fromEvent:()=>mn,fromIter:()=>Ve,fromPromise:()=>Nt,fromRaf:()=>pn,fromTimer:()=>fn,globToRegExp:()=>dn,keepalive:()=>Mn,matchesAnyPattern:()=>cn,never:()=>yn,nodeSignal:()=>An,of:()=>Et,reactiveCounter:()=>Rn,replay:()=>He,share:()=>Nn,shareReplay:()=>On,throwError:()=>wn,toArray:()=>xn});module.exports=Dt(Cn);function S(t){return{describeKind:"producer",...t}}function xt(t){return/[\\^$+?.()|[\]{}]/.test(t)?`\\${t}`:t}function dn(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){t[n+1]==="*"?(e+=".*",n+=1):e+="[^/]*";continue}e+=xt(r)}return e+="$",new RegExp(e)}function cn(t,e){for(let n of e)if(n.test(t))return!0;return!1}function ln(t,e){let n=M([t],(o,i)=>{let s=o[0];if(s==null||s.length===0){i.down([[w]]);return}for(let a of s)i.emit(a)},{describeKind:"derived",initial:t.cache}),r=n.subscribe.bind(n);return n.subscribe=(o,i)=>(e(o),r(o,i)),n}function fn(t,e){let{signal:n,period:r,...o}=e??{};return N(i=>{let s=!1,a=0,u,d,c=()=>{s=!0,u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),n?.removeEventListener("abort",f)},l=()=>{s||(r!=null?(i.emit(a++),d=setInterval(()=>{s||i.emit(a++)},r)):(s=!0,n?.removeEventListener("abort",f),i.emit(a++),i.down([[_]])))},f=()=>{s||(c(),i.down([[p,n.reason]]))};if(n?.aborted){f();return}return u=setTimeout(l,t),n?.addEventListener("abort",f,{once:!0}),c},S(o))}function pn(t){let{signal:e,...n}=t??{};return N(r=>{let o=!1,i,s,a=!1,u=!1,d=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,c=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,f=()=>{i!==void 0&&c&&c(i),s!==void 0&&clearTimeout(s),i=void 0,s=void 0},h=()=>{o=!0,f(),a&&(e?.removeEventListener("abort",T),a=!1),u&&l&&(l.removeEventListener("visibilitychange",m),u=!1)},T=()=>{o||(h(),r.down([[p,e.reason]]))},y=x=>{o||(r.emit(x),b())},b=()=>{o||(d&&(!l||l.visibilityState!=="hidden")?i=d(y):s=setTimeout(()=>y(performance.now()),16))},m=()=>{o||(f(),b())};return e?.aborted?(T(),h):(e?.addEventListener("abort",T,{once:!0}),a=e!==void 0,l&&d&&(l.addEventListener("visibilitychange",m),u=!0),b(),h)},S(n))}function hn(t,e){let n=at(t),{tickMs:r,output:o,...i}=e??{},s=r??6e4,a=o==="date";return N(u=>{let d=-1,c=()=>{let f=new Date,h=f.getFullYear()*1e8+(f.getMonth()+1)*1e6+f.getDate()*1e4+f.getHours()*100+f.getMinutes();h!==d&&ut(n,f)&&(d=h,u.emit(a?f:se()))};c();let l=setInterval(c,s);return()=>clearInterval(l)},{...S(i),name:i.name??`cron:${t}`})}function mn(t,e,n){let{capture:r,passive:o,once:i,...s}=n??{};return N(a=>{let u=c=>{a.emit(c)},d={capture:r,passive:o,once:i};return t.addEventListener(e,u,d),()=>t.removeEventListener(e,u,d)},S(s))}function Ve(t,e){return N(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[_]])}catch(o){r||n.down([[p,o]])}return()=>{r=!0}},S(e))}function bn(t){return t!=null&&typeof t.then=="function"}function Nt(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=!1,s=()=>{i||(i=!0,o.down([[p,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(a=>{i||(i=!0,n?.removeEventListener("abort",s),o.emit(a),o.down([[_]]))},a=>{i||(i=!0,n?.removeEventListener("abort",s),o.down([[p,a]]))}),()=>{i=!0,n?.removeEventListener("abort",s)}},S(r))}function kt(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=new AbortController,s=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let a=n??i.signal,u=!1,d=t[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(l=>{if(!(u||a.aborted)){if(l.done){o.down([[_]]);return}o.emit(l.value),c()}},l=>{!u&&!a.aborted&&o.down([[p,l]])})};return c(),()=>{u=!0,n?.removeEventListener("abort",s),i.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},S(r))}function gn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function _e(t,e){if(gn(t))return t;if(bn(t))return Nt(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return kt(t,e);if(typeof n[Symbol.iterator]=="function")return Ve(t,e)}return Et(t)}function Et(...t){return Ve(t,void 0)}function _n(t){return N(e=>{e.down([[_]])},S(t))}function yn(t){return N(()=>{},S(t))}function wn(t,e){return N(n=>{n.down([[p,t]])},S(e))}function Tn(t,e){let{signal:n,...r}=e??{},o=S(r),i=o.resubscribable===void 0?{...o,resubscribable:!0}:o;return N(s=>{let a,u=!1;try{let d=t();a=_e(d,e).subscribe(l=>{if(!u)for(let f of l){let h=f[0];if(h!==C)if(h===g)s.emit(f[1]);else if(h===_){u=!0,s.down([[_]]);break}else if(h===p){u=!0,s.down([[p,f[1]]]);break}else s.down([f])}})}catch(d){let c=d===void 0?new Error("defer: thunk threw undefined"):d;s.down([[p,c]])}return()=>{u=!0,a?.()}},i)}function vn(t,e,n){return M([t],(o,i)=>{let s=o[0];if(s!=null&&s.length>0)for(let a of s)e(a)},{describeKind:"effect",...n}).subscribe(()=>{})}function xn(t,e){return M([t],(n,r,o)=>{o.store.buf||(o.store.buf=[]);let i=o.store.buf,s=n[0];if(s!=null&&s.length>0)for(let a of s)i.push(a);if(o.terminalDeps[0]===!0){r.emit([...i]),r.down([[_]]);return}(s==null||s.length===0)&&r.down([[w]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function Nn(t,e){return N(n=>t.subscribe(r=>{n.down(r)}),{...S(e),initial:t.cache})}function He(t,e,n){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let r=[],o=N(i=>t.subscribe(s=>{for(let a of s)a[0]===g&&(r.push(a[1]),r.length>e&&r.shift());i.down(s)}),{...S(n),initial:t.cache});return ln(o,i=>{for(let s of r)i([[g,s]])})}function kn(t,e){return He(t,1,e)}function En(t){return new Promise((e,n)=>{let r=!1,o=!1,i;i=t.subscribe(s=>{for(let a of s){if(r)return;if(a[0]===g){r=!0,e(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===p){r=!0,n(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===_){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):o=!0;return}}}),o&&(i?.(),i=void 0)})}function Ge(t,e,n){return new Promise((r,o)=>{let i=!1,s=!1,a,u=n?.skipCurrent===!0;a=t.subscribe(d=>{for(let c of d){if(i)return;if(!(u&&c[0]===g)){if(c[0]===g){let l=c[1];if(e(l)){i=!0,r(l),a?(a(),a=void 0):s=!0;return}}if(c[0]===p){i=!0,o(c[1]),a?(a(),a=void 0):s=!0;return}if(c[0]===_){i=!0,o(new Error("completed without matching value")),a?(a(),a=void 0):s=!0;return}}}}),u=!1,s&&(a?.(),a=void 0)})}async function Sn(t,e){let n=e?.predicate??(i=>i!=null),r=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Ge(t,n,{skipCurrent:r});if(Be===void 0){let[i,s]=await Promise.all([Promise.resolve().then(()=>(wt(),yt)),Promise.resolve().then(()=>(Pe(),mt))]);Be=i.timeout,vt=s.NS_PER_MS}let o=Be(t,e.timeoutMs*vt);return await Ge(o,n,{skipCurrent:r})}function An(t,e){let n=new AbortController,r=e?.reason??new Error("cancelled via nodeSignal"),o,i=!1,s=()=>{o?(o(),o=void 0):i=!0};return o=t.subscribe(a=>{if(!n.signal.aborted)for(let u of a){if(u[0]===g&&u[1]===!0){n.abort(r),s();return}if(u[0]===p){n.abort(u[1]),s();return}if(u[0]===_){s();return}}}),i&&(o?.(),o=void 0),{signal:n.signal,dispose:()=>{o&&(o(),o=void 0)}}}function Mn(t){return t.subscribe(()=>{})}function Rn(t){let e=it(0);return{node:e,increment(){let n=e.cache??0;return n>=t?!1:(e.down([[v],[g,n+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=t}}}var Be,vt,On,Tt=E(()=>{ie();Z();fe();Le();dt();On=He});Tt();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
|
|
1
|
+
"use strict";var xe=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var It=Object.prototype.hasOwnProperty;var E=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ne=(t,e)=>{for(var n in e)xe(t,n,{get:e[n],enumerable:!0})},Ft=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Dt(e))!It.call(t,o)&&o!==n&&xe(t,o,{get:()=>e[o],enumerable:!(r=Ct(e,o))||r.enumerable});return t};var Lt=t=>Ft(xe({},"__esModule",{value:!0}),t);function U(){return Math.trunc(performance.now()*1e6)}function ie(){return Date.now()*1e6}var ae=E(()=>{"use strict"});var D,b,T,w,I,F,Z,A,y,p,W,ke,Pt,Ee,Bt,Gt,Se,We,$e,je,Ae,Q=E(()=>{"use strict";D=Symbol.for("graphrefly/START"),b=Symbol.for("graphrefly/DATA"),T=Symbol.for("graphrefly/DIRTY"),w=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),F=Symbol.for("graphrefly/PAUSE"),Z=Symbol.for("graphrefly/RESUME"),A=Symbol.for("graphrefly/TEARDOWN"),y=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),W=Object.freeze([T]),ke=Object.freeze([w]),Pt=Object.freeze([I]),Ee=Object.freeze([D]),Bt=Object.freeze([y]),Gt=Object.freeze([A]),Se=Object.freeze([W]),We=Object.freeze([ke]),$e=Object.freeze([Pt]),je=Object.freeze([Bt]),Ae=Object.freeze([Gt])});function ze(t){t.registerCodec(Vt)}var Vt,Ke=E(()=>{"use strict";Vt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function ue(t){if(t==null)return Ht;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Ht,qe=E(()=>{"use strict";Ht={type:"system",id:""}});function Ye(){return $>0||ee}function Je(){return $>0}function Xe(t){$>0?te.push(t):t()}function Oe(t){$+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if($-=1,$===0)if(e){if(!ee){let n=te.splice(0);for(let r of n)try{r()}catch{}L.length=0,P.length=0,j.length=0}}else Ut()}}function Ut(){let t=!ee;t&&(ee=!0);let e=[],n=0;try{for(;L.length>0||P.length>0||j.length>0||t&&te.length>0;){if(t&&te.length>0){let i=te.splice(0);for(let s of i)try{s()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw L.length=0,P.length=0,j.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(L.length>0?L:P.length>0?P:j).splice(0);for(let i of o)try{i()}catch(s){e.push(s)}}}finally{t&&(ee=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function ce(t,e,n){if(e.length===0)return;if(e.length===1){let c=n(e[0][0]);if(c<3||!Ye()){t(e);return}(c>=5?j:c===4?P:L).push(()=>t(e));return}let r=e.length,o=r,i=r,s=r,a=0;for(;a<r&&n(e[a][0])<3;)a++;for(o=a;a<r&&n(e[a][0])===3;)a++;for(i=a;a<r&&n(e[a][0])===4;)a++;s=a;let u=Ye();if(o>0){let c=e.slice(0,o);t(c)}if(i>o){let c=e.slice(o,i);u?L.push(()=>t(c)):t(c)}if(s>i){let c=e.slice(i,s);u?P.push(()=>t(c)):t(c)}if(r>s){let c=e.slice(s,r);u?j.push(()=>t(c)):t(c)}}var $,ee,L,P,j,te,Re=E(()=>{"use strict";$=0,ee=!1,L=[],P=[],j=[],te=[]});function Ze(t){t.registerMessageType(D,{tier:0,wireCrossing:!1}),t.registerMessageType(T,{tier:1,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(F,{tier:2,wireCrossing:!1}),t.registerMessageType(Z,{tier:2,wireCrossing:!1}),t.registerMessageType(b,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:3,wireCrossing:!0}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(A,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var de,Qe=E(()=>{"use strict";Q();de=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.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}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.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.")}}});var z,et=E(()=>{"use strict";z=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`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 Me(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Me);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Me(t[n]);return e}return null}function jt(t){let e=$t.encode(t),n=e.length,r=n*8,o=n+9+63&-64,i=new Uint8Array(o);i.set(e),i[n]=128;let s=new DataView(i.buffer);s.setUint32(o-4,r>>>0,!1),s.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,u=3144134277,c=1013904242,d=2773480762,l=1359893119,f=2600822924,h=528734635,v=1541459225,_=new Uint32Array(64),g=(x,O)=>x>>>O|x<<32-O;for(let x=0;x<o;x+=64){for(let k=0;k<16;k++)_[k]=s.getUint32(x+k*4,!1);for(let k=16;k<64;k++){let J=_[k-15],X=_[k-2],se=g(J,7)^g(J,18)^J>>>3,Te=g(X,17)^g(X,19)^X>>>10;_[k]=_[k-16]+se+_[k-7]+Te>>>0}let O=a,q=u,Y=c,we=d,M=l,re=f,oe=h,ve=v;for(let k=0;k<64;k++){let J=g(M,6)^g(M,11)^g(M,25),X=M&re^~M&oe,se=ve+J+X+Wt[k]+_[k]>>>0,Te=g(O,2)^g(O,13)^g(O,22),Rt=O&q^O&Y^q&Y,Mt=Te+Rt>>>0;ve=oe,oe=re,re=M,M=we+se>>>0,we=Y,Y=q,q=O,O=se+Mt>>>0}a=a+O>>>0,u=u+q>>>0,c=c+Y>>>0,d=d+we>>>0,l=l+M>>>0,f=f+re>>>0,h=h+oe>>>0,v=v+ve>>>0}let m=x=>x.toString(16).padStart(8,"0");return m(a)+m(u)+m(c)+m(d)+m(l)+m(f)+m(h)+m(v)}function Ce(t){let e=Me(t??null),n=JSON.stringify(e);return jt(n).slice(0,16)}function zt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function De(t,e,n){let r=n?.id??zt();if(t===0)return{id:r,version:0};let i=(n?.hash??Ce)(e);return{id:r,version:0,cid:i,prev:null}}function tt(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var Wt,$t,nt=E(()=>{"use strict";Wt=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]),$t=new TextEncoder});function st(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ie(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function le(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function R(t,e,n){let r=it(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return it(t)?i=(Fe(e)?e:n)??{}:Fe(t)?i=t:i=(Fe(e)?e:n)??{},new fe(r,o,i)}var rt,ot,Kt,qt,Le,fe,it,Fe,pe=E(()=>{"use strict";Ke();qe();Re();ae();Qe();et();Q();nt();rt=()=>{},ot=100;Kt=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},qt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let i=o._cached,s=i===void 0?[Ee]:[Ee,[b,i]];o._status==="dirty"&&s.push(W),ce(e,s,o._config.tierOf)},Le=new de({onMessage:Kt,onSubscribe:qt});Ze(Le);ze(Le);fe=class t{_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,n,r){this._config=r.config??Le,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Ce;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?De(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(st);let i={};for(let[a,u]of Object.entries(r.meta??{})){let c={initial:u,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(c.guard=r.guard),i[a]=new t([],void 0,c)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let s=this;this._actions={emit(a){s._emit([[b,a]])},down(a){s._emit(le(a))},up(a){s._emitUp(le(a))}},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,n){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 r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let i=this._cached===void 0?void 0:this._cached,s=this._versioning,a=s?.id??n?.id,u=s?.version??0,c=De(e,i,{id:a,hash:o});c.version=u,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 n=ue(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=ue(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,i))throw new z({actor:o,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(o,i))throw new z({actor:o,action:i,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:ie()}}down(e,n){let r=le(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[b,e]])}up(e,n){if(this._deps.length===0)return;let r=le(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[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,n){if(n!=null&&this._guard!=null){let u=ue(n);if(!this._guard(u,"observe"))throw new z({actor:u,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 u of this._deps)Ie(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.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:o},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!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[n]=this._sinks;this._sinks=n}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,n=0;try{for(let r=0;r<e;r++){let o=r,i=this._deps[r];i.unsub=rt,i.unsub=i.node.subscribe(s=>{if(i.unsub===null)return;let a=this._config.tierOf,u=!1;for(let c of s)a(c[0])>=3&&(u=!0),this._config.onMessage(this,c,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let i=this._deps[o];if(i.unsub!=null){let s=i.unsub;i.unsub=null;try{s()}catch{}Ie(i)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=st(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se),r.unsub=rt;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let i=this._config.tierOf,s=!1;for(let a of o)i(a[0])>=3&&(s=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}Ie(r)}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,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(i)}if(o!==D){if(o===T){this._depDirtied(r);return}if(o===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit($e);return}if(o===F||o===Z){this._emit([n]);return}if(o===A){this._emit(Ae);return}if(o===b)this._depSettledAsData(r,n[1]);else if(o===w)this._depSettledAsResolved(r);else if(o===y)this._depSettledAsTerminal(r,!0);else if(o===p)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===b||o===w)&&this._emit([n]),(o===y||o===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,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 n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}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(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(je)}_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(s){this._emit([[p,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(a){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),r=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let a=n[s];a!=null&&a.length>0&&(this._deps[s].prevData=a[a.length-1])}let o=this._deps.map(s=>s.terminal),i={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:r};for(let a of this._inspectorHooks)a(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,i);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let a=s;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[p,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>ot?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${ot} \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,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[W,e[0]]:e;let r=!0,o=!1,i=!1,s=-1;for(let u of e){let c=n(u[0]);c<s&&(r=!1),c===3&&(o=!0),u[0]===T&&(i=!0),s=c}let a=e;if(!r){let u=e.map((c,d)=>({m:c,i:d,tier:n(c[0])}));u.sort((c,d)=>c.tier-d.tier||c.i-d.i),a=u.map(c=>c.m)}if(o&&!i&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[W,...a]:[...a.slice(0,u),W,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===p&&u[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 n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===A||u[0]===I);if(a.length===0)return;n=a}n=this._frameBatch(n);let o=null;for(let a=0;a<n.length;a++){let u=n[a],c=u[0];if(c!==F&&c!==Z){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${c===F?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let d=!0;if(this._pausable!==!1){let l=u[1];if(c===F)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))d=!1;else if(this._pauseLocks.delete(l),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())}}d?o?.push(u):o==null&&(o=n.slice(0,a))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(a=>a[0]===A))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Ae)}catch{}let{finalMessages:i,equalsError:s}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let c of i)a(c[0])===3?this._pauseBuffer.push(c):u.push(c);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(i);s!=null&&this._emit([[p,s]])}_updateState(e){let n=this._config.tierOf,r,o,i=-1,s=0;for(let d of e)n(d[0])===3&&s++;let a=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let d=e.length-1;d>=0;d--)if(e[d][0]===b){u=d;break}}for(let d=0;d<e.length;d++){let l=e[d],f=l[0];if(f===b){if(l.length>=2){let h=!1;if(a&&this._cached!==void 0)try{h=this._equals(this._cached,l[1])}catch(v){o=this._wrapFnError("equals threw",v),i=d;break}if(h){r==null&&(r=e.slice(0,d)),r.push(ke),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||d===u)&&tt(this._versioning,l[1],this._hashFn)}this._status="settled",r?.push(l)}else if(r?.push(l),f===T)this._status="dirty";else if(f===w)this._status="resolved";else if(f===y){this._status="completed";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===p){this._status="errored";{let h=this._config.rigorRecorder;if(h!=null)try{h.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(f===I){if(this._cached!==void 0){let v=this._config.rigorRecorder;if(v!=null)try{v.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let h=this._cleanup;if(typeof h=="function"){this._cleanup=void 0;try{h()}catch{}}else if(h!=null&&typeof h=="object"){let v=h.invalidate;if(typeof v=="function")try{v()}catch{}}}else f===A&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let c=i>=0?r??e.slice(0,i):r??e;return o!=null?{finalMessages:c,equalsError:o}:{finalMessages:c}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if(Je()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Xe(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}ce(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);ce(this._deliverToSinks,n,this._config.tierOf)}},it=t=>Array.isArray(t),Fe=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function at(t,e){return R([],{...e,initial:t})}function N(t,e){return R((r,o,i)=>t(o,i)??void 0,{describeKind:"producer",...e})}var Pe=E(()=>{"use strict";pe()});function ne(t,e,n){let r=new Set;for(let o of t.split(",")){let[i,s]=o.split("/"),a=s?Number.parseInt(s,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let u,c;if(i==="*")u=e,c=n;else if(i.includes("-")){let[d,l]=i.split("-");u=Number.parseInt(d,10),c=Number.parseInt(l,10)}else u=Number.parseInt(i,10),c=u;if(Number.isNaN(u)||Number.isNaN(c))throw new Error(`Invalid cron field: ${t}`);if(u<e||c>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(u>c)throw new Error(`Invalid cron range: ${u}-${c} in ${t}`);for(let d=u;d<=c;d+=a)r.add(d)}return r}function ut(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:ne(e[0],0,59),hours:ne(e[1],0,23),daysOfMonth:ne(e[2],1,31),months:ne(e[3],1,12),daysOfWeek:ne(e[4],0,6)}}function ct(t,e){return t.minutes.has(e.getMinutes())&&t.hours.has(e.getHours())&&t.daysOfMonth.has(e.getDate())&&t.months.has(e.getMonth()+1)&&t.daysOfWeek.has(e.getDay())}var dt=E(()=>{"use strict"});function C(t,e){let n={factory:t};return e!==void 0&&(n.factoryArgs=e),n}var lt=E(()=>{"use strict"});var bt={};Ne(bt,{NS_PER_MS:()=>G,NS_PER_SEC:()=>K,constant:()=>ft,decorrelatedJitter:()=>gt,exponential:()=>ht,fibonacci:()=>mt,linear:()=>pt,resolveBackoffPreset:()=>he,withMaxAttempts:()=>Xt});function B(t){return t<0?0:t}function Yt(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function Jt(t,e){return t+Math.random()*(e-t)}function ft(t){let e=B(t);return()=>e}function pt(t,e){let n=B(t),r=e===void 0?n:B(e);return o=>n+r*Math.max(0,o)}function ht(t){let e=B(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,r=B(t?.maxDelayNs??30*1e9),o=t?.jitter??"none";return i=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let a=r/e,u=1;for(let c=0;c<Math.max(0,i);c++){if(u>=a){u=a;break}u*=n}s=e*u,s>r&&(s=r)}return Yt(s,o)}}function mt(t=100*1e6,e=30*1e9){let n=B(t),r=B(e);function o(i){if(i<=0)return 1;let s=1,a=2;for(let u=1;u<i;u++){let c=s+a;s=a,a=c}return a}return i=>{let s=o(i)*n;return s<=r?s:r}}function gt(t=100*1e6,e=30*1e9){return(n,r,o)=>{let s=Math.min(e,(o??t)*3);return Jt(t,s)}}function Xt(t,e){return(n,r,o)=>n>=e?null:t(n,r,o)}function he(t){if(t==="constant")return ft(1*1e9);if(t==="linear")return pt(1*1e9);if(t==="exponential")return ht();if(t==="fibonacci")return mt();if(t==="decorrelatedJitter")return gt();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var G,K,Be=E(()=>{"use strict";G=1e6,K=1e9});var V,yt=E(()=>{"use strict";V=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var Tt={};Ne(Tt,{CircuitOpenError:()=>me,RateLimiterOverflowError:()=>ge,TimeoutError:()=>be,circuitBreaker:()=>nn,fallback:()=>dn,rateLimiter:()=>on,retry:()=>Qt,timeout:()=>ln,tokenBucket:()=>vt,withBreaker:()=>rn,withStatus:()=>sn});function H(t){return{describeKind:"derived",...t}}function Zt(t){return t<0?0:t}function ye(t){return t[1]}function _t(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function Qt(t,e){return typeof t=="function"?tn(t,e):en(t,e)}function wt(t){let e={};return t?.count!==void 0&&(e.count=t.count),typeof t?.backoff=="string"&&(e.backoff=t.backoff),Object.keys(e).length>0?e:void 0}function en(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?he(r):r;return N(s=>{let a=0,u=!1,c=null,d,l=new V;function f(){d?.(),d=void 0}function h(_){if(u)return;if(a>=o){f(),s.down([[p,_]]);return}let g=i===null?0:i(a,_,c);if(g==null){f(),s.down([[p,_]]);return}let m;try{m=_t(g)}catch{f(),s.down([[p,_]]);return}c=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||v()})}function v(){l.cancel(),f(),d=t.subscribe(_=>{if(!u)for(let g of _){let m=g[0];if(m===T)s.down([[T]]);else if(m===b)a=0,c=null,s.emit(g[1]);else if(m===w)s.down([[w]]);else if(m===y)f(),s.down([[y]]);else if(m===p){h(ye(g));return}else s.down([g])}})}return v(),()=>{u=!0,l.cancel(),f()}},{...H(),initial:t.cache,meta:{...C("retry",wt(e))}})}function tn(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let i=r===void 0?null:typeof r=="string"?he(r):r;return N(s=>{let a=0,u=!1,c=null,d,l=new V;function f(){d?.(),d=void 0}function h(_){if(u)return;if(a>=o){f(),s.down([[p,_]]);return}let g=i===null?0:i(a,_,c);if(g==null){f(),s.down([[p,_]]);return}let m;try{m=_t(g)}catch{f(),s.down([[p,_]]);return}c=m,a+=1,f();let x=m>0?m/1e6:1;l.start(x,()=>{u||v()})}function v(){l.cancel(),f();let _;try{_=t()}catch(g){h(g);return}d=_.subscribe(g=>{if(!u)for(let m of g){let x=m[0];if(x===T)s.down([[T]]);else if(x===b)a=0,c=null,s.emit(m[1]);else if(x===w)s.down([[w]]);else if(x===y)f(),s.down([[y]]);else if(x===p){h(ye(m));return}else s.down([m])}})}return v(),()=>{u=!0,l.cancel(),f()}},{...H(),initial:e?.initial,meta:{...C("retry",wt(e))}})}function nn(t){let e=Math.max(1,t?.failureThreshold??5),n=Zt(t?.cooldownNs??30*1e9),r=t?.cooldown??null,o=Math.max(1,t?.halfOpenMax??1),i=t?.now??U,s="closed",a=0,u=0,c=0,d=n,l=0;function f(){if(!r)return n;let _=r(u);return _!==null?_:n}function h(){s="open",d=f(),c=i(),l=0}return{canExecute(){return s==="closed"?!0:s==="open"?i()-c>=d?(s="half-open",l=1,!0):!1:l<o?(l++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",a=0,u=0):s==="closed"&&(a=0)},recordFailure(_){if(s==="half-open"){u++,h();return}s==="closed"&&(a++,a>=e&&h())},get state(){return s},get failureCount(){return a},reset(){s="closed",a=0,u=0,l=0}}}function rn(t,e){let n=e?.onOpen??"skip";return r=>{let o=R([],(i,s)=>{function a(){o.meta.breakerState.down([[b,t.state]])}let u=r.subscribe(c=>{for(let d of c){let l=d[0];l===T?s.down([[T]]):l===b?t.canExecute()?(a(),s.emit(d[1])):(a(),n==="error"?s.down([[p,new me]]):s.down([[w]])):l===w?s.down([[w]]):l===y?(t.recordSuccess(),a(),s.down([[y]])):l===p?(t.recordFailure(ye(d)),a(),s.down([d])):s.down([d])}});return a(),u},{...H(),meta:{breakerState:t.state,...C("withBreaker",{onOpen:n})},completeWhenDepsComplete:!1,initial:r.cache});return{node:o,breakerState:o.meta.breakerState}}}function vt(t,e){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let n=t,r=U();function o(i){if(e>0){let s=i-r;n=Math.min(t,n+s/1e9*e)}r=i}return{available(){return o(U()),n},tryConsume(i=1){if(i<=0)return!0;let s=U();return o(s),n>=i?(n-=i,!0):!1},putBack(i=1){i<=0||(o(U()),n=Math.min(t,n+i))}}}function on(t,e){let{maxEvents:n,windowNs:r}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o!==void 0&&o<1)throw new RangeError("maxBuffer must be >= 1");let i=e.onOverflow??"drop-newest",s=n*1e9/r;return N(a=>{let u=vt(n,s),c=[],d=new V,l=!1,f=1e9/s;function h(){for(;c.length>0;)if(u.tryConsume(1))a.emit(c.shift());else{d.start(Math.max(1,f/1e6),h);return}}let v=t.subscribe(_=>{for(let g of _){if(l)return;let m=g[0];if(m===T)a.down([[T]]);else if(m===b){if(o!==void 0&&c.length>=o){if(i!=="drop-newest")if(i==="drop-oldest")c.shift(),c.push(g[1]);else{l=!0,d.cancel(),c.length=0,a.down([[p,new ge(o)]]);return}}else c.push(g[1]);h()}else if(m===w)a.down([[w]]);else if(m===y)l=!0,d.cancel(),c.length=0,a.down([[y]]);else if(m===p)l=!0,d.cancel(),c.length=0,a.down([g]);else if(m===A){l=!0,d.cancel(),c.length=0,a.down([g]);return}else a.down([g])}});return()=>{l=!0,d.cancel(),v()}},{...H(),initial:t.cache,meta:{...C("rateLimiter",e)}})}function sn(t,e){let n=e?.initialStatus??"pending",r=R([],(o,i)=>{let s=n;return r.meta.status.down([[b,n]]),r.meta.error.down([[b,null]]),t.subscribe(u=>{for(let c of u){let d=c[0];if(d===T)i.down([[T]]);else if(d===b)s==="errored"?Oe(()=>{r.meta.error.down([[b,null]]),r.meta.status.down([[b,"active"]])}):r.meta.status.down([[b,"active"]]),s="active",i.emit(c[1]);else if(d===w)i.down([[w]]);else if(d===y)r.meta.status.down([[b,"completed"]]),s="completed",i.down([[y]]);else if(d===p){let l=ye(c);Oe(()=>{r.meta.error.down([[b,l]]),r.meta.status.down([[b,"errored"]])}),s="errored",i.down([c])}else i.down([c])}})},{...H(),meta:{status:n,error:null,...C("withStatus",{initialStatus:n})},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function an(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function un(t){return t!=null&&typeof t.then=="function"}function cn(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function dn(t,e){return N(n=>{let r,o;function i(){o?.(),o=void 0,an(e)||un(e)||cn(e)?r=_e(e).subscribe(a=>{n.down(a)}):(n.emit(e),n.down([[y]]))}return o=t.subscribe(s=>{for(let a of s){let u=a[0];if(u===T)n.down([[T]]);else if(u===b)n.emit(a[1]);else if(u===w)n.down([[w]]);else if(u===y)n.down([[y]]);else if(u===p){i();return}else if(u===A){r?.(),n.down([a]);return}else n.down([a])}}),()=>{o?.(),r?.()}},{...H(),initial:t.cache,meta:{...C("fallback")}})}function ln(t,e){if(e<=0)throw new RangeError("timeoutNs must be > 0");return N(n=>{let r=!1,o=new V;function i(){let a=e/1e6;o.start(a,()=>{r||(r=!0,s(),n.down([[p,new be(e)]]))})}let s=t.subscribe(a=>{for(let u of a){if(r)return;let c=u[0];if(c===T)n.down([[T]]);else if(c===b)i(),n.emit(u[1]);else if(c===w)n.down([[w]]);else if(c===y){o.cancel(),r=!0,n.down([[y]]);return}else if(c===p){o.cancel(),r=!0,n.down([u]);return}else if(c===A){o.cancel(),r=!0,n.down([u]);return}else n.down([u])}});return i(),()=>{r=!0,o.cancel(),s()}},{...H(),initial:t.cache,meta:{...C("timeout",{timeoutNs:e})}})}var me,ge,be,xt=E(()=>{"use strict";Re();ae();Q();lt();pe();Pe();Be();Nt();yt();me=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};ge=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};be=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Fn={};Ne(Fn,{awaitSettled:()=>Rn,cached:()=>An,defer:()=>Nn,empty:()=>vn,escapeRegexChar:()=>Et,firstValueFrom:()=>On,firstWhere:()=>Ve,forEach:()=>kn,fromAny:()=>_e,fromAsyncIter:()=>At,fromCron:()=>bn,fromEvent:()=>yn,fromIter:()=>He,fromPromise:()=>St,fromRaf:()=>gn,fromTimer:()=>mn,globToRegExp:()=>fn,keepalive:()=>Dn,matchesAnyPattern:()=>pn,never:()=>Tn,nodeSignal:()=>Mn,of:()=>Ot,reactiveCounter:()=>In,replay:()=>Ue,share:()=>Sn,shareReplay:()=>Cn,throwError:()=>xn,toArray:()=>En});module.exports=Lt(Fn);function S(t){return{describeKind:"producer",...t}}function Et(t){return/[\\^$+?.()|[\]{}]/.test(t)?`\\${t}`:t}function fn(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){t[n+1]==="*"?(e+=".*",n+=1):e+="[^/]*";continue}e+=Et(r)}return e+="$",new RegExp(e)}function pn(t,e){for(let n of e)if(n.test(t))return!0;return!1}function hn(t,e){let n=R([t],(o,i)=>{let s=o[0];if(s==null||s.length===0){i.down([[w]]);return}for(let a of s)i.emit(a)},{describeKind:"derived",initial:t.cache}),r=n.subscribe.bind(n);return n.subscribe=(o,i)=>(e(o),r(o,i)),n}function mn(t,e){let{signal:n,period:r,...o}=e??{};return N(i=>{let s=!1,a=0,u,c,d=()=>{s=!0,u!==void 0&&clearTimeout(u),c!==void 0&&clearInterval(c),n?.removeEventListener("abort",f)},l=()=>{s||(r!=null?(i.emit(a++),c=setInterval(()=>{s||i.emit(a++)},r)):(s=!0,n?.removeEventListener("abort",f),i.emit(a++),i.down([[y]])))},f=()=>{s||(d(),i.down([[p,n.reason]]))};if(n?.aborted){f();return}return u=setTimeout(l,t),n?.addEventListener("abort",f,{once:!0}),d},S(o))}function gn(t){let{signal:e,...n}=t??{};return N(r=>{let o=!1,i,s,a=!1,u=!1,c=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,d=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,f=()=>{i!==void 0&&d&&d(i),s!==void 0&&clearTimeout(s),i=void 0,s=void 0},h=()=>{o=!0,f(),a&&(e?.removeEventListener("abort",v),a=!1),u&&l&&(l.removeEventListener("visibilitychange",m),u=!1)},v=()=>{o||(h(),r.down([[p,e.reason]]))},_=x=>{o||(r.emit(x),g())},g=()=>{o||(c&&(!l||l.visibilityState!=="hidden")?i=c(_):s=setTimeout(()=>_(performance.now()),16))},m=()=>{o||(f(),g())};return e?.aborted?(v(),h):(e?.addEventListener("abort",v,{once:!0}),a=e!==void 0,l&&c&&(l.addEventListener("visibilitychange",m),u=!0),g(),h)},S(n))}function bn(t,e){let n=ut(t),{tickMs:r,output:o,...i}=e??{},s=r??6e4,a=o==="date";return N(u=>{let c=-1,d=()=>{let f=new Date,h=f.getFullYear()*1e8+(f.getMonth()+1)*1e6+f.getDate()*1e4+f.getHours()*100+f.getMinutes();h!==c&&ct(n,f)&&(c=h,u.emit(a?f:ie()))};d();let l=setInterval(d,s);return()=>clearInterval(l)},{...S(i),name:i.name??`cron:${t}`})}function yn(t,e,n){let{capture:r,passive:o,once:i,...s}=n??{};return N(a=>{let u=d=>{a.emit(d)},c={capture:r,passive:o,once:i};return t.addEventListener(e,u,c),()=>t.removeEventListener(e,u,c)},S(s))}function He(t,e){return N(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[y]])}catch(o){r||n.down([[p,o]])}return()=>{r=!0}},S(e))}function _n(t){return t!=null&&typeof t.then=="function"}function St(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=!1,s=()=>{i||(i=!0,o.down([[p,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(a=>{i||(i=!0,n?.removeEventListener("abort",s),o.emit(a),o.down([[y]]))},a=>{i||(i=!0,n?.removeEventListener("abort",s),o.down([[p,a]]))}),()=>{i=!0,n?.removeEventListener("abort",s)}},S(r))}function At(t,e){let{signal:n,...r}=e??{};return N(o=>{let i=new AbortController,s=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let a=n??i.signal,u=!1,c=t[Symbol.asyncIterator](),d=()=>{u||a.aborted||Promise.resolve(c.next()).then(l=>{if(!(u||a.aborted)){if(l.done){o.down([[y]]);return}o.emit(l.value),d()}},l=>{!u&&!a.aborted&&o.down([[p,l]])})};return d(),()=>{u=!0,n?.removeEventListener("abort",s),i.abort(),Promise.resolve(c.return?.()).catch(()=>{})}},S(r))}function wn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function _e(t,e){if(wn(t))return t;if(_n(t))return St(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return At(t,e);if(typeof n[Symbol.iterator]=="function")return He(t,e)}return Ot(t)}function Ot(...t){return He(t,void 0)}function vn(t){return N(e=>{e.down([[y]])},S(t))}function Tn(t){return N(()=>{},S(t))}function xn(t,e){return N(n=>{n.down([[p,t]])},S(e))}function Nn(t,e){let{signal:n,...r}=e??{},o=S(r),i=o.resubscribable===void 0?{...o,resubscribable:!0}:o;return N(s=>{let a,u=!1;try{let c=t();a=_e(c,e).subscribe(l=>{if(!u)for(let f of l){let h=f[0];if(h!==D)if(h===b)s.emit(f[1]);else if(h===y){u=!0,s.down([[y]]);break}else if(h===p){u=!0,s.down([[p,f[1]]]);break}else s.down([f])}})}catch(c){let d=c===void 0?new Error("defer: thunk threw undefined"):c;s.down([[p,d]])}return()=>{u=!0,a?.()}},i)}function kn(t,e,n){return R([t],(o,i)=>{let s=o[0];if(s!=null&&s.length>0)for(let a of s)e(a)},{describeKind:"effect",...n}).subscribe(()=>{})}function En(t,e){return R([t],(n,r,o)=>{o.store.buf||(o.store.buf=[]);let i=o.store.buf,s=n[0];if(s!=null&&s.length>0)for(let a of s)i.push(a);if(o.terminalDeps[0]===!0){r.emit([...i]),r.down([[y]]);return}(s==null||s.length===0)&&r.down([[w]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function Sn(t,e){return N(n=>t.subscribe(r=>{n.down(r)}),{...S(e),initial:t.cache})}function Ue(t,e,n){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let r=[],o=N(i=>t.subscribe(s=>{for(let a of s)a[0]===b&&(r.push(a[1]),r.length>e&&r.shift());i.down(s)}),{...S(n),initial:t.cache});return hn(o,i=>{for(let s of r)i([[b,s]])})}function An(t,e){return Ue(t,1,e)}function On(t){return new Promise((e,n)=>{let r=!1,o=!1,i;i=t.subscribe(s=>{for(let a of s){if(r)return;if(a[0]===b){r=!0,e(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===p){r=!0,n(a[1]),i?(i(),i=void 0):o=!0;return}if(a[0]===y){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):o=!0;return}}}),o&&(i?.(),i=void 0)})}function Ve(t,e,n){return new Promise((r,o)=>{let i=!1,s=!1,a,u=n?.skipCurrent===!0;a=t.subscribe(c=>{for(let d of c){if(i)return;if(!(u&&d[0]===b)){if(d[0]===b){let l=d[1];if(e(l)){i=!0,r(l),a?(a(),a=void 0):s=!0;return}}if(d[0]===p){i=!0,o(d[1]),a?(a(),a=void 0):s=!0;return}if(d[0]===y){i=!0,o(new Error("completed without matching value")),a?(a(),a=void 0):s=!0;return}}}}),u=!1,s&&(a?.(),a=void 0)})}async function Rn(t,e){let n=e?.predicate??(i=>i!=null),r=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Ve(t,n,{skipCurrent:r});if(Ge===void 0){let[i,s]=await Promise.all([Promise.resolve().then(()=>(xt(),Tt)),Promise.resolve().then(()=>(Be(),bt))]);Ge=i.timeout,kt=s.NS_PER_MS}let o=Ge(t,e.timeoutMs*kt);return await Ve(o,n,{skipCurrent:r})}function Mn(t,e){let n=new AbortController,r=e?.reason??new Error("cancelled via nodeSignal"),o,i=!1,s=()=>{o?(o(),o=void 0):i=!0};return o=t.subscribe(a=>{if(!n.signal.aborted)for(let u of a){if(u[0]===b&&u[1]===!0){n.abort(r),s();return}if(u[0]===p){n.abort(u[1]),s();return}if(u[0]===y){s();return}}}),i&&(o?.(),o=void 0),{signal:n.signal,dispose:()=>{o&&(o(),o=void 0)}}}function Dn(t){return t.subscribe(()=>{})}function In(t){let e=at(0);return{node:e,increment(){let n=e.cache??0;return n>=t?!1:(e.down([[T],[b,n+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=t}}}var Ge,kt,Cn,Nt=E(()=>{ae();Q();pe();Pe();dt();Cn=Ue});Nt();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
|
package/dist/extra/sources.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-
|
|
1
|
+
import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-RZ5HKPGI.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{x as awaitSettled,u as cached,p as defer,m as empty,a as escapeRegexChar,v as firstValueFrom,w as firstWhere,q as forEach,k as fromAny,j as fromAsyncIter,f as fromCron,g as fromEvent,h as fromIter,i as fromPromise,e as fromRaf,d as fromTimer,b as globToRegExp,A as keepalive,c as matchesAnyPattern,n as never,y as nodeSignal,l as of,B as reactiveCounter,t as replay,s as share,z as shareReplay,o as throwError,r as toArray};
|
|
@@ -15,14 +15,48 @@ type IndexedDbBackendSpec = {
|
|
|
15
15
|
version?: number;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* IndexedDB backend
|
|
19
|
-
*
|
|
18
|
+
* Creates an IndexedDB backend for browser-based persistent storage.
|
|
19
|
+
*
|
|
20
|
+
* All operations (`read`, `write`, `delete`, `list`) are async and return
|
|
21
|
+
* `Promise`. The backing object store is created automatically on first open
|
|
22
|
+
* if it does not already exist.
|
|
23
|
+
*
|
|
24
|
+
* @param spec - Database name, object store name, and optional schema version.
|
|
25
|
+
* @returns `StorageBackend` backed by an IndexedDB object store.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { indexedDbBackend, snapshotStorage } from "@graphrefly/graphrefly/extra/browser";
|
|
30
|
+
*
|
|
31
|
+
* const backend = indexedDbBackend({ dbName: "my-app", storeName: "snapshots" });
|
|
32
|
+
* const tier = snapshotStorage(backend, { name: "graph1" });
|
|
33
|
+
* await tier.save({ name: "graph1", state: {} });
|
|
34
|
+
* ```
|
|
20
35
|
*
|
|
21
36
|
* @category extra
|
|
22
37
|
*/
|
|
23
38
|
declare function indexedDbBackend(spec: IndexedDbBackendSpec): StorageBackend;
|
|
24
39
|
/**
|
|
25
|
-
* IndexedDB snapshot tier
|
|
40
|
+
* Creates an IndexedDB snapshot tier backed by an `indexedDbBackend`.
|
|
41
|
+
*
|
|
42
|
+
* Convenience wrapper for `snapshotStorage(indexedDbBackend(spec), opts)`.
|
|
43
|
+
* All reads and writes are async via IndexedDB. Requires a browser or
|
|
44
|
+
* browser-compatible environment.
|
|
45
|
+
*
|
|
46
|
+
* @param spec - Database name, object store name, and optional schema version.
|
|
47
|
+
* @param opts - Optional snapshot storage options (name, codec, filter, keyOf, debounce, compactEvery).
|
|
48
|
+
* @returns `SnapshotStorageTier<T>` backed by IndexedDB.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { indexedDbSnapshot } from "@graphrefly/graphrefly/extra/browser";
|
|
53
|
+
*
|
|
54
|
+
* const tier = indexedDbSnapshot<{ count: number }>(
|
|
55
|
+
* { dbName: "my-app", storeName: "snapshots" },
|
|
56
|
+
* { name: "counter" },
|
|
57
|
+
* );
|
|
58
|
+
* await tier.save({ count: 1 });
|
|
59
|
+
* ```
|
|
26
60
|
*
|
|
27
61
|
* @category extra
|
|
28
62
|
*/
|
|
@@ -30,7 +64,25 @@ declare function indexedDbSnapshot<T>(spec: IndexedDbBackendSpec, opts?: Omit<Sn
|
|
|
30
64
|
name?: string;
|
|
31
65
|
}): SnapshotStorageTier<T>;
|
|
32
66
|
/**
|
|
33
|
-
* IndexedDB append-log tier
|
|
67
|
+
* Creates an IndexedDB append-log tier backed by an `indexedDbBackend`.
|
|
68
|
+
*
|
|
69
|
+
* Convenience wrapper for `appendLogStorage(indexedDbBackend(spec), opts)`.
|
|
70
|
+
* All reads and writes are async via IndexedDB. Requires a browser or
|
|
71
|
+
* browser-compatible environment.
|
|
72
|
+
*
|
|
73
|
+
* @param spec - Database name, object store name, and optional schema version.
|
|
74
|
+
* @param opts - Optional append-log storage options (name, codec, keyOf, debounce, compactEvery).
|
|
75
|
+
* @returns `AppendLogStorageTier<T>` backed by IndexedDB.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { indexedDbAppendLog } from "@graphrefly/graphrefly/extra/browser";
|
|
80
|
+
*
|
|
81
|
+
* const tier = indexedDbAppendLog<{ type: string }>(
|
|
82
|
+
* { dbName: "my-app", storeName: "events" },
|
|
83
|
+
* );
|
|
84
|
+
* await tier.appendEntries([{ type: "init" }]);
|
|
85
|
+
* ```
|
|
34
86
|
*
|
|
35
87
|
* @category extra
|
|
36
88
|
*/
|
|
@@ -38,7 +90,26 @@ declare function indexedDbAppendLog<T>(spec: IndexedDbBackendSpec, opts?: Omit<A
|
|
|
38
90
|
name?: string;
|
|
39
91
|
}): AppendLogStorageTier<T>;
|
|
40
92
|
/**
|
|
41
|
-
* IndexedDB
|
|
93
|
+
* Creates an IndexedDB key-value tier backed by an `indexedDbBackend`.
|
|
94
|
+
*
|
|
95
|
+
* Convenience wrapper for `kvStorage(indexedDbBackend(spec), opts)`.
|
|
96
|
+
* All reads and writes are async via IndexedDB. Requires a browser or
|
|
97
|
+
* browser-compatible environment.
|
|
98
|
+
*
|
|
99
|
+
* @param spec - Database name, object store name, and optional schema version.
|
|
100
|
+
* @param opts - Optional kv storage options (name, codec, filter, debounce, compactEvery).
|
|
101
|
+
* @returns `KvStorageTier<T>` backed by IndexedDB.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { indexedDbKv } from "@graphrefly/graphrefly/extra/browser";
|
|
106
|
+
*
|
|
107
|
+
* const kv = indexedDbKv<{ score: number }>(
|
|
108
|
+
* { dbName: "my-app", storeName: "scores" },
|
|
109
|
+
* );
|
|
110
|
+
* await kv.save("player1", { score: 100 });
|
|
111
|
+
* const val = await kv.load("player1");
|
|
112
|
+
* ```
|
|
42
113
|
*
|
|
43
114
|
* @category extra
|
|
44
115
|
*/
|