@synnaxlabs/pluto 0.33.0 → 0.33.2
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/{Animated-BGm8tACN.cjs → Animated-C7iWxEah.cjs} +1 -1
- package/dist/{Animated-Cg0ftviS.js → Animated-VpxahF8t.js} +2 -2
- package/dist/{Item-C89uBEra.cjs → Item-C1_OE8IF.cjs} +1 -1
- package/dist/{Item-B8JWj3fN.js → Item-Dpra-3n6.js} +5 -5
- package/dist/{Keyboard-B1757gtH.cjs → Keyboard-BBOcinRN.cjs} +1 -1
- package/dist/{Keyboard-BAU1UuVp.js → Keyboard-CpJQuX-J.js} +2 -2
- package/dist/LinePlot-Bwz2fEc0.cjs +34 -0
- package/dist/LinePlot-DHy70Cb7.js +6256 -0
- package/dist/{Link-Du1lxpym.js → Link-Ctlz9WUQ.js} +1 -1
- package/dist/{Link-BGZki0c9.cjs → Link-Cxj-3A6p.cjs} +1 -1
- package/dist/{List-e1hOSGSX.cjs → List-CcTL6wlO.cjs} +1 -1
- package/dist/{List-KmtaD0qw.js → List-DF0kzXpr.js} +2 -2
- package/dist/{Pack-CxtceW7N.js → Pack-BAJwD-n2.js} +1 -1
- package/dist/{Pack-uflj5a28.cjs → Pack-DBtBeGnj.cjs} +1 -1
- package/dist/{Text-D1VocrR6.js → Text-D5o4o3OI.js} +5 -5
- package/dist/{Text-DWBEhfiF.cjs → Text-GGA7QNwA.cjs} +1 -1
- package/dist/{Toggle-B96EPQ2x.js → Toggle-CTjPdq8o.js} +97 -70
- package/dist/Toggle-Dim0E2D2.cjs +143 -0
- package/dist/{Video-DKosAU7v.cjs → Video-B3geSdOZ.cjs} +1 -1
- package/dist/{Video-o34bcpwh.js → Video-CXccd2Jl.js} +1 -1
- package/dist/{aggregator-CU9VgdUJ.cjs → aggregator-D6Mmsfj4.cjs} +21 -21
- package/dist/{aggregator-B36SA-20.js → aggregator-QFq5XDjf.js} +997 -961
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-4MXuPP5v.cjs → css-CvXvQo39.cjs} +1 -1
- package/dist/{css-C8qHWSpT.js → css-DqBChhqm.js} +27 -5
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +5 -5
- package/dist/{external-DWm3_4ZA.js → external-BNMsCMKL.js} +11 -11
- package/dist/{external-BHkFTefx.cjs → external-BPnNv3RZ.cjs} +1 -1
- package/dist/{external-BdZ8kC55.cjs → external-BZpriFW_.cjs} +1 -1
- package/dist/{external-BRdQZoOL.cjs → external-Bksh4jhY.cjs} +1 -1
- package/dist/{external-CvTy-Tj3.js → external-Bm3VKQxs.js} +4 -4
- package/dist/{external-LyF1vgNR.cjs → external-C2YHV6Dz.cjs} +1 -1
- package/dist/{external-DZhjjzue.js → external-CI2s6wrc.js} +90 -88
- package/dist/external-CK8msIo3.js +96 -0
- package/dist/{external-C2PoeTKJ.js → external-CKp_fJJC.js} +2 -2
- package/dist/{external-C-PNFpoV.cjs → external-CKuO-iHz.cjs} +1 -1
- package/dist/{external-DDwIRENP.cjs → external-CUwDGrme.cjs} +1 -1
- package/dist/{external-Ckdd7teZ.js → external-CfOulkkd.js} +5 -5
- package/dist/{external-CPTY4-IY.cjs → external-ClRKAhnQ.cjs} +1 -1
- package/dist/{external-CzrKYxlg.js → external-Ct326ec4.js} +2 -2
- package/dist/{external-BSqwgq7l.js → external-DT1bMgJw.js} +2 -2
- package/dist/{external-Icf6LMl2.cjs → external-DYc6fMZC.cjs} +1 -1
- package/dist/external-Dhg4bEfF.cjs +1 -0
- package/dist/{external-Dk66psus.js → external-DmLFwKtu.js} +4 -4
- package/dist/{external-CxatFj2t.js → external-DyAGPLil.js} +5 -5
- package/dist/{external-Cc1Bqjmm.js → external-EHlrAzYc.js} +1 -1
- package/dist/external-X9NMQ2Zh.cjs +1 -0
- package/dist/{external-T318T5Xe.cjs → external-aTGyndBd.cjs} +1 -1
- package/dist/{external-GtPAaR7c.cjs → external-e143l3cy.cjs} +1 -1
- package/dist/{external-uvD747pL.js → external-mRJloDDi.js} +7 -7
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +33 -1
- package/dist/index.js +9765 -4790
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/color/Swatch/Swatch.d.ts +2 -1
- package/dist/src/color/Swatch/Swatch.d.ts.map +1 -1
- package/dist/src/text/core/types.d.ts +2 -0
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/theming/core/fontString.d.ts +7 -1
- package/dist/src/theming/core/fontString.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +1 -0
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts +0 -2
- package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
- package/dist/src/vis/legend/Simple.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/src/vis/render/loop.d.ts +7 -4
- package/dist/src/vis/render/loop.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +2 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts +11 -9
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +1 -0
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-DbfWaeE2.cjs → units-6W_8ukD-.cjs} +1 -1
- package/dist/{units-CmWU_YzJ.js → units-BHSMvrYX.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +4 -4
- package/dist/LinePlot-CgkhTRJT.js +0 -11256
- package/dist/LinePlot-oIHuM9Jz.cjs +0 -66
- package/dist/Toggle-C5E2dVg4.cjs +0 -143
- package/dist/external-BSHY-kgQ.cjs +0 -1
- package/dist/external-BpIfVU6K.js +0 -94
- package/dist/external-w5-jxIYn.cjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
"use strict";var pl=Object.defineProperty;var ml=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var he=(e,t,n)=>ml(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Cek9Ww4S.cjs"),d=require("react"),c=require("./Toggle-C5E2dVg4.cjs"),l=require("./css-4MXuPP5v.cjs"),Ke=require("./external-Icf6LMl2.cjs"),C=require("./aggregator-CU9VgdUJ.cjs"),D=require("./Pack-uflj5a28.cjs"),jl=require("./external-CPTY4-IY.cjs"),ne=require("./external-BHkFTefx.cjs"),gl=require("./external-LyF1vgNR.cjs"),Cs=require("./Animated-BGm8tACN.cjs"),j=require("./LinePlot-oIHuM9Jz.cjs"),pe=require("zod"),Bt=require("./external-w5-jxIYn.cjs"),de=require("./external-BSHY-kgQ.cjs"),fl=require("./Text-DWBEhfiF.cjs"),bs=require("./external-BRdQZoOL.cjs");require("./Item-C89uBEra.cjs");const At=require("react-dom"),$e=require("./external-BdZ8kC55.cjs"),vs=require("./units-DbfWaeE2.cjs"),me=require("./external-C-PNFpoV.cjs"),hl=require("./external-DDwIRENP.cjs"),El=require("./external-T318T5Xe.cjs"),Sl=require("./external-GtPAaR7c.cjs"),Rl=require("./Video-DKosAU7v.cjs"),ws=({variant:e,...t})=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{color:c.variantColors[e],style:{color:c.variantColors[e]},...t}),yl=({status:{key:e,time:t,count:n,message:r,description:o,variant:i},silence:a,actions:u,className:x,children:m,...p})=>s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS(l.CSS.B("notification"),x),direction:"y",empty:!0,...p,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",size:"small",children:[s.jsxRuntimeExports.jsx(ws,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),s.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${n}`}),s.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>a(e),children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})})]}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[m??s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:r}),o!=null&&s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),u!=null&&s.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:C.A(u).map(g=>s.jsxRuntimeExports.jsx(Cl,{action:g},g.key))})]},t.toString()),Cl=({action:e})=>{if(!d.isValidElement(e)){const t=e;return s.jsxRuntimeExports.jsx(c.Button,{...t})}return e},bl=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:ws,Notification:yl,Text:c.Text$2,VARIANTS:C.VARIANTS,specZ:C.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:C.variantZ},Symbol.toStringTag,{value:"Module"})),vl=Object.freeze(Object.defineProperty({__proto__:null,Config:c.Config,Context:c.Context,Dialog:c.Dialog$1,chooseLocation:c.chooseLocation,formatTip:c.formatTip,useConfig:c.useConfig,wrap:c.wrap},Symbol.toStringTag,{value:"Module"})),et=e=>e.preventDefault(),xt=d.forwardRef(({location:e,style:t,size:n,className:r,children:o,onDragStart:i,sizeUnits:a="px",showHandle:u=!0,...x},m)=>{const p=l.J.construct(e),g=l.J.direction(p),h=l.g.dimension(g);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(p),l.CSS.dir(g),r),style:{[h]:`${n}${a}`,...t},ref:m,...x,children:[o,u&&s.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(p))),onDragStart:i,onDrag:et,onDragEnd:et})]})});xt.displayName="Resize.Core";const Ot=({onResize:e,count:t,initialSizes:n=[],minSize:r=100,direction:o="x"})=>{const i=d.useRef(null),[a,u]=d.useState({sizeDistribution:wl(n,t),root:null}),x=d.useCallback((g,h,f)=>{if(i.current==null)return;const E=l.Eo.dim(l.Eo.construct(i.current),o);u(R=>Ct(R,E,g,r,h,f))},[r,u,o]);d.useEffect(()=>e==null?void 0:e(a.sizeDistribution),[a.sizeDistribution,e]);const m=d.useCallback((g,h)=>{g.preventDefault();const f=o==="x"?"clientX":"clientY",E=k=>x(h,k[f]),R=()=>{u(k=>({...k,root:null})),document.removeEventListener("mousemove",E)};u(k=>({...k,root:g[f]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",R,{once:!0})},[u,o,Ct]);return{setSize:d.useCallback((g,h)=>x(g,void 0,h),[Ct]),props:{direction:o,sizeDistribution:a.sizeDistribution,onDragHandle:m,ref:i}}},dt=d.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:r,className:o,...i},a)=>{const u=l.g.construct(e),x=d.Children.toArray(t);return n=Pl(n),s.jsxRuntimeExports.jsx(D.Space,{...i,ref:a,direction:u,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:x.map((m,p)=>s.jsxRuntimeExports.jsx(xt,{onDragStart:g=>r(g,p),location:l.g.location(u),size:n[p]*100,sizeUnits:"%",showHandle:p!==x.length-1,children:m},p))})});dt.displayName="Resize.Multiple";const wl=(e,t)=>{const n=e.reduce((o,i)=>o+i,0),r=t-e.length;if(r<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(r).fill(o/r)]}return e.map(()=>1/t)},yt=.001,Pl=e=>e.every(t=>l.W.closeTo(t,1/e.length),yt)?e.map((t,n)=>n%2===0?t+yt:n===e.length-1?t:t-yt):e,Ct=(e,t,n,r,o,i)=>{const a=Ps(e,t,n,o,i),[u,x]=kl(e.sizeDistribution,n,a,r/t),m=x?o??null:e.root;return{...e,sizeDistribution:u,root:m}},Ps=(e,t,n,r,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[n];else if(r!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(r-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},kl=(e,t,n,r)=>{let o=t;for(;o>0&&e[o]+n<=r;)o--;const i=e[o]+n,a=Ll(o,e,r,n),u=e[a]-n;return i<r||u<r?[e,!1]:[e.map((x,m)=>m===o?i:m===a?u:x),!0]},Ll=(e,t,n,r)=>(e===t.length-1?Ml:Tl)(e,t,n,r),Tl=(e,t,n,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=n;)o++;return o},Ml=(e,t,n,r)=>{let o=e-1;for(;o>0&&t[o]-r<=n;)o--;return o},pt=({onMove:e,onStart:t,onEnd:n})=>d.useCallback(r=>{r.preventDefault();const o=l.q.construct(r),i=c.mouseKey(r.button);t==null||t(o,i,r);const a=x=>{if(x.buttons===0)return u(x);const m=l.q.construct(x);e==null||e(l.Eo.construct(o,m),i,x)};window.addEventListener("mousemove",a);const u=x=>{window.removeEventListener("mousemove",a);const m=l.q.construct(x);n==null||n(l.Eo.construct(o,m),i,x)};window.addEventListener("mouseup",u,{once:!0})},[e,t,n]),bt=2,ks=({onCollapse:e,onResize:t,location:n="left",minSize:r=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:a=1/0,className:u,...x})=>{const[m,p]=d.useState(l.j(i,r,o)),g=d.useRef(null),h=l.J.construct(n),f=d.useCallback($=>{if(g.current===null)return 0;const P=l.Eo.dim($,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),S=g.current+P,v=l.j(S,r,o);return(v-S)/r>a?bt:v},[h,r,o,a]),E=d.useRef(null),R=d.useCallback($=>{const P=f($);p(P),E.current!=null&&(t==null||t(P,l.Eo.construct(E.current)))},[t,f]),k=d.useCallback(()=>p($=>(g.current=$,$)),[p]),T=d.useCallback($=>f($)===bt&&(e==null?void 0:e()),[e,f]);d.useEffect(()=>p($=>{const P=l.j($,r,o);return g.current=P,P}),[r,o]);const M=pt({onMove:R,onStart:k,onEnd:T});return s.jsxRuntimeExports.jsx(xt,{ref:E,location:h,size:m,onDragStart:M,className:l.clsx(u,l.CSS.expanded(m!==bt)),...x})},$l=Object.freeze(Object.defineProperty({__proto__:null,Core:xt,Multiple:dt,Single:ks,calculateDiffPercentage:Ps,useMultiple:Ot},Symbol.toStringTag,{value:"Module"})),Qe="y",us=28,Nl=32,_l=40,Bl=.5,Al=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:r,ref:o,...i}}=Ot({direction:Qe,count:e.length,minSize:us}),a=u=>{if(o.current==null)return;const x=l.Eo.dim(l.Eo.construct(o.current),Qe);r[u]<_l/x?n(u,e[u].initialSize??Bl):n(u,us+1)};return s.jsxRuntimeExports.jsx(dt,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:r,ref:o,...t,...i,children:e.map((u,x)=>d.createElement(Dl,{...u,key:u.key,index:x,direction:Qe,onExpand:a,parent:o,size:r[x]}))})},Ol=s.jsxRuntimeExports.jsx(c.Qt.Caret.Down,{"aria-label":"contract"}),zl=s.jsxRuntimeExports.jsx(c.Qt.Caret.Right,{"aria-label":"expand"}),Dl=({index:e,name:t,content:n,actions:r,size:o,parent:i,onExpand:a})=>{let u=!0;if(i.current!=null){const m=l.Eo.dim(l.Eo.construct(i.current),Qe);u=o*m>Nl}const x=u?Ol:zl;return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(Ke.Header,{level:"p",className:l.CSS.expanded(u),empty:!0,children:[s.jsxRuntimeExports.jsx(Ke.ButtonTitle,{startIcon:x,onClick:()=>a(e),children:t}),r!=null&&s.jsxRuntimeExports.jsx(Ke.Actions,{children:r})]}),n]})},Vl=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Al},Symbol.toStringTag,{value:"Module"})),Ls=(e,t,n)=>C.A(e).map(i=>i.split(t)).flat().map((i,a)=>[s.jsxRuntimeExports.jsx(c.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:l.CSS.shade(n)}},`${i}-${a}`),i]).flat(),Il=({children:e,icon:t,shade:n=7,weight:r=450,size:o=.5,url:i,level:a="p",separator:u=".",className:x,hideFirst:m=!1,...p})=>{i!=null&&(e=i);const g=Ls(e,u,n);return m&&g.shift(),s.jsxRuntimeExports.jsxs(c.WithIcon,{className:l.CSS(x,l.CSS.B("breadcrumb")),level:a,shade:n,weight:r,size:o,...p,children:[ne.resolve(t),...g]})},Zl=({url:e,className:t,level:n="p",separator:r=".",shade:o=7})=>{const i=Ls(e,r,o);return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:i.map((a,u)=>{if(c.isValidElement(a))return a;if(a==null)return null;const m=e.split(r).indexOf(a);let p=e.split(r).slice(0,m+1).join("/");return p="/"+p,s.jsxRuntimeExports.jsx(c.Link,{level:n,href:p,children:a.split("-").map(g=>l._.capitalize(g)).join(" ")},u)})})},Fl=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Il,URL:Zl},Symbol.toStringTag,{value:"Module"})),zt=d.createContext(j.ZERO_CONTEXT_VALUE),ge=()=>d.useContext(zt).synnax,ql=()=>d.useContext(zt).state,xs={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Ts="serverVersionMismatch",Hl=(e,t,n)=>`Cluster version ${n!=null?n+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Ms=c.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[r,o,i]=c.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:a},,u]=c.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),x=c.useAggregator(),m=d.useCallback(p=>{i.current.state.status!==p.status&&x({variant:xs[p.status],message:p.message??l._.capitalize(p.status)}),o(g=>({...g,state:p}))},[x]);return c.useAsyncEffect(async()=>{if(r.synnax!=null&&r.synnax.close(),t==null)return o(j.ZERO_CONTEXT_VALUE);const p=new C.Lf({...t,connectivityPollFrequency:C.k.seconds(5)});o({synnax:p,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:p.clientVersion}});const g=await p.connectivity.check();if(o({synnax:p,state:g}),x({variant:xs[g.status],message:g.message??g.status.toUpperCase()}),g.status==="connected"&&!g.clientServerCompatible){const h=g.nodeVersion==null||C.H.semVerOlder(g.nodeVersion,g.clientVersion),f=Hl(h,g.clientVersion,g.nodeVersion);x({variant:"warning",message:"Incompatible cluster version",description:f,data:{type:Ts,oldServer:h,nodeVersion:g.nodeVersion,clientVersion:g.clientVersion}})}return p.connectivity.onChange(m),u({props:t,state:g}),()=>{p.close(),o(j.ZERO_CONTEXT_VALUE),u({props:null,state:null})}},[t,m]),s.jsxRuntimeExports.jsx(zt.Provider,{value:r,children:s.jsxRuntimeExports.jsx(c.Composite,{path:a,children:n})})}),Yl=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ms,SERVER_VERSION_MISMATCH:Ts,use:ge,useConnectionState:ql},Symbol.toStringTag,{value:"Module"})),Ne=d.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),$s=()=>d.useContext(Ne),Ns=e=>{const{aliases:t}=d.useContext(Ne);return t[e]??null},mt=()=>{const{aliases:e}=d.useContext(Ne);return e},jt=(e,t="")=>{const{getName:n}=d.useContext(Ne),[r,o]=d.useState(t);return c.useAsyncEffect(async()=>{const i=await n(e);i!=null&&o(i)},[e,n]),r??t},Dt=()=>{const{activeRange:e}=d.useContext(Ne);return e??void 0},_s=({activeRange:e,children:t})=>{const n=ge(),[r,o]=d.useState({}),i=d.useCallback(x=>{o(m=>{const p={...m};return x.forEach(({variant:g,key:h,value:f})=>{const E=Number(h.split("---")[1]);g==="delete"?delete p[E]:p[f.channel]=f.alias}),p})},[o]),a=d.useCallback(async(x,m)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(x,m)},[n,e]),u=d.useCallback(async x=>{if(n==null||x===0)return;const m=r[x];return m??(await n.channels.retrieve(x)).name},[r,n]);return c.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const x=await n.ranges.retrieve(e),m=await x.listAliases();o(m);const p=await x.openAliasTracker(),g=p.onChange(i);return()=>{g(),p.close()}},[n,e]),s.jsxRuntimeExports.jsx(Ne.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?a:null,getName:u},children:t})},Ul=({channelKey:e,value:t,shadow:n,className:r,...o})=>{const[i,a]=d.useState(!1),{setAlias:u}=$s(),x=Ns(e),m=jt(e);let p=s.jsxRuntimeExports.jsx(c.Qt.Rename,{});i?p=s.jsxRuntimeExports.jsx(c.Qt.Loading,{}):x===t&&(p=s.jsxRuntimeExports.jsx(c.Qt.Check,{}));const g=u!=null&&!i&&x!==t&&e!==0,h=()=>{g&&(async()=>(a(!0),await u(e,t),a(!1)))()},f=()=>{var R;x!=null&&((R=o.onChange)==null||R.call(o,x))},E=()=>e===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):u==null?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):x===t?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",m," with this label"]});return s.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...o,children:[g&&s.jsxRuntimeExports.jsx(c.Icon,{onClick:f,tooltip:s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",m," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:s.jsxRuntimeExports.jsx(c.Qt.Sync,{})}),s.jsxRuntimeExports.jsx(c.Icon,{onClick:h,disabled:!g,tooltip:s.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},Ee="channel",Gl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:j.Canvas,axisStateZ:j.axisStateZ,newTickFactory:j.newTickFactory,tickFactoryProps:j.tickFactoryProps,tickType:j.tickType},Symbol.toStringTag,{value:"Module"})),Wl=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:j.AcquireChannelControl,AuthoritySource:j.AuthoritySource,Chip:j.Chip,Controller:j.Controller$1,Indicator:j.Indicator,Legend:j.Legend,REGISTRY:j.REGISTRY$3,STATUSES:j.STATUSES,SetChannelValue:j.SetChannelValue,StateProvider:j.StateProvider,acquireChannelControl:j.acquireChannelControl,acquireChannelControlPropsZ:j.acquireChannelControlPropsZ,authoritySource:j.authoritySource,authoritySourceProps:j.authoritySourceProps,chipStateZ:j.chipStateZ,controllerStateZ:j.controllerStateZ,indicatorStateZ:j.indicatorStateZ,legendStateZ:j.legendStateZ,setChannelValue:j.setChannelValue,setChannelValuePropsZ:j.setChannelValuePropsZ,stateProviderStateZ:j.stateProviderStateZ,statusZ:j.statusZ,sugaredStateZ:j.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var je;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(je||(je={}));function Kl({color:e,dimensions:t,lineWidth:n}){return d.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Ql({color:e,radius:t}){return d.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Xl={[je.Dots]:"#91919a",[je.Lines]:"#eee",[je.Cross]:"#e2e2e2"},Jl={[je.Dots]:1,[je.Lines]:1,[je.Cross]:6},ei=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Bs({id:e,variant:t=je.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:a,style:u,className:x}){const m=d.useRef(null),{transform:p,patternId:g}=j.useStore(ei,j.shallow$1),h=a||Xl[t],f=r||Jl[t],E=t===je.Dots,R=t===je.Cross,k=Array.isArray(n)?n:[n,n],T=[k[0]*p[2]||1,k[1]*p[2]||1],M=f*p[2],$=R?[M,M]:T,P=E?[M/i,M/i]:[$[0]/i,$[1]/i];return d.createElement("svg",{className:j.cc(["react-flow__background",x]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:m,"data-testid":"rf__background"},d.createElement("pattern",{id:g+e,x:p[0]%T[0],y:p[1]%T[1],width:T[0],height:T[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`},E?d.createElement(Ql,{color:h,radius:M/i}):d.createElement(Kl,{dimensions:$,color:h,lineWidth:o})),d.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`}))}Bs.displayName="Background";var ti=d.memo(Bs);const si={region:l.Eo.ZERO,dpr:1,os:C.w.getOS()},ni={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ri=c.wrap$1(j.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:r,...o})=>{const[{path:i},{bootstrapped:a,dpr:u},x]=c.use$3({aetherKey:n,type:j.Canvas$1.TYPE,schema:j.canvasStateZ,initialState:si}),m=d.useRef({...ni}),p=d.useCallback(f=>{m.current.bootstrapped&&x(()=>({bootstrapped:!0,region:f,dpr:window.devicePixelRatio,os:C.w.getOS({default:"Windows"})}))},[x]),g=c.useResize(p,{debounce:t});d.useEffect(()=>{const f=()=>{window.devicePixelRatio!==u&&x(E=>({...E,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",f,{once:!0})},[u]),d.useEffect(()=>{window.addEventListener("focus",()=>x(f=>({...f}))),window.addEventListener("blur",()=>x(f=>({...f})))},[x]);const h=d.useCallback(f=>{if(g(f),f==null)return;f.className.includes("gl")?m.current.gl=f:f.className.includes("upper2d")?m.current.upper2d=f:m.current.lower2d=f;const{gl:E,lower2d:R,upper2d:k,bootstrapped:T}=m.current;if(E==null||R==null||k==null||T)return;m.current.bootstrapped=!0;const M=E.transferControlToOffscreen(),$=k.transferControlToOffscreen(),P=R.transferControlToOffscreen();x({glCanvas:M,upper2dCanvas:$,lower2dCanvas:P,bootstrap:!0,bootstrapped:!1,region:l.Eo.construct(E),dpr:window.devicePixelRatio,os:C.w.getOS({default:"Windows"})},[M,$,P])},[x]);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),r),...o,children:[s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:a&&e})]})}),gt=(e,t)=>c.useResize(d.useCallback((n,r)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k$2.XY.translate(l.q.scale(l.Eo.topLeft(o),-1)).box(n),r)},[e]),t),oi=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ri,useRegion:gt},Symbol.toStringTag,{value:"Module"})),As=d.createContext(null),Se=e=>{const t=d.useContext(As);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Os=e=>{const t=Se("Viewport"),{addViewportHandler:n}=t;d.useEffect(()=>n(e),[n,e])},He=(e,t)=>{const{setGridEntry:n,removeGridEntry:r}=Se(t),{key:o}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),n(e)},([u],[x])=>C._.equal(u,x),[e]),d.useEffect(()=>()=>r(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},zs=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:r=l.q.ZERO,children:o,hold:i=!1,onHold:a,visible:u,...x})=>{const[m,p]=d.useState([]),g=c.useMemoDeepEqualProps({clearOverScan:r,hold:i,visible:u}),[{path:h},{grid:f},E]=c.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:l.Eo.ZERO,viewport:l.Eo.DECIMAL,grid:{},...g}});d.useEffect(()=>E(w=>({...w,...g})),[g]);const R=d.useRef(new Map),k=d.useCallback(w=>(R.current.set(w,null),()=>R.current.delete(w)),[R]),T=d.useCallback(w=>{const{mode:y,box:_,stage:z}=w;(y==="pan"&&z!=="start"||y==="zoom"||y==="zoomReset"&&z==="start")&&E(U=>({...U,viewport:_})),R.current.forEach((U,I)=>I(w))},[E]),M=d.useCallback(w=>E(y=>({...y,container:w})),[E]),$=gt(M,{debounce:n}),P=d.useCallback(w=>E(y=>({...y,grid:{...y.grid,[w.key]:w}})),[E]),S=d.useCallback(w=>E(y=>{const{[w]:_,...z}=y.grid;return{...y,grid:z}}),[E]),v=d.useCallback(w=>{p(y=>[...y.filter(({key:_})=>_!==w.key),w])},[p,T]),B=d.useCallback(w=>p(y=>y.filter(({key:_})=>_!==w)),[v]),L=d.useMemo(()=>li(f),[f]),N=d.useCallback(w=>{E(y=>({...y,hold:w})),a==null||a(w)},[E,a]),A=d.useMemo(()=>({lines:m,setGridEntry:P,removeGridEntry:S,setLine:v,removeLine:B,setViewport:T,addViewportHandler:k,setHold:N}),[m,P,S,v,B,T,k,N]);return s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...L},ref:$,...x,children:s.jsxRuntimeExports.jsx(As.Provider,{value:A,children:s.jsxRuntimeExports.jsx(c.Composite,{path:h,children:o})})})}),li=e=>{const t=l.CSS.newGridBuilder();return j.regions("top",e).forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),t.row("plot-start","plot-end","minmax(0, 1fr)"),j.regions("bottom",e).reverse().forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),j.regions("left",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.col("plot-start","plot-end","minmax(0, 1fr)"),j.regions("right",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.build()},Vt=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,r=`${e}-axis`;return c.wrap$1(n,({aetherKey:o,children:i,location:a=t,label:u="",labelLevel:x="small",labelDirection:m=e,onLabelChange:p,color:g,labelSize:h,showGrid:f,type:E,bounds:R,className:k,tickSpacing:T,autoBounds:M,autoBoundUpdateInterval:$,onAutoBoundsChange:P,style:S,...v})=>{const B=((u==null?void 0:u.length)??0)>0,L=c.useMemoDeepEqualProps({location:a,showGrid:f,type:E,bounds:R,label:u,labelDirection:m,tickSpacing:T,autoBounds:M,autoBoundUpdateInterval:$}),[{path:N},{size:A,labelSize:w,...y},_]=c.use$3({aetherKey:o,type:n,schema:j.coreAxisStateZ,initialState:L});d.useEffect(()=>_(G=>({...G,...L})),[L]),d.useEffect(()=>{const{lower:G,upper:O}=j.parseAutoBounds(y.autoBounds);y.bounds!=null&&(G&&(R==null?void 0:R.lower)!==y.bounds.lower||O&&(R==null?void 0:R.upper)!==y.bounds.upper)&&(P==null||P(y.bounds))},[y.autoBounds,y.bounds]);const z=He({loc:a,key:`${n}-${o}`,size:A+w,order:1},`${e.toUpperCase()}Axis`),U=c.useTypography(x).toString(),I=d.useRef(0);return d.useEffect(()=>{if(e==="y"){if(u==null)return;let O=C.dimensions(u,U)[l.g.dimension(l.g.construct(m))];O>0&&(O+=9),_(te=>({...te,labelSize:O}))}else{let O=C.dimensions(u,U).height*1.3;O>0&&(O+=12);const te=I.current;j.withinSizeThreshold(te,O)||(I.current=O,_(ce=>({...ce,labelSize:O})))}},[u,m,U]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(k,l.CSS.B("axis"),l.CSS.B(r),l.CSS.loc(a)),style:{...S,...z},align:"center",justify:a!=="left"?"end":"start",direction:l.g.swap(e),...v,children:B&&s.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(m)),value:u,onChange:p,level:x})}),s.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},Ds=Vt("x"),Vs=Vt("y"),Is=l.q.xy.extend({root:l.J.corner,units:pe.z.object({x:pe.z.enum(["px","decimal"]),y:pe.z.enum(["px","decimal"])})}),ii=Is.partial({root:!0,units:!0}),ci=e=>{var n,r,o,i;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((r=e==null?void 0:e.units)==null?void 0:r.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},ai=(e,t)=>{var i,a,u,x,m,p;const n={x:e.x,y:e.y};if(t.current==null)return n;const r=l.Eo.construct(t.current),o=l.Eo.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((a=e.root)==null?void 0:a.x)==="right"&&(n.x=1-e.x):((u=e.root)==null?void 0:u.x)==="right"?n.x=1-(e.x+l.Eo.width(r))/l.Eo.width(o):n.x/=l.Eo.width(o),((x=e.units)==null?void 0:x.y)==="decimal"?((m=e.root)==null?void 0:m.y)==="bottom"&&(n.y=1-e.y):((p=e.root)==null?void 0:p.y)==="bottom"?n.y=1-(e.y+l.Eo.height(r))/l.Eo.height(o):n.y/=l.Eo.height(o),n},Zs=(e,t)=>{if(t.current==null)return null;const n=l.Eo.construct(t.current.parentElement),r=l.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.Eo.width(n)-l.Eo.width(r),o.root.x="right"):e.x<.2?o.x=e.x*l.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.Eo.height(n)-l.Eo.height(r),o.root.y="bottom"):e.y<.2?o.y=e.y*l.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},ds=l.Eo.reRoot(l.Eo.DECIMAL,l.J.TOP_LEFT),It=d.memo(({className:e,value:t,onChange:n,style:r,draggable:o=!0,...i})=>{const[a,u]=C.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),x=d.useRef(a),m=c.useSyncedRef(o===!1),p=d.useRef(null);a!==null&&(r={...r,...ci(a)});const g=d.useCallback(f=>{var P;if(((P=p.current)==null?void 0:P.parentElement)==null)return x.current;const E=l.Eo.construct(p.current.parentElement),R=l.k$2.XY.scale(E).scale(ds),k=R.box(l.Eo.construct(p.current)),T=l.k$2.XY.clamp(l.Eo.construct(l.Eo.topLeft(ds),{width:1-l.Eo.width(k),height:1-l.Eo.height(k)})),M=l.q.translate(l.q.construct(x.current),l.Eo.signedDims(R.box(f))),$=T.pos(M);return Zs($,p)},[]),h=pt({onStart:d.useCallback(()=>{x.current=ai(x.current,p)},[]),onMove:d.useCallback(f=>{if(m.current)return;const E=g(f);E!==null&&u(E)},[]),onEnd:d.useCallback(f=>{if(m.current)return;const E=g(f);E!==null&&(x.current=E)},[])});return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:h,draggable:o,ref:p,...i,onDrag:et,onDragEnd:et,empty:!0})});It.displayName="Legend.Container";const Zt=(e,t,n)=>e.sort((r,o)=>r.label.localeCompare(o.label)).map(({key:r,color:o,label:i})=>s.jsxRuntimeExports.jsxs(D.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[s.jsxRuntimeExports.jsx(Bt.Swatch,{value:o,onChange:a=>t==null?void 0:t({key:r,color:a,label:i}),onVisibleChange:n,draggable:!1,size:"small"}),s.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:i,onChange:a=>t==null?void 0:t({key:r,color:o,label:a}),noWrap:!0})]},r)),Ft=({data:e=[],onEntryChange:t,position:n,onPositionChange:r,...o})=>{const[i,a]=d.useState(!1);return e.length===0?null:s.jsxRuntimeExports.jsx(It,{...o,draggable:!i,value:n,onChange:r,children:Zt(e,t,a)})},ui=Object.freeze(Object.defineProperty({__proto__:null,Container:It,Simple:Ft,calcStickyPos:Zs,completeStickyXYz:Is,legendSwatches:Zt,stickyXYz:ii},Symbol.toStringTag,{value:"Module"})),Fs=({className:e,style:t,onLineChange:n,...r})=>{const{lines:o}=Se("Legend");return Se("Legend"),s.jsxRuntimeExports.jsx(Ft,{data:o,onEntryChange:n,...r})},xi=({onLineChange:e})=>{const{lines:t}=Se("Legend"),n=c.useUniqueKey(),r=He({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...r,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Zt(t,e)})},qs=({variant:e="floating",...t})=>e==="floating"?s.jsxRuntimeExports.jsx(Fs,{...t}):s.jsxRuntimeExports.jsx(xi,{...t}),Hs=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=c.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),r=c.useMemoDeepEqualProps(t);return d.useLayoutEffect(()=>n(r),[r]),null}),di=Object.freeze(Object.defineProperty({__proto__:null,Line:Hs},Symbol.toStringTag,{value:"Module"})),qt=c.wrap$1("Line",({aetherKey:e,color:t,label:n="",...r})=>{const{setLine:o,removeLine:i}=Se("Line");return d.useEffect(()=>(o({key:e,color:t,label:n}),()=>i(e)),[n,t]),s.jsxRuntimeExports.jsx(Hs,{aetherKey:e,color:t,label:n,...r})}),Ys=({level:e="h2",...t})=>{const n=c.useUniqueKey(),r=c.useTypography(e),o=He({key:n,size:(r.lineHeight+2)*r.baseSize,loc:"top",order:10},"Title");return s.jsxRuntimeExports.jsx(D.Space,{justify:"center",align:"center",style:o,children:s.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Us=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),n=d.useRef(null),r=d.useCallback(i=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const u=l.Eo.topLeft(a);t({position:l.q.translation(u,l.q.construct(i))})},[t]),o=d.useCallback(()=>t({position:null}),[t]);return d.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement;if(i!=null)return i.addEventListener("mousemove",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",r),i.removeEventListener("mouseleave",o)}},[r]),s.jsxRuntimeExports.jsx("span",{ref:n})}),pi=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Us},Symbol.toStringTag,{value:"Module"})),mi={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Ht=d.forwardRef(({className:e,mode:t,maskBox:n,children:r,style:o,...i},a)=>s.jsxRuntimeExports.jsxs("div",{ref:a,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:mi[t],...o},...i,children:[s.jsxRuntimeExports.jsx("div",{style:{...l.Eo.css(n),display:l.Eo.areaIsZero(n)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),r]}));Ht.displayName="ZoomPanMask";const ji=[{key:"start",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Left,{})},{key:"center",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Center,{})},{key:"end",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Right,{})}],gi=({key:e,entry:t,onClick:n,selected:r})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:n,children:t.icon},e),Yt=({children:e=gi,...t})=>s.jsxRuntimeExports.jsx(de.Button,{...t,allowMultiple:!1,data:ji,children:e}),fi=new Set([C.g.UUID,C.g.JSON]),hi=C.g.ALL.filter(e=>e!==C.g.UNKNOWN).map(e=>({key:e.toString(),name:fi.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),Ei=[{key:"name",name:"Name"}],Si=e=>s.jsxRuntimeExports.jsx(de.DropdownButton,{...e,data:hi,columns:Ei,entryRenderKey:"name"}),Ri=[{key:"x",icon:s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{})},{key:"y",icon:s.jsxRuntimeExports.jsx(c.Qt.Arrow.Up,{})}],yi=({key:e,entry:t,onClick:n,selected:r})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:n,children:t.icon},e),Ci=({children:e=yi,...t})=>s.jsxRuntimeExports.jsx(de.Button,{...t,allowMultiple:!1,data:Ri,children:e}),Gs=e=>s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:s.jsxRuntimeExports.jsx(c.Qt.Close,{"aria-label":"clear"})}),be=({onChange:e,value:t,entryRenderKey:n="key",columns:r,data:o,emptyContent:i,inputProps:a,allowNone:u=!0,searcher:x,className:m,variant:p="button",hideColumnHeader:g=!1,disabled:h,omit:f,children:E,dropdownVariant:R="connected",placeholder:k=ft,inputPlaceholder:T=k,triggerTooltip:M,dropdownZIndex:$,filter:P,actions:S,...v})=>{const{visible:B,open:L,close:N,toggle:A}=c.use$2(),[w,y]=d.useState(null),_=x!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return y(null);if((w==null?void 0:w.key)===t)return;let O=null;if(_)try{[O]=await x.retrieve([t])}finally{O??(O=null)}else o!=null&&(O=o.find(te=>te.key===t)??null);y(O)},[x,t,o]);const z=d.useCallback((O,te)=>{Array.isArray(O)||(y(O==null?null:te.entries[0]),N(),e(O,te))},[e,u]),U=d.useMemo(()=>_?c.Search:$e.Filter,[_]),I=s.jsxRuntimeExports.jsx(U,{searcher:x,filter:P,children:({onChange:O})=>s.jsxRuntimeExports.jsx(bi,{autoFocus:R==="modal",variant:p,onChange:O,onFocus:L,selected:w,entryRenderKey:n,visible:B,allowNone:u,className:m,disabled:h,placeholder:T,children:S})}),G=s.jsxRuntimeExports.jsx(c.Button,{tooltip:M,variant:"outlined",onClick:A,disabled:h,children:w!=null?Ws(n,w):k});return s.jsxRuntimeExports.jsx(de.Core,{close:N,zIndex:$,open:L,data:o,omit:f,emptyContent:i,allowMultiple:!1,visible:B,value:t,hideColumnHeader:g,onChange:z,allowNone:u,columns:r,listItem:E,variant:R,trigger:R!=="modal"?I:G,extraDialogContent:R==="modal"?I:void 0,keepMounted:!1,...v})},ft="Select",Ws=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),bi=({entryRenderKey:e,selected:t,visible:n,onChange:r,onFocus:o,allowNone:i=!0,placeholder:a=ft,className:u,disabled:x,...m})=>{const{clear:p}=c.useSelectionUtils(),[g,h]=d.useState("");d.useEffect(()=>{if(!n){if(C.w$1(t==null?void 0:t.key))return h("");t!=null&&h(Ws(e,t))}},[t,n,e]);const f=T=>{r(T),h(T)},E=()=>{g===""&&r(""),h(""),o==null||o()},R=T=>{n||(T.preventDefault(),o==null||o())},k=()=>{h(""),p==null||p()};return s.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),u),value:g,onChange:f,onFocus:E,onKeyDown:c.matchCallback([["Enter"]],T=>{T.preventDefault(),!n&&(o==null||o())}),endContent:s.jsxRuntimeExports.jsx(Cs.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:R,placeholder:a,disabled:x,...m,children:i&&s.jsxRuntimeExports.jsx(Gs,{onClick:k,disabled:x})})},Ze=({children:e="",size:t="medium",color:n,icon:r,onClose:o,className:i,onDragStart:a,...u})=>{const x=l.cssString(n);r==null&&n!=null&&(r=s.jsxRuntimeExports.jsx(c.Qt.Circle,{fill:x}));const m=o==null?void 0:s.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:"small",className:l.CSS.BE("tag","close"),onClick:p=>{p.stopPropagation(),o()},children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})});return s.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:r,endIcon:m,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:C.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:a,...u,children:e})},vi=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ze},Symbol.toStringTag,{value:"Module"})),_e=({onChange:e,value:t,className:n,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:a,searcher:u,renderTag:x=c.componentRenderProp(Ks),placeholder:m,onTagDragStart:p,allowMultiple:g,allowNone:h,replaceOnSingle:f,onTagDragEnd:E,style:R,addPlaceholder:k="Add",children:T,dropdownVariant:M="connected",actions:$,...P})=>{const{visible:S,open:v,close:B}=c.use$2(),[L,N]=d.useState([]),[A,w]=d.useState(!1),y=u!=null;c.useAsyncEffect(async()=>{w(!0),c.selectValueIsZero(t)&&N([]);const G=L.map(ce=>ce.key),O=C.A(t);if(C.F.unorderedPrimitiveArrays(G,O)===C.F.EQUAL)return;let te=[];if(y)try{te=await u.retrieve(O)}finally{w(!1)}else r!=null&&(te=r.filter(ce=>O.includes(ce.key)));N(te)},[u,y,t,r]);const _=d.useCallback((G,O)=>{G!=null&&(N(O.entries),e(C.A(G),O))},[e]),z=d.useMemo(()=>y?c.Search:$e.Filter,[y]);let U,I;if(M==="connected")I=s.jsxRuntimeExports.jsx(z,{searcher:u,children:({onChange:G,value:O})=>s.jsxRuntimeExports.jsx(wi,{value:O,selectedKeys:t,className:n,onChange:G,loading:A,selected:L,onFocus:v,entryRenderKey:i,visible:S,renderTag:x,placeholder:m,onTagDragStart:p,onTagDragEnd:E,style:R,children:$})});else{const G=C.A(t);I=s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",grow:!0,style:R,size:"small",children:[G.map(O=>{const te=L.find(ce=>ce.key===O);return x({key:O,entryKey:O,entryRenderKey:i,loading:A,entry:te,onClose:()=>{const ce=G.filter(We=>We!==O);e(ce,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:ce=>p==null?void 0:p(ce,O),onDragEnd:ce=>E==null?void 0:E(ce,O)})}),G.length>0?s.jsxRuntimeExports.jsx(c.Icon,{onClick:v,children:s.jsxRuntimeExports.jsx(c.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):s.jsxRuntimeExports.jsx(c.Button,{onClick:v,shade:7,startIcon:s.jsxRuntimeExports.jsx(c.Qt.Add,{}),variant:"text",children:k})]}),U=s.jsxRuntimeExports.jsx(z,{searcher:u,children:O=>s.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...O,children:$})})}return s.jsxRuntimeExports.jsx(de.Core,{close:B,open:v,data:r,emptyContent:a,visible:S,value:t,onChange:_,allowNone:h,replaceOnSingle:f,columns:o,allowMultiple:!0,listItem:T,trigger:I,extraDialogContent:U,variant:M,...P})},wi=({selectedKeys:e,loading:t,selected:n,onChange:r,onFocus:o,visible:i,entryRenderKey:a,renderTag:u,placeholder:x=ft,onTagDragStart:m,onTagDragEnd:p,value:g,className:h,children:f,...E})=>{const{onSelect:R,clear:k}=c.useSelectionUtils(),T=d.useRef(null);d.useLayoutEffect(()=>{var S;i&&((S=T.current)==null||S.focus())},[i,n]);const M=()=>{i||r(""),o==null||o()},$=()=>{i||o==null||o()},P=()=>{i||r("")};return s.jsxRuntimeExports.jsxs(c.Text$1,{ref:T,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),h),onBlur:P,placeholder:x,value:g,onChange:r,onFocus:M,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:$,variant:"button",...E,children:[s.jsxRuntimeExports.jsx(D.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:C.A(e).map(S=>{const v=n.find(B=>B.key===S);return u({key:S,entryKey:S,entryRenderKey:a,loading:t,entry:v,onClose:()=>R==null?void 0:R(S),onDragStart:B=>m==null?void 0:m(B,S),onDragEnd:B=>p==null?void 0:p(B,S)})})}),f,s.jsxRuntimeExports.jsx(Gs,{onClick:k})]})},Ks=({entryKey:e,entryRenderKey:t,entry:n,loading:r,...o})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),d.createElement(Ze,{size:"small",variant:"outlined",className:l.CSS(n==null&&!r&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},C.Q(i))},Pi=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:de.BaseButton,Button:de.Button,DEFAULT_PLACEHOLDER:ft,DataType:Si,Direction:Ci,DropdownButton:de.DropdownButton,Multiple:_e,MultipleTag:Ks,Single:be,TextAlignment:Yt,defaultButton:de.defaultButton},Symbol.toStringTag,{value:"Module"})),Xe=6,ki=2,ps=5,Li=e=>l.Eo.width(e)<ps&&l.Eo.height(e)<ps,Ti=["zoom","pan","select","zoomReset"],Ie=[...Ti,"click"],Mi=pe.z.enum(Ie),Qs=["zoom","select"],Je={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Xs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Js={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Ut={zoom:Je,pan:Xs,select:Js,zoomReset:Je,click:Je},$i=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,r])=>n==="defaultMode"?[n,r]:[n,r.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},Ni=l.Eo.construct(0,0,1,1,l.J.TOP_LEFT),_i={width:30,height:50},en=({onChange:e,triggers:t,initial:n=Ni,threshold:r=_i,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[a,u]=d.useState(l.Eo.ZERO),[x,m]=d.useState(i),[p,g]=c.useStateRef(n),h=d.useRef(l.q.ZERO),f=d.useRef(null),E=l._$1.construct(r);d.useEffect(()=>g(()=>l.Eo.truncate(n,Xe)),[n]),d.useEffect(()=>m(i),[i]);const[R,k,T,M]=c.useMemoCompare(()=>{const L={...Ut[i],...t},N=c.flattenConfig(L),A=$i(L);return[L,N,A,c.flattenConfig(A)]},c.compareModeConfigs,[t]),$=d.useCallback(({box:L,triggers:N,stage:A,cursor:w})=>{if(f.current==null)return;const y=c.determineMode(R,N),_=l.Eo.construct(f.current);if(y==null)return;if(y==="zoomReset")return u(l.Eo.ZERO),e==null||e({box:l.Eo.DECIMAL,mode:y,stage:A,cursor:w}),g(l.Eo.DECIMAL);const z=Li(L);if(A==="end"){if(z){y==="zoom"&&u(l.Eo.ZERO),e==null||e({box:p.current,mode:"click",stage:A,cursor:w});return}return g(I=>{if(y==="pan"){const O=ms(L,I,_);return O===null||l.Eo.equals(O,I)?I:(e==null||e({box:O,mode:y,stage:A,cursor:w}),O)}const G=P(L,I,_);return G===null?I:(e==null||e({box:G,mode:y,stage:A,cursor:w}),y==="zoom"?(u(l.Eo.ZERO),G):l.Eo.truncate(I,Xe))})}if(Qs.includes(y))return z?void 0:u(l.k$2.XY.scale(_).clamp(_).translate({x:-l.Eo.left(_),y:-l.Eo.top(_)}).box(js(E,L,_)));if(u(I=>l.Eo.areaIsZero(I)?I:l.Eo.ZERO),l.q.distance(w,h.current)<ki)return;h.current=w;const U=ms(L,p.current,_);e==null||e({box:U,mode:y,stage:A,cursor:w})},[u,m,e,R,r.height,r.width,g,f]);d.useImperativeHandle(o,()=>({reset:()=>{u(l.Eo.ZERO),g(l.Eo.DECIMAL),e==null||e({box:l.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const P=d.useCallback((L,N,A)=>l.Eo.truncate(Lt(N,A).box(js(E,L,A)),Xe),[r]),S=c.useHeldRef({triggers:[["Control"]]}),v=c.useHeldRef({triggers:[["Alt"]]});d.useEffect(()=>{const L=N=>{if(f.current==null)return;let A=1;N.deltaY<0?A-=.035:A+=.035;const w=l.Eo.construct(f.current),y=l.q.construct(N);if(!l.Eo.contains(w,y)||N.target!==f.current)return;const z=Lt(p.current,l.Eo.construct(f.current)).pos(l.q.construct(N));let I=l.k$2.XY.magnify({x:S.current.held?1:A,y:v.current.held?1:A}).box(p.current);I=l.Eo.translate(I,{x:S.current.held?0:z.x*(1-A),y:v.current.held?0:z.y*(1-A)}),g(I),e==null||e({stage:"end",box:I,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[g,e]),bs.useDrag({bound:f,onDrag:$,triggers:k,loose:!0});const B=d.useCallback(({triggers:L,stage:N})=>{if(N==="end")return m(i);const A=c.determineMode(T,L);A!=null&&m(A)},[T,i,e]);return c.use$1({triggers:M,callback:B,region:f}),{maskBox:a,ref:f,mode:x}},Lt=(e,t)=>l.k$2.XY.scale(t).clamp(t).scale(e),ms=(e,t,n)=>{let r=l.Eo.signedDims(Lt(t,n).box(e));return r={signedWidth:-r.signedWidth,signedHeight:-r.signedHeight},l.Eo.truncate(l.k$2.XY.translate(l.q.construct(r)).box(t),Xe)},js=(e,t,n)=>l.Eo.height(t)<=e.height?l.Eo.construct(l.Eo.left(t),l.Eo.top(n),l.Eo.width(t),l.Eo.height(n)):l.Eo.width(t)<=e.width?l.Eo.construct(l.Eo.left(n),l.Eo.top(t),l.Eo.width(n),l.Eo.height(t)):t,Bi=({mode:e,triggers:t})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",children:[s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),s.jsxRuntimeExports.jsx(fl.Text,{trigger:t[0],level:"small"})]}),Ai={zoom:s.jsxRuntimeExports.jsx(c.Qt.Zoom,{}),pan:s.jsxRuntimeExports.jsx(c.Qt.Pan,{}),select:s.jsxRuntimeExports.jsx(c.Qt.Selection,{}),zoomReset:s.jsxRuntimeExports.jsx(c.Qt.Expand,{}),click:s.jsxRuntimeExports.jsx(c.Qt.Bolt,{})},Oi=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const r=Object.entries(e).filter(([o])=>!t.includes(o)&&Ie.includes(o)).map(([o,i])=>({key:o,icon:Ai[o],tooltip:s.jsxRuntimeExports.jsx(Bi,{mode:o,triggers:i})})).sort((o,i)=>Ie.indexOf(o.key)-Ie.indexOf(i.key));return s.jsxRuntimeExports.jsx(de.Button,{...n,data:r,entryRenderKey:"icon",children:({title:o,entry:i,...a})=>d.createElement(c.Icon,{...a,key:i.key,variant:a.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},zi=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Ut,MASK_MODES:Qs,MODES:Ie,Mask:Ht,PAN_DEFAULT_TRIGGERS:Xs,SELECT_DEFAULT_TRIGGERS:Js,SelectMode:Oi,ZOOM_DEFAULT_TRIGGERS:Je,modeZ:Mi,use:en},Symbol.toStringTag,{value:"Module"})),tn=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Gt=d.forwardRef(({children:e,initial:t=l.Eo.DECIMAL,onChange:n,...r},o)=>{const{setViewport:i}=Se("Viewport");d.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const a=d.useCallback(x=>{i(x),n==null||n(x)},[n,i]),u=en({onChange:a,initial:t,ref:o,...r});return s.jsxRuntimeExports.jsx(Ht,{className:l.CSS.BE("line-plot","viewport"),...u,children:e})});Gt.displayName="Viewport";const Di=Object.freeze(Object.defineProperty({__proto__:null,Floating:Fs,Legend:qs,Line:qt,LinePlot:zs,Title:Ys,Tooltip:pi,Viewport:Gt,XAxis:Ds,YAxis:Vs,axisFactory:Vt,selectViewportEl:tn,useContext:Se,useGridEntry:He,useViewport:Os},Symbol.toStringTag,{value:"Module"})),Vi=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),sn=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:r,setHold:o}=Se("Range.Provider"),[,{hovered:i,count:a},u]=c.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),x=He({key:e,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),m=c.useContextMenu(),p=c.useSyncedRef(m.visible),g=d.useCallback(h=>{const f=R=>{u(k=>({...k,cursor:{x:R.clientX,y:R.clientY}}))},E=h.currentTarget;E.addEventListener("mousemove",f),E.addEventListener("mouseleave",()=>{E.removeEventListener("mousemove",f),p.current||u(R=>({...R,cursor:null}))},{once:!0})},[u]);return s.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...x,cursor:i!=null?"pointer":"default"},...m,menu:()=>t==null||i==null?null:t(i),children:s.jsxRuntimeExports.jsx(D.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(r({box:l.Eo.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:g})})}),Ii=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Vi,Provider:sn},Symbol.toStringTag,{value:"Module"})),nn={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Zi=c.flattenConfig(nn),rn=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=d.useRef(null),r=c.useHeldRef({triggers:Zi,loose:!0}),o=d.useCallback(({mode:u,cursor:x})=>{if(u==="click"){const m=c.determineMode(nn,r.current.triggers,{loose:!0});if(["one","two"].includes(m))return t(p=>({...p,[m]:x}));t(m==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??x,two:p.one!==null?x:p.two}))}},[t,r]);Os(o);const i=d.useCallback(u=>t(x=>({...x,hover:l.q.construct(u)})),[t]),a=d.useCallback(()=>{t(u=>({...u,hover:null}))},[t]);return d.useEffect(()=>{if(n.current===null)return;const u=n.current.parentElement;if(u!=null)return u.addEventListener("mousemove",i),u.addEventListener("mouseleave",a),()=>{u.removeEventListener("mousemove",i),u.removeEventListener("mouseleave",a)}},[o]),s.jsxRuntimeExports.jsx("span",{ref:n})}),Fi=Object.freeze(Object.defineProperty({__proto__:null,Measure:rn},Symbol.toStringTag,{value:"Module"})),Wt=c.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:r,onPositionChange:o,units:i="",color:a,lineWidth:u,lineDash:x})=>{const[m,p]=C.usePurePassthrough({value:t,onChange:r,initial:""}),[,{position:g,pixelPosition:h},f]=c.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:u,lineDash:x}});d.useEffect(()=>{if(g==null)return;if(n==null)return o==null?void 0:o(g);const P=l.G.construct(g+.01,g-.01);n!=null&&!l.G.contains(P,n)&&(o==null||o(Math.trunc(g*100)/100))},[g]);const E=d.useRef(h);h!==E.current&&(E.current=h);const R=d.useRef(h);d.useEffect(()=>{f(P=>({...P,position:n,color:a,lineWidth:u,lineDash:x}))},[n,a,u,x]);const k=pt({onStart:d.useCallback(()=>{f(P=>({...P,dragging:!0})),R.current=E.current},[]),onMove:P=>{f(S=>({...S,pixelPosition:(R.current??0)+l.Eo.signedHeight(P)}))},onEnd:d.useCallback(()=>{f(P=>({...P,dragging:!1})),R.current=h},[])}),T=d.useRef(null);if(g==null||h==null)return null;const M=tn(T==null?void 0:T.current),$=s.jsxRuntimeExports.jsxs("div",{ref:T,className:l.CSS.B("rule"),style:{top:`calc(${h}px - 0.5rem)`},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:k,draggable:!0}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[s.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:m,onChange:p}),s.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${g.toFixed(2)} ${i}`})]})]});return M==null?$:At.createPortal($,M)}),qi=Object.freeze(Object.defineProperty({__proto__:null,Rule:Wt},Symbol.toStringTag,{value:"Module"})),on=c.canDropOfType(Ee),Hi=({lines:e,axes:t,showTitle:n=!0,title:r="",onTitleChange:o,showLegend:i=!0,legendPosition:a,onLegendPositionChange:u,titleLevel:x="h4",onLineChange:m,onRuleChange:p,onAxisChannelDrop:g,onAxisChange:h,rules:f,enableTooltip:E=!0,enableMeasure:R=!1,initialViewport:k=l.Eo.DECIMAL,legendVariant:T,onViewportChange:M,viewportTriggers:$,annotationProvider:P,...S})=>{var A;const v=t.filter(({location:w})=>l.J.isY(w)),B=d.useRef(),L=c.usePrevious(e.length),N=c.usePrevious(S.hold);return(L===0&&e.length!==0||N===!0&&S.hold===!1)&&((A=B.current)==null||A.reset()),s.jsxRuntimeExports.jsxs(zs,{...S,children:[v.map((w,y)=>{const _=e.filter(I=>I.axes.x===w.key),z=t.filter(({location:I})=>l.J.isX(I)),U=f==null?void 0:f.filter(I=>[...z.map(({key:G})=>G),w.key].includes(I.axis));return s.jsxRuntimeExports.jsx(Yi,{axis:w,index:y,lines:_,yAxes:z,rules:U,onAxisChannelDrop:g,onAxisChange:h,annotationProvider:P},w.key)}),i&&s.jsxRuntimeExports.jsx(qs,{onLineChange:m,position:a,onPositionChange:u,variant:T}),n&&s.jsxRuntimeExports.jsx(Ys,{value:r,onChange:o,level:x}),s.jsxRuntimeExports.jsxs(Gt,{initial:k,onChange:M,triggers:$,ref:B,children:[E&&s.jsxRuntimeExports.jsx(Us,{}),R&&s.jsxRuntimeExports.jsx(rn,{})]})]})},Yi=({yAxes:e,lines:t,index:n,rules:r,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:a,axis:{location:u,key:x,showGrid:m,...p},annotationProvider:g})=>{const h=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:on,onDrop:d.useCallback(({items:R})=>{const k=c.filterByType(Ee,R);return i==null||i(x,k.map(({key:T})=>T)),k},[x,i])}),f=r==null?void 0:r.filter(R=>R.axis===x),E=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Ds,{...p,...h,location:u,showGrid:m??n===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Ee)(E))),onAutoBoundsChange:R=>a==null?void 0:a({key:x,bounds:R}),children:[e.map((R,k)=>{const T=t.filter($=>$.axes.y===R.key),M=r==null?void 0:r.filter($=>$.axis===R.key);return s.jsxRuntimeExports.jsx(Gi,{axis:{...R,showGrid:m??(n===0&&k===0)},lines:T,rules:M,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:a},R.key)}),f==null?void 0:f.map(R=>d.createElement(Wt,{aetherKey:R.key,...R,key:R.key,onLabelChange:k=>o==null?void 0:o({key:R.key,label:k}),onPositionChange:k=>o==null?void 0:o({key:R.key,position:k})})),s.jsxRuntimeExports.jsx(sn,{...g})]})},Ui=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Gi=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:r,onAxisChange:o,axis:{key:i,location:a,...u}})=>{const x=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:on,onDrop:d.useCallback(({items:p})=>{const g=c.filterByType(Ee,p);return r==null||r(i,g.map(({key:h})=>h)),g},[i,r])}),m=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Vs,{...u,...x,location:a,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Ee)(m))),onAutoBoundsChange:p=>o==null?void 0:o({key:i,bounds:p}),children:[e.map(p=>s.jsxRuntimeExports.jsx(Wi,{line:p},Ui(p))),t==null?void 0:t.map(p=>d.createElement(Wt,{aetherKey:p.key,...p,key:p.key,onLabelChange:g=>n==null?void 0:n({key:p.key,label:g}),onPositionChange:g=>n==null?void 0:n({key:p.key,position:g})}))]})},Wi=({line:e})=>e.variant==="static"?s.jsxRuntimeExports.jsx(Qi,{line:e}):s.jsxRuntimeExports.jsx(Ki,{line:e}),Ki=({line:{key:e,timeSpan:t,channels:{x:n,y:r},...o}})=>{const i=Number(t.valueOf())*3,a=j.streamChannelData({timeSpan:t,channel:r,keepFor:i}),u=n!=null&&n!==0,x=j.streamChannelData({timeSpan:t,channel:u?n:r,useIndexOfChannel:!u,keepFor:i});return s.jsxRuntimeExports.jsx(qt,{aetherKey:e,y:a,x,...o})},Qi=({line:{timeRange:e,key:t,channels:{x:n,y:r},...o}})=>{const i=j.channelData({timeRange:e,channel:r}),a=n!=null&&n!==0,u=j.channelData({timeRange:e,channel:a?n:r,useIndexOfChannel:!a});return s.jsxRuntimeExports.jsx(qt,{aetherKey:t,y:i,x:u,...o})},gs=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],tt=({items:e},t)=>{const n=c.filterByType(Ee,e);return n.length>0&&!n.every(r=>t.includes(r.key))},ln=["name","alias"],cn=e=>{const t=mt();return d.useMemo(()=>e.length===0?gs:gs.filter(n=>e.includes(n.key)),[e,t])},Xi=({columns:e=ln,onChange:t,className:n,value:r,searchOptions:o,...i})=>{const a=ge(),u=mt(),x=cn(e),m=Dt(),p=c.useMemoDeepEqualProps(o),g=d.useMemo(()=>a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...p}),[a,m,p]),h=a!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:E,...R}=c.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:d.useCallback(P=>tt(P,C.A(r)),[r]),onDrop:d.useCallback(({items:P})=>{const S=c.filterByType(Ee,P);if(S.length===0)return[];const v=C.n([...C.A(r),...S.map(B=>B.key)]);return t(v,{clickedIndex:null,clicked:null,entries:[]}),S},[t,r])}),k=c.useDraggingState(),T=d.useCallback(({dropped:P})=>{t(C.A(r).filter(S=>!P.some(v=>v.key===S)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),M=d.useCallback((P,S)=>f([{key:S,type:Ee}],T),[f,T]),$=d.useCallback(P=>u[P.key]??P.name,[u]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(n,l.CSS.dropRegion(tt(k,C.A(r)))),value:r,onTagDragStart:M,onTagDragEnd:E,searcher:g,onChange:t,columns:x,emptyContent:h,entryRenderKey:$,...R,...i})},Ce=({columns:e=ln,onChange:t,value:n,className:r,data:o,searchOptions:i,...a})=>{const u=ge(),x=mt(),m=cn(e),p=Dt(),g=c.useMemoDeepEqualProps(i),h=d.useMemo(()=>{if(!(o!=null&&o.length>0))return u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...g})},[u,p,o==null?void 0:o.length,g]),f=u!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),E=d.useId(),R=d.useMemo(()=>({key:E,type:"Channel.SelectMultiple"}),[E]),{startDrag:k,onDragEnd:T,...M}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:d.useCallback(v=>tt(v,C.o(n)),[n]),onDrop:d.useCallback(({items:v})=>{const B=c.filterByType(Ee,v);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[R,t])}),$=c.useDraggingState(),P=d.useCallback(()=>n!=null&&k([{type:Ee,key:n}]),[k,n]),S=d.useCallback(v=>x[v.key]??v.name,[x]);return s.jsxRuntimeExports.jsx(be,{data:o,className:l.CSS(r,l.CSS.dropRegion(tt($,C.o(n)))),value:n,onDragStart:P,onDragEnd:T,onChange:t,searcher:h,columns:m,emptyContent:f,entryRenderKey:S,...M,...a})},Ji=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Ul,AliasProvider:_s,LinePlot:Hi,SelectMultiple:Xi,SelectSingle:Ce,useActiveRange:Dt,useAlias:Ns,useAliases:mt,useContext:$s,useName:jt},Symbol.toStringTag,{value:"Module"})),ve=({path:e,optional:t=!1,onChange:n})=>{const r=we(),{get:o,bind:i,set:a,setStatus:u}=r,[x,m]=d.useState(o(e,{optional:t}));d.useEffect(()=>(m(o(e,{optional:t})),i({path:e,onChange:m,listenToChildren:!1})),[e,n,i,o]);const p=d.useCallback(f=>{n==null||n(f,{...r,path:e}),a(e,f)},[e,a,n]),g=d.useCallback(f=>u(e,f),[e,u]);if(x==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let h;return r.mode==="preview"&&(h="preview"),{onChange:p,setStatus:g,variant:h,...x}},an=(e,t=!1,n)=>{const{get:r,bind:o}=we(n),[,i]=d.useState(0);return d.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),r(e,{optional:t})??null},ec=(e,t=!1,n)=>{var a;const{get:r,bind:o}=we(n),[,i]=d.useState(0);return d.useEffect(()=>(i(u=>u+1),o({path:e,onChange:()=>i(u=>u+1)})),[e,o]),((a=r(e,{optional:t}))==null?void 0:a.value)??null},tc=e=>{var t,n;return((n=(t=an(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},sc=({path:e,ctx:t,onChange:n})=>{const r=we(t);d.useEffect(()=>r.bind({path:e,onChange:o=>n(o,r),listenToChildren:!1}),[e,r])},nc=({path:e,optional:t=!1})=>{const{bind:n,get:r}=we(),[o,i]=d.useState(r(e,{optional:t}));if(d.useEffect(()=>(i(r(e,{optional:t})),n({path:e,onChange:a=>i({...a,value:C.U(a.value)}),listenToChildren:!0})),[e,n,r]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},un=(e,t)=>({add:(n,r)=>{const o=C.U(e.get(t).value);o.splice(r,0,...C.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,r)=>{const o=C.U(e.get(t).value);o.push(...C.A(n)),r!=null&&o.sort(r),e.set(t,o,{validateChildren:!1})},remove:n=>{const r=e.get(t).value,o=new Set(C.A(n));e.set(t,r.filter((i,a)=>!o.has(a)))},keepOnly:n=>{const r=e.get(t).value,o=new Set(C.A(n));e.set(t,r.filter((i,a)=>o.has(a)))},set:n=>e.set(t,C.executeSetter(n,e.get(t).value)),sort:n=>{const r=C.U(e.get(t).value);r.sort(n),e.set(t,r)}}),rc=({path:e,updateOnChildren:t=!1,ctx:n})=>{const r=we(n),{bind:o,get:i}=r,[a,u]=d.useState(i(e).value);return d.useEffect(()=>(u(i(e).value),o({path:e,onChange:x=>{u(C.U(x.value))},listenToChildren:t})),[e,o,i,u]),d.useMemo(()=>({value:a,...un(r,e)}),[a,r,e])},Kt=d.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),we=e=>{const t=d.useContext(Kt);return e??t},fs=e=>({key:e,variant:"success",message:""}),oc=e=>e.code===pe.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",xn=({values:e,sync:t=!1,schema:n,mode:r="normal",onChange:o})=>{const i=d.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),a=c.useSyncedRef(n),u=c.useSyncedRef(o),x=d.useCallback(({path:S,onChange:v,listenToChildren:B=!1})=>{var w;const{parentListeners:L,listeners:N}=i.current,A=B?L:N;return A.has(S)||A.set(S,new Set),(w=A.get(S))==null||w.add(v),()=>{var y;return(y=A.get(S))==null?void 0:y.delete(v)}},[]),m=d.useCallback((S,{optional:v}={optional:!1})=>{const{state:B,statuses:L,touched:N}=i.current,A=C._.get(B,S,{optional:v});if(A==null)return null;const w={value:A,status:L.get(S)??fs(S),touched:N.has(S),required:!1};if(a.current==null)return w;const y=a.current,_=C.N.getFieldSchema(y,S,{optional:!0});return _==null||(w.required=!_.isOptional()),w},[]),p=d.useCallback(S=>{const{state:v,statuses:B,touched:L,listeners:N,parentListeners:A}=i.current;C._.remove(v,S),B.delete(S),L.delete(S),N.delete(S),A.delete(S)},[]),g=d.useCallback(S=>{const{statuses:v,touched:B}=i.current;i.current.state=S,f(""),v.clear(),B.clear()},[]),h=d.useCallback(S=>{var L;const{listeners:v}=i.current,B=m(S,{optional:!0});B!=null&&((L=v.get(S))==null||L.forEach(N=>N(B)))},[]),f=d.useCallback(S=>{const{listeners:v,parentListeners:B}=i.current,L=v.get(S);if(S==""&&([...v.keys()].forEach(w=>{var _;const y=m(w,{optional:!0});y!=null&&((_=v.get(w))==null||_.forEach(z=>{z(y)}))}),[...B.keys()].forEach(w=>{var _;const y=m(w,{optional:!0});y!=null&&((_=B.get(w))==null||_.forEach(z=>{z(y)}))})),L!=null){const N=m(S,{optional:!0});N!=null&&L.forEach(A=>{A(N)})}B.forEach((N,A)=>{if(C._.pathsMatch(S,A)){const y=m(A,{optional:!0});y!=null&&N.forEach(_=>{_(y)})}})},[]),E=d.useCallback((S,v="",B=!0)=>{const{statuses:L,listeners:N,touched:A}=i.current;if(S.success){const z=[...L.keys()];return L.clear(),z.forEach(U=>h(U)),!0}let w=!0;const y=new Set(S.error.issues.map(z=>z.path.join(".")));let _=(z,U)=>z===U;return B&&(_=(z,U)=>C._.pathsMatch(z,U)),S.error.issues.forEach(z=>{var te;const{message:U}=z,I=z.path.join(".");if(!_(I,v))return;const G=oc(z);G!=="warning"&&(w=!1),L.set(I,{key:I,variant:G,message:U}),A.add(I);let O=m(I,{optional:!0});O==null&&(O={value:void 0,status:L.get(I)??fs(I),touched:!1,required:!1}),(te=N.get(I))==null||te.forEach(ce=>ce(O))}),L.forEach((z,U)=>{y.has(U)||(L.delete(U),h(U))}),w},[]),R=d.useCallback((S,v)=>{if(a.current==null)return!0;const{state:B}=i.current,L=a.current.safeParse(B);return E(L,S,v)},[E]),k=d.useCallback(async(S,v)=>{if(a.current==null)return!0;const{state:B}=i.current,L=await a.current.safeParseAsync(B);return E(L,S,v)},[E]),T=d.useCallback((S,v,B={})=>{const L=C._.get(i.current.state,S,{optional:!0}),{validateChildren:N=!0}=B,{state:A,touched:w}=i.current;w.add(S),S.length===0?i.current.state=v:C._.set(A,S,v),f(S),(async()=>{var _;let y;try{y=R(S,N)}catch{y=await k(S,N)}(_=u.current)==null||_.call(u,{values:i.current.state,path:S,prev:L,valid:y})})()},[]),M=d.useCallback(S=>C._.has(i.current.state,S),[]),$=d.useCallback((S,v)=>{i.current.statuses.set(S,v),i.current.touched.add(S),h(S)},[]),P=d.useCallback(()=>{const{statuses:S}=i.current;S.clear(),S.forEach((v,B)=>h(B))},[]);return d.useEffect(()=>{if(!t)return;const{listeners:S}=i.current;i.current.state=e,S.forEach((v,B)=>{const L=m(B,{optional:!0});L!=null&&v.forEach(N=>N(L))})},[t,e]),d.useMemo(()=>({bind:x,set:T,get:m,mode:r,validate:R,validateAsync:k,value:()=>i.current.state,has:M,remove:p,setStatus:$,clearStatuses:P,reset:g}),[x,T,m,R,k,M,p,$,P,g,r])},lc=e=>s.jsxRuntimeExports.jsx(Kt.Provider,{value:e,children:e.children}),ic=c.componentRenderProp(c.Text$1),se=({path:e,children:t=ic,label:n,padHelpText:r=!0,visible:o=!0,hideIfNull:i=!1,optional:a,onChange:u,className:x,...m})=>{const p=ve({path:e,optional:a??i,onChange:u}),g=we();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n==null&&(n=l._.capitalize(C._.element(e,-1))),o=typeof o=="function"?o(p,g):o,!o)return null;const h=p.status.message,{onChange:f,value:E}=p,R={onChange:f,value:E};return p.variant!=null&&(R.variant=p.variant),s.jsxRuntimeExports.jsx(me.Item,{padHelpText:r,helpText:h,helpTextVariant:p.status.variant,label:n,required:p.required,className:l.CSS(x,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(p.status.variant)),...m,children:t(R)})},Le=e=>({fieldKey:t,fieldProps:n,inputProps:r})=>{const o=({inputProps:i,path:a,fieldKey:u=t,...x})=>s.jsxRuntimeExports.jsx(se,{...n,...x,path:u?`${a}.${u}`:a,children:m=>s.jsxRuntimeExports.jsx(e,{...m,...r,...i})});return o.displayName=e.displayName,o},dn=Le(c.Numeric),ht=dn({}),pn=Le(c.Text$1),mn=pn({}),jn=Le(c.Switch$1),Qt=jn({}),cc=Le(be),ac=Le(_e),uc=Le(de.DropdownButton),Xt=({key:e,open:t,onChange:n})=>{const r=c.useMemoPrimitiveArray(e);c.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,r])},xc=({fetchInitialValue:e,...t})=>{const[n,r]=d.useState(void 0);return c.useAsyncEffect(async()=>{r(await e())},[e]),Xt({...t,onChange:r}),n},dc=Object.freeze(Object.defineProperty({__proto__:null,useListener:Xt,useState:xc},Symbol.toStringTag,{value:"Module"})),pc=({key:e,name:t,queryFn:n,values:r,openObservable:o,applyChanges:i,applyObservable:a,...u})=>{const x=ge(),m=c.useAggregator(),p=c.useMemoPrimitiveArray(e),g=xn({values:r,...u,sync:!1,onChange:E=>{x!=null&&(async()=>{try{await(i==null?void 0:i({...E,client:x}))}catch(R){m({variant:"error",message:`Failed to save ${t}`,description:R.message})}})()}});c.useAsyncEffect(async()=>{if(x!=null)try{const E=await n({client:x});g.set("",E)}catch(E){m({variant:"error",message:`Failed to retrieve ${t}`,description:E.message})}},[p,x==null?void 0:x.key]);const h=d.useCallback(async()=>{if(x!=null)return await(o==null?void 0:o(x))},[p,x==null?void 0:x.key]),f=d.useCallback(E=>a==null?void 0:a({changes:E,ctx:g}),[p,a]);return Xt({key:p,open:h,onChange:f}),g},mc=Object.freeze(Object.defineProperty({__proto__:null,Context:Kt,Field:se,Form:lc,NumericField:ht,SwitchField:Qt,TextField:mn,buildDropdownButtonSelectField:uc,buildNumericField:dn,buildSelectMultiField:ac,buildSelectSingleField:cc,buildSwitchField:jn,buildTextField:pn,fieldArrayUtils:un,fieldBuilder:Le,use:xn,useChildFieldValues:nc,useContext:we,useField:ve,useFieldArray:rc,useFieldListener:sc,useFieldState:an,useFieldValid:tc,useFieldValue:ec,useSynced:pc},Symbol.toStringTag,{value:"Module"})),jc=[{key:"name",name:"Name"},{key:"location",name:"Location"}],gc=({searchOptions:e,...t})=>{const n=ge();let r=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(r=n.hardware.devices.newSearcherWithOptions(e)),s.jsxRuntimeExports.jsx(be,{columns:jc,searcher:r,entryRenderKey:"name",...t})},fc=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:gc},Symbol.toStringTag,{value:"Module"})),Me="label",Jt=[{key:"color",name:"Color",render:({entry:e})=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],st=({items:e},t)=>{const n=c.filterByType(Me,e);return n.length>0&&!n.every(r=>t.includes(r.key))},hc=({entry:e,loading:t,entryKey:n,entryRenderKey:r,...o})=>s.jsxRuntimeExports.jsx(Ze,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Ec=c.componentRenderProp(hc),Sc=({onChange:e,className:t,value:n,...r})=>{const o=ge(),i=o!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...x}=c.useDragAndDrop({type:"Label.SelectMultiple",canDrop:d.useCallback(h=>st(h,C.A(n)),[n]),onDrop:d.useCallback(({items:h})=>{const f=c.filterByType(Me,h);if(f.length===0)return[];const E=C.n([...C.A(n),...f.map(R=>R.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),m=c.useDraggingState(),p=d.useCallback(({dropped:h})=>{e(C.A(n).filter(f=>!h.some(E=>E.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),g=d.useCallback((h,f)=>a([{key:f,type:Me}],p),[a,p]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(st(m,C.A(n)))),value:n,onTagDragStart:g,onTagDragEnd:u,searcher:o==null?void 0:o.labels,onChange:e,columns:Jt,emptyContent:i,renderTag:Ec,addPlaceholder:"Label",...x,...r})},gn=({value:e,onChange:t})=>{const n=ge(),r=n!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=d.useId(),i=d.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),a=c.useDragAndDrop({type:"Label.SelectSingle",canDrop:d.useCallback(m=>st(m,C.o(e)),[e]),onDrop:d.useCallback(({items:m})=>{const p=c.filterByType(Me,m);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),u=c.useDraggingState(),x=d.useCallback(()=>e!=null&&a.startDrag([{type:Me,key:e}]),[a.startDrag,e]);return{emptyContent:r,dragging:u,...a,onDragStart:x,searcher:n==null?void 0:n.labels}},Rc=({onChange:e,value:t,className:n,data:r,...o})=>{const{dragging:i,...a}=gn({value:t,onChange:e});return s.jsxRuntimeExports.jsx(be,{data:r,className:l.CSS(n,l.CSS.dropRegion(st(i,C.o(t)))),value:t,onChange:e,columns:Jt,entryRenderKey:"name",...a,...o})},yc=({data:e,value:t,onChange:n,...r})=>{const{dragging:o,...i}=gn({value:t,onChange:n});return s.jsxRuntimeExports.jsx(be,{data:e,value:t,onChange:n,columns:Jt,entryRenderKey:"name",...i,...r})},Cc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Me,SelectButton:yc,SelectMultiple:Sc,SelectSingle:Rc},Symbol.toStringTag,{value:"Module"})),fn=({children:e,centered:t,visible:n,enabled:r=!0,close:o,style:i,...a})=>{const u=d.useRef(null),x=d.useRef(n);c.useClickOutside({ref:u,exclude:p=>c.findParent(p.target,h=>h.getAttribute("role")==="dialog")!=null,onClickOutside:o});const m=d.useCallback(p=>{var h;if(!x.current||p.stage!=="start")return;const g=(h=u.current)==null?void 0:h.querySelectorAll(`.${l.CSS.visible(!0)}`);g&&g.length>0||o()},[o]);return c.use$1({triggers:[["Escape"]],callback:m,loose:!0}),s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(n),r&&l.CSS.M("enabled-modal")),empty:!0,align:"center",children:s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","dialog"),t&&l.CSS.M("centered")),role:"dialog",empty:!0,ref:u,...a,style:{zIndex:r?11:void 0,...i},children:s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:e})})})},bc=({root:e,...t})=>At.createPortal(s.jsxRuntimeExports.jsx(fn,{...t}),c.getRootElement(e)),vc=Object.freeze(Object.defineProperty({__proto__:null,Dialog:fn,Modal:bc},Symbol.toStringTag,{value:"Module"})),Et=new Error("Tab not found"),wc=new Error("Invalid Mosaic"),nt=(e,t,n="center",r)=>{var g;if(e=Re(e),r===void 0)return Tt(e,t);const o=Mt(e,r);if(n==="center")return(g=o.tabs)==null||g.push(t),o.selected=t.tabKey,e;const i=o.key*2,a=o.key*2+1,u=n==="top"||n==="left"?i:a;if(Mt(e,u).key!==o.key)return nt(e,t,"center",u);if(o.tabs==null||o.tabs.length===0)return nt(e,t,"center",r);const[x,m,p]=$c(n);if(o.direction=p,o[x]={key:0,tabs:[t],selected:t.tabKey},o[m]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw wc;return o.first.key=i,o.last.key=a,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Pc=(e,t,n)=>{var i;e=Re(e);const[r,o]=Pe(e,t);if(r==null||o==null)throw Et;return o.tabs=(i=o.tabs)==null?void 0:i.map(a=>a.tabKey===t?n(a):a),e},Tt=(e,t)=>(e=Re(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Tt(e.first,t):e.last!=null&&(e.last=Tt(e.last,t)),e)),rt=e=>{e=Re(e);const t=[];if(e.tabs!=null&&(e.selected=ne.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,r]=rt(e.first);e.first=n,t.push(...r)}if(e.last!=null){const[n,r]=rt(e.last);e.last=n,t.push(...r)}return[e,t]},es=(e,t)=>{var o;e=Re(e);const[,n]=Pe(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),n.selected=ne.resetSelection(n.selected,n.tabs),e=Mc(e);const r=n.selected??ot(e);return[e,r]},ot=e=>e.selected!=null?e.selected:e.first!=null?ot(e.first):e.last!=null?ot(e.last):null,hn=(e,t)=>{e=Re(e);const[n,r]=Pe(e,t);if(n==null||r==null)throw Et;return r.selected=t,e},En=(e,t,n,r)=>{e=Re(e);const[o,i]=Pe(e,t);if(o==null||i==null)throw Et;const[a,u]=es(e,t);return[nt(a,o,n,r),u]},Fe=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Fe(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Fe(e.last,t);if(n!=null)return n}},Sn=(e,t,n)=>{const r=lt(e,t);if(r==null)throw new Error("Node not found");return r.size=n,e},kc=(e,t,n)=>{e=Re(e);const r=Fe(e,t);if(r==null)throw new Error("Tab not found");if(r.tabs==null||r.tabs.length===0)throw new Error("Node has no tabs");const o=r.tabs.findIndex(p=>p.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const i=r.tabs[o];r.tabs=r.tabs.filter(p=>p.tabKey!==t);const a=r.key*2,x={key:r.key*2+1,tabs:[i],selected:i.tabKey},m={key:a,tabs:r.tabs,selected:r.selected};return m.selected=ne.resetSelection(m.selected,m.tabs),r.direction=n,r.first=m,r.last=x,r.tabs=void 0,r.selected=void 0,e},Lc=(e,t)=>{const n=Fe(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Rn=(e,t,n)=>{e=Re(e);const[,r]=Pe(e,t);if((r==null?void 0:r.tabs)==null)throw Et;return r.tabs=ne.rename(t,n,(r==null?void 0:r.tabs)??[]),e},Tc=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Mt=(e,t)=>{const n=lt(e,t);if(n!=null)return n;const r=Math.floor(t/2);return r===0?e:Mt(e,r)},Mc=e=>{let t=!0;for(;t;)[e,t]=$t(e);return e.first==null&&e.last==null&&(e.key=1),e},$t=e=>{if(e.first==null||e.last==null)return[e,!1];if(Es(e.first))return[hs(e.last,!0),!0];if(Es(e.last))return[hs(e.first,!1),!0];let[t,n]=[!1,!1];return[e.first,t]=$t(e.first),[e.last,n]=$t(e.last),[e,t||n]},hs=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Es=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Pe=(e,t)=>{if(e.tabs!=null){const a=e.tabs.find(u=>u.tabKey===t);if(a!=null)return[a,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,r]=Pe(e.first,t);if(n!=null&&r!=null)return[n,r];const[o,i]=Pe(e.last,t);return[o,i]},lt=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=lt(e.first,t);return n??lt(e.last,t)},$c=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},Re=e=>C._.copy(e),it=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&it(e.first,t,n),e.last!=null&&it(e.last,t,n),n),Nt=(e,t)=>{t(e),e.first!=null&&Nt(e.first,t),e.last!=null&&Nt(e.last,t)};class yn{constructor(t={}){he(this,"parent");he(this,"stub");he(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,r])=>this.el.setAttribute(n,r))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Nc=({node:e})=>{const t=d.createRef(),n=d.useRef(e);return d.useEffect(()=>{const r=t.current;if(r==null)return;const o=r.parentNode;if(o!=null)return e.mount(o,r),()=>{t.current!=null&&e.unmount(t.current)}},[]),d.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const r=t.current;if(r==null)return;const o=r.parentNode;o!=null&&e.mount(o,r)},[e]),s.jsxRuntimeExports.jsx("div",{ref:t})},Cn=({node:e,children:t})=>At.createPortal(t,e.el),_c=Object.freeze(Object.defineProperty({__proto__:null,In:Cn,Node:yn,Out:Nc},Symbol.toStringTag,{value:"Module"})),ct=d.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:r,direction:o,first:i,last:a,key:u,size:x},emptyContent:m,...p}=n,g=d.useCallback(([E])=>t(u,E),[t]),{props:h}=Ot({direction:o,onResize:g,count:2,initialSizes:x!=null?[x]:void 0});let f;return r!==void 0?f=s.jsxRuntimeExports.jsx(bn,{emptyContent:m,...n}):i!=null&&a!=null?f=s.jsxRuntimeExports.jsxs(dt,{id:`mosaic-${u}`,align:"stretch",className:l.CSS.BE("mosaic","resize"),...h,children:[s.jsxRuntimeExports.jsx(ct,{...p,root:i,onResize:t},i.key),s.jsxRuntimeExports.jsx(ct,{...p,root:a,onResize:t},a.key)]}):(f=null,console.warn("Mosaic tree is malformed")),u===1?s.jsxRuntimeExports.jsx(c.Provider$2,{children:f}):f});ct.displayName="Mosaic";const at="pluto-mosaic-tab-drop",ts="pluto-mosaic-tab-create",Bc=(e,t,n)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&n)return!0;const o=c.filterByType(at,t).map(u=>u.key),i=e.filter(u=>!o.includes(u.tabKey)).length>0;return c.filterByType(ts,t).length>0||o.length>0&&(i||e.length===0)},bn=d.memo(({root:e,onDrop:t,onCreate:n,activeTab:r,children:o,onFileDrop:i,...a})=>{const{key:u,tabs:x}=e,[m,p]=d.useState(null),g=i!=null,h=d.useCallback(({items:S})=>Bc(x,S,g),[x,g]),f=d.useCallback(({items:S,event:v})=>{if(v==null)return[];p(null);const B=c.filterByType(c.FILE_TYPE,S).length>0,L=x.length===0?"center":Rs(Ss(v));if(B)return i==null||i(u,L,v),S;const N=c.filterByType(at,S);if(N.length>0){const w=N.map(({key:y})=>y)[0];t(u,w,L)}const A=c.filterByType(ts,S);if(A.length>0){const w=A.map(({key:y})=>y);n==null||n(u,L,w)}return N},[t,x.length]),E=d.useCallback(({event:S})=>{if(S==null)return;const v=x.length===0?"center":Rs(Ss(S));p(v)},[x.length]),{startDrag:R,...k}=c.useDragAndDrop({type:"Mosaic",canDrop:h,onDrop:f,onDragOver:E}),T=h(c.useDraggingState()),M=d.useCallback(()=>p(null),[]),$=d.useCallback((S,{tabKey:v})=>{R([{key:v,type:at,elementID:S.currentTarget.id}])},[R]),P=d.useCallback(()=>n==null?void 0:n(u,"center"),[u]);return s.jsxRuntimeExports.jsxs("div",{id:`mosaic-${u}`,className:l.CSS.BE("mosaic","leaf"),children:[s.jsxRuntimeExports.jsxs(ne.Tabs,{id:`tab-${u}`,tabs:x,onDragLeave:M,selected:e.selected,selectedAltColor:r===e.selected,onDragStart:$,onCreate:P,...a,...k,children:[e.selected!=null&&o(x.find(S=>S.tabKey===e.selected)),T&&s.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),m!=null&&s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Ac[m]})]})});bn.displayName="MosaicTabLeaf";const Ac={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},Ss=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;return r<24?{px:.5,py:.5}:{px:n/t.width,py:r/t.height}},Oc=e=>e,zc=e=>1-e,Rs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,r]=[Oc(e),zc(e)];if(t>n&&t>r)return"bottom";if(t<n&&t<r)return"top";if(t>n&&t<r)return"left";if(t<n&&t>r)return"right";throw new Error("[bug] - invalid insert position")},Dc=({root:e,onSelect:t,children:n})=>{const r=d.useRef(new Map),o=new Set,i=it(e,a=>{var u;return(u=a.tabs)==null?void 0:u.map(x=>{let m=r.current.get(x.tabKey);return x==null?null:(m==null&&(m=new yn({style:"width: 100%; height: 100%; position: relative;"}),m.el.addEventListener("click",()=>t==null?void 0:t(x.tabKey)),r.current.set(x.tabKey,m)),o.add(x.tabKey),s.jsxRuntimeExports.jsx(Cn,{node:m,children:n({...x,visible:x.tabKey===a.selected})},x.tabKey))})}).flat().filter(a=>a!=null);return r.current.forEach((a,u)=>!o.has(u)&&r.current.delete(u)),[r,i]},Vc=pe.z.object({key:pe.z.number(),tabs:pe.z.array(ne.tabZ).optional(),selected:pe.z.string().optional(),direction:l.g.direction.optional(),size:pe.z.number().optional()}),_t=Vc.extend({first:pe.z.lazy(()=>_t).optional(),last:pe.z.lazy(()=>_t).optional()}),Ic=({allowRename:e=!1,initialTree:t})=>{const[n,r]=d.useState(t);return d.useEffect(()=>r(rt(t)[0]),[t]),{root:n,onDrop:(m,p,g)=>r(h=>En(h,p,g,m)[0]),onClose:m=>r(p=>es(p,m)[0]),onSelect:m=>r(p=>hn(p,m)),onResize:(m,p)=>r(g=>Sn(g,m,p)),onRename:e?(m,p)=>r(g=>Rn(g,m,p)):void 0}},Zc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:ts,HAUL_DROP_TYPE:at,Mosaic:ct,autoSelectTabs:rt,canSplit:Lc,findSelected:ot,findTabNode:Fe,forEachNode:Nt,insertTab:nt,isEmpty:Tc,mapNodes:it,moveTab:En,nodeZ:_t,removeTab:es,renameTab:Rn,resizeNode:Sn,selectTab:hn,split:kc,updateTab:Pc,use:Ic,usePortal:Dc},Symbol.toStringTag,{value:"Module"})),Fc=({location:e="left",size:t="9rem",className:n,style:r,...o})=>{const i=l.J.construct(e),a=l.J.direction(i),u=l.g.swap(a);return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(u),l.CSS.loc(i),n),direction:u,style:{[l.g.dimension(a)]:t,...r},align:"center",empty:!0,...o})},Ye=e=>({bordered:t=!1,className:n,...r})=>s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),n),align:"center",...r}),vn=Ye("start");vn.displayName="NavbarStart";const wn=Ye("end");wn.displayName="NavbarEnd";const Pn=Ye("center");Pn.displayName="NavbarCenter";const kn=Ye("");kn.displayName="NavbarContent";const Ln=Ye("absolute-center");Ln.displayName="NavbarAbsoluteCenter";const Be=Fc;Be.Start=vn;Be.Center=Pn;Be.End=wn;Be.AbsoluteCenter=Ln;Be.Content=kn;const ss=({aetherKey:e})=>{const[,{region:t},n]=c.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:l.Eo.ZERO,enabled:!0}}),r=c.useSyncedRef(t),o=d.useCallback(a=>{l.Eo.equals(a,r.current)||n(u=>({...u,region:a}))},[n]);return{setEnabled:d.useCallback(a=>n(u=>({...u,enabled:a})),[n]),erase:o}},qc=c.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=ss({aetherKey:e}),r=c.useResize(n);return s.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),Hc=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qc,use:ss},Symbol.toStringTag,{value:"Module"})),Yc=({items:e,initialKey:t})=>{const[n,r]=d.useState(t),o=a=>r(a===n?void 0:a),i=e.find(a=>a.key===n);return{onSelect:o,activeItem:i}},Uc=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:r,location:o="left",collapseThreshold:i=.65,className:a,onResize:u,...x})=>{const m=l.J.direction(o),p=d.useCallback(()=>t!=null&&(r==null?void 0:r(t.key)),[r,t==null?void 0:t.key]),{erase:g,setEnabled:h}=ss({aetherKey:e}),f=d.useCallback((T,M)=>{u==null||u(T,M),g(M)},[u,g]);if(d.useLayoutEffect(()=>{h(t!=null)},[t,h]),t==null)return null;const{content:E,key:R,...k}=t;return s.jsxRuntimeExports.jsx(ks,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(m),a),collapseThreshold:i,onCollapse:p,location:o,onResize:f,...k,...x,children:t.content},R)}),Gc=Object.freeze(Object.defineProperty({__proto__:null,Bar:Be,Drawer:Uc,useDrawer:Yc},Symbol.toStringTag,{value:"Module"})),Wc=({variant:e,className:t,children:n,...r})=>s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:n}),Kc=Object.freeze(Object.defineProperty({__proto__:null,Note:Wc},Symbol.toStringTag,{value:"Module"})),vt={Close:s.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:s.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:s.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),s.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Qc=({disabled:e=[],className:t,focused:n=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:a,...u})=>s.jsxRuntimeExports.jsxs(D.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!n&&l.CSS.BM("macos-controls","blurred"),t),...u,children:[s.jsxRuntimeExports.jsx(wt,{onClick:a,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:vt.Close}),s.jsxRuntimeExports.jsx(wt,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:vt.Minimize}),s.jsxRuntimeExports.jsx(wt,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:vt.Maximize})]}),wt=({className:e,disabled:t,color:n,...r})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...r}),Pt=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:r,onFullscreen:o,focused:i,...a})=>s.jsxRuntimeExports.jsxs(D.Pack,{...a,children:[s.jsxRuntimeExports.jsx(kt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:s.jsxRuntimeExports.jsx(c.Qt.Subtract,{})}),s.jsxRuntimeExports.jsx(kt,{className:l.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:s.jsxRuntimeExports.jsx(c.Qt.Box,{})}),s.jsxRuntimeExports.jsx(kt,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})})]}),kt=({disabled:e=!1,className:t,...n})=>e?null:s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...n}),Tn=e=>C.w.getOS(e),Xc={MacOS:Qc,Windows:Pt,Linux:Pt,Docker:Pt},Jc="Windows",ea=({forceOS:e,visibleIfOS:t,...n})=>{const r=Tn({force:e,default:Jc}),o=Xc[r];return t!=null&&t!==r?null:s.jsxRuntimeExports.jsx(o,{...n})},ta=Object.freeze(Object.defineProperty({__proto__:null,Controls:ea,use:Tn},Symbol.toStringTag,{value:"Module"})),sa=(e,t)=>{const n=r=>s.jsxRuntimeExports.jsx(e,{...t,...r});return n.displayName=e.displayName,n},na=Object.freeze(Object.defineProperty({__proto__:null,createComponent:sa},Symbol.toStringTag,{value:"Module"}));d.createContext({instrumentation:C.B.NOOP});const ra=c.wrap$1(j.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const r=c.useMemoDeepEqualProps(n),[{path:o},,i]=c.use$3({aetherKey:e,type:j.Provider$2.TYPE,schema:j.providerStateZ$1,initialState:r});return d.useEffect(()=>{i(r)},[r,i]),s.jsxRuntimeExports.jsx(c.Composite,{path:o,children:t})}),oa="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Mn=c.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=c.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ$2,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:e})}),la=Object.freeze(Object.defineProperty({__proto__:null,Provider:Mn},Symbol.toStringTag,{value:"Module"})),ia=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===C.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},$n=c.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:r,...o})=>{const i=c.useMemoDeepEqualProps({source:t,sink:n}),[,{status:a},u]=c.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:C.m.now()}}});d.useEffect(()=>{u(f=>({...f,...i}))},[i,u]);const x=d.useCallback(()=>u(f=>({...f,triggered:!f.triggered})),[u]),{message:m,chipColor:p,buttonStyle:g,disabled:h}=ia(a);return s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),r),disabled:h,onClick:x,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:m}),style:g,...o,children:s.jsxRuntimeExports.jsx(c.Qt.Circle,{color:p})})}),Nn=d.createContext({needsControlOf:[]}),_n=()=>d.useContext(Nn),ca=c.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...r})=>{const o=c.useMemoDeepEqualProps(r),[{path:i},{status:a,needsControlOf:u},x]=c.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:o});return d.useEffect(()=>{a!=null&&(n==null||n(a))},[a,n]),d.useEffect(()=>{x(m=>({...m,...o}))},[o,x]),d.useEffect(()=>()=>n==null?void 0:n("released"),[]),s.jsxRuntimeExports.jsxs(Nn.Provider,{value:{needsControlOf:u},children:[s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),Bn=c.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var x;const r=c.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:i},a]=c.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...r,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:C.m.now()}},schema:j.indicatorStateZ});d.useEffect(()=>{a(m=>({...m,...r}))},[r,a]);let u;return((x=i.data)==null?void 0:x.color)!=null?u=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?u=o:u="var(--pluto-gray-l8)",s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(u),flexGrow:1}})]})}),aa=c.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=_n(),[,{states:r},o]=c.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:n}});d.useEffect(()=>{o(u=>({...u,needsControlOf:n}))},[n]);const a=C.n(r.map(u=>u.subject.key)).map(u=>{const x=r.find(m=>m.subject.key===u);if(x==null)throw new C.Ce("Legend subject not found");return{key:x.subject.key,label:x.subject.name,color:x.subjectColor}});return s.jsxRuntimeExports.jsx(Ft,{data:a,...t})}),An=c.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=c.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:t})}),ua=Object.freeze(Object.defineProperty({__proto__:null,Chip:$n,Controller:ca,Indicator:Bn,Legend:aa,StateProvider:An,useContext:_n},Symbol.toStringTag,{value:"Module"})),On=e=>{const t=({disabled:n=!1,...r})=>n?r.children:s.jsxRuntimeExports.jsx(e,{...r});return t.displayName=e.displayName,t},xa=On(Mn),da=On(c.Provider$3),pa=({children:e,connParams:t,workerEnabled:n=!0,workerURL:r,theming:o,tooltip:i,triggers:a,alamos:u,haul:x,channelAlias:m,telem:p})=>s.jsxRuntimeExports.jsx(c.Provider$1,{...a,children:s.jsxRuntimeExports.jsx(c.Config,{...i,children:s.jsxRuntimeExports.jsx(c.Provider$2,{...x,children:s.jsxRuntimeExports.jsx(c.Provider$4,{url:r??oa,enabled:n,children:s.jsxRuntimeExports.jsx(da,{workerKey:"vis",children:s.jsxRuntimeExports.jsx(ra,{...u,children:s.jsxRuntimeExports.jsx(c.Aggregator,{children:s.jsxRuntimeExports.jsx(Ms,{connParams:t,children:s.jsxRuntimeExports.jsx(_s,{...m,children:s.jsxRuntimeExports.jsx(xa,{...p,children:s.jsxRuntimeExports.jsx(c.Provider,{...o,children:s.jsxRuntimeExports.jsx(An,{children:e})})})})})})})})})})})}),ma=Object.freeze(Object.defineProperty({__proto__:null,Provider:pa},Symbol.toStringTag,{value:"Module"})),ja=({value:e})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),ga=Object.freeze(Object.defineProperty({__proto__:null,Progress:ja},Symbol.toStringTag,{value:"Module"})),qe="range",ns=[{key:"name",name:"Name"}],ut=({items:e},t)=>{const n=c.filterByType(qe,e);return n.length>0&&!n.every(r=>t.includes(r.key))},fa=({onChange:e,className:t,value:n,...r})=>{const o=ge(),i=o!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...x}=c.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:d.useCallback(h=>ut(h,C.A(n)),[n]),onDrop:d.useCallback(({items:h})=>{const f=c.filterByType(qe,h);if(f.length===0)return[];const E=C.n([...C.A(n),...f.map(R=>R.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),m=c.useDraggingState(),p=d.useCallback(({dropped:h})=>{e(C.A(n).filter(f=>!h.some(E=>E.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),g=d.useCallback((h,f)=>a([{key:f,type:qe}],p),[a,p]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(ut(m,C.A(n)))),value:n,onTagDragStart:g,onTagDragEnd:u,searcher:o==null?void 0:o.ranges,onChange:e,columns:ns,emptyContent:i,entryRenderKey:"name",...x,...r})},zn=({value:e,onChange:t})=>{const n=ge(),r=n!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=d.useId(),i=d.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:a,...u}=c.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:d.useCallback(p=>ut(p,C.o(e)),[e]),onDrop:d.useCallback(({items:p})=>{const g=c.filterByType(qe,p);return g.length===0?[]:(t(g[0].key,{clickedIndex:null,clicked:null,entries:[]}),g)},[i,t])}),x=c.useDraggingState(),m=d.useCallback(()=>e!=null&&a([{type:qe,key:e}]),[a,e]);return{emptyContent:r,dragging:x,...u,onDragStart:m,searcher:n==null?void 0:n.ranges}},ha=({onChange:e,value:t,className:n,data:r,...o})=>{const{dragging:i,...a}=zn({value:t,onChange:e});return s.jsxRuntimeExports.jsx(be,{data:r,className:l.CSS(n,l.CSS.dropRegion(ut(i,C.o(t)))),value:t,onChange:e,columns:ns,entryRenderKey:"name",...a,...o})},Ea=({data:e,value:t,onChange:n,...r})=>{const{dragging:o,...i}=zn({value:t,onChange:n});return s.jsxRuntimeExports.jsx(be,{data:e,value:t,onChange:n,columns:ns,entryRenderKey:"name",...i,...r})},Sa=[{key:"color",name:"Color",width:50,render:e=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Ra=e=>{const t=ge();return s.jsxRuntimeExports.jsx(_e,{...e,searcher:t==null?void 0:t.labels,columns:Sa,renderTag:n=>n.entry==null?s.jsxRuntimeExports.jsx(Ze,{color:"gray",children:n.entryKey}):s.jsxRuntimeExports.jsx(Ze,{color:n.entry.color,children:n.entry.name})})},ya=({timeRange:e,level:t="p",shade:n=7,showSpan:r=!1,...o})=>{const i=new C.m(e.start),a=i.isToday?"time":"dateTime",u=new C.m(e.end),x=u.equals(C.m.MAX),m=u.span(i)<C.y.DAY?"time":"dateTime",p=i.span(u);return s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...o,children:[i.isToday&&s.jsxRuntimeExports.jsx(c.Text,{level:t,shade:n,weight:450,children:"Today"}),s.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:a,shade:n,weight:450,children:i}),s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),x?s.jsxRuntimeExports.jsx(c.Text,{level:t,children:"Now"}):s.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:m,shade:n,weight:450,children:u}),!p.isZero&&r&&s.jsxRuntimeExports.jsxs(c.Text,{level:t,shade:n,weight:450,children:["(",i.span(u).truncate(C.y.MILLISECOND).toString(),")"]})]})},Ca=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Ea,SelectLabels:Ra,SelectMultiple:fa,SelectSingle:ha,TimeRangeChip:ya},Symbol.toStringTag,{value:"Module"})),ba=({steps:e,value:t,onChange:n,...r})=>{const o=e.findIndex(i=>i.key===t);return s.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...r,children:e.map((i,a)=>s.jsxRuntimeExports.jsxs(d.Fragment,{children:[s.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:a>o,children:[a+1,". ",i.title]},i.key),a!==e.length-1&&s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},va=Object.freeze(Object.defineProperty({__proto__:null,Steps:ba},Symbol.toStringTag,{value:"Module"})),wa=(e,t="x")=>{if(e.length===0)return[];const n=l.J.construct(t),r=l.J.swap(n);return e.sort((o,i)=>l.Eo.loc(o.box,n)-l.Eo.loc(i.box,n)),e.forEach((o,i)=>{if(i===0)return;const u=e[i-1].handles.find(f=>f.orientation===r),x=o.handles.find(f=>f.orientation===n);if(u==null||x==null)return;const m=u.absolutePosition,p=x.absolutePosition,g=l.q.set(l.q.translation(p,m),t,0),h=l.q.translate(l.Eo.topLeft(o.box),g);o.box=l.Eo.construct(h,l.Eo.dims(o.box))}),e},rs=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},xe=(e,t)=>{const n=rs(t),r=e.getNodes().find(o=>o.id===t);if(r==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.Eo.construct(r.position,l.q.scale(l.Eo.dims(l.Eo.construct(n)),1/e.getZoom()))},Pa=(e,t)=>St.fromFlow(e,t);class Dn{constructor(t,n){he(this,"node_",null);he(this,"position");he(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.Eo.topLeft(this.node.box),this.position)}}class St{constructor(t,n,r){he(this,"key");he(this,"box");he(this,"handles");this.key=t,this.box=n,this.handles=r,r.forEach(o=>o.node=this)}static fromFlow(t,n){const r=xe(n,t),o=rs(t),i=o.getElementsByClassName("react-flow__handle"),a=l.Eo.construct(o),u=Array.from(i).map(x=>{const m=l.Eo.center(l.Eo.construct(x)),p=l.q.translation(l.Eo.topLeft(a),m),g=x.className.match(/react-flow__handle-(\w+)/);if(g==null)throw new Error("[schematic] - cannot find handle orientation");const h=l.J.construct(g[0]);return new Dn(p,h)});return new St(t,r,u)}}const ka=({fromX:e,fromY:t,toX:n,toY:r,fromPosition:o,toPosition:i,fromNode:a,connectionLineStyle:u,connectionStatus:x})=>{const m=document.querySelector(".react-flow__handle-connecting"),p=m==null?void 0:m.className.match(/react-flow__handle-(\w+)/);if(p!=null){const E=l.J.outer.safeParse(p[1]);E.success&&(i=E.data)}const g=j.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(n,r),sourceOrientation:o,targetOrientation:i,sourceBox:xe(j.useReactFlow(),(a==null?void 0:a.id)??""),targetBox:xe(j.useReactFlow(),(a==null?void 0:a.id)??"")}),h=j.useReactFlow(),f=j.segmentsToPoints(l.q.construct(e,t),g,h.getZoom(),!1);return s.jsxRuntimeExports.jsx(j.BaseEdge,{path:Vn(f),style:{...u,stroke:l.cssString(x==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},La=({id:e,source:t,target:n,sourcePosition:r,targetHandleId:o,targetPosition:i,style:a,segments:u=[],onSegmentsChange:x,color:m="var(--pluto-gray-l9)",selected:p=!1,...g})=>{const h=l.q.construct(g.sourceX,g.sourceY),f=d.useRef(h),E=l.q.equals(h,f.current),R=l.q.construct(g.targetX,g.targetY),k=d.useRef(R),T=l.q.equals(R,k.current),M=j.useReactFlow(),[$,P,S]=c.useCombinedStateAndRef(()=>u.length>0?u:j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),v=d.useRef(i),B=d.useRef(r),L=c.useDebouncedCallback(x,100,[x]);if(!E||!T){let y=$;const _=l.q.translation(f.current,h),z=l.q.translation(R,k.current);l.q.equals(_,l.q.scale(z,-1),.001)?(f.current=h,k.current=R):(E?T||(y=j.moveTargetNode({delta:z,segments:y}),v.current!==i&&(v.current=i,y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),j.checkIntegrity({sourcePos:h,targetPos:R,next:y,prev:$})||(y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),k.current=R):(y=j.moveSourceNode({delta:_,segments:y}),B.current!==r&&(B.current=r,y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),j.checkIntegrity({sourcePos:h,targetPos:R,next:y,prev:$})||(y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),f.current=h),L(y),P(y))}const N=d.useRef(null),A=pt({onStart:d.useCallback((y,_,z)=>{N.current={index:Number(z.currentTarget.id.split("-")[1]),segments:[...S.current]}},[]),onMove:d.useCallback(y=>{if(N.current==null)return;const _=j.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.Eo.dim(y,l.g.swap(N.current.segments[N.current.index].direction),!0)/M.getZoom()});P(_)},[]),onEnd:d.useCallback(()=>x(S.current),[x])}),w=j.segmentsToPoints(h,$,M.getZoom(),!0);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(j.BaseEdge,{path:Vn(w),style:{...a,stroke:l.cssString(m)},...g}),p&&Ta(w).map((y,_)=>{const z=$[_].direction,U=l.g.swap(z),I={[l.g.dimension(z)]:"18px",[l.g.dimension(U)]:"4px"},G={[z]:y[z]-9,[U]:y[U]-2};return s.jsxRuntimeExports.jsxs(d.Fragment,{children:[s.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...I,...G,rx:"2px",ry:"2px"}),s.jsxRuntimeExports.jsx("foreignObject",{x:y.x-9,y:y.y-9,width:"18px",height:"18px",children:s.jsxRuntimeExports.jsx("div",{id:`handle-${_}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(z)),draggable:!0,onDragStart:A})})]},_)})]})},Vn=e=>{let t="";const r=e.length+-1;for(let o=0;o<r;o++){const i=e[o%e.length],a=e[(o+1)%e.length],u=Math.min(6/Math.hypot(a.x-i.x,a.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),o===r-1?t+=`L${a.x},${a.y}`:o<r-1&&(t+=`L${i.x*u+a.x*(1-u)},${i.y*u+a.y*(1-u)}`)}return t},Ta=e=>e.slice(1).map((t,n)=>{const r=e[n];return l.q.construct((t.x+r.x)/2,(t.y+r.y)/2)}),Ma=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:r={position:l.q.ZERO,zoom:1}})=>{const[o,i]=d.useState(n),[a,u]=d.useState(e),[x,m]=d.useState(t),[p,g]=d.useState(r),[h,f]=d.useState(!1);return{viewport:p,onViewportChange:g,edges:x,nodes:a,onNodesChange:u,onEdgesChange:m,editable:o,onEditableChange:i,fitViewOnResize:h,setFitViewOnResize:f}},$a=e=>e.source!==e.target,Na={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},_a={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},In={maxZoom:1,minZoom:.5},Ba={hideAttribution:!0},Zn=d.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Ue=()=>d.useContext(Zn),Fn=d.memo(({children:e})=>{const{registerNodeRenderer:t}=Ue();return d.useEffect(()=>t(e),[t,e]),null});Fn.displayName="NodeRenderer";const Aa=["Backspace","Delete"],Oa=c.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:r,nodes:o,edges:i,onEditableChange:a,editable:u,viewport:x,triggers:m,onViewportChange:p,fitViewOnResize:g,setFitViewOnResize:h,visible:f,...E})=>{const R=c.useMemoDeepEqualProps({visible:f}),[{path:k},,T]=c.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:x.position,region:l.Eo.ZERO,zoom:x.zoom,...R}});d.useEffect(()=>T(F=>({...F,...R})),[R]);const M=c.use().colors.gray.l9.hex,$=c.useMemoCompare(()=>m??Ut.zoom,c.compareModeConfigs,[m]),{fitView:P}=j.useReactFlow(),S=c.useDebouncedCallback(P,50,[P]),v=gt(d.useCallback(F=>{g&&S({maxZoom:1}),T(Q=>({...Q,region:F}))},[T,S,g])),B=d.useRef(null),L=d.useCallback(F=>{const Q=B.current;Q!=null&&Q.x===F.x&&Q.y===F.y&&Q.zoom===F.zoom||(B.current=F,!(isNaN(F.x)||isNaN(F.y)||isNaN(F.zoom))&&(T(ue=>({...ue,position:F,zoom:F.zoom})),p(j.translateViewportBackward(F))))},[T,p]);j.useOnViewportChange({onStart:L,onChange:L,onEnd:L});const[N,A]=d.useState(()=>()=>null),w=d.useCallback(F=>A(()=>F),[]),y=d.useMemo(()=>({custom:({id:F,xPos:Q,yPos:ue,selected:ze})=>N({symbolKey:F,position:{x:Q,y:ue},selected:ze})}),[N]),_=d.useRef(i),z=d.useMemo(()=>(_.current=i,j.translateEdgesForward(i)),[i]),U=d.useRef(o),I=d.useMemo(()=>(U.current=o,j.translateNodesForward(o)),[o]),G=d.useCallback(F=>n(j.nodeConverter(U.current,Q=>j.applyNodeChanges(F,Q))),[n]),O=d.useCallback(F=>r(j.edgeConverter(_.current,Q=>j.applyEdgeChanges(F,Q),M)),[r,M]),te=d.useCallback((F,Q)=>r(j.edgeConverter(_.current,ue=>j.updateEdge(F,Q,ue),M)),[]),ce=d.useCallback(F=>{r(j.edgeConverter(_.current,Q=>j.addEdge(F,Q),M))},[r,M]),We=d.useCallback((F,Q)=>{const ue=[..._.current],ze=ue.findIndex(dl=>dl.key===F);ze!==-1&&(ue[ze]={...ue[ze],segments:Q},_.current=ue,r(ue))},[r]),ll=u?Na:_a,il=d.useMemo(()=>({default:F=>s.jsxRuntimeExports.jsx(La,{...F,segments:F.data.segments,color:F.data.color,onSegmentsChange:d.useCallback(Q=>We(F.id,Q),[F.id])},F.id)}),[We]),is=d.useRef(null);c.use$1({triggers:$.zoomReset,callback:d.useCallback(({stage:F,cursor:Q})=>{const ue=is.current;ue==null||F!=="start"||!l.Eo.contains(ue,Q)||P()},[P])});const cs=c.purgeMouse($.select)[0]??null,as=c.purgeMouse($.pan)[0]??null,cl=c.purgeMouse($.zoom)[0]??null,al={selectionOnDrag:cs==null,panOnDrag:as==null,selectionKeyCode:cs,panActivationKeyCode:as,zoomActivationKeyCode:cl},ul=c.useCombinedRefs(is,v),xl=d.useMemo(()=>({editable:u,onEditableChange:a,registerNodeRenderer:w,fitViewOnResize:g,setFitViewOnResize:h}),[u,a,w,g]);return s.jsxRuntimeExports.jsx(Zn.Provider,{value:xl,children:s.jsxRuntimeExports.jsx(c.Composite,{path:k,children:f&&s.jsxRuntimeExports.jsx(j.ReactFlow,{...al,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(u)),nodes:I,edges:z,nodeTypes:y,edgeTypes:il,ref:ul,fitView:!0,onNodesChange:G,onEdgesChange:O,onConnect:ce,onEdgeUpdate:te,defaultViewport:j.translateViewportForward(x),connectionLineComponent:ka,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:$a,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:In,selectionMode:j.SelectionMode.Partial,proOptions:Ba,deleteKeyCode:Aa,...E,style:{[l.CSS.var("diagram-zoom")]:x.zoom,...E.style},...ll,children:t})})})}),za=()=>{const{editable:e}=Ue();return e?s.jsxRuntimeExports.jsx(ti,{}):null},Da=({children:e,...t})=>s.jsxRuntimeExports.jsx(D.Pack,{direction:"y",borderShade:4,className:l.CSS.BE("diagram","controls"),...t,children:e}),Va=({onClick:e,...t})=>{const{editable:n,onEditableChange:r}=Ue();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>r(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:n?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?s.jsxRuntimeExports.jsx(c.Qt.EditOff,{}):s.jsxRuntimeExports.jsx(c.Qt.Edit,{})})},Ia=({onClick:e,...t})=>{const{fitView:n}=j.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=Ue();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{n(In),e==null||e(i)},value:r,onChange:i=>o(i),rightClickToggle:!0,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:s.jsxRuntimeExports.jsx(c.Qt.Expand,{})})},Za=e=>s.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:s.jsxRuntimeExports.jsx(Oa,{...e})}),Fa=Object.freeze(Object.defineProperty({__proto__:null,Background:za,Controls:Da,Diagram:Za,FitViewControl:Ia,HandleLayout:Dn,NodeLayout:St,NodeRenderer:Fn,ToggleEditControl:Va,alignNodes:wa,edgeConverter:j.edgeConverter,edgeZ:j.edgeZ,nodeConverter:j.nodeConverter,nodeZ:j.nodeZ,rfEdgeDataZ:j.rfEdgeDataZ,selectNode:rs,selectNodeBox:xe,selectNodeLayout:Pa,translateEdgesBackward:j.translateEdgesBackward,translateEdgesForward:j.translateEdgesForward,translateNodesBackward:j.translateNodesBackward,translateNodesForward:j.translateNodesForward,translateViewportBackward:j.translateViewportBackward,translateViewportForward:j.translateViewportForward,use:Ma,useContext:Ue,viewportZ:j.viewportZ},Symbol.toStringTag,{value:"Module"})),qa=c.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:r=!0,emptyContent:o=s.jsxRuntimeExports.jsx(c.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:a,...u})=>{const x=c.useMemoDeepEqualProps({font:t,color:i,telem:a,visible:r}),[,{scrolling:m,empty:p},g]=c.use$3({aetherKey:e,type:j.Log.TYPE,schema:j.logState,initialState:{empty:!0,region:l.Eo.ZERO,scrolling:!1,wheelPos:0,...x}});d.useEffect(()=>{g(f=>({...f,...x}))},[x,g]);const h=gt(d.useCallback(f=>g(E=>({...E,region:f})),[g]));return s.jsxRuntimeExports.jsx("div",{ref:h,className:l.CSS(l.CSS.B("log"),n),onWheel:f=>{g(E=>({...E,wheelPos:E.wheelPos-f.deltaY,scrolling:E.scrolling?E.scrolling:f.deltaY<0}))},...u,children:p?o:s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("log","live"),m&&l.CSS.M("active")),variant:"outlined",onClick:()=>g(f=>({...f,scrolling:!f.scrolling})),tooltip:m?"Resume Scrolling":"Pause Scrolling",children:s.jsxRuntimeExports.jsx(c.Qt.Dynamic,{})})})}),Ha=Object.freeze(Object.defineProperty({__proto__:null,Log:qa},Symbol.toStringTag,{value:"Module"})),Ya=({value:e,showOuter:t=!0,showInner:n,onChange:r})=>{const{outer:o}=e,i=a=>()=>r({...e,...a});return t?s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(ye,{selected:o==="top",onClick:i({outer:"top"})}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(ye,{selected:o==="left",onClick:i({outer:"left"})}),s.jsxRuntimeExports.jsx(ys,{showInner:n,value:e,onChange:r}),s.jsxRuntimeExports.jsx(ye,{selected:o==="right",onClick:i({outer:"right"})})]}),s.jsxRuntimeExports.jsx(ye,{selected:o==="bottom",onClick:i({outer:"bottom"})})]}):s.jsxRuntimeExports.jsx(ys,{className:l.CSS.B("orientation-control"),value:e,onChange:r})},ys=({value:e,onChange:t,className:n,showInner:r=!0,...o})=>{const{inner:i}=e,a=x=>()=>t({...e,...x});let u={};return r||(u={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS(n,l.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,className:l.CSS(l.CSS.dir("y")),selected:i==="top",onClick:a({inner:"top"})}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",children:[s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,selected:i==="left",onClick:a({inner:"left"})}),s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,selected:i==="right",onClick:a({inner:"right"})})]}),s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,className:l.CSS(l.CSS.dir("y")),selected:i==="bottom",onClick:a({inner:"bottom"})})]})},ye=({selected:e,className:t,...n})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...n,children:s.jsxRuntimeExports.jsx("div",{className:"symbol"})}),fe=({className:e,direction:t,...n})=>s.jsxRuntimeExports.jsx(D.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Ae=({showOuter:e,showInner:t,...n})=>s.jsxRuntimeExports.jsx(se,{label:"Orientation",padHelpText:!1,...n,children:({value:r,onChange:o})=>{var i;return s.jsxRuntimeExports.jsx(Ya,{value:{inner:r.orientation??"top",outer:((i=r.label)==null?void 0:i.orientation)??"top"},showInner:t,showOuter:e,onChange:a=>o({...r,orientation:a.inner,label:{...r.label,orientation:a.outer}})})}}),Ge=({path:e,omit:t=[]})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsx(se,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:n=>s.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...n})}),s.jsxRuntimeExports.jsx(ht,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:e+".maxInlineSize",hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,visible:!t.includes("level"),path:e+".level",label:"Label Size",padHelpText:!1,children:n=>s.jsxRuntimeExports.jsx(de.SelectLevel,{...n})}),s.jsxRuntimeExports.jsx(se,{visible:!t.includes("align"),path:e+".align",label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>s.jsxRuntimeExports.jsx(Yt,{...n})})]}),ke=e=>s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:r,...o})=>s.jsxRuntimeExports.jsx(Bt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...o,bordered:!0})}),Ua=e=>s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>s.jsxRuntimeExports.jsx(c.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),ae=({omit:e})=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{omit:e,path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",grow:!0,children:[s.jsxRuntimeExports.jsx(ke,{path:"color",optional:!0}),s.jsxRuntimeExports.jsx(se,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>s.jsxRuntimeExports.jsx(c.Switch$1,{...t})}),s.jsxRuntimeExports.jsx(Ua,{path:"scale"})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]}),Ga=({path:e})=>{var m,p;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),o=j.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),a=j.setChannelValuePropsZ.parse(o.segments.setter.props),u=g=>{g=g??0;const h=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:g}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:h})},x=g=>{g=g??0;const h=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:g}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=j.authoritySource({channel:g}),E=j.acquireChannelControl({channel:g,authority:255});n({...t,sink:h,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:E,source:f},indicator:{statusSource:f}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:x})}),s.jsxRuntimeExports.jsx(Qt,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},os=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],re=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Ga,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},De={y:2,x:.25},Ve={lower:0,upper:2e3},qn=({includeBorderRadius:e=!1})=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(ke,{path:"backgroundColor",label:"Background Color"}),s.jsxRuntimeExports.jsx(se,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"%",...n})}),s.jsxRuntimeExports.jsx(se,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"%",...n})}),e&&s.jsxRuntimeExports.jsx(se,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"px",...n})}),s.jsxRuntimeExports.jsx(se,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:De,bounds:Ve,endContent:"px",...n})}),s.jsxRuntimeExports.jsx(se,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:De,bounds:Ve,endContent:"px",...n})})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showInner:!1})]}),Hn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],Wa=({path:e})=>{var g;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((g=t.telem)==null?void 0:g.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=j.stringifyNumberProps.parse(r.segments.stringifier.props),a=j.rollingAverageProps.parse(r.segments.rollingAverage.props),u=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:h??0}),stringifier:j.stringifyNumber({precision:i.precision??2}),rollingAverage:j.rollingAverage({windowSize:a.windowSize??1})},outlet:"stringifier"});n({...t,telem:f})},x=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:o.channel}),stringifier:j.stringifyNumber({precision:h}),rollingAverage:j.rollingAverage({windowSize:a.windowSize})},outlet:"stringifier"});n({...t,telem:f})},m=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:j.stringifyNumber({precision:i.precision??2}),valueStream:j.streamChannelValue({channel:o.channel}),rollingAverage:j.rollingAverage({windowSize:h})},outlet:"stringifier"});n({...t,telem:f})},p=jt(o.channel);return d.useEffect(()=>{n({...t,tooltip:[p]})},[p]),s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Precision",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Averaging Window",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:a.windowSize??1,bounds:{lower:1,upper:100},onChange:m})})]})},Ka=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(Wa,{path:""});default:return s.jsxRuntimeExports.jsxs(fe,{direction:"x",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(se,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>s.jsxRuntimeExports.jsx(c.Text$1,{...r})}),s.jsxRuntimeExports.jsx(ht,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showInner:!1})]})}},[]),t=ne.useStatic({tabs:Hn,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},Qa=({path:e})=>{var u;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=x=>{x=x??0;const m=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:x}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=jt(o.channel);return d.useEffect(()=>n({...t}),[a]),s.jsxRuntimeExports.jsx(fe,{direction:"x",align:"stretch",children:s.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})})})},Xa=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(Qa,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{})}},[]),t=ne.useStatic({tabs:Hn,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},Ja=({path:e})=>{var a;const{value:t,onChange:n}=ve({path:e}),r=j.sinkPipelinePropsZ.parse((a=t.sink)==null?void 0:a.props),o=j.setChannelValuePropsZ.parse(r.segments.setter.props),i=u=>{u=u??0;const x=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:u}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=j.authoritySource({channel:u}),p=j.acquireChannelControl({channel:u,authority:255});n({...t,sink:x,control:{...t.control,showChip:!0,chip:{sink:p,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})}),s.jsxRuntimeExports.jsx(ht,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),s.jsxRuntimeExports.jsx(Qt,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},eu=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Ja,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{omit:["align","maxInlineSize"]})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},tu=({path:e})=>{var m,p;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),o=j.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),a=j.setChannelValuePropsZ.parse(o.segments.setter.props),u=g=>{g=g??0;const h=j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:g})},outlet:"valueStream"});n({...t,source:h})},x=g=>{g=g??0;const h=j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:g})},inlet:"setter"}),f=j.authoritySource({channel:g}),E=j.acquireChannelControl({channel:g,authority:255});n({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:E,source:f},showIndicator:!0,indicator:{statusSource:f}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:x})})]})},su=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(tu,{path:""});default:return s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsx(mn,{path:"units",label:"Units",align:"start",padHelpText:!1}),s.jsxRuntimeExports.jsx(ke,{path:"color"})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},nu=()=>{const e=ve({path:"autoFit",optional:!0});return s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(se,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>s.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),s.jsxRuntimeExports.jsx(se,{path:"level",label:"Text Size",padHelpText:!1,children:t=>s.jsxRuntimeExports.jsx(de.SelectLevel,{...t})}),s.jsxRuntimeExports.jsx(se,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>s.jsxRuntimeExports.jsx(Yt,{...t})})]}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(se,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>s.jsxRuntimeExports.jsx(c.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:s.jsxRuntimeExports.jsx(c.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:s.jsxRuntimeExports.jsx(c.Qt.AutoFitWidth,{})})})})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]})},ru=()=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label",omit:["maxInlineSize","align"]}),s.jsxRuntimeExports.jsx(ke,{path:"color"})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showOuter:!1})]}),V=e=>s.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Oe=e=>s.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Te=e=>s.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),W=e=>s.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ou={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},lu=(e,t)=>ou[t][e],iu=(e,t=!1)=>{if(t)return e;switch(e){case j.Position.Left:return j.Position.Right;case j.Position.Right:return j.Position.Left;case j.Position.Top:return j.Position.Bottom;case j.Position.Bottom:return j.Position.Top;default:return j.Position.Top}},cu=(e,t,n,r=!1)=>r?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},q=({children:e,orientation:t})=>{let n;try{n=j.useUpdateNodeInternals()}catch{return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{})}const r=d.useRef(null),o=d.useRef(!0);return d.useEffect(()=>{if(r.current==null)return;if(o.current){o.current=!1;return}const i=r.current.closest(".react-flow__node"),a=i==null?void 0:i.getAttribute("data-id");a!=null&&(n==null||n(a))},[t]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:r,swap:o,top:i,...a})=>{const u=cu(i,r,t,n);return s.jsxRuntimeExports.jsx(j.Handle$1,{position:iu(lu(e,t),!o),...a,type:"source",onClick:x=>x.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",a.id)),style:{left:`${u.left}%`,top:`${u.top}%`}})},ie=({className:e,enabled:t=!1,triggered:n=!1,orientation:r="left",color:o,...i})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),r!=null&&l.CSS.loc(r),t&&l.CSS.M("enabled"),n&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),ee=({className:e,...t})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),au=.8,K=({dimensions:e,orientation:t="left",children:n,className:r,color:o,style:i={},scale:a=1,...u})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const m=l.cssString(o),p=c.use();return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(o).pickByContrast(p.colors.gray.l0,p.colors.gray.l10).rgbString),s.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._$1.svgViewBox(e),className:l.CSS(l.CSS.loc(t),r),fill:m,stroke:m,...u,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,a*au).width,...i},children:s.jsxRuntimeExports.jsx("g",{children:n})})},Yn=({className:e,orientation:t,scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:87},color:r,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Un=({color:e,orientation:t="left",scale:n,...r})=>s.jsxRuntimeExports.jsxs(ie,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),s.jsxRuntimeExports.jsx(V,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Gn=({orientation:e="left",color:t,scale:n,...r})=>s.jsxRuntimeExports.jsxs(ie,{...r,children:[s.jsxRuntimeExports.jsxs(q,{orientation:e,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:s.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Wn=({className:e,color:t,orientation:n="left",normallyOpen:r=!1,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(V,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),s.jsxRuntimeExports.jsx(W,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),s.jsxRuntimeExports.jsx(Oe,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Kn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:58},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Qn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:45,height:43},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Xn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,orientation:n,className:l.CSS(l.CSS.B("angled-valve"),t),children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),s.jsxRuntimeExports.jsx(V,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),Jn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),er=({className:e,color:t,orientation:n="left",scale:r,...o})=>{const i=l.cssString(t);return s.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[s.jsxRuntimeExports.jsx(q,{orientation:n,children:s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:40,height:48},color:t,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),s.jsxRuntimeExports.jsx(V,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),s.jsxRuntimeExports.jsx(V,{d:"M33 24H2",strokeLinecap:"round"})]})]})},tr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[s.jsxRuntimeExports.jsx(q,{orientation:t,children:s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),s.jsxRuntimeExports.jsx(K,{color:n,dimensions:{width:26,height:48},orientation:t,scale:r,children:s.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),sr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:48},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),s.jsxRuntimeExports.jsx(V,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),nr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:52,height:34},orientation:t,color:n,scale:r,children:s.jsxRuntimeExports.jsx(V,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),uu=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,xu=e=>{const{topLeft:t,topRight:n,bottomLeft:r,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${r.x}% / ${t.y}% ${n.y}% ${o.y}% ${r.y}%`},du={width:40,height:80},rr={x:50,y:10},Rt=({className:e,dimensions:t=du,borderRadius:n=rr,boxBorderRadius:r,color:o,backgroundColor:i,...a})=>{const u=uu(n),x=r==null,m=c.use();return s.jsxRuntimeExports.jsx(ee,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:r??xu(u),borderColor:l.cssString(o??m.colors.gray.l9),backgroundColor:i==null?void 0:l.cssString(i)},...a,children:s.jsxRuntimeExports.jsxs(q,{children:[s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:0,id:"1"}),x&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:-.5,top:u.topLeft.y-1,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:101,top:u.topRight.y-1,id:"3"})]}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),x&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:-.5,top:100-u.bottomLeft.y+1,id:"5"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:101,top:100-u.bottomRight.y+1,id:"6"})]}),s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},or=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),s.jsxRuntimeExports.jsx(V,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),s.jsxRuntimeExports.jsx(W,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),lr=({className:e,orientation:t="left",scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:70,height:34},orientation:t,color:r,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),ir=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:42},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(n)}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),cr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:79},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),s.jsxRuntimeExports.jsx(V,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),ar=({className:e,color:t,dimensions:n,orientation:r,units:o="psi",children:i,inlineSize:a=80,...u})=>{const x=l.cssString(t),m=c.use(),p=t==null?"var(--pluto-gray-l0)":l.cssString(new l.Color(t).pickByContrast(m.colors.gray.l0,m.colors.gray.l9)),g=2.5*((n==null?void 0:n.width)??0)/500;return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:x,height:n==null?void 0:n.height,width:"100%"},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:a},children:i}),s.jsxRuntimeExports.jsxs(q,{orientation:r,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:-2+g,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:102-g,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:x},children:s.jsxRuntimeExports.jsx(c.Text,{level:"small",color:p,children:o})})]})},ur=({enabled:e=!1,onClick:t,orientation:n="left"})=>s.jsxRuntimeExports.jsxs(ee,{orientation:n,children:[s.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),xr=({onClick:e,orientation:t="left",label:n="",color:r,size:o,level:i,onClickDelay:a})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,children:[s.jsxRuntimeExports.jsx(c.Button,{onClick:e,color:r,size:o,level:i,onClickDelay:a,children:n}),s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:0,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),dr=({className:e,orientation:t="left",text:n="",width:r,color:o,level:i,autoFit:a,align:u="center"})=>{const x=c.use(),m=l.cssString(o??x.colors.gray.l0),p={borderColor:m,textAlign:u};return l.g.construct(t)==="y"?p.height=a?"fit-content":r:p.width=a?"fit-content":r,s.jsxRuntimeExports.jsx(ee,{style:p,orientation:t,className:l.CSS(l.CSS.B("text-box"),l.CSS.loc(t),e),children:s.jsxRuntimeExports.jsx(c.Text,{color:m,level:i,children:n})})},pr=({orientation:e="left",className:t,onClick:n,children:r,value:o,units:i,color:a,onChange:u,...x})=>{const[m,p]=d.useState(o);return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...x,children:[s.jsxRuntimeExports.jsxs(q,{orientation:e,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsx(c.Numeric,{size:"small",value:m,onChange:p,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:a,style:{[l.CSS.var("pack-border-shade")]:l.cssString(a)},borderWidth:2,children:s.jsxRuntimeExports.jsx(c.Button,{variant:"outlined",size:"small",onClick:()=>u(m),color:a,children:"Set"})})]})},mr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),jr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),gr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:l.CSS(l.CSS.M("detail"),t)})]})]}),fr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),hr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:66,height:30},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Oe,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),s.jsxRuntimeExports.jsx(V,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Er=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:50,height:33},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Sr=({className:e,color:t,orientation:n="left",enabled:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ee,{...i,orientation:n,className:l.CSS(l.CSS.B("light"),r&&l.CSS.M("enabled"),e),children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"})})]}),Rr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),s.jsxRuntimeExports.jsx(Oe,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),s.jsxRuntimeExports.jsx(W,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),yr=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Cr=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),br=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),vr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),s.jsxRuntimeExports.jsx(W,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"49",x2:"43",y2:"83",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),wr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Pr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",left:50,top:2,id:"4",orientation:n})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),kr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("compressor"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:68,height:61},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"35",cy:"25",r:"23"}),s.jsxRuntimeExports.jsx(V,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),s.jsxRuntimeExports.jsx(W,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),s.jsxRuntimeExports.jsx(W,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),Lr=({id:e,className:t,orientation:n="right",label:r="text",color:o="black",level:i="p",...a})=>{const u=document.querySelector(`[data-id="${e}"]`);u&&u.classList.add(n);const x=l.g.construct(n)==="y";return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("arrow"),l.CSS.loc(n),t),orientation:n,...a,children:[s.jsxRuntimeExports.jsx("div",{className:"wrapper",children:s.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:l.cssString(o)},children:s.jsxRuntimeExports.jsx("div",{className:"bg",children:s.jsxRuntimeExports.jsx(c.Text,{level:i,className:l.CSS.BE("symbol","label"),children:r})})})}),s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:x,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:x,id:"2"})]}),s.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:s.jsxRuntimeExports.jsx("defs",{children:s.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[s.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),s.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),s.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},pu=({aetherKey:e,sink:t})=>{const n=c.useMemoDeepEqualProps({sink:t}),[,,r]=c.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return d.useEffect(()=>{r(i=>({...i,...n}))},[n]),{click:d.useCallback(()=>{r(i=>({...i,trigger:i.trigger+1}))},[r])}},mu=({aetherKey:e,source:t})=>{const n=c.useMemoDeepEqualProps({source:t}),[,{enabled:r},o]=c.use$3({aetherKey:e,type:j.Light.TYPE,schema:j.lightStateZ,initialState:{enabled:!1,...n}});return d.useEffect(()=>o(i=>({...i,...n})),[n,o]),{enabled:r}},H=d.forwardRef(({label:e="",onChange:t,level:n="p",children:r,orientation:o="top",style:i,className:a,maxInlineSize:u=150,...x},m)=>s.jsxRuntimeExports.jsxs(D.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:m,className:l.CSS(l.CSS.B("symbol"),a),align:"center",justify:"center",...x,children:[e.length>0&&s.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:u},onChange:d.useCallback(p=>t({label:{label:p,level:n,orientation:o}}),[t,n]),level:n}),r]}));H.displayName="Labeled";const ju=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},i]=c.use$3({aetherKey:e,type:j.Setpoint.TYPE,schema:j.setpointStateZ,initialState:{trigger:0,value:0,...r}});return d.useEffect(()=>{i(u=>({...u,...r}))},[r,i]),{set:d.useCallback(u=>i(x=>({...x,trigger:x.trigger+1,command:u})),[i]),value:o}},oe=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:i},a]=c.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...r}});return d.useEffect(()=>{a(x=>({...x,...r}))},[r,a]),{toggle:d.useCallback(()=>a(x=>({...x,triggered:!x.triggered})),[a]),triggered:o,enabled:i}},gu=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:C.levelZ.optional()}),Tr=({aetherKey:e,box:t,telem:n,color:r,precision:o,minWidth:i,level:a="small"})=>{const u=c.useMemoDeepEqualProps({box:t,telem:n,color:r,precision:o,level:a,minWidth:i}),[,x,m]=c.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:u});return d.useLayoutEffect(()=>m(p=>({...p,...u})),[u]),{width:x.width??x.minWidth}},fu=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:gu,use:Tr},Symbol.toStringTag,{value:"Module"})),Mr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,hu=e=>l.g.construct(e)==="y"?l.J.swap(e):e,X=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:r="left",chip:o,children:i,show:a=!0,...u})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:l.g.construct(r),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[a&&e&&s.jsxRuntimeExports.jsx($n,{size:"small",...o}),a&&t&&s.jsxRuntimeExports.jsx(Bn,{...n})]}),i]}),$r=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:r,source:o,sink:i,orientation:a="left",...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:o,sink:i});return s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(X,{...r,orientation:Mr(a),children:s.jsxRuntimeExports.jsx(Un,{enabled:x,triggered:m,onClick:p,orientation:a,...u})})})}),Nr=e=>s.jsxRuntimeExports.jsx(Un,{...e}),_r=c.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:r,source:o,sink:i,orientation:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:t,source:o,sink:i});return s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...e,orientation:a,children:s.jsxRuntimeExports.jsx(Gn,{enabled:x,triggered:m,onClick:p,orientation:a,...u})})})}),Br=e=>s.jsxRuntimeExports.jsx(Gn,{...e}),Ar=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:r="left",normallyOpen:o,source:i,sink:a,control:u,...x})=>{const{enabled:m,triggered:p,toggle:g}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(X,{...u,orientation:hu(r),children:s.jsxRuntimeExports.jsx(Wn,{enabled:m,triggered:p,onClick:g,orientation:r,normallyOpen:o,...x})})})}),Or=e=>s.jsxRuntimeExports.jsx(Wn,{...e}),zr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...t,orientation:o,children:s.jsxRuntimeExports.jsx(Yn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Dr=e=>s.jsxRuntimeExports.jsx(Yn,{...e}),Vr=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:r,orientation:o="left",source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:Mr(o),children:s.jsxRuntimeExports.jsx(Xn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Ir=e=>s.jsxRuntimeExports.jsx(Xn,{...e}),Zr=c.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Jn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Fr=e=>s.jsxRuntimeExports.jsx(Jn,{...e}),qr=({backgroundColor:e,label:t,onChange:n,orientation:r,color:o,dimensions:i,borderRadius:a})=>s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(Rt,{onResize:u=>n({dimensions:u}),orientation:r,color:o,dimensions:i,borderRadius:a,backgroundColor:e})}),Hr=e=>s.jsxRuntimeExports.jsx(Rt,{...e,dimensions:{width:25,height:50}}),Yr=({backgroundColor:e,borderRadius:t,label:n,onChange:r,orientation:o,color:i,dimensions:a})=>s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(Rt,{onResize:u=>r({dimensions:u}),orientation:o,color:i,dimensions:a,boxBorderRadius:t,backgroundColor:e})}),Ur=e=>s.jsxRuntimeExports.jsx(Rt,{...e,dimensions:{width:25,height:50},borderRadius:0}),Gr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Kn,{...r})}),Wr=e=>s.jsxRuntimeExports.jsx(Kn,{...e}),Kr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(or,{...r})}),Qr=e=>s.jsxRuntimeExports.jsx(or,{...e}),Xr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Rr,{...r})}),Jr=e=>s.jsxRuntimeExports.jsx(Rr,{...e}),eo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(er,{...r})}),to=e=>s.jsxRuntimeExports.jsx(er,{...e}),so=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(tr,{...r})}),no=e=>s.jsxRuntimeExports.jsx(tr,{...e}),ro=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(sr,{...r})}),oo=e=>s.jsxRuntimeExports.jsx(sr,{...e}),lo=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:r,units:o,source:i,sink:a,color:u,onChange:x})=>{const{value:m,set:p}=ju({aetherKey:t,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...e,onChange:x,children:s.jsxRuntimeExports.jsx(X,{...r,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(pr,{value:m,onChange:p,units:o,color:u,orientation:n})})})}),io=e=>s.jsxRuntimeExports.jsx(pr,{value:12,onChange:()=>{},units:"mV",...e,children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),co=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(nr,{...r})}),ao=e=>s.jsxRuntimeExports.jsx(nr,{...e}),uo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(ir,{...r})}),xo=e=>s.jsxRuntimeExports.jsx(ir,{...e}),po=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Qn,{...r})}),mo=e=>s.jsxRuntimeExports.jsx(Qn,{...e}),jo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(lr,{...r})}),go=e=>s.jsxRuntimeExports.jsx(lr,{...e}),fo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(cr,{...r})}),ho=e=>s.jsxRuntimeExports.jsx(cr,{...e}),Eo=c.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:r,className:o,textColor:i,color:a,telem:u,units:x,onChange:m,tooltip:p,inlineSize:g})=>{const h=c.useTypography(n),[f,E]=d.useState({outerBox:l.Eo.ZERO,labelBox:l.Eo.ZERO}),R=(h.lineHeight+.5)*h.baseSize+2,k=c.useResize(d.useCallback(P=>{const S=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let v={...l.Eo.ZERO};S!=null&&(v=l.Eo.construct(S),v=l.Eo.resize(v,{width:l.Eo.width(v),height:l.Eo.height(v)})),E({outerBox:P,labelBox:v})},[]),{}),{zoom:T}=j.useInitialViewport(),M=Su({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:R,position:r,zoom:T,...f}),{width:$}=Tr({aetherKey:e,color:i,level:n,box:M,telem:u,minWidth:g});return s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:p==null||p.length===0,children:[s.jsxRuntimeExports.jsx(D.Space,{direction:"y",children:p==null?void 0:p.map((P,S)=>s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:P},S))}),s.jsxRuntimeExports.jsx(H,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:k,onChange:m,...t,children:s.jsxRuntimeExports.jsx(ar,{color:a,dimensions:{height:R,width:$},inlineSize:g,units:x})})]})}),Eu=.9,Su=({labelOrientation:e,outerBox:t,labelBox:n,valueBoxHeight:r,position:o,hasLabel:i,zoom:a})=>{const u=l.q.scale(l.Eo.dims(n),1/(Eu*a));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((u.y-r)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",u.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",u.y+4)),l.Eo.construct(o.x,o.y,l.Eo.width(t),r)},So=({color:e})=>s.jsxRuntimeExports.jsx(ar,{color:e,dimensions:{width:60,height:25},units:"psi",children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Ro=c.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(ur,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),yo=e=>s.jsxRuntimeExports.jsx(ur,{...e}),Co=c.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:r,control:o,...i})=>{const{click:a}=pu({aetherKey:e,sink:r});return s.jsxRuntimeExports.jsx(X,{...o,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(xr,{...t,onClick:a,...i})})}),bo=({label:e,...t})=>s.jsxRuntimeExports.jsx(xr,{label:"Button",...t}),vo=c.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(mr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),wo=e=>s.jsxRuntimeExports.jsx(mr,{...e}),Po=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(jr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),ko=e=>s.jsxRuntimeExports.jsx(jr,{...e}),Lo=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(gr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),To=e=>s.jsxRuntimeExports.jsx(gr,{...e}),Mo=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(fr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),$o=e=>s.jsxRuntimeExports.jsx(fr,{...e}),No=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(hr,{...r})}),_o=e=>s.jsxRuntimeExports.jsx(hr,{...e}),Bo=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Er,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Ao=e=>s.jsxRuntimeExports.jsx(Er,{...e}),Oo=c.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:r,...o})=>{const{enabled:i}=mu({aetherKey:e,source:n});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(Sr,{enabled:i,...o})})}),zo=e=>s.jsxRuntimeExports.jsx(Sr,{...e}),Do=c.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(yr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Vo=e=>s.jsxRuntimeExports.jsx(yr,{...e}),Io=c.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(Cr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Zo=e=>s.jsxRuntimeExports.jsx(Cr,{...e}),Fo=c.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(br,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),qo=e=>s.jsxRuntimeExports.jsx(br,{...e}),Ho=c.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(vr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Yo=e=>s.jsxRuntimeExports.jsx(vr,{...e}),Uo=c.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(wr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Go=e=>s.jsxRuntimeExports.jsx(wr,{...e}),Wo=c.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(Pr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Ko=e=>s.jsxRuntimeExports.jsx(Pr,{...e}),Qo=c.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(kr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Xo=e=>s.jsxRuntimeExports.jsx(kr,{...e}),Jo=e=>s.jsxRuntimeExports.jsx(dr,{...e}),el=({level:e="p",width:t=100,...n})=>s.jsxRuntimeExports.jsx(dr,{className:l.CSS.B("symbol"),level:e,width:t,...n}),tl=({label:{label:e,level:t},aetherKey:n,position:r,...o})=>s.jsxRuntimeExports.jsx(Lr,{label:e,level:t,...o,className:l.CSS.B("symbol")}),sl=({label:e,...t})=>s.jsxRuntimeExports.jsx(Lr,{label:"Off Page",...t,orientation:"right"}),Y=4,nl=2,Ru=["agitator","angledReliefValve","angledValve","offPageReference","box","burstDisc","button","cap","cavityPump","checkValve","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","light","manualValve","needleValve","orifice","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve"],yu=pe.z.enum(Ru),J={orientation:"left",scale:1},Cu={...J,source:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:0}),rollingAverage:j.rollingAverage({windowSize:1}),stringifier:j.stringifyNumber({precision:2})},outlet:"stringifier"})},bu={...J,source:j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:0})},outlet:"valueStream"})},vu={...J,sink:j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:0})},inlet:"setter"})},rl={...J,source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},ol={...J,control:{show:!0},sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},le={...rl,...ol},Z=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),wu={width:125,height:200},ls={dimensions:wu},Pu=3,ku={name:"Three Way Valve",key:"threeWayValve",Form:re,Symbol:$r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Three Way Valve"),...le}),Preview:Nr,zIndex:Y},Lu={name:"Valve",key:"valve",Form:re,Symbol:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Valve"),...le}),Preview:Br,zIndex:Y},Tu={name:"Solenoid Valve",key:"solenoidValve",Form:re,Symbol:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Solenoid Valve"),normallyOpen:!1,...le}),Preview:Or,zIndex:Y},Mu={name:"Four Way Valve",key:"fourWayValve",Form:re,Symbol:zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Four Way Valve"),...le}),Preview:Dr,zIndex:Y},$u={name:"Angled Valve",key:"angledValve",Form:re,Symbol:Vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Angled Valve"),...le}),Preview:Ir,zIndex:Y},Nu={name:"Pump",key:"pump",Form:re,Symbol:Zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Pump"),...le}),Preview:Fr,zIndex:Y},_u={name:"Screw Pump",key:"screwPump",Form:re,Symbol:vo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Screw Pump"),...le}),Preview:wo,zIndex:Y},Bu={name:"Tank",key:"tank",Form:qn,Symbol:qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Z("Tank"),borderRadius:rr,...ls,...J}),Preview:Hr,zIndex:nl},Au={name:"Box",key:"box",Form:()=>qn({includeBorderRadius:!0}),Symbol:Yr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Z("Box"),borderRadius:Pu,...ls,...J}),Preview:Ur,zIndex:nl},Ou={name:"Relief Valve",key:"reliefValve",Form:ae,Symbol:Gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Relief Valve"),...J}),Preview:Wr,zIndex:Y},zu={name:"Regulator",key:"regulator",Form:ae,Symbol:Kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Regulator"),...J}),Preview:Qr,zIndex:Y},Du={name:"Electric Regulator",key:"electricRegulator",Form:ae,Symbol:Xr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Electric Regulator"),...J}),Preview:Jr,zIndex:Y},Vu={name:"Burst Disc",key:"burstDisc",Form:ae,Symbol:eo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Burst Disc"),...J}),Preview:to,zIndex:Y},Iu={name:"Cap",key:"cap",Form:ae,Symbol:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cap"),...J}),Preview:no,zIndex:Y},Zu={name:"Manual Valve",key:"manualValve",Form:ae,Symbol:ro,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Manual Valve"),...J}),Preview:oo,zIndex:Y},Fu={name:"Filter",key:"filter",Form:ae,Symbol:co,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Filter"),...J}),Preview:ao,zIndex:Y},qu={name:"Needle Valve",key:"needleValve",Form:ae,Symbol:uo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Needle Valve"),...J}),Preview:xo,zIndex:Y},Hu={name:"Check Valve",key:"checkValve",Form:ae,Symbol:po,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Check Valve"),...J}),Preview:mo,zIndex:Y},Yu={name:"Orifice",key:"orifice",Form:ae,Symbol:jo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Orifice"),...J}),Preview:go,zIndex:Y},Uu={name:"Angled Relief Valve",key:"angledReliefValve",Form:ae,Symbol:fo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Angled Relief Valve"),...J}),Preview:ho,zIndex:Y},Gu={name:"Value",key:"value",Form:Ka,Symbol:Eo,Preview:So,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...Z("Value"),...J,telem:Cu.source}),zIndex:Y},Wu={name:"Button",key:"button",Symbol:Co,Form:eu,Preview:bo,defaultProps:e=>({color:e.colors.primary.z.rgba255,...Z("Button"),...ol,onClickDelay:0,scale:null}),zIndex:Y},Ku={name:"Switch",key:"switch",Symbol:Ro,Preview:yo,Form:re,defaultProps:()=>({...Z("Switch"),...le,scale:null}),zIndex:Y},Qu={name:"Vacuum Pump",key:"vacuumPump",Symbol:Po,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Vacuum Pump"),...le}),Preview:ko,zIndex:Y},Xu={name:"Cavity Pump",key:"cavityPump",Symbol:Lo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cavity Pump"),...le}),Preview:To,zIndex:Y},Ju={name:"Piston Pump",key:"pistonPump",Symbol:Mo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Piston Pump"),...le}),Preview:$o,zIndex:Y},ex={name:"Static Mixer",key:"staticMixer",Symbol:No,Form:ae,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Static Mixer"),...J}),Preview:_o,zIndex:Y},tx={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Bo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Rotary Mixer"),...le}),Preview:Ao,zIndex:Y},sx={name:"Light",key:"light",Symbol:Oo,Form:Xa,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Light"),...rl}),Preview:zo,zIndex:Y},nx={name:"Setpoint",key:"setpoint",Symbol:lo,Form:su,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...Z("Setpoint"),...bu,...vu}),Preview:io,zIndex:Y},rx={name:"Agitator",key:"agitator",Symbol:Do,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Agitator"),...le}),Preview:Vo,zIndex:Y},ox={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Io,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Propeller Agitator"),...le}),Preview:Zo,zIndex:Y},lx={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Fo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Flat Blade Agitator"),...le}),Preview:qo,zIndex:Y},ix={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Ho,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Paddle Agitator"),...le}),Preview:Yo,zIndex:Y},cx={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Uo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cross Beam Agitator"),...le}),Preview:Go,zIndex:Y},ax={name:"Helical Agitator",key:"helicalAgitator",Symbol:Wo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Helical Agitator"),...le}),Preview:Ko,zIndex:Y},ux={name:"Compressor",key:"compressor",Symbol:Qo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Compressor"),...le}),Preview:Xo,zIndex:Y},xx={name:"Text Box",key:"textBox",Symbol:Jo,Form:nu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...Z("Text Box"),...J,...ls,level:"p",text:"Text Box",width:75}),Preview:el,zIndex:Y},dx={name:"Off Page Reference",key:"offPageReference",Form:ru,Symbol:tl,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...Z("Off Page Reference")}),Preview:sl,zIndex:Y},px={value:Gu,button:Wu,tank:Bu,switch:Ku,offPageReference:dx,light:sx,setpoint:nx,box:Au,textBox:xx,valve:Lu,solenoidValve:Tu,threeWayValve:ku,fourWayValve:Mu,angledValve:$u,manualValve:Zu,needleValve:qu,reliefValve:Ou,angledReliefValve:Uu,checkValve:Hu,regulator:zu,electricRegulator:Du,pump:Nu,pistonPump:Ju,screwPump:_u,cavityPump:Xu,vacuumPump:Qu,staticMixer:ex,rotaryMixer:tx,burstDisc:Vu,cap:Iu,filter:Fu,orifice:Yu,agitator:rx,propellerAgitator:ox,flatBladeAgitator:lx,paddleAgitator:ix,crossBeamAgitator:cx,helicalAgitator:ax,compressor:ux},mx=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Do,AgitatorPreview:Vo,AngledReliefValve:fo,AngledReliefValvePreview:ho,AngledValve:Vr,AngledValvePreview:Ir,Box:Yr,BoxPreview:Ur,BurstDisc:eo,BurstDiscPreview:to,Button:Co,ButtonPreview:bo,Cap:so,CapPreview:no,CavityPump:Lo,CavityPumpPreview:To,CheckValve:po,CheckValvePreview:mo,Compressor:Qo,CompressorPreview:Xo,CrossBeamAgitator:Uo,CrossBeamAgitatorPreview:Go,ElectricRegulator:Xr,ElectricRegulatorPreview:Jr,Filter:co,FilterPreview:ao,FlatBladeAgitator:Fo,FlatBladeAgitatorPreview:qo,FourWayValve:zr,FourWayValvePreview:Dr,HelicalAgitator:Wo,HelicalAgitatorPreview:Ko,Light:Oo,LightPreview:zo,ManualValve:ro,ManualValvePreview:oo,NeedleValve:uo,NeedleValvePreview:xo,OffPageReference:tl,OffPageReferencePreview:sl,Orifice:jo,OrificePreview:go,PaddleAgitator:Ho,PaddleAgitatorPreview:Yo,PistonPump:Mo,PistonPumpPreview:$o,PropellerAgitator:Io,PropellerAgitatorPreview:Zo,Pump:Zr,PumpPreview:Fr,Regulator:Kr,RegulatorPreview:Qr,ReliefValve:Gr,ReliefValvePreview:Wr,RotaryMixer:Bo,RotaryMixerPreview:Ao,SYMBOLS:px,ScrewPump:vo,ScrewPumpPreview:wo,Setpoint:lo,SetpointPreview:io,SolenoidValve:Ar,SolenoidValvePreview:Or,StaticMixer:No,StaticMixerPreview:_o,Switch:Ro,SwitchPreview:yo,Tank:qr,TankPreview:Hr,TextBox:Jo,TextBoxPreview:el,ThreeWayValve:$r,ThreeWayValvePreview:Nr,VacuumPump:Po,VacuumPumpPreview:ko,Value:Eo,ValuePreview:So,Valve:_r,ValvePreview:Br,typeZ:yu},Symbol.toStringTag,{value:"Module"}));exports.Aether=c.main;exports.Dialog=c.use$4;exports.Divider=c.Divider$1;exports.Dropdown=c.Dropdown;exports.Haul=c.Haul;exports.Worker=c.Context$1;exports.compareArrayDeps=c.compareArrayDeps;exports.componentRenderProp=c.componentRenderProp;exports.isRenderProp=c.isRenderProp;exports.useAsyncEffect=c.useAsyncEffect;exports.useClickOutside=c.useClickOutside;exports.useCombinedRefs=c.useCombinedRefs;exports.useCombinedStateAndRef=c.useCombinedStateAndRef;exports.useDebouncedCallback=c.useDebouncedCallback;exports.useEffectCompare=c.useEffectCompare;exports.useMemoCompare=c.useMemoCompare;exports.useMemoDeepEqualProps=c.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=c.useMemoPrimitiveArray;exports.usePrevious=c.usePrevious;exports.useResize=c.useResize;exports.useStateRef=c.useStateRef;exports.useSyncedRef=c.useSyncedRef;exports.useTransforms=c.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ke.external;exports.DataType=C.g;exports.Density=C.b;exports.MultiSeries=C.Ct;exports.Rate=C.P;exports.Series=C.V;exports.TimeRange=C.E;exports.TimeSpan=C.y;exports.TimeStamp=C.m;exports.state=C.state;exports.Generic=D.Generic;exports.Align=jl.external;exports.Icon=ne.Icon;exports.Tabs=ne.external;exports.Button=gl.external;exports.Caret=Cs.Animated$1;exports.telem=j.external;exports.Color=Bt.external;exports.Text=de.external;exports.Triggers=bs.external;exports.List=$e.external;exports.createFilterTransform=$e.createFilterTransform;exports.fuseFilter=$e.fuseFilter;exports.proxyMemo=$e.proxyMemo;exports.createHexOpacityVariants=vs.createHexOpacityVariants;exports.unitProperty=vs.unitProperty;exports.Input=me.external;exports.Menu=hl.external;exports.Theming=El.external;exports.Tree=Sl.external;exports.Video=Rl.Video;exports.Accordion=Vl;exports.Breadcrumb=Fl;exports.Canvas=oi;exports.Channel=Ji;exports.Control=ua;exports.Device=fc;exports.Diagram=Fa;exports.Eraser=Hc;exports.Form=mc;exports.Label=Cc;exports.Legend=ui;exports.Line=di;exports.LinePlot=Di;exports.Log=Ha;exports.Measure=Fi;exports.Modal=vc;exports.Mosaic=Zc;exports.Nav=Gc;exports.Note=Kc;exports.OS=ta;exports.Observe=dc;exports.Override=na;exports.Pluto=ma;exports.Portal=_c;exports.Progress=ga;exports.Range=Ii;exports.Ranger=Ca;exports.Resize=$l;exports.Rule=qi;exports.Schematic=mx;exports.Select=Pi;exports.Status=bl;exports.Steps=va;exports.Synnax=Yl;exports.Tag=vi;exports.Telem=la;exports.Tooltip=vl;exports.Value=fu;exports.Viewport=zi;exports.axis=Gl;exports.control=Wl;
|
|
1
|
+
"use strict";var dx=Object.defineProperty;var xx=(e,t,n)=>t in e?dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ke=(e,t,n)=>xx(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Cek9Ww4S.cjs"),f=require("react"),g=require("./Toggle-Dim0E2D2.cjs"),x=require("./css-CvXvQo39.cjs"),qn=require("./external-DYc6fMZC.cjs"),Z=require("./aggregator-D6Mmsfj4.cjs"),X=require("./Pack-DBtBeGnj.cjs"),fx=require("./external-ClRKAhnQ.cjs"),be=require("./external-BPnNv3RZ.cjs"),px=require("./external-C2YHV6Dz.cjs"),_i=require("./Animated-C7iWxEah.cjs"),P=require("./LinePlot-Bwz2fEc0.cjs"),ne=require("zod"),_r=require("./external-Dhg4bEfF.cjs"),Me=require("./external-X9NMQ2Zh.cjs"),mx=require("./Text-GGA7QNwA.cjs"),ki=require("./external-Bksh4jhY.cjs");require("./Item-C1_OE8IF.cjs");const kr=require("react-dom"),nn=require("./external-BZpriFW_.cjs"),Pi=require("./units-6W_8ukD-.cjs"),He=require("./external-CKuO-iHz.cjs"),hx=require("./external-CUwDGrme.cjs"),gx=require("./external-aTGyndBd.cjs"),yx=require("./external-e143l3cy.cjs"),Sx=require("./Video-B3geSdOZ.cjs"),Ni=({variant:e,...t})=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{color:g.variantColors[e],style:{color:g.variantColors[e]},...t}),Ex=({status:{key:e,time:t,count:n,message:s,description:r,variant:o},silence:i,actions:c,className:a,children:d,...u})=>l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS(x.CSS.B("notification"),a),direction:"y",empty:!0,...u,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",size:"small",children:[l.jsxRuntimeExports.jsx(Ni,{style:{height:"2.25rem",width:"2.5rem"},variant:o}),l.jsxRuntimeExports.jsx(g.Text,{level:"small",shade:7,children:`x${n}`}),l.jsxRuntimeExports.jsx(g.DateTime,{className:x.CSS(x.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>i(e),children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})})]}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",align:"start",className:x.CSS(x.CSS.BE("notification","content")),size:"small",children:[d??l.jsxRuntimeExports.jsx(g.Text,{className:x.CSS(x.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&l.jsxRuntimeExports.jsx(g.Text,{className:x.CSS(x.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&l.jsxRuntimeExports.jsx(X.Space,{direction:"x",align:"center",justify:"end",className:x.CSS(x.CSS.BE("notification","actions")),children:Z.A(c).map(p=>l.jsxRuntimeExports.jsx(jx,{action:p},p.key))})]},t.toString()),jx=({action:e})=>{if(!f.isValidElement(e)){const t=e;return l.jsxRuntimeExports.jsx(g.Button,{...t})}return e},Rx=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:g.Aggregator,Circle:Ni,Notification:Ex,Text:g.Text$2,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:g.useAggregator,useContext:g.useContext$2,useNotifications:g.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),bx=Object.freeze(Object.defineProperty({__proto__:null,Config:g.Config,Context:g.Context,Dialog:g.Dialog$1,chooseLocation:g.chooseLocation,formatTip:g.formatTip,useConfig:g.useConfig,wrap:g.wrap},Symbol.toStringTag,{value:"Module"})),es=e=>e.preventDefault(),Ss=f.forwardRef(({location:e,style:t,size:n,className:s,children:r,onDragStart:o,sizeUnits:i="px",showHandle:c=!0,...a},d)=>{const u=x.J.construct(e),p=x.J.direction(u),m=x.g.dimension(p);return l.jsxRuntimeExports.jsxs("div",{className:x.CSS(x.CSS.B("resize"),x.CSS.loc(u),x.CSS.dir(p),s),style:{[m]:`${n}${i}`,...t},ref:d,...a,children:[r,c&&l.jsxRuntimeExports.jsx("div",{draggable:!0,className:x.CSS(x.CSS.BE("resize","handle"),x.CSS.bordered(x.J.swap(u))),onDragStart:o,onDrag:es,onDragEnd:es})]})});Ss.displayName="Resize.Core";const Pr=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const o=f.useRef(null),[i,c]=f.useState({sizeDistribution:wx(n,t),root:null}),a=f.useCallback((p,m,h)=>{if(o.current==null)return;const E=x.Eo.dim(x.Eo.construct(o.current),r);c(y=>Vs(y,E,p,s,m,h))},[s,c,r]);f.useEffect(()=>e==null?void 0:e(i.sizeDistribution),[i.sizeDistribution,e]);const d=f.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",E=w=>a(m,w[h]),y=()=>{c(w=>({...w,root:null})),document.removeEventListener("mousemove",E)};c(w=>({...w,root:p[h]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",y,{once:!0})},[c,r,Vs]);return{setSize:f.useCallback((p,m)=>a(p,void 0,m),[Vs]),props:{direction:r,sizeDistribution:i.sizeDistribution,onDragHandle:d,ref:o}}},Es=f.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:s,className:r,...o},i)=>{const c=x.g.construct(e),a=f.Children.toArray(t);return n=Cx(n),l.jsxRuntimeExports.jsx(X.Space,{...o,ref:i,direction:c,className:x.CSS(x.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:a.map((d,u)=>l.jsxRuntimeExports.jsx(Ss,{onDragStart:p=>s(p,u),location:x.g.location(c),size:n[u]*100,sizeUnits:"%",showHandle:u!==a.length-1,children:d},u))})});Es.displayName="Resize.Multiple";const wx=(e,t)=>{const n=e.reduce((r,o)=>r+o,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},Is=.001,Cx=e=>e.every(t=>x.W.closeTo(t,1/e.length),Is)?e.map((t,n)=>n%2===0?t+Is:n===e.length-1?t:t-Is):e,Vs=(e,t,n,s,r,o)=>{const i=Mi(e,t,n,r,o),[c,a]=vx(e.sizeDistribution,n,i,s/t),d=a?r??null:e.root;return{...e,sizeDistribution:c,root:d}},Mi=(e,t,n,s,r)=>{let o;if(r!=null)r>1&&(r=r/t),o=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");o=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return o},vx=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const o=e[r]+n,i=_x(r,e,s,n),c=e[i]-n;return o<s||c<s?[e,!1]:[e.map((a,d)=>d===r?o:d===i?c:a),!0]},_x=(e,t,n,s)=>(e===t.length-1?Px:kx)(e,t,n,s),kx=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},Px=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},js=({onMove:e,onStart:t,onEnd:n})=>f.useCallback(s=>{s.preventDefault();const r=x.q.construct(s),o=g.mouseKey(s.button);t==null||t(r,o,s);const i=a=>{if(a.buttons===0)return c(a);const d=x.q.construct(a);e==null||e(x.Eo.construct(r,d),o,a)};window.addEventListener("mousemove",i);const c=a=>{window.removeEventListener("mousemove",i);const d=x.q.construct(a);n==null||n(x.Eo.construct(r,d),o,a)};window.addEventListener("mouseup",c,{once:!0})},[e,t,n]),Fs=2,Ti=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:o=200,collapseThreshold:i=1/0,className:c,...a})=>{const[d,u]=f.useState(x.j(o,s,r)),p=f.useRef(null),m=x.J.construct(n),h=f.useCallback(v=>{if(p.current===null)return 0;const R=x.Eo.dim(v,x.J.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),b=p.current+R,_=x.j(b,s,r);return(_-b)/s>i?Fs:_},[m,s,r,i]),E=f.useRef(null),y=f.useCallback(v=>{const R=h(v);u(R),E.current!=null&&(t==null||t(R,x.Eo.construct(E.current)))},[t,h]),w=f.useCallback(()=>u(v=>(p.current=v,v)),[u]),j=f.useCallback(v=>h(v)===Fs&&(e==null?void 0:e()),[e,h]);f.useEffect(()=>u(v=>{const R=x.j(v,s,r);return p.current=R,R}),[s,r]);const C=js({onMove:y,onStart:w,onEnd:j});return l.jsxRuntimeExports.jsx(Ss,{ref:E,location:m,size:d,onDragStart:C,className:x.clsx(c,x.CSS.expanded(d!==Fs)),...a})},Nx=Object.freeze(Object.defineProperty({__proto__:null,Core:Ss,Multiple:Es,Single:Ti,calculateDiffPercentage:Mi,useMultiple:Pr},Symbol.toStringTag,{value:"Module"})),Yn="y",bo=28,Mx=32,Tx=40,Ax=.5,Lx=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...o}}=Pr({direction:Yn,count:e.length,minSize:bo}),i=c=>{if(r.current==null)return;const a=x.Eo.dim(x.Eo.construct(r.current),Yn);s[c]<Tx/a?n(c,e[c].initialSize??Ax):n(c,bo+1)};return l.jsxRuntimeExports.jsx(Es,{empty:!0,className:x.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...o,children:e.map((c,a)=>f.createElement(Dx,{...c,key:c.key,index:a,direction:Yn,onExpand:i,parent:r,size:s[a]}))})},$x=l.jsxRuntimeExports.jsx(g.Qt.Caret.Down,{"aria-label":"contract"}),Ox=l.jsxRuntimeExports.jsx(g.Qt.Caret.Right,{"aria-label":"expand"}),Dx=({index:e,name:t,content:n,actions:s,size:r,parent:o,onExpand:i})=>{let c=!0;if(o.current!=null){const d=x.Eo.dim(x.Eo.construct(o.current),Yn);c=r*d>Mx}const a=c?$x:Ox;return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsxs(qn.Header,{level:"p",className:x.CSS.expanded(c),empty:!0,children:[l.jsxRuntimeExports.jsx(qn.ButtonTitle,{startIcon:a,onClick:()=>i(e),children:t}),s!=null&&l.jsxRuntimeExports.jsx(qn.Actions,{children:s})]}),n]})},zx=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Lx},Symbol.toStringTag,{value:"Module"})),Ai=(e,t,n)=>Z.A(e).map(o=>o.split(t)).flat().map((o,i)=>[l.jsxRuntimeExports.jsx(g.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:x.CSS.shade(n)}},`${o}-${i}`),o]).flat(),Bx=({children:e,icon:t,shade:n=7,weight:s=450,size:r=.5,url:o,level:i="p",separator:c=".",className:a,hideFirst:d=!1,...u})=>{o!=null&&(e=o);const p=Ai(e,c,n);return d&&p.shift(),l.jsxRuntimeExports.jsxs(g.WithIcon,{className:x.CSS(a,x.CSS.B("breadcrumb")),level:i,shade:n,weight:s,size:r,...u,children:[be.resolve(t),...p]})},Ix=({url:e,className:t,level:n="p",separator:s=".",shade:r=7})=>{const o=Ai(e,s,r);return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(t,x.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:o.map((i,c)=>{if(g.isValidElement(i))return i;if(i==null)return null;const d=e.split(s).indexOf(i);let u=e.split(s).slice(0,d+1).join("/");return u="/"+u,l.jsxRuntimeExports.jsx(g.Link,{level:n,href:u,children:i.split("-").map(p=>x._$1.capitalize(p)).join(" ")},c)})})},Vx=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Bx,URL:Ix},Symbol.toStringTag,{value:"Module"})),Nr=f.createContext(P.ZERO_CONTEXT_VALUE),Ye=()=>f.useContext(Nr).synnax,Fx=()=>f.useContext(Nr).state,wo={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Li="serverVersionMismatch",Zx=(e,t,n)=>`Cluster version ${n!=null?n+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,$i=g.wrap$1(P.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,r,o]=g.useCombinedStateAndRef(P.ZERO_CONTEXT_VALUE),[{path:i},,c]=g.use$3({aetherKey:e,type:P.Provider.TYPE,schema:P.Provider.stateZ,initialState:{props:t??null,state:null}}),a=g.useAggregator(),d=f.useCallback(u=>{o.current.state.status!==u.status&&a({variant:wo[u.status],message:u.message??x._$1.capitalize(u.status)}),r(p=>({...p,state:u}))},[a]);return g.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return r(P.ZERO_CONTEXT_VALUE);const u=new Z.Lf({...t,connectivityPollFrequency:Z.k.seconds(5)});r({synnax:u,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:u.clientVersion}});const p=await u.connectivity.check();if(r({synnax:u,state:p}),a({variant:wo[p.status],message:p.message??p.status.toUpperCase()}),p.status==="connected"&&!p.clientServerCompatible){const m=p.nodeVersion==null||Z.H.semVerOlder(p.nodeVersion,p.clientVersion),h=Zx(m,p.clientVersion,p.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:h,data:{type:Li,oldServer:m,nodeVersion:p.nodeVersion,clientVersion:p.clientVersion}})}return u.connectivity.onChange(d),c({props:t,state:p}),()=>{u.close(),r(P.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,d]),l.jsxRuntimeExports.jsx(Nr.Provider,{value:s,children:l.jsxRuntimeExports.jsx(g.Composite,{path:i,children:n})})}),Hx=Object.freeze(Object.defineProperty({__proto__:null,Provider:$i,SERVER_VERSION_MISMATCH:Li,use:Ye,useConnectionState:Fx},Symbol.toStringTag,{value:"Module"})),sn=f.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Oi=()=>f.useContext(sn),Di=e=>{const{aliases:t}=f.useContext(sn);return t[e]??null},Rs=()=>{const{aliases:e}=f.useContext(sn);return e},bs=(e,t="")=>{const{getName:n}=f.useContext(sn),[s,r]=f.useState(t);return g.useAsyncEffect(async()=>{const o=await n(e);o!=null&&r(o)},[e,n]),s??t},Mr=()=>{const{activeRange:e}=f.useContext(sn);return e??void 0},zi=({activeRange:e,children:t})=>{const n=Ye(),[s,r]=f.useState({}),o=f.useCallback(a=>{r(d=>{const u={...d};return a.forEach(({variant:p,key:m,value:h})=>{const E=Number(m.split("---")[1]);p==="delete"?delete u[E]:u[h.channel]=h.alias}),u})},[r]),i=f.useCallback(async(a,d)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,d)},[n,e]),c=f.useCallback(async a=>{if(n==null||a===0)return;const d=s[a];return d??(await n.channels.retrieve(a)).name},[s,n]);return g.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),d=await a.listAliases();r(d);const u=await a.openAliasTracker(),p=u.onChange(o);return()=>{p(),u.close()}},[n,e]),l.jsxRuntimeExports.jsx(sn.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?i:null,getName:c},children:t})},qx=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[o,i]=f.useState(!1),{setAlias:c}=Oi(),a=Di(e),d=bs(e);let u=l.jsxRuntimeExports.jsx(g.Qt.Rename,{});o?u=l.jsxRuntimeExports.jsx(g.Qt.Loading,{}):a===t&&(u=l.jsxRuntimeExports.jsx(g.Qt.Check,{}));const p=c!=null&&!o&&a!==t&&e!==0,m=()=>{p&&(async()=>(i(!0),await c(e,t),i(!1)))()},h=()=>{var y;a!=null&&((y=r.onChange)==null||y.call(r,a))},E=()=>e===0?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Alias synced with this label"}):l.jsxRuntimeExports.jsxs(g.Text,{level:"small",children:["Sync alias for ",d," with this label"]});return l.jsxRuntimeExports.jsxs(g.Text$1,{value:t,...r,children:[p&&l.jsxRuntimeExports.jsx(g.Icon,{onClick:h,tooltip:l.jsxRuntimeExports.jsxs(g.Text,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:l.jsxRuntimeExports.jsx(g.Qt.Sync,{})}),l.jsxRuntimeExports.jsx(g.Icon,{onClick:m,disabled:!p,tooltip:l.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:u})]})},Qe="channel";var Co=180/Math.PI,rr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bi(e,t,n,s,r,o){var i,c,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*Co,skewX:Math.atan(a)*Co,scaleX:i,scaleY:c}}var On;function Yx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rr:Bi(t.a,t.b,t.c,t.d,t.e,t.f)}function Ux(e){return e==null||(On||(On=document.createElementNS("http://www.w3.org/2000/svg","g")),On.setAttribute("transform",e),!(e=On.transform.baseVal.consolidate()))?rr:(e=e.matrix,Bi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ii(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function o(d,u,p,m,h,E){if(d!==p||u!==m){var y=h.push("translate(",null,t,null,n);E.push({i:y-4,x:P.interpolateNumber(d,p)},{i:y-2,x:P.interpolateNumber(u,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function i(d,u,p,m){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:P.interpolateNumber(d,u)})):u&&p.push(r(p)+"rotate("+u+s)}function c(d,u,p,m){d!==u?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:P.interpolateNumber(d,u)}):u&&p.push(r(p)+"skewX("+u+s)}function a(d,u,p,m,h,E){if(d!==p||u!==m){var y=h.push(r(h)+"scale(",null,",",null,")");E.push({i:y-4,x:P.interpolateNumber(d,p)},{i:y-2,x:P.interpolateNumber(u,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,u){var p=[],m=[];return d=e(d),u=e(u),o(d.translateX,d.translateY,u.translateX,u.translateY,p,m),i(d.rotate,u.rotate,p,m),c(d.skewX,u.skewX,p,m),a(d.scaleX,d.scaleY,u.scaleX,u.scaleY,p,m),d=u=null,function(h){for(var E=-1,y=m.length,w;++E<y;)p[(w=m[E]).i]=w.x(h);return p.join("")}}}var Gx=Ii(Yx,"px, ","px)","deg)"),Wx=Ii(Ux,", ",")",")"),Kx=1e-12;function vo(e){return((e=Math.exp(e))+1/e)/2}function Xx(e){return((e=Math.exp(e))-1/e)/2}function Qx(e){return((e=Math.exp(2*e))-1)/(e+1)}const Jx=function e(t,n,s){function r(o,i){var c=o[0],a=o[1],d=o[2],u=i[0],p=i[1],m=i[2],h=u-c,E=p-a,y=h*h+E*E,w,j;if(y<Kx)j=Math.log(m/d)/t,w=function($){return[c+$*h,a+$*E,d*Math.exp(t*$*j)]};else{var C=Math.sqrt(y),v=(m*m-d*d+s*y)/(2*d*n*C),R=(m*m-d*d-s*y)/(2*m*n*C),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(R*R+1)-R);j=(_-b)/t,w=function($){var O=$*j,N=vo(b),D=d/(n*C)*(N*Qx(t*O+b)-Xx(b));return[c+D*h,a+D*E,d*N/vo(t*O+b)]}}return w.duration=j*1e3*t/Math.SQRT2,w}return r.rho=function(o){var i=Math.max(.001,+o),c=i*i,a=c*c;return e(i,c,a)},r}(Math.SQRT2,2,4),ef=Object.freeze(Object.defineProperty({__proto__:null,Canvas:P.Canvas,axisStateZ:P.axisStateZ,newTickFactory:P.newTickFactory,tickFactoryProps:P.tickFactoryProps,tickType:P.tickType},Symbol.toStringTag,{value:"Module"})),tf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:P.AcquireChannelControl,AuthoritySource:P.AuthoritySource,Chip:P.Chip,Controller:P.Controller$1,Indicator:P.Indicator,Legend:P.Legend,REGISTRY:P.REGISTRY$3,STATUSES:P.STATUSES,SetChannelValue:P.SetChannelValue,StateProvider:P.StateProvider,acquireChannelControl:P.acquireChannelControl,acquireChannelControlPropsZ:P.acquireChannelControlPropsZ,authoritySource:P.authoritySource,authoritySourceProps:P.authoritySourceProps,chipStateZ:P.chipStateZ,controllerStateZ:P.controllerStateZ,indicatorStateZ:P.indicatorStateZ,legendStateZ:P.legendStateZ,setChannelValue:P.setChannelValue,setChannelValuePropsZ:P.setChannelValuePropsZ,stateProviderStateZ:P.stateProviderStateZ,statusZ:P.statusZ,sugaredStateZ:P.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),nf={region:x.Eo.ZERO,dpr:1,os:Z.w.getOS()},sf={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},rf=g.wrap$1(P.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...r})=>{const[{path:o},{bootstrapped:i,dpr:c},a]=g.use$3({aetherKey:n,type:P.Canvas$1.TYPE,schema:P.canvasStateZ,initialState:nf}),d=f.useRef({...sf}),u=f.useCallback(h=>{d.current.bootstrapped&&a(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})}))},[a]),p=g.useResize(u,{debounce:t});f.useEffect(()=>{const h=()=>{window.devicePixelRatio!==c&&a(E=>({...E,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",h,{once:!0})},[c]),f.useEffect(()=>{window.addEventListener("focus",()=>a(h=>({...h}))),window.addEventListener("blur",()=>a(h=>({...h})))},[a]);const m=f.useCallback(h=>{if(p(h),h==null)return;h.className.includes("gl")?d.current.gl=h:h.className.includes("upper2d")?d.current.upper2d=h:d.current.lower2d=h;const{gl:E,lower2d:y,upper2d:w,bootstrapped:j}=d.current;if(E==null||y==null||w==null||j)return;d.current.bootstrapped=!0;const C=E.transferControlToOffscreen(),v=w.transferControlToOffscreen(),R=y.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:v,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:x.Eo.construct(E),dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})},[C,v,R])},[a]);return l.jsxRuntimeExports.jsxs("div",{className:x.CSS(x.CSS.B("canvas-container"),s),...r,children:[l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","lower2d"))}),l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","gl"))}),l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","upper2d"))}),l.jsxRuntimeExports.jsx(g.Composite,{path:o,children:i&&e})]})}),ws=(e,t)=>g.useResize(f.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(x.k$2.XY.translate(x.q.scale(x.Eo.topLeft(r),-1)).box(n),s)},[e]),t),of=Object.freeze(Object.defineProperty({__proto__:null,Canvas:rf,useRegion:ws},Symbol.toStringTag,{value:"Module"})),Vi=f.createContext(null),ot=e=>{const t=f.useContext(Vi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Fi=e=>{const t=ot("Viewport"),{addViewportHandler:n}=t;f.useEffect(()=>n(e),[n,e])},Mn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=ot(t),{key:r}=e;return g.useEffectCompare(()=>{x.J.outer.parse(e.loc),n(e)},([c],[a])=>Z._.equal(c,a),[e]),f.useEffect(()=>()=>s(r),[]),{gridArea:x.g.swap(x.J.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Zi=g.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=x.q.ZERO,children:r,hold:o=!1,onHold:i,visible:c,...a})=>{const[d,u]=f.useState([]),p=g.useMemoDeepEqualProps({clearOverScan:s,hold:o,visible:c}),[{path:m},{grid:h},E]=g.use$3({aetherKey:e,type:P.LinePlot.TYPE,schema:P.linePlotStateZ,initialState:{container:x.Eo.ZERO,viewport:x.Eo.DECIMAL,grid:{},...p}});f.useEffect(()=>E(T=>({...T,...p})),[p]);const y=f.useRef(new Map),w=f.useCallback(T=>(y.current.set(T,null),()=>y.current.delete(T)),[y]),j=f.useCallback(T=>{const{mode:M,box:z,stage:S}=T;(M==="pan"&&S!=="start"||M==="zoom"||M==="zoomReset"&&S==="start")&&E(L=>({...L,viewport:z})),y.current.forEach((L,k)=>k(T))},[E]),C=f.useCallback(T=>E(M=>({...M,container:T})),[E]),v=ws(C,{debounce:n}),R=f.useCallback(T=>E(M=>({...M,grid:{...M.grid,[T.key]:T}})),[E]),b=f.useCallback(T=>E(M=>{const{[T]:z,...S}=M.grid;return{...M,grid:S}}),[E]),_=f.useCallback(T=>{u(M=>[...M.filter(({key:z})=>z!==T.key),T])},[u,j]),$=f.useCallback(T=>u(M=>M.filter(({key:z})=>z!==T)),[_]),O=f.useMemo(()=>lf(h),[h]),N=f.useCallback(T=>{E(M=>({...M,hold:T})),i==null||i(T)},[E,i]),D=f.useMemo(()=>({lines:d,setGridEntry:R,removeGridEntry:b,setLine:_,removeLine:$,setViewport:j,addViewportHandler:w,setHold:N}),[d,R,b,_,$,j,w,N]);return l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("line-plot"),style:{...t,...O},ref:v,...a,children:l.jsxRuntimeExports.jsx(Vi.Provider,{value:D,children:l.jsxRuntimeExports.jsx(g.Composite,{path:m,children:r})})})}),lf=e=>{const t=x.CSS.newGridBuilder();return P.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),P.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),P.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),P.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},Tr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?P.XAxis.TYPE:P.YAxis.TYPE,s=`${e}-axis`;return g.wrap$1(n,({aetherKey:r,children:o,location:i=t,label:c="",labelLevel:a="small",labelDirection:d=e,onLabelChange:u,color:p,labelSize:m,showGrid:h,type:E,bounds:y,className:w,tickSpacing:j,autoBounds:C,autoBoundUpdateInterval:v,onAutoBoundsChange:R,style:b,..._})=>{const $=((c==null?void 0:c.length)??0)>0,O=g.useMemoDeepEqualProps({location:i,showGrid:h,type:E,bounds:y,label:c,labelDirection:d,tickSpacing:j,autoBounds:C,autoBoundUpdateInterval:v}),[{path:N},{size:D,labelSize:T,...M},z]=g.use$3({aetherKey:r,type:n,schema:P.coreAxisStateZ,initialState:O});f.useEffect(()=>z(I=>({...I,...O})),[O]),f.useEffect(()=>{const{lower:I,upper:B}=P.parseAutoBounds(M.autoBounds);M.bounds!=null&&(I&&(y==null?void 0:y.lower)!==M.bounds.lower||B&&(y==null?void 0:y.upper)!==M.bounds.upper)&&(R==null||R(M.bounds))},[M.autoBounds,M.bounds]);const S=Mn({loc:i,key:`${n}-${r}`,size:D+T,order:1},`${e.toUpperCase()}Axis`),L=g.useTypography(a).toString(),k=f.useRef(0);return f.useEffect(()=>{if(e==="y"){if(c==null)return;let B=Z.dimensions(c,L)[x.g.dimension(x.g.construct(d))];B>0&&(B+=9),z(A=>({...A,labelSize:B}))}else{let B=Z.dimensions(c,L).height*1.3;B>0&&(B+=12);const A=k.current;P.withinSizeThreshold(A,B)||(k.current=B,z(V=>({...V,labelSize:B})))}},[c,d,L]),l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(w,x.CSS.B("axis"),x.CSS.B(s),x.CSS.loc(i)),style:{...b,...S},align:"center",justify:i!=="left"?"end":"start",direction:x.g.swap(e),..._,children:$&&l.jsxRuntimeExports.jsx(g.MaybeEditable,{className:x.CSS(x.CSS.BE("axis","label"),x.CSS.dir(d)),value:c,onChange:u,level:a})}),l.jsxRuntimeExports.jsx(g.Composite,{path:N,children:o})]})})},Hi=Tr("x"),qi=Tr("y"),Yi=x.q.xy.extend({root:x.J.corner,units:ne.z.object({x:ne.z.enum(["px","decimal"]),y:ne.z.enum(["px","decimal"])})}),cf=Yi.partial({root:!0,units:!0}),af=e=>{var n,s,r,o;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((o=e==null?void 0:e.units)==null?void 0:o.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},uf=(e,t)=>{var o,i,c,a,d,u;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=x.Eo.construct(t.current),r=x.Eo.construct(t.current.parentElement);return((o=e.units)==null?void 0:o.x)==="decimal"?((i=e.root)==null?void 0:i.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+x.Eo.width(s))/x.Eo.width(r):n.x/=x.Eo.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((d=e.root)==null?void 0:d.y)==="bottom"&&(n.y=1-e.y):((u=e.root)==null?void 0:u.y)==="bottom"?n.y=1-(e.y+x.Eo.height(s))/x.Eo.height(r):n.y/=x.Eo.height(r),n},Ui=(e,t)=>{if(t.current==null)return null;const n=x.Eo.construct(t.current.parentElement),s=x.Eo.construct(t.current),r={x:e.x,y:e.y,root:{...x.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*x.Eo.width(n)-x.Eo.width(s),r.root.x="right"):e.x<.2?r.x=e.x*x.Eo.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*x.Eo.height(n)-x.Eo.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*x.Eo.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...x.q.truncate(r,3)}},_o=x.Eo.reRoot(x.Eo.DECIMAL,x.J.TOP_LEFT),Ar=f.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...o})=>{const[i,c]=Z.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:x.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=f.useRef(i),d=g.useSyncedRef(r===!1),u=f.useRef(null);i!==null&&(s={...s,...af(i)});const p=f.useCallback(h=>{var R;if(((R=u.current)==null?void 0:R.parentElement)==null)return a.current;const E=x.Eo.construct(u.current.parentElement),y=x.k$2.XY.scale(E).scale(_o),w=y.box(x.Eo.construct(u.current)),j=x.k$2.XY.clamp(x.Eo.construct(x.Eo.topLeft(_o),{width:1-x.Eo.width(w),height:1-x.Eo.height(w)})),C=x.q.translate(x.q.construct(a.current),x.Eo.signedDims(y.box(h))),v=j.pos(C);return Ui(v,u)},[]),m=js({onStart:f.useCallback(()=>{a.current=uf(a.current,u)},[]),onMove:f.useCallback(h=>{if(d.current)return;const E=p(h);E!==null&&c(E)},[]),onEnd:f.useCallback(h=>{if(d.current)return;const E=p(h);E!==null&&(a.current=E)},[])});return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(e,x.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:u,...o,onDrag:es,onDragEnd:es,empty:!0})});Ar.displayName="Legend.Container";const Lr=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:o})=>l.jsxRuntimeExports.jsxs(X.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[l.jsxRuntimeExports.jsx(_r.Swatch,{value:r,onChange:i=>t==null?void 0:t({key:s,color:i,label:o}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),l.jsxRuntimeExports.jsx(g.MaybeEditable,{level:"small",value:o,onChange:i=>t==null?void 0:t({key:s,color:r,label:i}),noWrap:!0})]},s)),$r=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[o,i]=f.useState(!1);return e.length===0?null:l.jsxRuntimeExports.jsx(Ar,{...r,draggable:!o,value:n,onChange:s,children:Lr(e,t,i)})},df=Object.freeze(Object.defineProperty({__proto__:null,Container:Ar,Simple:$r,calcStickyPos:Ui,completeStickyXYz:Yi,legendSwatches:Lr,stickyXYz:cf},Symbol.toStringTag,{value:"Module"})),Gi=({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=ot("Legend");return ot("Legend"),l.jsxRuntimeExports.jsx($r,{data:r,onEntryChange:n,...s})},xf=({onLineChange:e})=>{const{lines:t}=ot("Legend"),n=g.useUniqueKey(),s=Mn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Lr(t,e)})},Wi=({variant:e="floating",...t})=>e==="floating"?l.jsxRuntimeExports.jsx(Gi,{...t}):l.jsxRuntimeExports.jsx(xf,{...t}),Ki=g.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=g.use$3({aetherKey:e,type:P.Line.TYPE,schema:P.stateZ,initialState:t}),s=g.useMemoDeepEqualProps(t);return f.useLayoutEffect(()=>n(s),[s]),null}),ff=Object.freeze(Object.defineProperty({__proto__:null,Line:Ki},Symbol.toStringTag,{value:"Module"})),Or=g.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:r,removeLine:o}=ot("Line");return f.useEffect(()=>(r({key:e,color:t,label:n}),()=>o(e)),[n,t]),l.jsxRuntimeExports.jsx(Ki,{aetherKey:e,color:t,label:n,...s})}),Xi=({level:e="h2",...t})=>{const n=g.useUniqueKey(),s=g.useTypography(e),r=Mn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return l.jsxRuntimeExports.jsx(X.Space,{justify:"center",align:"center",style:r,children:l.jsxRuntimeExports.jsx(g.MaybeEditable,{...t,level:e})})},Qi=g.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=g.use$3({aetherKey:e,type:P.Tooltip.TYPE,schema:P.tooltipStateZ,initialState:{position:null}}),n=f.useRef(null),s=f.useCallback(o=>{const i=document.querySelector(".pluto-canvas-container");if(i==null)return;const c=x.Eo.topLeft(i);t({position:x.q.translation(c,x.q.construct(o))})},[t]),r=f.useCallback(()=>t({position:null}),[t]);return f.useEffect(()=>{if(n.current===null)return;const o=n.current.parentElement;if(o!=null)return o.addEventListener("mousemove",s),o.addEventListener("mouseleave",r),()=>{o.removeEventListener("mousemove",s),o.removeEventListener("mouseleave",r)}},[s]),l.jsxRuntimeExports.jsx("span",{ref:n})}),pf=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Qi},Symbol.toStringTag,{value:"Module"})),mf={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Dr=f.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:r,...o},i)=>l.jsxRuntimeExports.jsxs("div",{ref:i,className:x.CSS(x.CSS.noSelect,x.CSS.BE("viewport-mask","container"),e),style:{cursor:mf[t],...r},...o,children:[l.jsxRuntimeExports.jsx("div",{style:{...x.Eo.css(n),display:x.Eo.areaIsZero(n)?"none":"block"},className:x.CSS.BE("viewport-mask","selection")}),s]}));Dr.displayName="ZoomPanMask";const hf=[{key:"start",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Left,{})},{key:"center",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Center,{})},{key:"end",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Right,{})}],gf=({key:e,entry:t,onClick:n,selected:s})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),zr=({children:e=gf,...t})=>l.jsxRuntimeExports.jsx(Me.Button,{...t,allowMultiple:!1,data:hf,children:e}),yf=new Set([Z.g.UUID,Z.g.JSON]),Sf=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:yf.has(e)?e.toString().toUpperCase():x._$1.capitalize(e.toString())})),Ef=[{key:"name",name:"Name"}],jf=e=>l.jsxRuntimeExports.jsx(Me.DropdownButton,{...e,data:Sf,columns:Ef,entryRenderKey:"name"}),Rf=[{key:"x",icon:l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{})},{key:"y",icon:l.jsxRuntimeExports.jsx(g.Qt.Arrow.Up,{})}],bf=({key:e,entry:t,onClick:n,selected:s})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),wf=({children:e=bf,...t})=>l.jsxRuntimeExports.jsx(Me.Button,{...t,allowMultiple:!1,data:Rf,children:e}),Ji=e=>l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS.BE("select","clear"),variant:"outlined",...e,children:l.jsxRuntimeExports.jsx(g.Qt.Close,{"aria-label":"clear"})}),gt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:r,emptyContent:o,inputProps:i,allowNone:c=!0,searcher:a,className:d,variant:u="button",hideColumnHeader:p=!1,disabled:m,omit:h,children:E,dropdownVariant:y="connected",placeholder:w=Cs,inputPlaceholder:j=w,triggerTooltip:C,dropdownZIndex:v,filter:R,actions:b,..._})=>{const{visible:$,open:O,close:N,toggle:D}=g.use$2(),[T,M]=f.useState(null),z=a!=null;g.useAsyncEffect(async()=>{if(g.selectValueIsZero(t))return M(null);if((T==null?void 0:T.key)===t)return;let B=null;if(z)try{[B]=await a.retrieve([t])}finally{B??(B=null)}else r!=null&&(B=r.find(A=>A.key===t)??null);M(B)},[a,t,r]);const S=f.useCallback((B,A)=>{Array.isArray(B)||(M(B==null?null:A.entries[0]),N(),e(B,A))},[e,c]),L=f.useMemo(()=>z?g.Search:nn.Filter,[z]),k=l.jsxRuntimeExports.jsx(L,{searcher:a,filter:R,children:({onChange:B})=>l.jsxRuntimeExports.jsx(Cf,{autoFocus:y==="modal",variant:u,onChange:B,onFocus:O,selected:T,entryRenderKey:n,visible:$,allowNone:c,className:d,disabled:m,placeholder:j,children:b})}),I=l.jsxRuntimeExports.jsx(g.Button,{tooltip:C,variant:"outlined",onClick:D,disabled:m,children:T!=null?el(n,T):w});return l.jsxRuntimeExports.jsx(Me.Core,{close:N,zIndex:v,open:O,data:r,omit:h,emptyContent:o,allowMultiple:!1,visible:$,value:t,hideColumnHeader:p,onChange:S,allowNone:c,columns:s,listItem:E,variant:y,trigger:y!=="modal"?k:I,extraDialogContent:y==="modal"?k:void 0,keepMounted:!1,..._})},Cs="Select",el=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Cf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:o=!0,placeholder:i=Cs,className:c,disabled:a,...d})=>{const{clear:u}=g.useSelectionUtils(),[p,m]=f.useState("");f.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return m("");t!=null&&m(el(e,t))}},[t,n,e]);const h=j=>{s(j),m(j)},E=()=>{p===""&&s(""),m(""),r==null||r()},y=j=>{n||(j.preventDefault(),r==null||r())},w=()=>{m(""),u==null||u()};return l.jsxRuntimeExports.jsx(g.Text$1,{className:x.CSS(x.CSS.BE("select","input"),c),value:p,onChange:h,onFocus:E,onKeyDown:g.matchCallback([["Enter"]],j=>{j.preventDefault(),!n&&(r==null||r())}),endContent:l.jsxRuntimeExports.jsx(_i.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:y,placeholder:i,disabled:a,...d,children:o&&l.jsxRuntimeExports.jsx(Ji,{onClick:w,disabled:a})})},wn=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:o,onDragStart:i,...c})=>{const a=x.cssString(n);s==null&&n!=null&&(s=l.jsxRuntimeExports.jsx(g.Qt.Circle,{fill:a}));const d=r==null?void 0:l.jsxRuntimeExports.jsx(g.Icon,{"aria-label":"close",size:"small",className:x.CSS.BE("tag","close"),onClick:u=>{u.stopPropagation(),r()},children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})});return l.jsxRuntimeExports.jsx(g.WithIcon,{startIcon:s,endIcon:d,className:x.CSS(o,x.CSS.B("tag"),r!=null&&x.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:i,...c,children:e})},vf=Object.freeze(Object.defineProperty({__proto__:null,Tag:wn},Symbol.toStringTag,{value:"Module"})),rn=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:o="key",emptyContent:i,searcher:c,renderTag:a=g.componentRenderProp(tl),placeholder:d,onTagDragStart:u,allowMultiple:p,allowNone:m,replaceOnSingle:h,onTagDragEnd:E,style:y,addPlaceholder:w="Add",children:j,dropdownVariant:C="connected",actions:v,...R})=>{const{visible:b,open:_,close:$}=g.use$2(),[O,N]=f.useState([]),[D,T]=f.useState(!1),M=c!=null;g.useAsyncEffect(async()=>{T(!0),g.selectValueIsZero(t)&&N([]);const I=O.map(V=>V.key),B=Z.A(t);if(Z.F.unorderedPrimitiveArrays(I,B)===Z.F.EQUAL)return;let A=[];if(M)try{A=await c.retrieve(B)}finally{T(!1)}else s!=null&&(A=s.filter(V=>B.includes(V.key)));N(A)},[c,M,t,s]);const z=f.useCallback((I,B)=>{I!=null&&(N(B.entries),e(Z.A(I),B))},[e]),S=f.useMemo(()=>M?g.Search:nn.Filter,[M]);let L,k;if(C==="connected")k=l.jsxRuntimeExports.jsx(S,{searcher:c,children:({onChange:I,value:B})=>l.jsxRuntimeExports.jsx(_f,{value:B,selectedKeys:t,className:n,onChange:I,loading:D,selected:O,onFocus:_,entryRenderKey:o,visible:b,renderTag:a,placeholder:d,onTagDragStart:u,onTagDragEnd:E,style:y,children:v})});else{const I=Z.A(t);k=l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",grow:!0,style:y,size:"small",children:[I.map(B=>{const A=O.find(V=>V.key===B);return a({key:B,entryKey:B,entryRenderKey:o,loading:D,entry:A,onClose:()=>{const V=I.filter(F=>F!==B);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>u==null?void 0:u(V,B),onDragEnd:V=>E==null?void 0:E(V,B)})}),I.length>0?l.jsxRuntimeExports.jsx(g.Icon,{onClick:_,children:l.jsxRuntimeExports.jsx(g.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):l.jsxRuntimeExports.jsx(g.Button,{onClick:_,shade:7,startIcon:l.jsxRuntimeExports.jsx(g.Qt.Add,{}),variant:"text",children:w})]}),L=l.jsxRuntimeExports.jsx(S,{searcher:c,children:B=>l.jsxRuntimeExports.jsx(g.Text$1,{autoFocus:!0,placeholder:"Search",...B,children:v})})}return l.jsxRuntimeExports.jsx(Me.Core,{close:$,open:_,data:s,emptyContent:i,visible:b,value:t,onChange:z,allowNone:m,replaceOnSingle:h,columns:r,allowMultiple:!0,listItem:j,trigger:k,extraDialogContent:L,variant:C,...R})},_f=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:o,entryRenderKey:i,renderTag:c,placeholder:a=Cs,onTagDragStart:d,onTagDragEnd:u,value:p,className:m,children:h,...E})=>{const{onSelect:y,clear:w}=g.useSelectionUtils(),j=f.useRef(null);f.useLayoutEffect(()=>{var b;o&&((b=j.current)==null||b.focus())},[o,n]);const C=()=>{o||s(""),r==null||r()},v=()=>{o||r==null||r()},R=()=>{o||s("")};return l.jsxRuntimeExports.jsxs(g.Text$1,{ref:j,className:x.CSS(x.CSS.BE("select-multiple","input"),x.CSS.visible(o),m),onBlur:R,placeholder:a,value:p,onChange:s,onFocus:C,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:v,variant:"button",...E,children:[l.jsxRuntimeExports.jsx(X.Space,{direction:"x",className:x.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(b=>{const _=n.find($=>$.key===b);return c({key:b,entryKey:b,entryRenderKey:i,loading:t,entry:_,onClose:()=>y==null?void 0:y(b),onDragStart:$=>d==null?void 0:d($,b),onDragEnd:$=>u==null?void 0:u($,b)})})}),h,l.jsxRuntimeExports.jsx(Ji,{onClick:w})]})},tl=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let o=e;return n!=null&&(o=typeof t=="function"?t(n):n[t]),f.createElement(wn,{size:"small",variant:"outlined",className:x.CSS(n==null&&!s&&x.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},Z.Q(o))},kf=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Me.BaseButton,Button:Me.Button,DEFAULT_PLACEHOLDER:Cs,DataType:jf,Direction:wf,DropdownButton:Me.DropdownButton,Multiple:rn,MultipleTag:tl,Single:gt,TextAlignment:zr,defaultButton:Me.defaultButton},Symbol.toStringTag,{value:"Module"})),Un=6,Pf=2,ko=5,Nf=e=>x.Eo.width(e)<ko&&x.Eo.height(e)<ko,Mf=["zoom","pan","select","zoomReset"],bn=[...Mf,"click"],Tf=ne.z.enum(bn),nl=["zoom","select"],Gn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},sl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},rl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Br={zoom:Gn,pan:sl,select:rl,zoomReset:Gn,click:Gn},Af=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(o=>o!=="MouseLeft")).filter(r=>r.length>0)]))},Lf=x.Eo.construct(0,0,1,1,x.J.TOP_LEFT),$f={width:30,height:50},ol=({onChange:e,triggers:t,initial:n=Lf,threshold:s=$f,ref:r})=>{const o=(t==null?void 0:t.defaultMode)??"zoom",[i,c]=f.useState(x.Eo.ZERO),[a,d]=f.useState(o),[u,p]=g.useStateRef(n),m=f.useRef(x.q.ZERO),h=f.useRef(null),E=x._.construct(s);f.useEffect(()=>p(()=>x.Eo.truncate(n,Un)),[n]),f.useEffect(()=>d(o),[o]);const[y,w,j,C]=g.useMemoCompare(()=>{const O={...Br[o],...t},N=g.flattenConfig(O),D=Af(O);return[O,N,D,g.flattenConfig(D)]},g.compareModeConfigs,[t]),v=f.useCallback(({box:O,triggers:N,stage:D,cursor:T})=>{if(h.current==null)return;const M=g.determineMode(y,N),z=x.Eo.construct(h.current);if(M==null)return;if(M==="zoomReset")return c(x.Eo.ZERO),e==null||e({box:x.Eo.DECIMAL,mode:M,stage:D,cursor:T}),p(x.Eo.DECIMAL);const S=Nf(O);if(D==="end"){if(S){M==="zoom"&&c(x.Eo.ZERO),e==null||e({box:u.current,mode:"click",stage:D,cursor:T});return}return p(k=>{if(M==="pan"){const B=Po(O,k,z);return B===null||x.Eo.equals(B,k)?k:(e==null||e({box:B,mode:M,stage:D,cursor:T}),B)}const I=R(O,k,z);return I===null?k:(e==null||e({box:I,mode:M,stage:D,cursor:T}),M==="zoom"?(c(x.Eo.ZERO),I):x.Eo.truncate(k,Un))})}if(nl.includes(M))return S?void 0:c(x.k$2.XY.scale(z).clamp(z).translate({x:-x.Eo.left(z),y:-x.Eo.top(z)}).box(No(E,O,z)));if(c(k=>x.Eo.areaIsZero(k)?k:x.Eo.ZERO),x.q.distance(T,m.current)<Pf)return;m.current=T;const L=Po(O,u.current,z);e==null||e({box:L,mode:M,stage:D,cursor:T})},[c,d,e,y,s.height,s.width,p,h]);f.useImperativeHandle(r,()=>({reset:()=>{c(x.Eo.ZERO),p(x.Eo.DECIMAL),e==null||e({box:x.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:x.q.ZERO})}}),[e]);const R=f.useCallback((O,N,D)=>x.Eo.truncate(or(N,D).box(No(E,O,D)),Un),[s]),b=g.useHeldRef({triggers:[["Control"]]}),_=g.useHeldRef({triggers:[["Alt"]]});f.useEffect(()=>{const O=N=>{if(h.current==null)return;let D=1;N.deltaY<0?D-=.035:D+=.035;const T=x.Eo.construct(h.current),M=x.q.construct(N);if(!x.Eo.contains(T,M)||N.target!==h.current)return;const S=or(u.current,x.Eo.construct(h.current)).pos(x.q.construct(N));let k=x.k$2.XY.magnify({x:b.current.held?1:D,y:_.current.held?1:D}).box(u.current);k=x.Eo.translate(k,{x:b.current.held?0:S.x*(1-D),y:_.current.held?0:S.y*(1-D)}),p(k),e==null||e({stage:"end",box:k,cursor:x.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",O),()=>window.removeEventListener("wheel",O)},[p,e]),ki.useDrag({bound:h,onDrag:v,triggers:w,loose:!0});const $=f.useCallback(({triggers:O,stage:N})=>{if(N==="end")return d(o);const D=g.determineMode(j,O);D!=null&&d(D)},[j,o,e]);return g.use$1({triggers:C,callback:$,region:h}),{maskBox:i,ref:h,mode:a}},or=(e,t)=>x.k$2.XY.scale(t).clamp(t).scale(e),Po=(e,t,n)=>{let s=x.Eo.signedDims(or(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},x.Eo.truncate(x.k$2.XY.translate(x.q.construct(s)).box(t),Un)},No=(e,t,n)=>x.Eo.height(t)<=e.height?x.Eo.construct(x.Eo.left(t),x.Eo.top(n),x.Eo.width(t),x.Eo.height(n)):x.Eo.width(t)<=e.width?x.Eo.construct(x.Eo.left(n),x.Eo.top(t),x.Eo.width(n),x.Eo.height(t)):t,Of=({mode:e,triggers:t})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",children:[l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:x._$1.capitalize(e)}),l.jsxRuntimeExports.jsx(mx.Text,{trigger:t[0],level:"small"})]}),Df={zoom:l.jsxRuntimeExports.jsx(g.Qt.Zoom,{}),pan:l.jsxRuntimeExports.jsx(g.Qt.Pan,{}),select:l.jsxRuntimeExports.jsx(g.Qt.Selection,{}),zoomReset:l.jsxRuntimeExports.jsx(g.Qt.Expand,{}),click:l.jsxRuntimeExports.jsx(g.Qt.Bolt,{})},zf=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&bn.includes(r)).map(([r,o])=>({key:r,icon:Df[r],tooltip:l.jsxRuntimeExports.jsx(Of,{mode:r,triggers:o})})).sort((r,o)=>bn.indexOf(r.key)-bn.indexOf(o.key));return l.jsxRuntimeExports.jsx(Me.Button,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:o,...i})=>f.createElement(g.Icon,{...i,key:o.key,variant:i.selected?"filled":"text",size:"medium",tooltip:o.tooltip,tooltipLocation:{x:"right",y:"top"}},o.icon)})},Bf=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Br,MASK_MODES:nl,MODES:bn,Mask:Dr,PAN_DEFAULT_TRIGGERS:sl,SELECT_DEFAULT_TRIGGERS:rl,SelectMode:zf,ZOOM_DEFAULT_TRIGGERS:Gn,modeZ:Tf,use:ol},Symbol.toStringTag,{value:"Module"})),il=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ir=f.forwardRef(({children:e,initial:t=x.Eo.DECIMAL,onChange:n,...s},r)=>{const{setViewport:o}=ot("Viewport");f.useLayoutEffect(()=>{o({box:t,mode:"zoom",cursor:x.q.ZERO,stage:"start"})},[o,t]);const i=f.useCallback(a=>{o(a),n==null||n(a)},[n,o]),c=ol({onChange:i,initial:t,ref:r,...s});return l.jsxRuntimeExports.jsx(Dr,{className:x.CSS.BE("line-plot","viewport"),...c,children:e})});Ir.displayName="Viewport";const If=Object.freeze(Object.defineProperty({__proto__:null,Floating:Gi,Legend:Wi,Line:Or,LinePlot:Zi,Title:Xi,Tooltip:pf,Viewport:Ir,XAxis:Hi,YAxis:qi,axisFactory:Tr,selectViewportEl:il,useContext:ot,useGridEntry:Mn,useViewport:Fi},Symbol.toStringTag,{value:"Module"})),Vf=g.wrap$1("Tooltip",({aetherKey:e,...t})=>(g.use$3({aetherKey:e,type:P.Annotation.TYPE,schema:P.annotationStateZ,initialState:t}),null)),ll=g.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:r}=ot("Range.Provider"),[,{hovered:o,count:i},c]=g.use$3({aetherKey:e,type:P.Provider$1.TYPE,schema:P.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=Mn({key:e,loc:"top",size:i>0?32:0,order:3},"Annotation.Provider"),d=g.useContextMenu(),u=g.useSyncedRef(d.visible),p=f.useCallback(m=>{const h=y=>{c(w=>({...w,cursor:{x:y.clientX,y:y.clientY}}))},E=m.currentTarget;E.addEventListener("mousemove",h),E.addEventListener("mouseleave",()=>{E.removeEventListener("mousemove",h),u.current||c(y=>({...y,cursor:null}))},{once:!0})},[c]);return l.jsxRuntimeExports.jsx(g.ContextMenu,{style:{...a,cursor:o!=null?"pointer":"default"},...d,menu:()=>t==null||o==null?null:t(o),children:l.jsxRuntimeExports.jsx(X.Space,{style:{width:"100%",height:"100%"},onClick:()=>{o!=null&&(s({box:x.Eo.construct({x:o.viewport.lower,y:0},{x:o.viewport.upper,y:1}),mode:"zoom",cursor:x.q.ZERO,stage:"start"}),r(!0))},onMouseEnter:p})})}),Ff=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Vf,Provider:ll},Symbol.toStringTag,{value:"Module"})),cl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Zf=g.flattenConfig(cl),al=g.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=g.use$3({aetherKey:e,type:P.Measure.TYPE,schema:P.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=f.useRef(null),s=g.useHeldRef({triggers:Zf,loose:!0}),r=f.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const d=g.determineMode(cl,s.current.triggers,{loose:!0});if(["one","two"].includes(d))return t(u=>({...u,[d]:a}));t(d==="clear"?u=>({...u,one:null,two:null}):u=>({...u,one:u.one??a,two:u.one!==null?a:u.two}))}},[t,s]);Fi(r);const o=f.useCallback(c=>t(a=>({...a,hover:x.q.construct(c)})),[t]),i=f.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return f.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",o),c.addEventListener("mouseleave",i),()=>{c.removeEventListener("mousemove",o),c.removeEventListener("mouseleave",i)}},[r]),l.jsxRuntimeExports.jsx("span",{ref:n})}),Hf=Object.freeze(Object.defineProperty({__proto__:null,Measure:al},Symbol.toStringTag,{value:"Module"})),Vr=g.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,units:o="",color:i,lineWidth:c,lineDash:a})=>{const[d,u]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),[,{position:p,pixelPosition:m},h]=g.use$3({aetherKey:e,type:P.Rule.TYPE,schema:P.ruleStateZ,initialState:{color:i,dragging:!1,position:n,lineWidth:c,lineDash:a}});f.useEffect(()=>{if(p==null)return;if(n==null)return r==null?void 0:r(p);const R=x.G.construct(p+.01,p-.01);n!=null&&!x.G.contains(R,n)&&(r==null||r(Math.trunc(p*100)/100))},[p]);const E=f.useRef(m);m!==E.current&&(E.current=m);const y=f.useRef(m);f.useEffect(()=>{h(R=>({...R,position:n,color:i,lineWidth:c,lineDash:a}))},[n,i,c,a]);const w=js({onStart:f.useCallback(()=>{h(R=>({...R,dragging:!0})),y.current=E.current},[]),onMove:R=>{h(b=>({...b,pixelPosition:(y.current??0)+x.Eo.signedHeight(R)}))},onEnd:f.useCallback(()=>{h(R=>({...R,dragging:!1})),y.current=m},[])}),j=f.useRef(null);if(p==null||m==null)return null;const C=il(j==null?void 0:j.current),v=l.jsxRuntimeExports.jsxs("div",{ref:j,className:x.CSS.B("rule"),style:{top:`calc(${m}px - 0.5rem)`},children:[l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("rule","drag-handle"),onDragStart:w,draggable:!0}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[l.jsxRuntimeExports.jsx(g.Editable,{level:"p",value:d,onChange:u}),l.jsxRuntimeExports.jsx(g.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${p.toFixed(2)} ${o}`})]})]});return C==null?v:kr.createPortal(v,C)}),qf=Object.freeze(Object.defineProperty({__proto__:null,Rule:Vr},Symbol.toStringTag,{value:"Module"})),ul=g.canDropOfType(Qe),Yf=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:o=!0,legendPosition:i,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:d,onRuleChange:u,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:E=!0,enableMeasure:y=!1,initialViewport:w=x.Eo.DECIMAL,legendVariant:j,onViewportChange:C,viewportTriggers:v,annotationProvider:R,...b})=>{var D;const _=t.filter(({location:T})=>x.J.isY(T)),$=f.useRef(),O=g.usePrevious(e.length),N=g.usePrevious(b.hold);return(O===0&&e.length!==0||N===!0&&b.hold===!1)&&((D=$.current)==null||D.reset()),l.jsxRuntimeExports.jsxs(Zi,{...b,children:[_.map((T,M)=>{const z=e.filter(k=>k.axes.x===T.key),S=t.filter(({location:k})=>x.J.isX(k)),L=h==null?void 0:h.filter(k=>[...S.map(({key:I})=>I),T.key].includes(k.axis));return l.jsxRuntimeExports.jsx(Uf,{axis:T,index:M,lines:z,yAxes:S,rules:L,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:R},T.key)}),o&&l.jsxRuntimeExports.jsx(Wi,{onLineChange:d,position:i,onPositionChange:c,variant:j}),n&&l.jsxRuntimeExports.jsx(Xi,{value:s,onChange:r,level:a}),l.jsxRuntimeExports.jsxs(Ir,{initial:w,onChange:C,triggers:v,ref:$,children:[E&&l.jsxRuntimeExports.jsx(Qi,{}),y&&l.jsxRuntimeExports.jsx(al,{})]})]})},Uf=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onAxisChannelDrop:o,onAxisChange:i,axis:{location:c,key:a,showGrid:d,...u},annotationProvider:p})=>{const m=g.useDrop({type:"Channel.LinePlot.XAxis",canDrop:ul,onDrop:f.useCallback(({items:y})=>{const w=g.filterByType(Qe,y);return o==null||o(a,w.map(({key:j})=>j)),w},[a,o])}),h=s==null?void 0:s.filter(y=>y.axis===a),E=g.useDraggingState();return l.jsxRuntimeExports.jsxs(Hi,{...u,...m,location:c,showGrid:d??n===0,className:x.CSS(x.CSS.dropRegion(g.canDropOfType(Qe)(E))),onAutoBoundsChange:y=>i==null?void 0:i({key:a,bounds:y}),children:[e.map((y,w)=>{const j=t.filter(v=>v.axes.y===y.key),C=s==null?void 0:s.filter(v=>v.axis===y.key);return l.jsxRuntimeExports.jsx(Wf,{axis:{...y,showGrid:d??(n===0&&w===0)},lines:j,rules:C,onRuleChange:r,onAxisChannelDrop:o,onAxisChange:i},y.key)}),h==null?void 0:h.map(y=>f.createElement(Vr,{aetherKey:y.key,...y,key:y.key,onLabelChange:w=>r==null?void 0:r({key:y.key,label:w}),onPositionChange:w=>r==null?void 0:r({key:y.key,position:w})})),l.jsxRuntimeExports.jsx(ll,{...p})]})},Gf=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Wf=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:o,location:i,...c}})=>{const a=g.useDrop({type:"Channel.LinePlot.YAxis",canDrop:ul,onDrop:f.useCallback(({items:u})=>{const p=g.filterByType(Qe,u);return s==null||s(o,p.map(({key:m})=>m)),p},[o,s])}),d=g.useDraggingState();return l.jsxRuntimeExports.jsxs(qi,{...c,...a,location:i,className:x.CSS(x.CSS.dropRegion(g.canDropOfType(Qe)(d))),onAutoBoundsChange:u=>r==null?void 0:r({key:o,bounds:u}),children:[e.map(u=>l.jsxRuntimeExports.jsx(Kf,{line:u},Gf(u))),t==null?void 0:t.map(u=>f.createElement(Vr,{aetherKey:u.key,...u,key:u.key,onLabelChange:p=>n==null?void 0:n({key:u.key,label:p}),onPositionChange:p=>n==null?void 0:n({key:u.key,position:p})}))]})},Kf=({line:e})=>e.variant==="static"?l.jsxRuntimeExports.jsx(Qf,{line:e}):l.jsxRuntimeExports.jsx(Xf,{line:e}),Xf=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...r}})=>{const o=Number(t.valueOf())*3,i=P.streamChannelData({timeSpan:t,channel:s,keepFor:o}),c=n!=null&&n!==0,a=P.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:o});return l.jsxRuntimeExports.jsx(Or,{aetherKey:e,y:i,x:a,...r})},Qf=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const o=P.channelData({timeRange:e,channel:s}),i=n!=null&&n!==0,c=P.channelData({timeRange:e,channel:i?n:s,useIndexOfChannel:!i});return l.jsxRuntimeExports.jsx(Or,{aetherKey:t,y:o,x:c,...r})},Mo=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],ts=({items:e},t)=>{const n=g.filterByType(Qe,e);return n.length>0&&!n.every(s=>t.includes(s.key))},dl=["name","alias"],xl=e=>{const t=Rs();return f.useMemo(()=>e.length===0?Mo:Mo.filter(n=>e.includes(n.key)),[e,t])},Jf=({columns:e=dl,onChange:t,className:n,value:s,searchOptions:r,...o})=>{const i=Ye(),c=Rs(),a=xl(e),d=Mr(),u=g.useMemoDeepEqualProps(r),p=f.useMemo(()=>i==null?void 0:i.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...u}),[i,d,u]),m=i!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:h,onDragEnd:E,...y}=g.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:f.useCallback(R=>ts(R,Z.A(s)),[s]),onDrop:f.useCallback(({items:R})=>{const b=g.filterByType(Qe,R);if(b.length===0)return[];const _=Z.n([...Z.A(s),...b.map($=>$.key)]);return t(_,{clickedIndex:null,clicked:null,entries:[]}),b},[t,s])}),w=g.useDraggingState(),j=f.useCallback(({dropped:R})=>{t(Z.A(s).filter(b=>!R.some(_=>_.key===b)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),C=f.useCallback((R,b)=>h([{key:b,type:Qe}],j),[h,j]),v=f.useCallback(R=>c[R.key]??R.name,[c]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(n,x.CSS.dropRegion(ts(w,Z.A(s)))),value:s,onTagDragStart:C,onTagDragEnd:E,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:v,...y,...o})},mt=({columns:e=dl,onChange:t,value:n,className:s,data:r,searchOptions:o,...i})=>{const c=Ye(),a=Rs(),d=xl(e),u=Mr(),p=g.useMemoDeepEqualProps(o),m=f.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...p})},[c,u,r==null?void 0:r.length,p]),h=c!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),E=f.useId(),y=f.useMemo(()=>({key:E,type:"Channel.SelectMultiple"}),[E]),{startDrag:w,onDragEnd:j,...C}=g.useDragAndDrop({type:"Channel.SelectSingle",canDrop:f.useCallback(_=>ts(_,Z.o$1(n)),[n]),onDrop:f.useCallback(({items:_})=>{const $=g.filterByType(Qe,_);return $.length===0?[]:(t($[0].key,{clickedIndex:null,clicked:null,entries:[]}),$)},[y,t])}),v=g.useDraggingState(),R=f.useCallback(()=>n!=null&&w([{type:Qe,key:n}]),[w,n]),b=f.useCallback(_=>a[_.key]??_.name,[a]);return l.jsxRuntimeExports.jsx(gt,{data:r,className:x.CSS(s,x.CSS.dropRegion(ts(v,Z.o$1(n)))),value:n,onDragStart:R,onDragEnd:j,onChange:t,searcher:m,columns:d,emptyContent:h,entryRenderKey:b,...C,...i})},ep=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:qx,AliasProvider:zi,LinePlot:Yf,SelectMultiple:Jf,SelectSingle:mt,useActiveRange:Mr,useAlias:Di,useAliases:Rs,useContext:Oi,useName:bs},Symbol.toStringTag,{value:"Module"})),yt=({path:e,optional:t=!1,onChange:n})=>{const s=St(),{get:r,bind:o,set:i,setStatus:c}=s,[a,d]=f.useState(r(e,{optional:t}));f.useEffect(()=>(d(r(e,{optional:t})),o({path:e,onChange:d,listenToChildren:!1})),[e,n,o,r]);const u=f.useCallback(h=>{n==null||n(h,{...s,path:e}),i(e,h)},[e,i,n]),p=f.useCallback(h=>c(e,h),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:u,setStatus:p,variant:m,...a}},fl=(e,t=!1,n)=>{const{get:s,bind:r}=St(n),[,o]=f.useState(0);return f.useEffect(()=>(o(i=>i+1),r({path:e,onChange:()=>o(i=>i+1)})),[e,r]),s(e,{optional:t})??null},tp=(e,t=!1,n)=>{var i;const{get:s,bind:r}=St(n),[,o]=f.useState(0);return f.useEffect(()=>(o(c=>c+1),r({path:e,onChange:()=>o(c=>c+1)})),[e,r]),((i=s(e,{optional:t}))==null?void 0:i.value)??null},np=e=>{var t,n;return((n=(t=fl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},sp=({path:e,ctx:t,onChange:n})=>{const s=St(t);f.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},rp=({path:e,optional:t=!1})=>{const{bind:n,get:s}=St(),[r,o]=f.useState(s(e,{optional:t}));if(f.useEffect(()=>(o(s(e,{optional:t})),n({path:e,onChange:i=>o({...i,value:Z.U(i.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},pl=(e,t)=>({add:(n,s)=>{const r=Z.U(e.get(t).value);r.splice(s,0,...Z.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=Z.U(e.get(t).value);r.push(...Z.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((o,i)=>!r.has(i)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((o,i)=>r.has(i)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.U(e.get(t).value);s.sort(n),e.set(t,s)}}),op=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=St(n),{bind:r,get:o}=s,[i,c]=f.useState(o(e).value);return f.useEffect(()=>(c(o(e).value),r({path:e,onChange:a=>{c(Z.U(a.value))},listenToChildren:t})),[e,r,o,c]),f.useMemo(()=>({value:i,...pl(s,e)}),[i,s,e])},Fr=f.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),St=e=>{const t=f.useContext(Fr);return e??t},To=e=>({key:e,variant:"success",message:""}),ip=e=>e.code===ne.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",ml=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r})=>{const o=f.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=g.useSyncedRef(n),c=g.useSyncedRef(r),a=f.useCallback(({path:b,onChange:_,listenToChildren:$=!1})=>{var T;const{parentListeners:O,listeners:N}=o.current,D=$?O:N;return D.has(b)||D.set(b,new Set),(T=D.get(b))==null||T.add(_),()=>{var M;return(M=D.get(b))==null?void 0:M.delete(_)}},[]),d=f.useCallback((b,{optional:_}={optional:!1})=>{const{state:$,statuses:O,touched:N}=o.current,D=Z._.get($,b,{optional:_});if(D==null)return null;const T={value:D,status:O.get(b)??To(b),touched:N.has(b),required:!1};if(i.current==null)return T;const M=i.current,z=Z.N.getFieldSchema(M,b,{optional:!0});return z==null||(T.required=!z.isOptional()),T},[]),u=f.useCallback(b=>{const{state:_,statuses:$,touched:O,listeners:N,parentListeners:D}=o.current;Z._.remove(_,b),$.delete(b),O.delete(b),N.delete(b),D.delete(b)},[]),p=f.useCallback(b=>{const{statuses:_,touched:$}=o.current;o.current.state=b,h(""),_.clear(),$.clear()},[]),m=f.useCallback(b=>{var O;const{listeners:_}=o.current,$=d(b,{optional:!0});$!=null&&((O=_.get(b))==null||O.forEach(N=>N($)))},[]),h=f.useCallback(b=>{const{listeners:_,parentListeners:$}=o.current,O=_.get(b);if(b==""&&([..._.keys()].forEach(T=>{var z;const M=d(T,{optional:!0});M!=null&&((z=_.get(T))==null||z.forEach(S=>{S(M)}))}),[...$.keys()].forEach(T=>{var z;const M=d(T,{optional:!0});M!=null&&((z=$.get(T))==null||z.forEach(S=>{S(M)}))})),O!=null){const N=d(b,{optional:!0});N!=null&&O.forEach(D=>{D(N)})}$.forEach((N,D)=>{if(Z._.pathsMatch(b,D)){const M=d(D,{optional:!0});M!=null&&N.forEach(z=>{z(M)})}})},[]),E=f.useCallback((b,_="",$=!0)=>{const{statuses:O,listeners:N,touched:D}=o.current;if(b.success){const S=[...O.keys()];return O.clear(),S.forEach(L=>m(L)),!0}let T=!0;const M=new Set(b.error.issues.map(S=>S.path.join(".")));let z=(S,L)=>S===L;return $&&(z=(S,L)=>Z._.pathsMatch(S,L)),b.error.issues.forEach(S=>{var A;const{message:L}=S,k=S.path.join(".");if(!z(k,_))return;const I=ip(S);I!=="warning"&&(T=!1),O.set(k,{key:k,variant:I,message:L}),D.add(k);let B=d(k,{optional:!0});B==null&&(B={value:void 0,status:O.get(k)??To(k),touched:!1,required:!1}),(A=N.get(k))==null||A.forEach(V=>V(B))}),O.forEach((S,L)=>{M.has(L)||(O.delete(L),m(L))}),T},[]),y=f.useCallback((b,_)=>{if(i.current==null)return!0;const{state:$}=o.current,O=i.current.safeParse($);return E(O,b,_)},[E]),w=f.useCallback(async(b,_)=>{if(i.current==null)return!0;const{state:$}=o.current,O=await i.current.safeParseAsync($);return E(O,b,_)},[E]),j=f.useCallback((b,_,$={})=>{const O=Z._.get(o.current.state,b,{optional:!0}),{validateChildren:N=!0}=$,{state:D,touched:T}=o.current;T.add(b),b.length===0?o.current.state=_:Z._.set(D,b,_),h(b),(async()=>{var z;let M;try{M=y(b,N)}catch{M=await w(b,N)}(z=c.current)==null||z.call(c,{values:o.current.state,path:b,prev:O,valid:M})})()},[]),C=f.useCallback(b=>Z._.has(o.current.state,b),[]),v=f.useCallback((b,_)=>{o.current.statuses.set(b,_),o.current.touched.add(b),m(b)},[]),R=f.useCallback(()=>{const{statuses:b}=o.current;b.clear(),b.forEach((_,$)=>m($))},[]);return f.useEffect(()=>{if(!t)return;const{listeners:b}=o.current;o.current.state=e,b.forEach((_,$)=>{const O=d($,{optional:!0});O!=null&&_.forEach(N=>N(O))})},[t,e]),f.useMemo(()=>({bind:a,set:j,get:d,mode:s,validate:y,validateAsync:w,value:()=>o.current.state,has:C,remove:u,setStatus:v,clearStatuses:R,reset:p}),[a,j,d,y,w,C,u,v,R,p,s])},lp=e=>l.jsxRuntimeExports.jsx(Fr.Provider,{value:e,children:e.children}),cp=g.componentRenderProp(g.Text$1),je=({path:e,children:t=cp,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:o=!1,optional:i,onChange:c,className:a,...d})=>{const u=yt({path:e,optional:i??o,onChange:c}),p=St();if(u==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n==null&&(n=x._$1.capitalize(Z._.element(e,-1))),r=typeof r=="function"?r(u,p):r,!r)return null;const m=u.status.message,{onChange:h,value:E}=u,y={onChange:h,value:E};return u.variant!=null&&(y.variant=u.variant),l.jsxRuntimeExports.jsx(He.Item,{padHelpText:s,helpText:m,helpTextVariant:u.status.variant,label:n,required:u.required,className:x.CSS(a,x.CSS.BE("field",e.split(".").join("-")),x.CSS.M(u.status.variant)),...d,children:t(y)})},Lt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:o,path:i,fieldKey:c=t,...a})=>l.jsxRuntimeExports.jsx(je,{...n,...a,path:c?`${i}.${c}`:i,children:d=>l.jsxRuntimeExports.jsx(e,{...d,...s,...o})});return r.displayName=e.displayName,r},hl=Lt(g.Numeric),vs=hl({}),gl=Lt(g.Text$1),yl=gl({}),Sl=Lt(g.Switch$1),Zr=Sl({}),ap=Lt(gt),up=Lt(rn),dp=Lt(Me.DropdownButton),Hr=({key:e,open:t,onChange:n})=>{const s=g.useMemoPrimitiveArray(e);g.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(n),async()=>await r.close()},[t==null,s])},xp=({fetchInitialValue:e,...t})=>{const[n,s]=f.useState(void 0);return g.useAsyncEffect(async()=>{s(await e())},[e]),Hr({...t,onChange:s}),n},fp=Object.freeze(Object.defineProperty({__proto__:null,useListener:Hr,useState:xp},Symbol.toStringTag,{value:"Module"})),pp=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:o,applyObservable:i,...c})=>{const a=Ye(),d=g.useAggregator(),u=g.useMemoPrimitiveArray(e),p=ml({values:s,...c,sync:!1,onChange:E=>{a!=null&&(async()=>{try{await(o==null?void 0:o({...E,client:a}))}catch(y){d({variant:"error",message:`Failed to save ${t}`,description:y.message})}})()}});g.useAsyncEffect(async()=>{if(a!=null)try{const E=await n({client:a});p.set("",E)}catch(E){d({variant:"error",message:`Failed to retrieve ${t}`,description:E.message})}},[u,a==null?void 0:a.key]);const m=f.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[u,a==null?void 0:a.key]),h=f.useCallback(E=>i==null?void 0:i({changes:E,ctx:p}),[u,i]);return Hr({key:u,open:m,onChange:h}),p},mp=Object.freeze(Object.defineProperty({__proto__:null,Context:Fr,Field:je,Form:lp,NumericField:vs,SwitchField:Zr,TextField:yl,buildDropdownButtonSelectField:dp,buildNumericField:hl,buildSelectMultiField:up,buildSelectSingleField:ap,buildSwitchField:Sl,buildTextField:gl,fieldArrayUtils:pl,fieldBuilder:Lt,use:ml,useChildFieldValues:rp,useContext:St,useField:yt,useFieldArray:op,useFieldListener:sp,useFieldState:fl,useFieldValid:np,useFieldValue:tp,useSynced:pp},Symbol.toStringTag,{value:"Module"})),hp=[{key:"name",name:"Name"},{key:"location",name:"Location"}],gp=({searchOptions:e,...t})=>{const n=Ye();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),l.jsxRuntimeExports.jsx(gt,{columns:hp,searcher:s,entryRenderKey:"name",...t})},yp=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:gp},Symbol.toStringTag,{value:"Module"})),Xt="label",qr=[{key:"color",name:"Color",render:({entry:e})=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],ns=({items:e},t)=>{const n=g.filterByType(Xt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Sp=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>l.jsxRuntimeExports.jsx(wn,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),Ep=g.componentRenderProp(Sp),jp=({onChange:e,className:t,value:n,...s})=>{const r=Ye(),o=r!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:i,onDragEnd:c,...a}=g.useDragAndDrop({type:"Label.SelectMultiple",canDrop:f.useCallback(m=>ns(m,Z.A(n)),[n]),onDrop:f.useCallback(({items:m})=>{const h=g.filterByType(Xt,m);if(h.length===0)return[];const E=Z.n([...Z.A(n),...h.map(y=>y.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),h},[e,n])}),d=g.useDraggingState(),u=f.useCallback(({dropped:m})=>{e(Z.A(n).filter(h=>!m.some(E=>E.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=f.useCallback((m,h)=>i([{key:h,type:Xt}],u),[i,u]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(t,x.CSS.dropRegion(ns(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:qr,emptyContent:o,renderTag:Ep,addPlaceholder:"Label",...a,...s})},El=({value:e,onChange:t})=>{const n=Ye(),s=n!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=f.useId(),o=f.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),i=g.useDragAndDrop({type:"Label.SelectSingle",canDrop:f.useCallback(d=>ns(d,Z.o$1(e)),[e]),onDrop:f.useCallback(({items:d})=>{const u=g.filterByType(Xt,d);return u.length===0?[]:(t(u[0].key,{clickedIndex:null,clicked:null,entries:[]}),u)},[o,t])}),c=g.useDraggingState(),a=f.useCallback(()=>e!=null&&i.startDrag([{type:Xt,key:e}]),[i.startDrag,e]);return{emptyContent:s,dragging:c,...i,onDragStart:a,searcher:n==null?void 0:n.labels}},Rp=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:o,...i}=El({value:t,onChange:e});return l.jsxRuntimeExports.jsx(gt,{data:s,className:x.CSS(n,x.CSS.dropRegion(ns(o,Z.o$1(t)))),value:t,onChange:e,columns:qr,entryRenderKey:"name",...i,...r})},bp=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...o}=El({value:t,onChange:n});return l.jsxRuntimeExports.jsx(gt,{data:e,value:t,onChange:n,columns:qr,entryRenderKey:"name",...o,...s})},wp=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Xt,SelectButton:bp,SelectMultiple:jp,SelectSingle:Rp},Symbol.toStringTag,{value:"Module"})),jl=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:o,...i})=>{const c=f.useRef(null),a=f.useRef(n);g.useClickOutside({ref:c,exclude:u=>g.findParent(u.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const d=f.useCallback(u=>{var m;if(!a.current||u.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${x.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return g.use$1({triggers:[["Escape"]],callback:d,loose:!0}),l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","bg"),x.CSS.visible(n),s&&x.CSS.M("enabled-modal")),empty:!0,align:"center",children:l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","dialog"),t&&x.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...i,style:{zIndex:s?11:void 0,...o},children:l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","content")),empty:!0,children:e})})})},Cp=({root:e,...t})=>kr.createPortal(l.jsxRuntimeExports.jsx(jl,{...t}),g.getRootElement(e)),vp=Object.freeze(Object.defineProperty({__proto__:null,Dialog:jl,Modal:Cp},Symbol.toStringTag,{value:"Module"})),_s=new Error("Tab not found"),_p=new Error("Invalid Mosaic"),ss=(e,t,n="center",s)=>{var p;if(e=lt(e),s===void 0)return ir(e,t);const r=lr(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const o=r.key*2,i=r.key*2+1,c=n==="top"||n==="left"?o:i;if(lr(e,c).key!==r.key)return ss(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return ss(e,t,"center",s);const[a,d,u]=Ap(n);if(r.direction=u,r[a]={key:0,tabs:[t],selected:t.tabKey},r[d]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw _p;return r.first.key=o,r.last.key=i,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},kp=(e,t,n)=>{var o;e=lt(e);const[s,r]=Nt(e,t);if(s==null||r==null)throw _s;return r.tabs=(o=r.tabs)==null?void 0:o.map(i=>i.tabKey===t?n(i):i),e},ir=(e,t)=>(e=lt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=ir(e.first,t):e.last!=null&&(e.last=ir(e.last,t)),e)),rs=e=>{e=lt(e);const t=[];if(e.tabs!=null&&(e.selected=be.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=rs(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=rs(e.last);e.last=n,t.push(...s)}return[e,t]},Yr=(e,t)=>{var r;e=lt(e);const[,n]=Nt(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(o=>o.tabKey!==t),n.selected=be.resetSelection(n.selected,n.tabs),e=Tp(e);const s=n.selected??os(e);return[e,s]},os=e=>e.selected!=null?e.selected:e.first!=null?os(e.first):e.last!=null?os(e.last):null,Rl=(e,t)=>{e=lt(e);const[n,s]=Nt(e,t);if(n==null||s==null)throw _s;return s.selected=t,e},bl=(e,t,n,s)=>{e=lt(e);const[r,o]=Nt(e,t);if(r==null||o==null)throw _s;const[i,c]=Yr(e,t);return[ss(i,r,n,s),c]},Cn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Cn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Cn(e.last,t);if(n!=null)return n}},wl=(e,t,n)=>{const s=is(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Pp=(e,t,n)=>{e=lt(e);const s=Cn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(u=>u.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const o=s.tabs[r];s.tabs=s.tabs.filter(u=>u.tabKey!==t);const i=s.key*2,a={key:s.key*2+1,tabs:[o],selected:o.tabKey},d={key:i,tabs:s.tabs,selected:s.selected};return d.selected=be.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=a,s.tabs=void 0,s.selected=void 0,e},Np=(e,t)=>{const n=Cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Cl=(e,t,n)=>{e=lt(e);const[,s]=Nt(e,t);if((s==null?void 0:s.tabs)==null)throw _s;return s.tabs=be.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Mp=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,lr=(e,t)=>{const n=is(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:lr(e,s)},Tp=e=>{let t=!0;for(;t;)[e,t]=cr(e);return e.first==null&&e.last==null&&(e.key=1),e},cr=e=>{if(e.first==null||e.last==null)return[e,!1];if(Lo(e.first))return[Ao(e.last,!0),!0];if(Lo(e.last))return[Ao(e.first,!1),!0];let[t,n]=[!1,!1];return[e.first,t]=cr(e.first),[e.last,n]=cr(e.last),[e,t||n]},Ao=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Lo=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Nt=(e,t)=>{if(e.tabs!=null){const i=e.tabs.find(c=>c.tabKey===t);if(i!=null)return[i,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=Nt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,o]=Nt(e.last,t);return[r,o]},is=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=is(e.first,t);return n??is(e.last,t)},Ap=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},lt=e=>Z._.copy(e),ls=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ls(e.first,t,n),e.last!=null&&ls(e.last,t,n),n),ar=(e,t)=>{t(e),e.first!=null&&ar(e.first,t),e.last!=null&&ar(e.last,t)};class vl{constructor(t={}){Ke(this,"parent");Ke(this,"stub");Ke(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Lp=({node:e})=>{const t=f.createRef(),n=f.useRef(e);return f.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),f.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),l.jsxRuntimeExports.jsx("div",{ref:t})},_l=({node:e,children:t})=>kr.createPortal(t,e.el),$p=Object.freeze(Object.defineProperty({__proto__:null,In:_l,Node:vl,Out:Lp},Symbol.toStringTag,{value:"Module"})),cs=f.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:o,last:i,key:c,size:a},emptyContent:d,...u}=n,p=f.useCallback(([E])=>t(c,E),[t]),{props:m}=Pr({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let h;return s!==void 0?h=l.jsxRuntimeExports.jsx(kl,{emptyContent:d,...n}):o!=null&&i!=null?h=l.jsxRuntimeExports.jsxs(Es,{id:`mosaic-${c}`,align:"stretch",className:x.CSS.BE("mosaic","resize"),...m,children:[l.jsxRuntimeExports.jsx(cs,{...u,root:o,onResize:t},o.key),l.jsxRuntimeExports.jsx(cs,{...u,root:i,onResize:t},i.key)]}):(h=null,console.warn("Mosaic tree is malformed")),c===1?l.jsxRuntimeExports.jsx(g.Provider$2,{children:h}):h});cs.displayName="Mosaic";const as="pluto-mosaic-tab-drop",Ur="pluto-mosaic-tab-create",Op=(e,t,n)=>{if(g.filterByType(g.FILE_TYPE,t).length>0&&n)return!0;const r=g.filterByType(as,t).map(c=>c.key),o=e.filter(c=>!r.includes(c.tabKey)).length>0;return g.filterByType(Ur,t).length>0||r.length>0&&(o||e.length===0)},kl=f.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:o,...i})=>{const{key:c,tabs:a}=e,[d,u]=f.useState(null),p=o!=null,m=f.useCallback(({items:b})=>Op(a,b,p),[a,p]),h=f.useCallback(({items:b,event:_})=>{if(_==null)return[];u(null);const $=g.filterByType(g.FILE_TYPE,b).length>0,O=a.length===0?"center":Oo($o(_));if($)return o==null||o(c,O,_),b;const N=g.filterByType(as,b);if(N.length>0){const T=N.map(({key:M})=>M)[0];t(c,T,O)}const D=g.filterByType(Ur,b);if(D.length>0){const T=D.map(({key:M})=>M);n==null||n(c,O,T)}return N},[t,a.length]),E=f.useCallback(({event:b})=>{if(b==null)return;const _=a.length===0?"center":Oo($o(b));u(_)},[a.length]),{startDrag:y,...w}=g.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:h,onDragOver:E}),j=m(g.useDraggingState()),C=f.useCallback(()=>u(null),[]),v=f.useCallback((b,{tabKey:_})=>{y([{key:_,type:as,elementID:b.currentTarget.id}])},[y]),R=f.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return l.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:x.CSS.BE("mosaic","leaf"),children:[l.jsxRuntimeExports.jsxs(be.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:C,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:v,onCreate:R,...i,...w,children:[e.selected!=null&&r(a.find(b=>b.tabKey===e.selected)),j&&l.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("mosaic","mask"),style:Dp[d]})]})});kl.displayName="MosaicTabLeaf";const Dp={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},$o=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},zp=e=>e,Bp=e=>1-e,Oo=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[zp(e),Bp(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},Ip=({root:e,onSelect:t,children:n})=>{const s=f.useRef(new Map),r=new Set,o=ls(e,i=>{var c;return(c=i.tabs)==null?void 0:c.map(a=>{let d=s.current.get(a.tabKey);return a==null?null:(d==null&&(d=new vl({style:"width: 100%; height: 100%; position: relative;"}),d.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,d)),r.add(a.tabKey),l.jsxRuntimeExports.jsx(_l,{node:d,children:n({...a,visible:a.tabKey===i.selected})},a.tabKey))})}).flat().filter(i=>i!=null);return s.current.forEach((i,c)=>!r.has(c)&&s.current.delete(c)),[s,o]},Vp=ne.z.object({key:ne.z.number(),tabs:ne.z.array(be.tabZ).optional(),selected:ne.z.string().optional(),direction:x.g.direction.optional(),size:ne.z.number().optional()}),ur=Vp.extend({first:ne.z.lazy(()=>ur).optional(),last:ne.z.lazy(()=>ur).optional()}),Fp=({allowRename:e=!1,initialTree:t})=>{const[n,s]=f.useState(t);return f.useEffect(()=>s(rs(t)[0]),[t]),{root:n,onDrop:(d,u,p)=>s(m=>bl(m,u,p,d)[0]),onClose:d=>s(u=>Yr(u,d)[0]),onSelect:d=>s(u=>Rl(u,d)),onResize:(d,u)=>s(p=>wl(p,d,u)),onRename:e?(d,u)=>s(p=>Cl(p,d,u)):void 0}},Zp=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ur,HAUL_DROP_TYPE:as,Mosaic:cs,autoSelectTabs:rs,canSplit:Np,findSelected:os,findTabNode:Cn,forEachNode:ar,insertTab:ss,isEmpty:Mp,mapNodes:ls,moveTab:bl,nodeZ:ur,removeTab:Yr,renameTab:Cl,resizeNode:wl,selectTab:Rl,split:Pp,updateTab:kp,use:Fp,usePortal:Ip},Symbol.toStringTag,{value:"Module"})),Hp=({location:e="left",size:t="9rem",className:n,style:s,...r})=>{const o=x.J.construct(e),i=x.J.direction(o),c=x.g.swap(i);return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.B("navbar"),x.CSS.bordered(x.J.swap(o)),x.CSS.dir(c),x.CSS.loc(o),n),direction:c,style:{[x.g.dimension(i)]:t,...s},align:"center",empty:!0,...r})},Tn=e=>({bordered:t=!1,className:n,...s})=>l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("navbar","content"),e==="absolute-center"?x.CSS.M(e):x.CSS.align(e),e!==""&&t&&x.CSS.bordered(e),n),align:"center",...s}),Pl=Tn("start");Pl.displayName="NavbarStart";const Nl=Tn("end");Nl.displayName="NavbarEnd";const Ml=Tn("center");Ml.displayName="NavbarCenter";const Tl=Tn("");Tl.displayName="NavbarContent";const Al=Tn("absolute-center");Al.displayName="NavbarAbsoluteCenter";const on=Hp;on.Start=Pl;on.Center=Ml;on.End=Nl;on.AbsoluteCenter=Al;on.Content=Tl;const Gr=({aetherKey:e})=>{const[,{region:t},n]=g.use$3({aetherKey:e,type:P.Eraser$1.TYPE,schema:P.eraserStateZ,initialState:{region:x.Eo.ZERO,enabled:!0}}),s=g.useSyncedRef(t),r=f.useCallback(i=>{x.Eo.equals(i,s.current)||n(c=>({...c,region:i}))},[n]);return{setEnabled:f.useCallback(i=>n(c=>({...c,enabled:i})),[n]),erase:r}},qp=g.wrap$1(P.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Gr({aetherKey:e}),s=g.useResize(n);return l.jsxRuntimeExports.jsx("div",{ref:s,className:x.CSS(x.CSS.inheritDims()),children:t})}),Yp=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qp,use:Gr},Symbol.toStringTag,{value:"Module"})),Up=({items:e,initialKey:t})=>{const[n,s]=f.useState(t),r=i=>s(i===n?void 0:i),o=e.find(i=>i.key===n);return{onSelect:r,activeItem:o}},Gp=g.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:s,location:r="left",collapseThreshold:o=.65,className:i,onResize:c,...a})=>{const d=x.J.direction(r),u=f.useCallback(()=>t!=null&&(s==null?void 0:s(t.key)),[s,t==null?void 0:t.key]),{erase:p,setEnabled:m}=Gr({aetherKey:e}),h=f.useCallback((j,C)=>{c==null||c(j,C),p(C)},[c,p]);if(f.useLayoutEffect(()=>{m(t!=null)},[t,m]),t==null)return null;const{content:E,key:y,...w}=t;return l.jsxRuntimeExports.jsx(Ti,{className:x.CSS(x.CSS.BE("navdrawer","content"),x.CSS.dir(d),i),collapseThreshold:o,onCollapse:u,location:r,onResize:h,...w,...a,children:t.content},y)}),Wp=Object.freeze(Object.defineProperty({__proto__:null,Bar:on,Drawer:Gp,useDrawer:Up},Symbol.toStringTag,{value:"Module"})),Kp=({variant:e,className:t,children:n,...s})=>l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(t,x.CSS.B("note"),x.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),Xp=Object.freeze(Object.defineProperty({__proto__:null,Note:Kp},Symbol.toStringTag,{value:"Module"})),Zs={Close:l.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),l.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:l.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:l.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),l.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Qp=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:o,onClose:i,...c})=>l.jsxRuntimeExports.jsxs(X.Space,{size:1.5,direction:"x",className:x.CSS(x.CSS.B("macos-controls"),!n&&x.CSS.BM("macos-controls","blurred"),t),...c,children:[l.jsxRuntimeExports.jsx(Hs,{onClick:i,className:x.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Zs.Close}),l.jsxRuntimeExports.jsx(Hs,{onClick:s,className:x.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Zs.Minimize}),l.jsxRuntimeExports.jsx(Hs,{onClick:o,className:x.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Zs.Maximize})]}),Hs=({className:e,disabled:t,color:n,...s})=>l.jsxRuntimeExports.jsx("button",{className:x.CSS(x.CSS.B("macos-control"),x.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),qs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:o,...i})=>l.jsxRuntimeExports.jsxs(X.Pack,{...i,children:[l.jsxRuntimeExports.jsx(Ys,{className:x.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:l.jsxRuntimeExports.jsx(g.Qt.Subtract,{})}),l.jsxRuntimeExports.jsx(Ys,{className:x.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:l.jsxRuntimeExports.jsx(g.Qt.Box,{})}),l.jsxRuntimeExports.jsx(Ys,{onClick:s,className:x.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})})]}),Ys=({disabled:e=!1,className:t,...n})=>e?null:l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ll=e=>Z.w.getOS(e),Jp={MacOS:Qp,Windows:qs,Linux:qs,Docker:qs},em="Windows",tm=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ll({force:e,default:em}),r=Jp[s];return t!=null&&t!==s?null:l.jsxRuntimeExports.jsx(r,{...n})},nm=Object.freeze(Object.defineProperty({__proto__:null,Controls:tm,use:Ll},Symbol.toStringTag,{value:"Module"})),sm=(e,t)=>{const n=s=>l.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},rm=Object.freeze(Object.defineProperty({__proto__:null,createComponent:sm},Symbol.toStringTag,{value:"Module"}));f.createContext({instrumentation:Z.B$1.NOOP});const om=g.wrap$1(P.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=g.useMemoDeepEqualProps(n),[{path:r},,o]=g.use$3({aetherKey:e,type:P.Provider$2.TYPE,schema:P.providerStateZ$1,initialState:s});return f.useEffect(()=>{o(s)},[s,o]),l.jsxRuntimeExports.jsx(g.Composite,{path:r,children:t})}),im="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",$l=g.wrap$1(P.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=g.use$3({aetherKey:t,type:P.BaseProvider.TYPE,schema:P.providerStateZ$2,initialState:{}});return l.jsxRuntimeExports.jsx(g.Composite,{path:n,children:e})}),lm=Object.freeze(Object.defineProperty({__proto__:null,Provider:$l},Symbol.toStringTag,{value:"Module"})),cm=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Ol=g.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...r})=>{const o=g.useMemoDeepEqualProps({source:t,sink:n}),[,{status:i},c]=g.use$3({aetherKey:e,type:P.Chip.TYPE,schema:P.chipStateZ,initialState:{triggered:!1,...o,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});f.useEffect(()=>{c(h=>({...h,...o}))},[o,c]);const a=f.useCallback(()=>c(h=>({...h,triggered:!h.triggered})),[c]),{message:d,chipColor:u,buttonStyle:p,disabled:m}=cm(i);return l.jsxRuntimeExports.jsx(g.Icon,{variant:"text",className:x.CSS(x.CSS.B("control-chip"),s),disabled:m,onClick:a,tooltip:l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:d}),style:p,...r,children:l.jsxRuntimeExports.jsx(g.Qt.Circle,{color:u})})}),Dl=f.createContext({needsControlOf:[]}),zl=()=>f.useContext(Dl),am=g.wrap$1(P.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const r=g.useMemoDeepEqualProps(s),[{path:o},{status:i,needsControlOf:c},a]=g.use$3({aetherKey:e,type:P.Controller$1.TYPE,schema:P.controllerStateZ,initialState:r});return f.useEffect(()=>{i!=null&&(n==null||n(i))},[i,n]),f.useEffect(()=>{a(d=>({...d,...r}))},[r,a]),f.useEffect(()=>()=>n==null?void 0:n("released"),[]),l.jsxRuntimeExports.jsxs(Dl.Provider,{value:{needsControlOf:c},children:[l.jsxRuntimeExports.jsx(g.Composite,{path:o,children:t}),";"]})}),Bl=g.wrap$1(P.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=g.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:r,status:o},i]=g.use$3({aetherKey:e,type:P.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:P.indicatorStateZ});f.useEffect(()=>{i(d=>({...d,...s}))},[s,i]);let c;return((a=o.data)==null?void 0:a.color)!=null?c=x.Color.z.parse(o.data.color):r!=null&&!r.isZero?c=r:c="var(--pluto-gray-l8)",l.jsxRuntimeExports.jsxs(g.Dialog$1,{location:{x:"center",y:"bottom"},children:[l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:o.message}),l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("indicator"),style:{backgroundColor:x.cssString(c),flexGrow:1}})]})}),um=g.wrap$1(P.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=zl(),[,{states:s},r]=g.use$3({aetherKey:e,type:P.Legend.TYPE,schema:P.legendStateZ,initialState:{states:[],needsControlOf:n}});f.useEffect(()=>{r(c=>({...c,needsControlOf:n}))},[n]);const i=Z.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(d=>d.subject.key===c);if(a==null)throw new Z.Ce("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return l.jsxRuntimeExports.jsx($r,{data:i,...t})}),Il=g.wrap$1(P.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=g.use$3({aetherKey:e,type:P.StateProvider.TYPE,schema:P.stateProviderStateZ,initialState:{}});return l.jsxRuntimeExports.jsx(g.Composite,{path:n,children:t})}),dm=Object.freeze(Object.defineProperty({__proto__:null,Chip:Ol,Controller:am,Indicator:Bl,Legend:um,StateProvider:Il,useContext:zl},Symbol.toStringTag,{value:"Module"})),Vl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:l.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},xm=Vl($l),fm=Vl(g.Provider$3),pm=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:o,triggers:i,alamos:c,haul:a,channelAlias:d,telem:u})=>l.jsxRuntimeExports.jsx(g.Provider$1,{...i,children:l.jsxRuntimeExports.jsx(g.Config,{...o,children:l.jsxRuntimeExports.jsx(g.Provider$2,{...a,children:l.jsxRuntimeExports.jsx(g.Provider$4,{url:s??im,enabled:n,children:l.jsxRuntimeExports.jsx(fm,{workerKey:"vis",children:l.jsxRuntimeExports.jsx(om,{...c,children:l.jsxRuntimeExports.jsx(g.Aggregator,{children:l.jsxRuntimeExports.jsx($i,{connParams:t,children:l.jsxRuntimeExports.jsx(zi,{...d,children:l.jsxRuntimeExports.jsx(xm,{...u,children:l.jsxRuntimeExports.jsx(g.Provider,{...r,children:l.jsxRuntimeExports.jsx(Il,{children:e})})})})})})})})})})})}),mm=Object.freeze(Object.defineProperty({__proto__:null,Provider:pm},Symbol.toStringTag,{value:"Module"})),hm=({value:e})=>l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("progress"),children:l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("progress-bar"),style:{width:`${e}%`}})}),gm=Object.freeze(Object.defineProperty({__proto__:null,Progress:hm},Symbol.toStringTag,{value:"Module"})),vn="range",Wr=[{key:"name",name:"Name"}],us=({items:e},t)=>{const n=g.filterByType(vn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},ym=({onChange:e,className:t,value:n,...s})=>{const r=Ye(),o=r!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:i,onDragEnd:c,...a}=g.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:f.useCallback(m=>us(m,Z.A(n)),[n]),onDrop:f.useCallback(({items:m})=>{const h=g.filterByType(vn,m);if(h.length===0)return[];const E=Z.n([...Z.A(n),...h.map(y=>y.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),h},[e,n])}),d=g.useDraggingState(),u=f.useCallback(({dropped:m})=>{e(Z.A(n).filter(h=>!m.some(E=>E.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=f.useCallback((m,h)=>i([{key:h,type:vn}],u),[i,u]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(t,x.CSS.dropRegion(us(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Wr,emptyContent:o,entryRenderKey:"name",...a,...s})},Fl=({value:e,onChange:t})=>{const n=Ye(),s=n!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=f.useId(),o=f.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:i,...c}=g.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:f.useCallback(u=>us(u,Z.o$1(e)),[e]),onDrop:f.useCallback(({items:u})=>{const p=g.filterByType(vn,u);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[o,t])}),a=g.useDraggingState(),d=f.useCallback(()=>e!=null&&i([{type:vn,key:e}]),[i,e]);return{emptyContent:s,dragging:a,...c,onDragStart:d,searcher:n==null?void 0:n.ranges}},Sm=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:o,...i}=Fl({value:t,onChange:e});return l.jsxRuntimeExports.jsx(gt,{data:s,className:x.CSS(n,x.CSS.dropRegion(us(o,Z.o$1(t)))),value:t,onChange:e,columns:Wr,entryRenderKey:"name",...i,...r})},Em=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...o}=Fl({value:t,onChange:n});return l.jsxRuntimeExports.jsx(gt,{data:e,value:t,onChange:n,columns:Wr,entryRenderKey:"name",...o,...s})},jm=[{key:"color",name:"Color",width:50,render:e=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Rm=e=>{const t=Ye();return l.jsxRuntimeExports.jsx(rn,{...e,searcher:t==null?void 0:t.labels,columns:jm,renderTag:n=>n.entry==null?l.jsxRuntimeExports.jsx(wn,{color:"gray",children:n.entryKey}):l.jsxRuntimeExports.jsx(wn,{color:n.entry.color,children:n.entry.name})})},bm=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const o=new Z.m(e.start),i=o.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),d=c.span(o)<Z.y.DAY?"time":"dateTime",u=o.span(c);return l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",size:"small",className:x.CSS(x.CSS.B("time-range-chip")),align:"center",...r,children:[o.isToday&&l.jsxRuntimeExports.jsx(g.Text,{level:t,shade:n,weight:450,children:"Today"}),l.jsxRuntimeExports.jsx(g.DateTime,{level:t,displayTZ:"local",format:i,shade:n,weight:450,children:o}),l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?l.jsxRuntimeExports.jsx(g.Text,{level:t,children:"Now"}):l.jsxRuntimeExports.jsx(g.DateTime,{level:t,displayTZ:"local",format:d,shade:n,weight:450,children:c}),!u.isZero&&s&&l.jsxRuntimeExports.jsxs(g.Text,{level:t,shade:n,weight:450,children:["(",o.span(c).truncate(Z.y.MILLISECOND).toString(),")"]})]})},wm=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Em,SelectLabels:Rm,SelectMultiple:ym,SelectSingle:Sm,TimeRangeChip:bm},Symbol.toStringTag,{value:"Module"})),Cm=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(o=>o.key===t);return l.jsxRuntimeExports.jsx(X.Space,{direction:"x",align:"center",className:x.CSS.B("steps"),...s,children:e.map((o,i)=>l.jsxRuntimeExports.jsxs(f.Fragment,{children:[l.jsxRuntimeExports.jsxs(g.Button,{onClick:()=>n(o.key),variant:"outlined",disabled:i>r,children:[i+1,". ",o.title]},o.key),i!==e.length-1&&l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},o.key))})},vm=Object.freeze(Object.defineProperty({__proto__:null,Steps:Cm},Symbol.toStringTag,{value:"Module"})),Do=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=En(e,...n);return x.q.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},zo=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:o})=>{if(!_m({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const i=x.g.construct(t),c=x.g.swap(i);let a=Pt(c,s[c]-e[c]);const d=x.Eo.loc(n,a);if(x.J.swap(t)===r){const u=x.Eo.loc(o,x.J.swap(a));Math.abs(d-u)<Ie&&(a=x.J.swap(a))}return{direction:c,length:d-e[c]+Mt(a,Ie)}},dr=ne.z.object({direction:x.g.direction,length:ne.z.number()}),En=(e,...t)=>{let n=e;for(const s of t)n=x.q.translate(n,s.direction,s.length);return n},Zl=(e,t,n,s)=>{try{let r=e;const o=[e,...t.map(h=>(r=x.q.translate(r,h.direction,h.length),r))];if(!s)return o;const i=t[0],c=Pt(i.direction,i.length),a=Bo(c),d=4*(2-n**.5);o[0]=x.q.translate(o[0],{[i.direction]:-1*a*d,[x.g.swap(i.direction)]:0});const u=t[t.length-1],p=Pt(u.direction,u.length),m=Bo(p);return o[o.length-1]=x.q.translate(o[o.length-1],{[u.direction]:m*d,[x.g.swap(u.direction)]:0}),o}catch{return[]}},Ie=10,Bo=e=>e==="top"||e==="left"?-1:1,Mt=(e,t)=>e==="top"||e==="left"?-t:t,Pt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",dt=e=>Pt(e.direction,e.length),_m=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=x.g.construct(n),r=t[s]-e[s];return Mt(n,r)<0},Dn=e=>({direction:x.g.construct(e),length:Mt(e,Ie)}),Io={top:Dn("top"),bottom:Dn("bottom"),left:Dn("left"),right:Dn("right")},km=4,Pm=.25,ks=e=>xr(Nm(xr(e))),Nm=e=>{const t=[...e],n=e.findIndex((s,r)=>{const o=Math.abs(s.length);if(o<km){if(o<Pm)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const i=t[r+2];if(i.direction!==s.direction)return!1;t[r+2]={...i,length:i.length+s.length}}else{const i=t[r-2];if(i.direction!==s.direction)return!1;t[r-2]={...i,length:i.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},xr=e=>{const t=[...e];return e.findIndex((s,r)=>{const o=t[r-1];if(r===0||s.direction!==o.direction)return!1;if(r===1){const i=r-1,c=r,a=dt(o),d=dt(s);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(o.length)===Ie)return!1;const u=Mt(a,Ie),p=t[i].length-u,m=t[c].length+p;return Math.abs(m)<Ie?!1:(t[i]={...t[i],length:u},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const i=r,c=r-1,a=dt(s),d=dt(o);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Ie)return!1;const u=Mt(a,Ie),p=t[i].length-u,m=t[c].length+p;return Math.abs(m)<Ie?!1:(t[i]={...t[i],length:u},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?xr(t):t},Yt=e=>ks(Mm(e)),Mm=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:o})=>{let i=o,c=r,a={...Io[o]},d=En(n,a);const u={...Io[r]};let p=En(s,u);const m=[a],h=zo({sourceStumpTip:d,sourceOrientation:o,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});h!=null&&(m.push(h),d=En(d,h),i=dt(h),a=h);const E=zo({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:d,targetOrientation:i,targetBox:e});E!=null&&(p=En(p,E),c=Pt(E.direction,E.length));const y=()=>{E!=null&&(E.length*=-1,m.push(E)),u.length*=-1,m.push(u)};if(x.J.swap(i)===r){const b=x.g.construct(i),_=(p[b]-d[b])/2;m.push({direction:b,length:_});const $=x.g.swap(b);return m.push({direction:$,length:p[$]-d[$]}),m.push({direction:b,length:_}),y(),m}const w=p[a.direction]-d[a.direction];let j=x.g.swap(a.direction);const C=d[j]-p[j];let v;Pt(a.direction,w)===i&&Pt(j,C)===c?v={direction:a.direction,length:w}:(v={direction:j,length:p[j]-d[j]},j=x.g.swap(j)),m.push(v);const R={direction:j,length:p[j]-d[j]};return m.push(R),y(),m},Tm=e=>ks(Am(e)),Am=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],o=x.g.swap(r.direction),i=dt(r);if(t===0){s.unshift({direction:o,length:n});const c=Mt(i,Ie);s.unshift({direction:r.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:o,length:-n});const c=Mt(i,Ie);s.push({direction:r.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},Lm=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},$m=(e,t,n=!1,...s)=>{const r=(o,i)=>!s.includes(i)&&t(o,i);return n?Lm(e,r):e.findIndex(r)},Om=({delta:e,segments:t})=>ks(Hl(e,t,!1)),Dm=({delta:e,segments:t})=>ks(Hl(e,t,!0)),Hl=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Fo("x",e,s,n)),e.y!==0&&(s=Fo("y",e,s,n)),s},Vo=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=dt(t),o=dt(s);return Math.abs(s.length)>Ie&&r===o},Fo=(e,t,n,s)=>{const r=x.g.swap(e),o=s?n.length-1:0,i=n[o];if(Vo(e,i,t))return n[o]={...i,length:i.length-t[e]},n;const c=s?0:n.length-1,d=$m(n,p=>p.direction===e,s,o);if(d===c){const p=n[c];return Vo(e,p,t)?(n[c]={...p,length:p.length-t[e]},n):(i.direction===e?n[o]={...i,length:i.length-t[e]}:n[c]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:i.direction===e?(n[o]={...i,length:i.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const u=n[d];return n[d]={...u,length:u.length-t[e]},n},zm=ne.z.object({position:x.q.xy,zoom:ne.z.number()}),ql=ne.z.object({color:x.crudeZ,segments:ne.z.array(dr)}),Bm=ql.extend({key:ne.z.string(),source:ne.z.string(),target:ne.z.string(),segments:ne.z.array(dr),color:x.crudeZ,id:ne.z.string(),data:ne.z.object({segments:ne.z.array(dr),color:x.crudeZ}).optional(),selected:ne.z.boolean(),sourceHandle:ne.z.string().nullable().optional(),targetHandle:ne.z.string().nullable().optional()}),Im=ne.z.object({key:ne.z.string(),position:x.q.xy,selected:ne.z.boolean().optional(),zIndex:ne.z.number().optional(),id:ne.z.string().optional(),type:ne.z.string().optional(),data:ne.z.unknown().optional(),width:ne.z.number().optional().nullable(),height:ne.z.number().optional().nullable()}),Kr=e=>e.map(t=>({...t,id:t.key,type:"custom",zIndex:t.zIndex,data:{}})),Xr=e=>e.map(({segments:t,color:n,...s})=>({...s,id:s.key,data:{segments:t,color:n}})),Yl=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),Ul=(e,t)=>e.map(n=>{var s,r;return n.data==null&&(n.data={segments:[],color:t}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((r=n.data)==null?void 0:r.color)??t,...n}}),Gl=e=>({...e.position,zoom:e.zoom}),Wl=e=>({position:x.q.construct(e),zoom:e.zoom}),Kl=(e,t)=>Yl(t(Kr(e))),Wn=(e,t,n)=>Ul(t(Xr(e)),n),Vm=(e,t="x")=>{if(e.length===0)return[];const n=x.J.construct(t),s=x.J.swap(n);return e.sort((r,o)=>x.Eo.loc(r.box,n)-x.Eo.loc(o.box,n)),e.forEach((r,o)=>{if(o===0)return;const c=e[o-1].handles.find(h=>h.orientation===s),a=r.handles.find(h=>h.orientation===n);if(c==null||a==null)return;const d=c.absolutePosition,u=a.absolutePosition,p=x.q.set(x.q.translation(u,d),t,0),m=x.q.translate(x.Eo.topLeft(r.box),p);r.box=x.Eo.construct(m,x.Eo.dims(r.box))}),e};function ze(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=ze(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var fr={exports:{}},Us={},zn={exports:{}},Gs={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Zo;function Fm(){if(Zo)return Gs;Zo=1;var e=f;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function c(p,m){var h=m(),E=s({inst:{value:h,getSnapshot:m}}),y=E[0].inst,w=E[1];return o(function(){y.value=h,y.getSnapshot=m,a(y)&&w({inst:y})},[p,h,m]),r(function(){return a(y)&&w({inst:y}),p(function(){a(y)&&w({inst:y})})},[p]),i(h),h}function a(p){var m=p.getSnapshot;p=p.value;try{var h=m();return!n(p,h)}catch{return!0}}function d(p,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Gs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Gs}var Ws={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ho;function Zm(){return Ho||(Ho=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=f,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(v){{for(var R=arguments.length,b=new Array(R>1?R-1:0),_=1;_<R;_++)b[_-1]=arguments[_];s("error",v,b)}}function s(v,R,b){{var _=t.ReactDebugCurrentFrame,$=_.getStackAddendum();$!==""&&(R+="%s",b=b.concat([$]));var O=b.map(function(N){return String(N)});O.unshift("Warning: "+R),Function.prototype.apply.call(console[v],console,O)}}function r(v,R){return v===R&&(v!==0||1/v===1/R)||v!==v&&R!==R}var o=typeof Object.is=="function"?Object.is:r,i=e.useState,c=e.useEffect,a=e.useLayoutEffect,d=e.useDebugValue,u=!1,p=!1;function m(v,R,b){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var _=R();if(!p){var $=R();o(_,$)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}var O=i({inst:{value:_,getSnapshot:R}}),N=O[0].inst,D=O[1];return a(function(){N.value=_,N.getSnapshot=R,h(N)&&D({inst:N})},[v,_,R]),c(function(){h(N)&&D({inst:N});var T=function(){h(N)&&D({inst:N})};return v(T)},[v]),d(_),_}function h(v){var R=v.getSnapshot,b=v.value;try{var _=R();return!o(b,_)}catch{return!0}}function E(v,R,b){return R()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",w=!y,j=w?E:m,C=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:j;Ws.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ws}var qo;function Xl(){return qo||(qo=1,process.env.NODE_ENV==="production"?zn.exports=Fm():zn.exports=Zm()),zn.exports}/**
|
|
18
|
+
* @license React
|
|
19
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Yo;function Hm(){if(Yo)return Us;Yo=1;var e=f,t=Xl();function n(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Us.useSyncExternalStoreWithSelector=function(d,u,p,m,h){var E=o(null);if(E.current===null){var y={hasValue:!1,value:null};E.current=y}else y=E.current;E=c(function(){function j(_){if(!C){if(C=!0,v=_,_=m(_),h!==void 0&&y.hasValue){var $=y.value;if(h($,_))return R=$}return R=_}if($=R,s(v,_))return $;var O=m(_);return h!==void 0&&h($,O)?$:(v=_,R=O)}var C=!1,v,R,b=p===void 0?null:p;return[function(){return j(u())},b===null?void 0:function(){return j(b())}]},[u,p,m,h]);var w=r(d,E[0],E[1]);return i(function(){y.hasValue=!0,y.value=w},[w]),a(w),w},Us}var Ks={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Uo;function qm(){return Uo||(Uo=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=f,t=Xl();function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;function d(u,p,m,h,E){var y=o(null),w;y.current===null?(w={hasValue:!1,value:null},y.current=w):w=y.current;var j=c(function(){var b=!1,_,$,O=function(M){if(!b){b=!0,_=M;var z=h(M);if(E!==void 0&&w.hasValue){var S=w.value;if(E(S,z))return $=S,S}return $=z,z}var L=_,k=$;if(s(L,M))return k;var I=h(M);return E!==void 0&&E(k,I)?k:(_=M,$=I,I)},N=m===void 0?null:m,D=function(){return O(p())},T=N===null?void 0:function(){return O(N())};return[D,T]},[p,m,h,E]),C=j[0],v=j[1],R=r(u,C,v);return i(function(){w.hasValue=!0,w.value=R},[R]),a(R),R}Ks.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ks}process.env.NODE_ENV==="production"?fr.exports=Hm():fr.exports=qm();var Ym=fr.exports;const Um=g.getDefaultExportFromCjs(Ym),Gm={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Go=e=>{let t;const n=new Set,s=(u,p)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const h=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(E=>E(t,h))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>d,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Gm?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,r,a);return a},Wm=e=>e?Go(e):Go,{useDebugValue:Km}=f,{useSyncExternalStoreWithSelector:Xm}=Um,Qm=e=>e;function Ql(e,t=Qm,n){const s=Xm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Km(s),s}const Wo=(e,t)=>{const n=Wm(e),s=(r,o=t)=>Ql(n,r,o);return Object.assign(s,n),s},Jm=(e,t)=>e?Wo(e,t):Wo;function Ne(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}var eh={value:()=>{}};function Ps(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Kn(n)}function Kn(e){this._=e}function th(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Kn.prototype=Ps.prototype={constructor:Kn,on:function(e,t){var n=this._,s=th(e+"",n),r,o=-1,i=s.length;if(arguments.length<2){for(;++o<i;)if((r=(e=s[o]).type)&&(r=nh(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(r=(e=s[o]).type)n[r]=Ko(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ko(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Kn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,o;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],s=0,r=o.length;s<r;++s)o[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,o=s.length;r<o;++r)s[r].value.apply(t,n)}};function nh(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Ko(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=eh,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var pr="http://www.w3.org/1999/xhtml";const Xo={svg:"http://www.w3.org/2000/svg",xhtml:pr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ns(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xo.hasOwnProperty(t)?{space:Xo[t],local:e}:e}function sh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===pr&&t.documentElement.namespaceURI===pr?t.createElement(e):t.createElementNS(n,e)}}function rh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jl(e){var t=Ns(e);return(t.local?rh:sh)(t)}function oh(){}function Qr(e){return e==null?oh:function(){return this.querySelector(e)}}function ih(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=new Array(i),a,d,u=0;u<i;++u)(a=o[u])&&(d=e.call(a,a.__data__,u,o))&&("__data__"in a&&(d.__data__=a.__data__),c[u]=d);return new Oe(s,this._parents)}function lh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ch(){return[]}function ec(e){return e==null?ch:function(){return this.querySelectorAll(e)}}function ah(e){return function(){return lh(e.apply(this,arguments))}}function uh(e){typeof e=="function"?e=ah(e):e=ec(e);for(var t=this._groups,n=t.length,s=[],r=[],o=0;o<n;++o)for(var i=t[o],c=i.length,a,d=0;d<c;++d)(a=i[d])&&(s.push(e.call(a,a.__data__,d,i)),r.push(a));return new Oe(s,r)}function tc(e){return function(){return this.matches(e)}}function nc(e){return function(t){return t.matches(e)}}var dh=Array.prototype.find;function xh(e){return function(){return dh.call(this.children,e)}}function fh(){return this.firstElementChild}function ph(e){return this.select(e==null?fh:xh(typeof e=="function"?e:nc(e)))}var mh=Array.prototype.filter;function hh(){return Array.from(this.children)}function gh(e){return function(){return mh.call(this.children,e)}}function yh(e){return this.selectAll(e==null?hh:gh(typeof e=="function"?e:nc(e)))}function Sh(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=[],a,d=0;d<i;++d)(a=o[d])&&e.call(a,a.__data__,d,o)&&c.push(a);return new Oe(s,this._parents)}function sc(e){return new Array(e.length)}function Eh(){return new Oe(this._enter||this._groups.map(sc),this._parents)}function ds(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ds.prototype={constructor:ds,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jh(e){return function(){return e}}function Rh(e,t,n,s,r,o){for(var i=0,c,a=t.length,d=o.length;i<d;++i)(c=t[i])?(c.__data__=o[i],s[i]=c):n[i]=new ds(e,o[i]);for(;i<a;++i)(c=t[i])&&(r[i]=c)}function bh(e,t,n,s,r,o,i){var c,a,d=new Map,u=t.length,p=o.length,m=new Array(u),h;for(c=0;c<u;++c)(a=t[c])&&(m[c]=h=i.call(a,a.__data__,c,t)+"",d.has(h)?r[c]=a:d.set(h,a));for(c=0;c<p;++c)h=i.call(e,o[c],c,o)+"",(a=d.get(h))?(s[c]=a,a.__data__=o[c],d.delete(h)):n[c]=new ds(e,o[c]);for(c=0;c<u;++c)(a=t[c])&&d.get(m[c])===a&&(r[c]=a)}function wh(e){return e.__data__}function Ch(e,t){if(!arguments.length)return Array.from(this,wh);var n=t?bh:Rh,s=this._parents,r=this._groups;typeof e!="function"&&(e=jh(e));for(var o=r.length,i=new Array(o),c=new Array(o),a=new Array(o),d=0;d<o;++d){var u=s[d],p=r[d],m=p.length,h=vh(e.call(u,u&&u.__data__,d,s)),E=h.length,y=c[d]=new Array(E),w=i[d]=new Array(E),j=a[d]=new Array(m);n(u,p,y,w,j,h,t);for(var C=0,v=0,R,b;C<E;++C)if(R=y[C]){for(C>=v&&(v=C+1);!(b=w[v])&&++v<E;);R._next=b||null}}return i=new Oe(i,s),i._enter=c,i._exit=a,i}function vh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _h(){return new Oe(this._exit||this._groups.map(sc),this._parents)}function kh(e,t,n){var s=this.enter(),r=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?o.remove():n(o),s&&r?s.merge(r).order():r}function Ph(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,o=s.length,i=Math.min(r,o),c=new Array(r),a=0;a<i;++a)for(var d=n[a],u=s[a],p=d.length,m=c[a]=new Array(p),h,E=0;E<p;++E)(h=d[E]||u[E])&&(m[E]=h);for(;a<r;++a)c[a]=n[a];return new Oe(c,this._parents)}function Nh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,o=s[r],i;--r>=0;)(i=s[r])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Mh(e){e||(e=Th);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),o=0;o<s;++o){for(var i=n[o],c=i.length,a=r[o]=new Array(c),d,u=0;u<c;++u)(d=i[u])&&(a[u]=d);a.sort(t)}return new Oe(r,this._parents).order()}function Th(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ah(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Lh(){return Array.from(this)}function $h(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,o=s.length;r<o;++r){var i=s[r];if(i)return i}return null}function Oh(){let e=0;for(const t of this)++e;return e}function Dh(){return!this.node()}function zh(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],o=0,i=r.length,c;o<i;++o)(c=r[o])&&e.call(c,c.__data__,o,r);return this}function Bh(e){return function(){this.removeAttribute(e)}}function Ih(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vh(e,t){return function(){this.setAttribute(e,t)}}function Fh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Hh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function qh(e,t){var n=Ns(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?Ih:Bh:typeof t=="function"?n.local?Hh:Zh:n.local?Fh:Vh)(n,t))}function rc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Yh(e){return function(){this.style.removeProperty(e)}}function Uh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Gh(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Wh(e,t,n){return arguments.length>1?this.each((t==null?Yh:typeof t=="function"?Gh:Uh)(e,t,n??"")):Qt(this.node(),e)}function Qt(e,t){return e.style.getPropertyValue(t)||rc(e).getComputedStyle(e,null).getPropertyValue(t)}function Kh(e){return function(){delete this[e]}}function Xh(e,t){return function(){this[e]=t}}function Qh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Jh(e,t){return arguments.length>1?this.each((t==null?Kh:typeof t=="function"?Qh:Xh)(e,t)):this.node()[e]}function oc(e){return e.trim().split(/^|\s+/)}function Jr(e){return e.classList||new ic(e)}function ic(e){this._node=e,this._names=oc(e.getAttribute("class")||"")}ic.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function lc(e,t){for(var n=Jr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function cc(e,t){for(var n=Jr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function eg(e){return function(){lc(this,e)}}function tg(e){return function(){cc(this,e)}}function ng(e,t){return function(){(t.apply(this,arguments)?lc:cc)(this,e)}}function sg(e,t){var n=oc(e+"");if(arguments.length<2){for(var s=Jr(this.node()),r=-1,o=n.length;++r<o;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?ng:t?eg:tg)(n,t))}function rg(){this.textContent=""}function og(e){return function(){this.textContent=e}}function ig(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lg(e){return arguments.length?this.each(e==null?rg:(typeof e=="function"?ig:og)(e)):this.node().textContent}function cg(){this.innerHTML=""}function ag(e){return function(){this.innerHTML=e}}function ug(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function dg(e){return arguments.length?this.each(e==null?cg:(typeof e=="function"?ug:ag)(e)):this.node().innerHTML}function xg(){this.nextSibling&&this.parentNode.appendChild(this)}function fg(){return this.each(xg)}function pg(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mg(){return this.each(pg)}function hg(e){var t=typeof e=="function"?e:Jl(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gg(){return null}function yg(e,t){var n=typeof e=="function"?e:Jl(e),s=t==null?gg:typeof t=="function"?t:Qr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Sg(){var e=this.parentNode;e&&e.removeChild(this)}function Eg(){return this.each(Sg)}function jg(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rg(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bg(e){return this.select(e?Rg:jg)}function wg(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Cg(e){return function(t){e.call(this,t,this.__data__)}}function vg(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function _g(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,o;n<r;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++s]=o;++s?t.length=s:delete this.__on}}}function kg(e,t,n){return function(){var s=this.__on,r,o=Cg(t);if(s){for(var i=0,c=s.length;i<c;++i)if((r=s[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},s?s.push(r):this.__on=[r]}}function Pg(e,t,n){var s=vg(e+""),r,o=s.length,i;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,d=c.length,u;a<d;++a)for(r=0,u=c[a];r<o;++r)if((i=s[r]).type===u.type&&i.name===u.name)return u.value}return}for(c=t?kg:_g,r=0;r<o;++r)this.each(c(s[r],t,n));return this}function ac(e,t,n){var s=rc(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Ng(e,t){return function(){return ac(this,e,t)}}function Mg(e,t){return function(){return ac(this,e,t.apply(this,arguments))}}function Tg(e,t){return this.each((typeof t=="function"?Mg:Ng)(e,t))}function*Ag(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,o=s.length,i;r<o;++r)(i=s[r])&&(yield i)}var uc=[null];function Oe(e,t){this._groups=e,this._parents=t}function An(){return new Oe([[document.documentElement]],uc)}function Lg(){return this}Oe.prototype=An.prototype={constructor:Oe,select:ih,selectAll:uh,selectChild:ph,selectChildren:yh,filter:Sh,data:Ch,enter:Eh,exit:_h,join:kh,merge:Ph,selection:Lg,order:Nh,sort:Mh,call:Ah,nodes:Lh,node:$h,size:Oh,empty:Dh,each:zh,attr:qh,style:Wh,property:Jh,classed:sg,text:lg,html:dg,raise:fg,lower:mg,append:hg,insert:yg,remove:Eg,clone:bg,datum:wg,on:Pg,dispatch:Tg,[Symbol.iterator]:Ag};function Ze(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],uc)}function $g(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xe(e,t){if(e=$g(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Og={passive:!1},_n={capture:!0,passive:!1};function Xs(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function dc(e){var t=e.document.documentElement,n=Ze(e).on("dragstart.drag",Gt,_n);"onselectstart"in t?n.on("selectstart.drag",Gt,_n):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xc(e,t){var n=e.document.documentElement,s=Ze(e).on("dragstart.drag",null);t&&(s.on("click.drag",Gt,_n),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Bn=e=>()=>e;function mr(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:o,x:i,y:c,dx:a,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}mr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Dg(e){return!e.ctrlKey&&!e.button}function zg(){return this.parentNode}function Bg(e,t){return t??{x:e.x,y:e.y}}function Ig(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vg(){var e=Dg,t=zg,n=Bg,s=Ig,r={},o=Ps("start","drag","end"),i=0,c,a,d,u,p=0;function m(R){R.on("mousedown.drag",h).filter(s).on("touchstart.drag",w).on("touchmove.drag",j,Og).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(R,b){if(!(u||!e.call(this,R,b))){var _=v(this,t.call(this,R,b),R,b,"mouse");_&&(Ze(R.view).on("mousemove.drag",E,_n).on("mouseup.drag",y,_n),dc(R.view),Xs(R),d=!1,c=R.clientX,a=R.clientY,_("start",R))}}function E(R){if(Gt(R),!d){var b=R.clientX-c,_=R.clientY-a;d=b*b+_*_>p}r.mouse("drag",R)}function y(R){Ze(R.view).on("mousemove.drag mouseup.drag",null),xc(R.view,d),Gt(R),r.mouse("end",R)}function w(R,b){if(e.call(this,R,b)){var _=R.changedTouches,$=t.call(this,R,b),O=_.length,N,D;for(N=0;N<O;++N)(D=v(this,$,R,b,_[N].identifier,_[N]))&&(Xs(R),D("start",R,_[N]))}}function j(R){var b=R.changedTouches,_=b.length,$,O;for($=0;$<_;++$)(O=r[b[$].identifier])&&(Gt(R),O("drag",R,b[$]))}function C(R){var b=R.changedTouches,_=b.length,$,O;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),$=0;$<_;++$)(O=r[b[$].identifier])&&(Xs(R),O("end",R,b[$]))}function v(R,b,_,$,O,N){var D=o.copy(),T=Xe(N||_,b),M,z,S;if((S=n.call(R,new mr("beforestart",{sourceEvent:_,target:m,identifier:O,active:i,x:T[0],y:T[1],dx:0,dy:0,dispatch:D}),$))!=null)return M=S.x-T[0]||0,z=S.y-T[1]||0,function L(k,I,B){var A=T,V;switch(k){case"start":r[O]=L,V=i++;break;case"end":delete r[O],--i;case"drag":T=Xe(B||I,b),V=i;break}D.call(k,R,new mr(k,{sourceEvent:I,subject:S,target:m,identifier:O,active:V,x:T[0]+M,y:T[1]+z,dx:T[0]-A[0],dy:T[1]-A[1],dispatch:D}),$)}}return m.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Bn(!!R),m):e},m.container=function(R){return arguments.length?(t=typeof R=="function"?R:Bn(R),m):t},m.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Bn(R),m):n},m.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Bn(!!R),m):s},m.on=function(){var R=o.on.apply(o,arguments);return R===o?m:R},m.clickDistance=function(R){return arguments.length?(p=(R=+R)*R,m):Math.sqrt(p)},m}var Jt=0,jn=0,fn=0,fc=1e3,xs,Rn,fs=0,Tt=0,Ms=0,kn=typeof performance=="object"&&performance.now?performance:Date,pc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eo(){return Tt||(pc(Fg),Tt=kn.now()+Ms)}function Fg(){Tt=0}function ps(){this._call=this._time=this._next=null}ps.prototype=mc.prototype={constructor:ps,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?eo():+n)+(t==null?0:+t),!this._next&&Rn!==this&&(Rn?Rn._next=this:xs=this,Rn=this),this._call=e,this._time=n,hr()},stop:function(){this._call&&(this._call=null,this._time=1/0,hr())}};function mc(e,t,n){var s=new ps;return s.restart(e,t,n),s}function Zg(){eo(),++Jt;for(var e=xs,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jt}function Qo(){Tt=(fs=kn.now())+Ms,Jt=jn=0;try{Zg()}finally{Jt=0,qg(),Tt=0}}function Hg(){var e=kn.now(),t=e-fs;t>fc&&(Ms-=t,fs=e)}function qg(){for(var e,t=xs,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xs=n);Rn=e,hr(s)}function hr(e){if(!Jt){jn&&(jn=clearTimeout(jn));var t=e-Tt;t>24?(e<1/0&&(jn=setTimeout(Qo,e-kn.now()-Ms)),fn&&(fn=clearInterval(fn))):(fn||(fs=kn.now(),fn=setInterval(Hg,fc)),Jt=1,pc(Qo))}}function Jo(e,t,n){var s=new ps;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var Yg=Ps("start","end","cancel","interrupt"),Ug=[],hc=0,ei=1,gr=2,Xn=3,ti=4,yr=5,Qn=6;function Ts(e,t,n,s,r,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Gg(e,n,{name:t,index:s,group:r,on:Yg,tween:Ug,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:hc})}function to(e,t){var n=Ue(e,t);if(n.state>hc)throw new Error("too late; already scheduled");return n}function Je(e,t){var n=Ue(e,t);if(n.state>Xn)throw new Error("too late; already running");return n}function Ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Gg(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=mc(o,0,n.time);function o(d){n.state=ei,n.timer.restart(i,n.delay,n.time),n.delay<=d&&i(d-n.delay)}function i(d){var u,p,m,h;if(n.state!==ei)return a();for(u in s)if(h=s[u],h.name===n.name){if(h.state===Xn)return Jo(i);h.state===ti?(h.state=Qn,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[u]):+u<t&&(h.state=Qn,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[u])}if(Jo(function(){n.state===Xn&&(n.state=ti,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=gr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gr){for(n.state=Xn,r=new Array(m=n.tween.length),u=0,p=-1;u<m;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function c(d){for(var u=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(a),n.state=yr,1),p=-1,m=r.length;++p<m;)r[p].call(e,u);n.state===yr&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Qn,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function Jn(e,t){var n=e.__transition,s,r,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((s=n[i]).name!==t){o=!1;continue}r=s.state>gr&&s.state<yr,s.state=Qn,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[i]}o&&delete e.__transition}}function Wg(e){return this.each(function(){Jn(this,e)})}function Kg(e,t){var n,s;return function(){var r=Je(this,e),o=r.tween;if(o!==n){s=n=o;for(var i=0,c=s.length;i<c;++i)if(s[i].name===t){s=s.slice(),s.splice(i,1);break}}r.tween=s}}function Xg(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var o=Je(this,e),i=o.tween;if(i!==s){r=(s=i).slice();for(var c={name:t,value:n},a=0,d=r.length;a<d;++a)if(r[a].name===t){r[a]=c;break}a===d&&r.push(c)}o.tween=r}}function Qg(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ue(this.node(),n).tween,r=0,o=s.length,i;r<o;++r)if((i=s[r]).name===e)return i.value;return null}return this.each((t==null?Kg:Xg)(n,e,t))}function no(e,t,n){var s=e._id;return e.each(function(){var r=Je(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Ue(r,s).value[t]}}function gc(e,t){var n;return(typeof t=="number"?P.interpolateNumber:t instanceof P.color?P.interpolateRgb:(n=P.color(t))?(t=n,P.interpolateRgb):P.interpolateString)(e,t)}function Jg(e){return function(){this.removeAttribute(e)}}function ey(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ty(e,t,n){var s,r=n+"",o;return function(){var i=this.getAttribute(e);return i===r?null:i===s?o:o=t(s=i,n)}}function ny(e,t,n){var s,r=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===r?null:i===s?o:o=t(s=i,n)}}function sy(e,t,n){var s,r,o;return function(){var i,c=n(this),a;return c==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=c+"",i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c)))}}function ry(e,t,n){var s,r,o;return function(){var i,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=c+"",i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c)))}}function oy(e,t){var n=Ns(e),s=n==="transform"?Wx:gc;return this.attrTween(e,typeof t=="function"?(n.local?ry:sy)(n,s,no(this,"attr."+e,t)):t==null?(n.local?ey:Jg)(n):(n.local?ny:ty)(n,s,t))}function iy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ly(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cy(e,t){var n,s;function r(){var o=t.apply(this,arguments);return o!==s&&(n=(s=o)&&ly(e,o)),n}return r._value=t,r}function ay(e,t){var n,s;function r(){var o=t.apply(this,arguments);return o!==s&&(n=(s=o)&&iy(e,o)),n}return r._value=t,r}function uy(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Ns(e);return this.tween(n,(s.local?cy:ay)(s,t))}function dy(e,t){return function(){to(this,e).delay=+t.apply(this,arguments)}}function xy(e,t){return t=+t,function(){to(this,e).delay=t}}function fy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dy:xy)(t,e)):Ue(this.node(),t).delay}function py(e,t){return function(){Je(this,e).duration=+t.apply(this,arguments)}}function my(e,t){return t=+t,function(){Je(this,e).duration=t}}function hy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?py:my)(t,e)):Ue(this.node(),t).duration}function gy(e,t){if(typeof t!="function")throw new Error;return function(){Je(this,e).ease=t}}function yy(e){var t=this._id;return arguments.length?this.each(gy(t,e)):Ue(this.node(),t).ease}function Sy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Je(this,e).ease=n}}function Ey(e){if(typeof e!="function")throw new Error;return this.each(Sy(this._id,e))}function jy(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=[],a,d=0;d<i;++d)(a=o[d])&&e.call(a,a.__data__,d,o)&&c.push(a);return new it(s,this._parents,this._name,this._id)}function Ry(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,o=Math.min(s,r),i=new Array(s),c=0;c<o;++c)for(var a=t[c],d=n[c],u=a.length,p=i[c]=new Array(u),m,h=0;h<u;++h)(m=a[h]||d[h])&&(p[h]=m);for(;c<s;++c)i[c]=t[c];return new it(i,this._parents,this._name,this._id)}function by(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function wy(e,t,n){var s,r,o=by(t)?to:Je;return function(){var i=o(this,e),c=i.on;c!==s&&(r=(s=c).copy()).on(t,n),i.on=r}}function Cy(e,t){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(e):this.each(wy(n,e,t))}function vy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _y(){return this.on("end.remove",vy(this._id))}function ky(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qr(e));for(var s=this._groups,r=s.length,o=new Array(r),i=0;i<r;++i)for(var c=s[i],a=c.length,d=o[i]=new Array(a),u,p,m=0;m<a;++m)(u=c[m])&&(p=e.call(u,u.__data__,m,c))&&("__data__"in u&&(p.__data__=u.__data__),d[m]=p,Ts(d[m],t,n,m,d,Ue(u,n)));return new it(o,this._parents,t,n)}function Py(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ec(e));for(var s=this._groups,r=s.length,o=[],i=[],c=0;c<r;++c)for(var a=s[c],d=a.length,u,p=0;p<d;++p)if(u=a[p]){for(var m=e.call(u,u.__data__,p,a),h,E=Ue(u,n),y=0,w=m.length;y<w;++y)(h=m[y])&&Ts(h,t,n,y,m,E);o.push(m),i.push(u)}return new it(o,i,t,n)}var Ny=An.prototype.constructor;function My(){return new Ny(this._groups,this._parents)}function Ty(e,t){var n,s,r;return function(){var o=Qt(this,e),i=(this.style.removeProperty(e),Qt(this,e));return o===i?null:o===n&&i===s?r:r=t(n=o,s=i)}}function yc(e){return function(){this.style.removeProperty(e)}}function Ay(e,t,n){var s,r=n+"",o;return function(){var i=Qt(this,e);return i===r?null:i===s?o:o=t(s=i,n)}}function Ly(e,t,n){var s,r,o;return function(){var i=Qt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Qt(this,e))),i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c))}}function $y(e,t){var n,s,r,o="style."+t,i="end."+o,c;return function(){var a=Je(this,e),d=a.on,u=a.value[o]==null?c||(c=yc(t)):void 0;(d!==n||r!==u)&&(s=(n=d).copy()).on(i,r=u),a.on=s}}function Oy(e,t,n){var s=(e+="")=="transform"?Gx:gc;return t==null?this.styleTween(e,Ty(e,s)).on("end.style."+e,yc(e)):typeof t=="function"?this.styleTween(e,Ly(e,s,no(this,"style."+e,t))).each($y(this._id,e)):this.styleTween(e,Ay(e,s,t),n).on("end.style."+e,null)}function Dy(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function zy(e,t,n){var s,r;function o(){var i=t.apply(this,arguments);return i!==r&&(s=(r=i)&&Dy(e,i,n)),s}return o._value=t,o}function By(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,zy(e,t,n??""))}function Iy(e){return function(){this.textContent=e}}function Vy(e){return function(){var t=e(this);this.textContent=t??""}}function Fy(e){return this.tween("text",typeof e=="function"?Vy(no(this,"text",e)):Iy(e==null?"":e+""))}function Zy(e){return function(t){this.textContent=e.call(this,t)}}function Hy(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Zy(r)),t}return s._value=e,s}function qy(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Hy(e))}function Yy(){for(var e=this._name,t=this._id,n=Sc(),s=this._groups,r=s.length,o=0;o<r;++o)for(var i=s[o],c=i.length,a,d=0;d<c;++d)if(a=i[d]){var u=Ue(a,t);Ts(a,e,n,d,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new it(s,this._parents,e,n)}function Uy(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(o,i){var c={value:i},a={value:function(){--r===0&&o()}};n.each(function(){var d=Je(this,s),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),d.on=t}),r===0&&o()})}var Gy=0;function it(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Sc(){return++Gy}var nt=An.prototype;it.prototype={constructor:it,select:ky,selectAll:Py,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:jy,merge:Ry,selection:My,transition:Yy,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:Cy,attr:oy,attrTween:uy,style:Oy,styleTween:By,text:Fy,textTween:qy,remove:_y,tween:Qg,delay:fy,duration:hy,ease:yy,easeVarying:Ey,end:Uy,[Symbol.iterator]:nt[Symbol.iterator]};function Wy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ky={time:null,delay:0,duration:250,ease:Wy};function Xy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Qy(e){var t,n;e instanceof it?(t=e._id,e=e._name):(t=Sc(),(n=Ky).time=eo(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,o=0;o<r;++o)for(var i=s[o],c=i.length,a,d=0;d<c;++d)(a=i[d])&&Ts(a,e,t,d,i,n||Xy(a,t));return new it(s,this._parents,e,t)}An.prototype.interrupt=Wg;An.prototype.transition=Qy;const In=e=>()=>e;function Jy(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function st(e,t,n){this.k=e,this.x=t,this.y=n}st.prototype={constructor:st,scale:function(e){return e===1?this:new st(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new st(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ft=new st(1,0,0);st.prototype;function Qs(e){e.stopImmediatePropagation()}function pn(e){e.preventDefault(),e.stopImmediatePropagation()}function eS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tS(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ni(){return this.__zoom||ft}function nS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sS(){return navigator.maxTouchPoints||"ontouchstart"in this}function rS(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function oS(){var e=eS,t=tS,n=rS,s=nS,r=sS,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Jx,d=Ps("start","zoom","end"),u,p,m,h=500,E=150,y=0,w=10;function j(S){S.property("__zoom",ni).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",D).filter(r).on("touchstart.zoom",T).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(S,L,k,I){var B=S.selection?S.selection():S;B.property("__zoom",ni),S!==B?b(S,L,k,I):B.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},j.scaleBy=function(S,L,k,I){j.scaleTo(S,function(){var B=this.__zoom.k,A=typeof L=="function"?L.apply(this,arguments):L;return B*A},k,I)},j.scaleTo=function(S,L,k,I){j.transform(S,function(){var B=t.apply(this,arguments),A=this.__zoom,V=k==null?R(B):typeof k=="function"?k.apply(this,arguments):k,F=A.invert(V),H=typeof L=="function"?L.apply(this,arguments):L;return n(v(C(A,H),V,F),B,i)},k,I)},j.translateBy=function(S,L,k,I){j.transform(S,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,I)},j.translateTo=function(S,L,k,I,B){j.transform(S,function(){var A=t.apply(this,arguments),V=this.__zoom,F=I==null?R(A):typeof I=="function"?I.apply(this,arguments):I;return n(ft.translate(F[0],F[1]).scale(V.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof k=="function"?-k.apply(this,arguments):-k),A,i)},I,B)};function C(S,L){return L=Math.max(o[0],Math.min(o[1],L)),L===S.k?S:new st(L,S.x,S.y)}function v(S,L,k){var I=L[0]-k[0]*S.k,B=L[1]-k[1]*S.k;return I===S.x&&B===S.y?S:new st(S.k,I,B)}function R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function b(S,L,k,I){S.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var B=this,A=arguments,V=_(B,A).event(I),F=t.apply(B,A),H=k==null?R(F):typeof k=="function"?k.apply(B,A):k,G=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),U=B.__zoom,Q=typeof L=="function"?L.apply(B,A):L,ie=a(U.invert(H).concat(G/U.k),Q.invert(H).concat(G/Q.k));return function(le){if(le===1)le=Q;else{var de=ie(le),he=G/de[2];le=new st(he,H[0]-de[0]*he,H[1]-de[1]*he)}V.zoom(null,le)}})}function _(S,L,k){return!k&&S.__zooming||new $(S,L)}function $(S,L){this.that=S,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,L),this.taps=0}$.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,L){return this.mouse&&S!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var L=Ze(this.that).datum();d.call(S,this.that,new Jy(S,{sourceEvent:this.sourceEvent,target:j,type:S,transform:this.that.__zoom,dispatch:d}),L)}};function O(S,...L){if(!e.apply(this,arguments))return;var k=_(this,L).event(S),I=this.__zoom,B=Math.max(o[0],Math.min(o[1],I.k*Math.pow(2,s.apply(this,arguments)))),A=Xe(S);if(k.wheel)(k.mouse[0][0]!==A[0]||k.mouse[0][1]!==A[1])&&(k.mouse[1]=I.invert(k.mouse[0]=A)),clearTimeout(k.wheel);else{if(I.k===B)return;k.mouse=[A,I.invert(A)],Jn(this),k.start()}pn(S),k.wheel=setTimeout(V,E),k.zoom("mouse",n(v(C(I,B),k.mouse[0],k.mouse[1]),k.extent,i));function V(){k.wheel=null,k.end()}}function N(S,...L){if(m||!e.apply(this,arguments))return;var k=S.currentTarget,I=_(this,L,!0).event(S),B=Ze(S.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",G,!0),A=Xe(S,k),V=S.clientX,F=S.clientY;dc(S.view),Qs(S),I.mouse=[A,this.__zoom.invert(A)],Jn(this),I.start();function H(U){if(pn(U),!I.moved){var Q=U.clientX-V,ie=U.clientY-F;I.moved=Q*Q+ie*ie>y}I.event(U).zoom("mouse",n(v(I.that.__zoom,I.mouse[0]=Xe(U,k),I.mouse[1]),I.extent,i))}function G(U){B.on("mousemove.zoom mouseup.zoom",null),xc(U.view,I.moved),pn(U),I.event(U).end()}}function D(S,...L){if(e.apply(this,arguments)){var k=this.__zoom,I=Xe(S.changedTouches?S.changedTouches[0]:S,this),B=k.invert(I),A=k.k*(S.shiftKey?.5:2),V=n(v(C(k,A),I,B),t.apply(this,L),i);pn(S),c>0?Ze(this).transition().duration(c).call(b,V,I,S):Ze(this).call(j.transform,V,I,S)}}function T(S,...L){if(e.apply(this,arguments)){var k=S.touches,I=k.length,B=_(this,L,S.changedTouches.length===I).event(S),A,V,F,H;for(Qs(S),V=0;V<I;++V)F=k[V],H=Xe(F,this),H=[H,this.__zoom.invert(H),F.identifier],B.touch0?!B.touch1&&B.touch0[2]!==H[2]&&(B.touch1=H,B.taps=0):(B.touch0=H,A=!0,B.taps=1+!!u);u&&(u=clearTimeout(u)),A&&(B.taps<2&&(p=H[0],u=setTimeout(function(){u=null},h)),Jn(this),B.start())}}function M(S,...L){if(this.__zooming){var k=_(this,L).event(S),I=S.changedTouches,B=I.length,A,V,F,H;for(pn(S),A=0;A<B;++A)V=I[A],F=Xe(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=F:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=F);if(V=k.that.__zoom,k.touch1){var G=k.touch0[0],U=k.touch0[1],Q=k.touch1[0],ie=k.touch1[1],le=(le=Q[0]-G[0])*le+(le=Q[1]-G[1])*le,de=(de=ie[0]-U[0])*de+(de=ie[1]-U[1])*de;V=C(V,Math.sqrt(le/de)),F=[(G[0]+Q[0])/2,(G[1]+Q[1])/2],H=[(U[0]+ie[0])/2,(U[1]+ie[1])/2]}else if(k.touch0)F=k.touch0[0],H=k.touch0[1];else return;k.zoom("touch",n(v(V,F,H),k.extent,i))}}function z(S,...L){if(this.__zooming){var k=_(this,L).event(S),I=S.changedTouches,B=I.length,A,V;for(Qs(S),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),A=0;A<B;++A)V=I[A],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=Xe(V,this),Math.hypot(p[0]-V[0],p[1]-V[1])<w)){var F=Ze(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return j.wheelDelta=function(S){return arguments.length?(s=typeof S=="function"?S:In(+S),j):s},j.filter=function(S){return arguments.length?(e=typeof S=="function"?S:In(!!S),j):e},j.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:In(!!S),j):r},j.extent=function(S){return arguments.length?(t=typeof S=="function"?S:In([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),j):t},j.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],j):[o[0],o[1]]},j.translateExtent=function(S){return arguments.length?(i[0][0]=+S[0][0],i[1][0]=+S[1][0],i[0][1]=+S[0][1],i[1][1]=+S[1][1],j):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},j.constrain=function(S){return arguments.length?(n=S,j):n},j.duration=function(S){return arguments.length?(c=+S,j):c},j.interpolate=function(S){return arguments.length?(a=S,j):a},j.on=function(){var S=d.on.apply(d,arguments);return S===d?j:S},j.clickDistance=function(S){return arguments.length?(y=(S=+S)*S,j):Math.sqrt(y)},j.tapDistance=function(S){return arguments.length?(w=+S,j):w},j}const As=f.createContext(null),iS=As.Provider,De={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Ec=De.error001();function ye(e,t){const n=f.useContext(As);if(n===null)throw new Error(Ec);return Ql(n,e,t)}const we=()=>{const e=f.useContext(As);if(e===null)throw new Error(Ec);return f.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},lS=e=>e.userSelectionActive?"none":"all";function cS({position:e,children:t,className:n,style:s,...r}){const o=ye(lS),i=`${e}`.split("-");return f.createElement("div",{className:ze(["react-flow__panel",n,...i]),style:{...s,pointerEvents:o},...r},t)}function aS({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.createElement(cS,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},f.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const uS=({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:o={},labelBgPadding:i=[2,4],labelBgBorderRadius:c=2,children:a,className:d,...u})=>{const p=f.useRef(null),[m,h]=f.useState({x:0,y:0,width:0,height:0}),E=ze(["react-flow__edge-textwrapper",d]);return f.useEffect(()=>{if(p.current){const y=p.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),typeof n>"u"||!n?null:f.createElement("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:E,visibility:m.width?"visible":"hidden",...u},r&&f.createElement("rect",{width:m.width+2*i[0],x:-i[0],y:-i[1],height:m.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),f.createElement("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:p,style:s},n),a)};var dS=f.memo(uS);const so=e=>({width:e.offsetWidth,height:e.offsetHeight}),en=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ro=(e={x:0,y:0},t)=>({x:en(e.x,t[0][0],t[1][0]),y:en(e.y,t[0][1],t[1][1])}),si=(e,t,n)=>e<t?en(Math.abs(e-t),1,50)/50:e>n?-en(Math.abs(e-n),1,50)/50:0,jc=(e,t)=>{const n=si(e.x,35,t.width-35)*20,s=si(e.y,35,t.height-35)*20;return[n,s]},Rc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},xS=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),oo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),fS=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),ri=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Sr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},pS=e=>Ve(e.width)&&Ve(e.height)&&Ve(e.x)&&Ve(e.y),Ve=e=>!isNaN(e)&&isFinite(e),ge=Symbol.for("internals"),bc=["Enter"," ","Escape"],ms=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},mS=e=>"nativeEvent"in e;function Er(e){var r,o;const t=mS(e)?e.nativeEvent:e,n=((o=(r=t.composedPath)==null?void 0:r.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const wc=e=>"clientX"in e,pt=(e,t)=>{var o,i;const n=wc(e),s=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,r=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},hs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},$t=({id:e,path:t,labelX:n,labelY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h=20})=>f.createElement(f.Fragment,null,f.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:m}),h&&f.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),r&&Ve(n)&&Ve(s)?f.createElement(dS,{x:n,y:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d}):null);$t.displayName="BaseEdge";function mn(e,t,n){return n===void 0?n:s=>{const r=t().edges.find(o=>o.id===e);r&&n(s,{...r})}}function Cc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,o=n<e?n+r:n-r,i=Math.abs(s-t)/2,c=s<t?s+i:s-i;return[o,c,r,i]}function vc({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:o,targetControlX:i,targetControlY:c}){const a=e*.125+r*.375+i*.375+n*.125,d=t*.125+o*.375+c*.375+s*.125,u=Math.abs(a-e),p=Math.abs(d-t);return[a,d,u,p]}var ht;(function(e){e.Strict="strict",e.Loose="loose"})(ht||(ht={}));var kt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(kt||(kt={}));var tn;(function(e){e.Partial="partial",e.Full="full"})(tn||(tn={}));var ut;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ut||(ut={}));var gs;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gs||(gs={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));function oi({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Y.Left||e===Y.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function _c({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top}){const[i,c]=oi({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,d]=oi({pos:o,x1:s,y1:r,x2:e,y2:t}),[u,p,m,h]=vc({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:i,sourceControlY:c,targetControlX:a,targetControlY:d});return[`M${e},${t} C${i},${c} ${a},${d} ${s},${r}`,u,p,m,h]}const io=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,sourcePosition:r=Y.Bottom,targetPosition:o=Y.Top,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:y})=>{const[w,j,C]=_c({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:s,targetPosition:o});return f.createElement($t,{path:w,labelX:j,labelY:C,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:y})});io.displayName="SimpleBezierEdge";const ii={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},hS=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},li=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gS({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:s=Y.Top,center:r,offset:o}){const i=ii[t],c=ii[s],a={x:e.x+i.x*o,y:e.y+i.y*o},d={x:n.x+c.x*o,y:n.y+c.y*o},u=hS({source:a,sourcePosition:t,target:d}),p=u.x!==0?"x":"y",m=u[p];let h=[],E,y;const w={x:0,y:0},j={x:0,y:0},[C,v,R,b]=Cc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[p]*c[p]===-1){E=r.x??C,y=r.y??v;const $=[{x:E,y:a.y},{x:E,y:d.y}],O=[{x:a.x,y},{x:d.x,y}];i[p]===m?h=p==="x"?$:O:h=p==="x"?O:$}else{const $=[{x:a.x,y:d.y}],O=[{x:d.x,y:a.y}];if(p==="x"?h=i.x===m?O:$:h=i.y===m?$:O,t===s){const z=Math.abs(e[p]-n[p]);if(z<=o){const S=Math.min(o-1,o-z);i[p]===m?w[p]=(a[p]>e[p]?-1:1)*S:j[p]=(d[p]>n[p]?-1:1)*S}}if(t!==s){const z=p==="x"?"y":"x",S=i[p]===c[z],L=a[z]>d[z],k=a[z]<d[z];(i[p]===1&&(!S&&L||S&&k)||i[p]!==1&&(!S&&k||S&&L))&&(h=p==="x"?$:O)}const N={x:a.x+w.x,y:a.y+w.y},D={x:d.x+j.x,y:d.y+j.y},T=Math.max(Math.abs(N.x-h[0].x),Math.abs(D.x-h[0].x)),M=Math.max(Math.abs(N.y-h[0].y),Math.abs(D.y-h[0].y));T>=M?(E=(N.x+D.x)/2,y=h[0].y):(E=h[0].x,y=(N.y+D.y)/2)}return[[e,{x:a.x+w.x,y:a.y+w.y},...h,{x:d.x+j.x,y:d.y+j.y},n],E,y,R,b]}function yS(e,t,n,s){const r=Math.min(li(e,t)/2,li(t,n)/2,s),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const d=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+r*d},${i}Q ${o},${i} ${o},${i+r*u}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${i+r*a}Q ${o},${i} ${o+r*c},${i}`}function jr({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top,borderRadius:i=5,centerX:c,centerY:a,offset:d=20}){const[u,p,m,h,E]=gS({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:o,center:{x:c,y:a},offset:d});return[u.reduce((w,j,C)=>{let v="";return C>0&&C<u.length-1?v=yS(u[C-1],j,u[C+1],i):v=`${C===0?"M":"L"}${j.x} ${j.y}`,w+=v,w},""),p,m,h,E]}const Ls=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,sourcePosition:p=Y.Bottom,targetPosition:m=Y.Top,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:w})=>{const[j,C,v]=jr({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:s,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset});return f.createElement($t,{path:j,labelX:C,labelY:v,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:E,interactionWidth:w})});Ls.displayName="SmoothStepEdge";const lo=f.memo(e=>{var t;return f.createElement(Ls,{...e,pathOptions:f.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});lo.displayName="StepEdge";function SS({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,o,i,c]=Cc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,o,i,c]}const co=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h})=>{const[E,y,w]=SS({sourceX:e,sourceY:t,targetX:n,targetY:s});return f.createElement($t,{path:E,labelX:y,labelY:w,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h})});co.displayName="StraightEdge";function Vn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ci({pos:e,x1:t,y1:n,x2:s,y2:r,c:o}){switch(e){case Y.Left:return[t-Vn(t-s,o),n];case Y.Right:return[t+Vn(s-t,o),n];case Y.Top:return[t,n-Vn(n-r,o)];case Y.Bottom:return[t,n+Vn(r-n,o)]}}function kc({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top,curvature:i=.25}){const[c,a]=ci({pos:n,x1:e,y1:t,x2:s,y2:r,c:i}),[d,u]=ci({pos:o,x1:s,y1:r,x2:e,y2:t,c:i}),[p,m,h,E]=vc({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:d,targetControlY:u});return[`M${e},${t} C${c},${a} ${d},${u} ${s},${r}`,p,m,h,E]}const ys=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,sourcePosition:r=Y.Bottom,targetPosition:o=Y.Top,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:w})=>{const[j,C,v]=kc({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:s,targetPosition:o,curvature:y==null?void 0:y.curvature});return f.createElement($t,{path:j,labelX:C,labelY:v,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:w})});ys.displayName="BezierEdge";const ao=f.createContext(null),ES=ao.Provider;ao.Consumer;const jS=()=>f.useContext(ao),RS=e=>"id"in e&&"source"in e&&"target"in e,Pc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`reactflow__edge-${e}${t||""}-${n}${s||""}`,Rr=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,bS=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Nc=(e,t)=>{if(!e.source||!e.target)return ms("006",De.error006()),t;let n;return RS(e)?n={...e}:n={...e,id:Pc(e)},bS(n,t)?t:t.concat(n)},wS=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...o}=e;if(!t.source||!t.target)return ms("006",De.error006()),n;if(!n.find(a=>a.id===r))return ms("007",De.error007(r)),n;const c={...o,id:s.shouldReplaceId?Pc(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)},br=({x:e,y:t},[n,s,r],o,[i,c])=>{const a={x:(e-n)/r,y:(t-s)/r};return o?{x:i*Math.round(a.x/i),y:c*Math.round(a.y/c)}:a},Mc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),Wt=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],s=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-s};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-s}:r}},uo=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const{x:o,y:i}=Wt(r,t).positionAbsolute;return xS(s,oo({x:o,y:i,width:r.width||0,height:r.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fS(n)},Tc=(e,t,[n,s,r]=[0,0,1],o=!1,i=!1,c=[0,0])=>{const a={x:(t.x-n)/r,y:(t.y-s)/r,width:t.width/r,height:t.height/r},d=[];return e.forEach(u=>{const{width:p,height:m,selectable:h=!0,hidden:E=!1}=u;if(i&&!h||E)return!1;const{positionAbsolute:y}=Wt(u,c),w={x:y.x,y:y.y,width:p||0,height:m||0},j=Sr(a,w),C=typeof p>"u"||typeof m>"u"||p===null||m===null,v=o&&j>0,R=(p||0)*(m||0);(C||v||j>=R||u.dragging)&&d.push(u)}),d},Ac=(e,t)=>{const n=e.map(s=>s.id);return t.filter(s=>n.includes(s.source)||n.includes(s.target))},Lc=(e,t,n,s,r,o=.1)=>{const i=t/(e.width*(1+o)),c=n/(e.height*(1+o)),a=Math.min(i,c),d=en(a,s,r),u=e.x+e.width/2,p=e.y+e.height/2,m=t/2-u*d,h=n/2-p*d;return{x:m,y:h,zoom:d}},_t=(e,t=0)=>e.transition().duration(t);function ai(e,t,n,s){return(t[n]||[]).reduce((r,o)=>{var i,c;return`${e.id}-${o.id}-${n}`!==s&&r.push({id:o.id||null,type:n,nodeId:e.id,x:(((i=e.positionAbsolute)==null?void 0:i.x)??0)+o.x+o.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+o.y+o.height/2}),r},[])}function CS(e,t,n,s,r,o){const{x:i,y:c}=pt(e),d=t.elementsFromPoint(i,c).find(E=>E.classList.contains("react-flow__handle"));if(d){const E=d.getAttribute("data-nodeid");if(E){const y=xo(void 0,d),w=d.getAttribute("data-handleid"),j=o({nodeId:E,id:w,type:y});if(j){const C=r.find(v=>v.nodeId===E&&v.type===y&&v.id===w);return{handle:{id:w,type:y,nodeId:E,x:(C==null?void 0:C.x)||n.x,y:(C==null?void 0:C.y)||n.y},validHandleResult:j}}}}let u=[],p=1/0;if(r.forEach(E=>{const y=Math.sqrt((E.x-n.x)**2+(E.y-n.y)**2);if(y<=s){const w=o(E);y<=p&&(y<p?u=[{handle:E,validHandleResult:w}]:y===p&&u.push({handle:E,validHandleResult:w}),p=y)}}),!u.length)return{handle:null,validHandleResult:$c()};if(u.length===1)return u[0];const m=u.some(({validHandleResult:E})=>E.isValid),h=u.some(({handle:E})=>E.type==="target");return u.find(({handle:E,validHandleResult:y})=>h?E.type==="target":m?y.isValid:!0)||u[0]}const vS={source:null,target:null,sourceHandle:null,targetHandle:null},$c=()=>({handleDomNode:null,isValid:!1,connection:vS,endHandle:null});function Oc(e,t,n,s,r,o,i){const c=r==="target",a=i.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),d={...$c(),handleDomNode:a};if(a){const u=xo(void 0,a),p=a.getAttribute("data-nodeid"),m=a.getAttribute("data-handleid"),h=a.classList.contains("connectable"),E=a.classList.contains("connectableend"),y={source:c?p:n,sourceHandle:c?m:s,target:c?n:p,targetHandle:c?s:m};d.connection=y,h&&E&&(t===ht.Strict?c&&u==="source"||!c&&u==="target":p!==n||m!==s)&&(d.endHandle={nodeId:p,handleId:m,type:u},d.isValid=o(y))}return d}function _S({nodes:e,nodeId:t,handleId:n,handleType:s}){return e.reduce((r,o)=>{if(o[ge]){const{handleBounds:i}=o[ge];let c=[],a=[];i&&(c=ai(o,i,"source",`${t}-${n}-${s}`),a=ai(o,i,"target",`${t}-${n}-${s}`)),r.push(...c,...a)}return r},[])}function xo(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Js(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function kS(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Dc({event:e,handleId:t,nodeId:n,onConnect:s,isTarget:r,getState:o,setState:i,isValidConnection:c,edgeUpdaterType:a,onReconnectEnd:d}){const u=Rc(e.target),{connectionMode:p,domNode:m,autoPanOnConnect:h,connectionRadius:E,onConnectStart:y,panBy:w,getNodes:j,cancelConnection:C}=o();let v=0,R;const{x:b,y:_}=pt(e),$=u==null?void 0:u.elementFromPoint(b,_),O=xo(a,$),N=m==null?void 0:m.getBoundingClientRect();if(!N||!O)return;let D,T=pt(e,N),M=!1,z=null,S=!1,L=null;const k=_S({nodes:j(),nodeId:n,handleId:t,handleType:O}),I=()=>{if(!h)return;const[V,F]=jc(T,N);w({x:V,y:F}),v=requestAnimationFrame(I)};i({connectionPosition:T,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:O,connectionStartHandle:{nodeId:n,handleId:t,type:O},connectionEndHandle:null}),y==null||y(e,{nodeId:n,handleId:t,handleType:O});function B(V){const{transform:F}=o();T=pt(V,N);const{handle:H,validHandleResult:G}=CS(V,u,br(T,F,!1,[1,1]),E,k,U=>Oc(U,p,n,t,r?"target":"source",c,u));if(R=H,M||(I(),M=!0),L=G.handleDomNode,z=G.connection,S=G.isValid,i({connectionPosition:R&&S?Mc({x:R.x,y:R.y},F):T,connectionStatus:kS(!!R,S),connectionEndHandle:G.endHandle}),!R&&!S&&!L)return Js(D);z.source!==z.target&&L&&(Js(D),D=L,L.classList.add("connecting","react-flow__handle-connecting"),L.classList.toggle("valid",S),L.classList.toggle("react-flow__handle-valid",S))}function A(V){var F,H;(R||L)&&z&&S&&(s==null||s(z)),(H=(F=o()).onConnectEnd)==null||H.call(F,V),a&&(d==null||d(V)),Js(D),C(),cancelAnimationFrame(v),M=!1,S=!1,z=null,L=null,u.removeEventListener("mousemove",B),u.removeEventListener("mouseup",A),u.removeEventListener("touchmove",B),u.removeEventListener("touchend",A)}u.addEventListener("mousemove",B),u.addEventListener("mouseup",A),u.addEventListener("touchmove",B),u.addEventListener("touchend",A)}const ui=()=>!0,PS=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),NS=(e,t,n)=>s=>{const{connectionStartHandle:r,connectionEndHandle:o,connectionClickStartHandle:i}=s;return{connecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.handleId)===t&&(r==null?void 0:r.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n}},zc=f.forwardRef(({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:o=!0,id:i,onConnect:c,children:a,className:d,onMouseDown:u,onTouchStart:p,...m},h)=>{var N,D;const E=i||null,y=e==="target",w=we(),j=jS(),{connectOnClick:C,noPanClassName:v}=ye(PS,Ne),{connecting:R,clickConnecting:b}=ye(NS(j,E,e),Ne);j||(D=(N=w.getState()).onError)==null||D.call(N,"010",De.error010());const _=T=>{const{defaultEdgeOptions:M,onConnect:z,hasDefaultEdges:S}=w.getState(),L={...M,...T};if(S){const{edges:k,setEdges:I}=w.getState();I(Nc(L,k))}z==null||z(L),c==null||c(L)},$=T=>{if(!j)return;const M=wc(T);r&&(M&&T.button===0||!M)&&Dc({event:T,handleId:E,nodeId:j,onConnect:_,isTarget:y,getState:w.getState,setState:w.setState,isValidConnection:n||w.getState().isValidConnection||ui}),M?u==null||u(T):p==null||p(T)},O=T=>{const{onClickConnectStart:M,onClickConnectEnd:z,connectionClickStartHandle:S,connectionMode:L,isValidConnection:k}=w.getState();if(!j||!S&&!r)return;if(!S){M==null||M(T,{nodeId:j,handleId:E,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:j,type:e,handleId:E}});return}const I=Rc(T.target),B=n||k||ui,{connection:A,isValid:V}=Oc({nodeId:j,id:E,type:e},L,S.nodeId,S.handleId||null,S.type,B,I);V&&_(A),z==null||z(T),w.setState({connectionClickStartHandle:null})};return f.createElement("div",{"data-handleid":E,"data-nodeid":j,"data-handlepos":t,"data-id":`${j}-${E}-${e}`,className:ze(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",v,d,{source:!y,target:y,connectable:s,connectablestart:r,connectableend:o,connecting:b,connectionindicator:s&&(r&&!R||o&&R)}]),onMouseDown:$,onTouchStart:$,onClick:C?O:void 0,ref:h,...m},a)});zc.displayName="Handle";var Pn=f.memo(zc);const Bc=({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:s=Y.Bottom})=>f.createElement(f.Fragment,null,f.createElement(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.createElement(Pn,{type:"source",position:s,isConnectable:t}));Bc.displayName="DefaultNode";var wr=f.memo(Bc);const Ic=({data:e,isConnectable:t,sourcePosition:n=Y.Bottom})=>f.createElement(f.Fragment,null,e==null?void 0:e.label,f.createElement(Pn,{type:"source",position:n,isConnectable:t}));Ic.displayName="InputNode";var Vc=f.memo(Ic);const Fc=({data:e,isConnectable:t,targetPosition:n=Y.Top})=>f.createElement(f.Fragment,null,f.createElement(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Fc.displayName="OutputNode";var Zc=f.memo(Fc);const fo=()=>null;fo.displayName="GroupNode";const MS=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Fn=e=>e.id;function TS(e,t){return Ne(e.selectedNodes.map(Fn),t.selectedNodes.map(Fn))&&Ne(e.selectedEdges.map(Fn),t.selectedEdges.map(Fn))}const Hc=f.memo(({onSelectionChange:e})=>{const t=we(),{selectedNodes:n,selectedEdges:s}=ye(MS,TS);return f.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChange.forEach(o=>o(r))},[n,s,e]),null});Hc.displayName="SelectionListener";const AS=e=>!!e.onSelectionChange;function LS({onSelectionChange:e}){const t=ye(AS);return e||t?f.createElement(Hc,{onSelectionChange:e}):null}const $S=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ft(e,t){f.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function te(e,t,n){f.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const OS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:r,onConnectStart:o,onConnectEnd:i,onClickConnectStart:c,onClickConnectEnd:a,nodesDraggable:d,nodesConnectable:u,nodesFocusable:p,edgesFocusable:m,edgesUpdatable:h,elevateNodesOnSelect:E,minZoom:y,maxZoom:w,nodeExtent:j,onNodesChange:C,onEdgesChange:v,elementsSelectable:R,connectionMode:b,snapGrid:_,snapToGrid:$,translateExtent:O,connectOnClick:N,defaultEdgeOptions:D,fitView:T,fitViewOptions:M,onNodesDelete:z,onEdgesDelete:S,onNodeDrag:L,onNodeDragStart:k,onNodeDragStop:I,onSelectionDrag:B,onSelectionDragStart:A,onSelectionDragStop:V,noPanClassName:F,nodeOrigin:H,rfId:G,autoPanOnConnect:U,autoPanOnNodeDrag:Q,onError:ie,connectionRadius:le,isValidConnection:de,nodeDragThreshold:he})=>{const{setNodes:xe,setEdges:Le,setDefaultNodesAndEdges:W,setMinZoom:ce,setMaxZoom:fe,setTranslateExtent:pe,setNodeExtent:Be,reset:me}=ye($S,Ne),K=we();return f.useEffect(()=>{const $e=s==null?void 0:s.map(Et=>({...Et,...D}));return W(n,$e),()=>{me()}},[]),te("defaultEdgeOptions",D,K.setState),te("connectionMode",b,K.setState),te("onConnect",r,K.setState),te("onConnectStart",o,K.setState),te("onConnectEnd",i,K.setState),te("onClickConnectStart",c,K.setState),te("onClickConnectEnd",a,K.setState),te("nodesDraggable",d,K.setState),te("nodesConnectable",u,K.setState),te("nodesFocusable",p,K.setState),te("edgesFocusable",m,K.setState),te("edgesUpdatable",h,K.setState),te("elementsSelectable",R,K.setState),te("elevateNodesOnSelect",E,K.setState),te("snapToGrid",$,K.setState),te("snapGrid",_,K.setState),te("onNodesChange",C,K.setState),te("onEdgesChange",v,K.setState),te("connectOnClick",N,K.setState),te("fitViewOnInit",T,K.setState),te("fitViewOnInitOptions",M,K.setState),te("onNodesDelete",z,K.setState),te("onEdgesDelete",S,K.setState),te("onNodeDrag",L,K.setState),te("onNodeDragStart",k,K.setState),te("onNodeDragStop",I,K.setState),te("onSelectionDrag",B,K.setState),te("onSelectionDragStart",A,K.setState),te("onSelectionDragStop",V,K.setState),te("noPanClassName",F,K.setState),te("nodeOrigin",H,K.setState),te("rfId",G,K.setState),te("autoPanOnConnect",U,K.setState),te("autoPanOnNodeDrag",Q,K.setState),te("onError",ie,K.setState),te("connectionRadius",le,K.setState),te("isValidConnection",de,K.setState),te("nodeDragThreshold",he,K.setState),Ft(e,xe),Ft(t,Le),Ft(y,ce),Ft(w,fe),Ft(O,pe),Ft(j,Be),null},di={display:"none"},DS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},qc="react-flow__node-desc",Yc="react-flow__edge-desc",zS="react-flow__aria-live",BS=e=>e.ariaLiveMessage;function IS({rfId:e}){const t=ye(BS);return f.createElement("div",{id:`${zS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DS},t)}function VS({rfId:e,disableKeyboardA11y:t}){return f.createElement(f.Fragment,null,f.createElement("div",{id:`${qc}-${e}`,style:di},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),f.createElement("div",{id:`${Yc}-${e}`,style:di},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&f.createElement(IS,{rfId:e}))}var Nn=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,s]=f.useState(!1),r=f.useRef(!1),o=f.useRef(new Set([])),[i,c]=f.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),u=d.reduce((p,m)=>p.concat(...m),[]);return[d,u]}return[[],[]]},[e]);return f.useEffect(()=>{const a=typeof document<"u"?document:null,d=(t==null?void 0:t.target)||a;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Er(h))return!1;const y=fi(h.code,c);o.current.add(h[y]),xi(i,o.current,!1)&&(h.preventDefault(),s(!0))},p=h=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Er(h))return!1;const y=fi(h.code,c);xi(i,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(h[y]),h.key==="Meta"&&o.current.clear(),r.current=!1},m=()=>{o.current.clear(),s(!1)};return d==null||d.addEventListener("keydown",u),d==null||d.addEventListener("keyup",p),window.addEventListener("blur",m),()=>{d==null||d.removeEventListener("keydown",u),d==null||d.removeEventListener("keyup",p),window.removeEventListener("blur",m)}}},[e,s]),n};function xi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function fi(e,t){return t.includes(e)?"code":"key"}function Uc(e,t,n,s){var c,a;const r=e.parentNode||e.parentId;if(!r)return n;const o=t.get(r),i=Wt(o,s);return Uc(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((c=o[ge])==null?void 0:c.z)??0)>(n.z??0)?((a=o[ge])==null?void 0:a.z)??0:n.z??0},s)}function Gc(e,t,n){e.forEach(s=>{var o;const r=s.parentNode||s.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[s.id]){const{x:i,y:c,z:a}=Uc(s,e,{...s.position,z:((o=s[ge])==null?void 0:o.z)??0},t);s.positionAbsolute={x:i,y:c},s[ge].z=a,n!=null&&n[s.id]&&(s[ge].isParent=!0)}})}function er(e,t,n,s){const r=new Map,o={},i=s?1e3:0;return e.forEach(c=>{var h;const a=(Ve(c.zIndex)?c.zIndex:0)+(c.selected?i:0),d=t.get(c.id),u={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},p=c.parentNode||c.parentId;p&&(o[p]=!0);const m=(d==null?void 0:d.type)&&(d==null?void 0:d.type)!==c.type;Object.defineProperty(u,ge,{enumerable:!1,value:{handleBounds:m||(h=d==null?void 0:d[ge])==null?void 0:h.handleBounds,z:a}}),r.set(c.id,u)}),Gc(r,n,o),r}function Wc(e,t={}){const{getNodes:n,width:s,height:r,minZoom:o,maxZoom:i,d3Zoom:c,d3Selection:a,fitViewOnInitDone:d,fitViewOnInit:u,nodeOrigin:p}=e(),m=t.initial&&!d&&u;if(c&&a&&(m||!t.initial)){const E=n().filter(w=>{var C;const j=t.includeHiddenNodes?w.width&&w.height:!w.hidden;return(C=t.nodes)!=null&&C.length?j&&t.nodes.some(v=>v.id===w.id):j}),y=E.every(w=>w.width&&w.height);if(E.length>0&&y){const w=uo(E,p),{x:j,y:C,zoom:v}=Lc(w,s,r,t.minZoom??o,t.maxZoom??i,t.padding??.1),R=ft.translate(j,C).scale(v);return typeof t.duration=="number"&&t.duration>0?c.transform(_t(a,t.duration),R):c.transform(a,R),!0}}return!1}function FS(e,t){return e.forEach(n=>{const s=t.get(n.id);s&&t.set(s.id,{...s,[ge]:s[ge],selected:n.selected})}),new Map(t)}function ZS(e,t){return t.map(n=>{const s=e.find(r=>r.id===n.id);return s&&(n.selected=s.selected),n})}function Zn({changedNodes:e,changedEdges:t,get:n,set:s}){const{nodeInternals:r,edges:o,onNodesChange:i,onEdgesChange:c,hasDefaultNodes:a,hasDefaultEdges:d}=n();e!=null&&e.length&&(a&&s({nodeInternals:FS(e,r)}),i==null||i(e)),t!=null&&t.length&&(d&&s({edges:ZS(t,o)}),c==null||c(t))}const Zt=()=>{},HS={zoomIn:Zt,zoomOut:Zt,zoomTo:Zt,getZoom:()=>1,setViewport:Zt,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Zt,fitBounds:Zt,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},qS=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),YS=()=>{const e=we(),{d3Zoom:t,d3Selection:n}=ye(qS,Ne);return f.useMemo(()=>n&&t?{zoomIn:r=>t.scaleBy(_t(n,r==null?void 0:r.duration),1.2),zoomOut:r=>t.scaleBy(_t(n,r==null?void 0:r.duration),1/1.2),zoomTo:(r,o)=>t.scaleTo(_t(n,o==null?void 0:o.duration),r),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,c,a]=e.getState().transform,d=ft.translate(r.x??i,r.y??c).scale(r.zoom??a);t.transform(_t(n,o==null?void 0:o.duration),d)},getViewport:()=>{const[r,o,i]=e.getState().transform;return{x:r,y:o,zoom:i}},fitView:r=>Wc(e.getState,r),setCenter:(r,o,i)=>{const{width:c,height:a,maxZoom:d}=e.getState(),u=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:d,p=c/2-r*u,m=a/2-o*u,h=ft.translate(p,m).scale(u);t.transform(_t(n,i==null?void 0:i.duration),h)},fitBounds:(r,o)=>{const{width:i,height:c,minZoom:a,maxZoom:d}=e.getState(),{x:u,y:p,zoom:m}=Lc(r,i,c,a,d,(o==null?void 0:o.padding)??.1),h=ft.translate(u,p).scale(m);t.transform(_t(n,o==null?void 0:o.duration),h)},project:r=>{const{transform:o,snapToGrid:i,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),br(r,o,i,c)},screenToFlowPosition:r=>{const{transform:o,snapToGrid:i,snapGrid:c,domNode:a}=e.getState();if(!a)return r;const{x:d,y:u}=a.getBoundingClientRect(),p={x:r.x-d,y:r.y-u};return br(p,o,i,c)},flowToScreenPosition:r=>{const{transform:o,domNode:i}=e.getState();if(!i)return r;const{x:c,y:a}=i.getBoundingClientRect(),d=Mc(r,o);return{x:d.x+c,y:d.y+a}},viewportInitialized:!0}:HS,[t,n])};function rt(){const e=YS(),t=we(),n=f.useCallback(()=>t.getState().getNodes().map(y=>({...y})),[]),s=f.useCallback(y=>t.getState().nodeInternals.get(y),[]),r=f.useCallback(()=>{const{edges:y=[]}=t.getState();return y.map(w=>({...w}))},[]),o=f.useCallback(y=>{const{edges:w=[]}=t.getState();return w.find(j=>j.id===y)},[]),i=f.useCallback(y=>{const{getNodes:w,setNodes:j,hasDefaultNodes:C,onNodesChange:v}=t.getState(),R=w(),b=typeof y=="function"?y(R):y;if(C)j(b);else if(v){const _=b.length===0?R.map($=>({type:"remove",id:$.id})):b.map($=>({item:$,type:"reset"}));v(_)}},[]),c=f.useCallback(y=>{const{edges:w=[],setEdges:j,hasDefaultEdges:C,onEdgesChange:v}=t.getState(),R=typeof y=="function"?y(w):y;if(C)j(R);else if(v){const b=R.length===0?w.map(_=>({type:"remove",id:_.id})):R.map(_=>({item:_,type:"reset"}));v(b)}},[]),a=f.useCallback(y=>{const w=Array.isArray(y)?y:[y],{getNodes:j,setNodes:C,hasDefaultNodes:v,onNodesChange:R}=t.getState();if(v){const _=[...j(),...w];C(_)}else if(R){const b=w.map(_=>({item:_,type:"add"}));R(b)}},[]),d=f.useCallback(y=>{const w=Array.isArray(y)?y:[y],{edges:j=[],setEdges:C,hasDefaultEdges:v,onEdgesChange:R}=t.getState();if(v)C([...j,...w]);else if(R){const b=w.map(_=>({item:_,type:"add"}));R(b)}},[]),u=f.useCallback(()=>{const{getNodes:y,edges:w=[],transform:j}=t.getState(),[C,v,R]=j;return{nodes:y().map(b=>({...b})),edges:w.map(b=>({...b})),viewport:{x:C,y:v,zoom:R}}},[]),p=f.useCallback(({nodes:y,edges:w})=>{const{nodeInternals:j,getNodes:C,edges:v,hasDefaultNodes:R,hasDefaultEdges:b,onNodesDelete:_,onEdgesDelete:$,onNodesChange:O,onEdgesChange:N}=t.getState(),D=(y||[]).map(L=>L.id),T=(w||[]).map(L=>L.id),M=C().reduce((L,k)=>{const I=k.parentNode||k.parentId,B=!D.includes(k.id)&&I&&L.find(V=>V.id===I);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(D.includes(k.id)||B)&&L.push(k),L},[]),z=v.filter(L=>typeof L.deletable=="boolean"?L.deletable:!0),S=z.filter(L=>T.includes(L.id));if(M||S){const L=Ac(M,z),k=[...S,...L],I=k.reduce((B,A)=>(B.includes(A.id)||B.push(A.id),B),[]);if((b||R)&&(b&&t.setState({edges:v.filter(B=>!I.includes(B.id))}),R&&(M.forEach(B=>{j.delete(B.id)}),t.setState({nodeInternals:new Map(j)}))),I.length>0&&($==null||$(k),N&&N(I.map(B=>({id:B,type:"remove"})))),M.length>0&&(_==null||_(M),O)){const B=M.map(A=>({id:A.id,type:"remove"}));O(B)}}},[]),m=f.useCallback(y=>{const w=pS(y),j=w?null:t.getState().nodeInternals.get(y.id);return!w&&!j?[null,null,w]:[w?y:ri(j),j,w]},[]),h=f.useCallback((y,w=!0,j)=>{const[C,v,R]=m(y);return C?(j||t.getState().getNodes()).filter(b=>{if(!R&&(b.id===v.id||!b.positionAbsolute))return!1;const _=ri(b),$=Sr(_,C);return w&&$>0||$>=C.width*C.height}):[]},[]),E=f.useCallback((y,w,j=!0)=>{const[C]=m(y);if(!C)return!1;const v=Sr(C,w);return j&&v>0||v>=C.width*C.height},[]);return f.useMemo(()=>({...e,getNodes:n,getNode:s,getEdges:r,getEdge:o,setNodes:i,setEdges:c,addNodes:a,addEdges:d,toObject:u,deleteElements:p,getIntersectingNodes:h,isNodeIntersecting:E}),[e,n,s,r,o,i,c,a,d,u,p,h,E])}const US={actInsideInputWithModifier:!1};var GS=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=we(),{deleteElements:s}=rt(),r=Nn(e,US),o=Nn(t);f.useEffect(()=>{if(r){const{edges:i,getNodes:c}=n.getState(),a=c().filter(u=>u.selected),d=i.filter(u=>u.selected);s({nodes:a,edges:d}),n.setState({nodesSelectionActive:!1})}},[r]),f.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function WS(e){const t=we();f.useEffect(()=>{let n;const s=()=>{var o,i;if(!e.current)return;const r=so(e.current);(r.height===0||r.width===0)&&((i=(o=t.getState()).onError)==null||i.call(o,"004",De.error004())),t.setState({width:r.width||500,height:r.height||500})};return s(),window.addEventListener("resize",s),e.current&&(n=new ResizeObserver(()=>s()),n.observe(e.current)),()=>{window.removeEventListener("resize",s),n&&e.current&&n.unobserve(e.current)}},[])}const po={position:"absolute",width:"100%",height:"100%",top:0,left:0},KS=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Hn=e=>({x:e.x,y:e.y,zoom:e.k}),Ht=(e,t)=>e.target.closest(`.${t}`),pi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mi=e=>{const t=e.ctrlKey&&hs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},XS=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),QS=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:s,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:i=!1,panOnScrollSpeed:c=.5,panOnScrollMode:a=kt.Free,zoomOnDoubleClick:d=!0,elementsSelectable:u,panOnDrag:p=!0,defaultViewport:m,translateExtent:h,minZoom:E,maxZoom:y,zoomActivationKeyCode:w,preventScrolling:j=!0,children:C,noWheelClassName:v,noPanClassName:R})=>{const b=f.useRef(),_=we(),$=f.useRef(!1),O=f.useRef(!1),N=f.useRef(null),D=f.useRef({x:0,y:0,zoom:0}),{d3Zoom:T,d3Selection:M,d3ZoomHandler:z,userSelectionActive:S}=ye(XS,Ne),L=Nn(w),k=f.useRef(0),I=f.useRef(!1),B=f.useRef();return WS(N),f.useEffect(()=>{if(N.current){const A=N.current.getBoundingClientRect(),V=oS().scaleExtent([E,y]).translateExtent(h),F=Ze(N.current).call(V),H=ft.translate(m.x,m.y).scale(en(m.zoom,E,y)),G=[[0,0],[A.width,A.height]],U=V.constrain()(H,G,h);V.transform(F,U),V.wheelDelta(mi),_.setState({d3Zoom:V,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:N.current.closest(".react-flow")})}},[]),f.useEffect(()=>{M&&T&&(i&&!L&&!S?M.on("wheel.zoom",A=>{if(Ht(A,v))return!1;A.preventDefault(),A.stopImmediatePropagation();const V=M.property("__zoom").k||1;if(A.ctrlKey&&o){const de=Xe(A),he=mi(A),xe=V*Math.pow(2,he);T.scaleTo(M,xe,de,A);return}const F=A.deltaMode===1?20:1;let H=a===kt.Vertical?0:A.deltaX*F,G=a===kt.Horizontal?0:A.deltaY*F;!hs()&&A.shiftKey&&a!==kt.Vertical&&(H=A.deltaY*F,G=0),T.translateBy(M,-(H/V)*c,-(G/V)*c,{internal:!0});const U=Hn(M.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:ie,onViewportChangeEnd:le}=_.getState();clearTimeout(B.current),I.current||(I.current=!0,t==null||t(A,U),Q==null||Q(U)),I.current&&(e==null||e(A,U),ie==null||ie(U),B.current=setTimeout(()=>{n==null||n(A,U),le==null||le(U),I.current=!1},150))},{passive:!1}):typeof z<"u"&&M.on("wheel.zoom",function(A,V){if(!j&&A.type==="wheel"&&!A.ctrlKey||Ht(A,v))return null;A.preventDefault(),z.call(this,A,V)},{passive:!1}))},[S,i,a,M,T,z,L,o,j,v,t,e,n]),f.useEffect(()=>{T&&T.on("start",A=>{var H,G;if(!A.sourceEvent||A.sourceEvent.internal)return null;k.current=(H=A.sourceEvent)==null?void 0:H.button;const{onViewportChangeStart:V}=_.getState(),F=Hn(A.transform);$.current=!0,D.current=F,((G=A.sourceEvent)==null?void 0:G.type)==="mousedown"&&_.setState({paneDragging:!0}),V==null||V(F),t==null||t(A.sourceEvent,F)})},[T,t]),f.useEffect(()=>{T&&(S&&!$.current?T.on("zoom",null):S||T.on("zoom",A=>{var F;const{onViewportChange:V}=_.getState();if(_.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),O.current=!!(s&&pi(p,k.current??0)),(e||V)&&!((F=A.sourceEvent)!=null&&F.internal)){const H=Hn(A.transform);V==null||V(H),e==null||e(A.sourceEvent,H)}}))},[S,T,e,p,s]),f.useEffect(()=>{T&&T.on("end",A=>{if(!A.sourceEvent||A.sourceEvent.internal)return null;const{onViewportChangeEnd:V}=_.getState();if($.current=!1,_.setState({paneDragging:!1}),s&&pi(p,k.current??0)&&!O.current&&s(A.sourceEvent),O.current=!1,(n||V)&&KS(D.current,A.transform)){const F=Hn(A.transform);D.current=F,clearTimeout(b.current),b.current=setTimeout(()=>{V==null||V(F),n==null||n(A.sourceEvent,F)},i?150:0)}})},[T,i,p,n,s]),f.useEffect(()=>{T&&T.filter(A=>{const V=L||r,F=o&&A.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&A.button===1&&A.type==="mousedown"&&(Ht(A,"react-flow__node")||Ht(A,"react-flow__edge")))return!0;if(!p&&!V&&!i&&!d&&!o||S||!d&&A.type==="dblclick"||Ht(A,v)&&A.type==="wheel"||Ht(A,R)&&(A.type!=="wheel"||i&&A.type==="wheel"&&!L)||!o&&A.ctrlKey&&A.type==="wheel"||!V&&!i&&!F&&A.type==="wheel"||!p&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(p)&&!p.includes(A.button)&&A.type==="mousedown")return!1;const H=Array.isArray(p)&&p.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&H})},[S,T,r,o,i,d,p,u,L]),f.createElement("div",{className:"react-flow__renderer",ref:N,style:po},C)},JS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function eE(){const{userSelectionActive:e,userSelectionRect:t}=ye(JS,Ne);return e&&t?f.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function hi(e,t){const n=t.parentNode||t.parentId,s=e.find(r=>r.id===n);if(s){const r=t.position.x+t.width-s.width,o=t.position.y+t.height-s.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(s.style={...s.style},s.style.width=s.style.width??s.width,s.style.height=s.style.height??s.height,r>0&&(s.style.width+=r),o>0&&(s.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);s.position.x=s.position.x-i,s.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);s.position.y=s.position.y-i,s.style.height+=i,t.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function Kc(e,t){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const n=e.filter(s=>s.type==="add").map(s=>s.item);return t.reduce((s,r)=>{const o=e.filter(c=>c.id===r.id);if(o.length===0)return s.push(r),s;const i={...r};for(const c of o)if(c)switch(c.type){case"select":{i.selected=c.selected;break}case"position":{typeof c.position<"u"&&(i.position=c.position),typeof c.positionAbsolute<"u"&&(i.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(i.dragging=c.dragging),i.expandParent&&hi(s,i);break}case"dimensions":{typeof c.dimensions<"u"&&(i.width=c.dimensions.width,i.height=c.dimensions.height),typeof c.updateStyle<"u"&&(i.style={...i.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(i.resizing=c.resizing),i.expandParent&&hi(s,i);break}case"remove":return s}return s.push(i),s},n)}function Xc(e,t){return Kc(e,t)}function tE(e,t){return Kc(e,t)}const at=(e,t)=>({id:e,type:"select",selected:t});function Ut(e,t){return e.reduce((n,s)=>{const r=t.includes(s.id);return!s.selected&&r?(s.selected=!0,n.push(at(s.id,!0))):s.selected&&!r&&(s.selected=!1,n.push(at(s.id,!1))),n},[])}const tr=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Qc=f.memo(({isSelecting:e,selectionMode:t=tn.Full,panOnDrag:n,onSelectionStart:s,onSelectionEnd:r,onPaneClick:o,onPaneContextMenu:i,onPaneScroll:c,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:u,children:p})=>{const m=f.useRef(null),h=we(),E=f.useRef(0),y=f.useRef(0),w=f.useRef(),{userSelectionActive:j,elementsSelectable:C,dragging:v}=ye(nE,Ne),R=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,y.current=0},b=z=>{o==null||o(z),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},_=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}i==null||i(z)},$=c?z=>c(z):void 0,O=z=>{const{resetSelectedElements:S,domNode:L}=h.getState();if(w.current=L==null?void 0:L.getBoundingClientRect(),!C||!e||z.button!==0||z.target!==m.current||!w.current)return;const{x:k,y:I}=pt(z,w.current);S(),h.setState({userSelectionRect:{width:0,height:0,startX:k,startY:I,x:k,y:I}}),s==null||s(z)},N=z=>{const{userSelectionRect:S,nodeInternals:L,edges:k,transform:I,onNodesChange:B,onEdgesChange:A,nodeOrigin:V,getNodes:F}=h.getState();if(!e||!w.current||!S)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const H=pt(z,w.current),G=S.startX??0,U=S.startY??0,Q={...S,x:H.x<G?H.x:G,y:H.y<U?H.y:U,width:Math.abs(H.x-G),height:Math.abs(H.y-U)},ie=F(),le=Tc(L,Q,I,t===tn.Partial,!0,V),de=Ac(le,k).map(xe=>xe.id),he=le.map(xe=>xe.id);if(E.current!==he.length){E.current=he.length;const xe=Ut(ie,he);xe.length&&(B==null||B(xe))}if(y.current!==de.length){y.current=de.length;const xe=Ut(k,de);xe.length&&(A==null||A(xe))}h.setState({userSelectionRect:Q})},D=z=>{if(z.button!==0)return;const{userSelectionRect:S}=h.getState();!j&&S&&z.target===m.current&&(b==null||b(z)),h.setState({nodesSelectionActive:E.current>0}),R(),r==null||r(z)},T=z=>{j&&(h.setState({nodesSelectionActive:E.current>0}),r==null||r(z)),R()},M=C&&(e||j);return f.createElement("div",{className:ze(["react-flow__pane",{dragging:v,selection:e}]),onClick:M?void 0:tr(b,m),onContextMenu:tr(_,m),onWheel:tr($,m),onMouseEnter:M?void 0:a,onMouseDown:M?O:void 0,onMouseMove:M?N:d,onMouseUp:M?D:void 0,onMouseLeave:M?T:u,ref:m,style:po},p,f.createElement(eE,null))});Qc.displayName="Pane";function Jc(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const s=t.get(n);return s?s.selected?!0:Jc(s,t):!1}function gi(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n.current)return!1;s=s.parentElement}while(s);return!1}function sE(e,t,n,s){return Array.from(e.values()).filter(r=>(r.selected||r.id===s)&&(!r.parentNode||r.parentId||!Jc(r,e))&&(r.draggable||t&&typeof r.draggable>"u")).map(r=>{var o,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=r.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function rE(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ea(e,t,n,s,r=[0,0],o){const i=rE(e,e.extent||s);let c=i;const a=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(a&&e.width&&e.height){const p=n.get(a),{x:m,y:h}=Wt(p,r).positionAbsolute;c=p&&Ve(m)&&Ve(h)&&Ve(p.width)&&Ve(p.height)?[[m+e.width*r[0],h+e.height*r[1]],[m+p.width-e.width+e.width*r[0],h+p.height-e.height+e.height*r[1]]]:c}else o==null||o("005",De.error005()),c=i;else if(e.extent&&a&&e.extent!=="parent"){const p=n.get(a),{x:m,y:h}=Wt(p,r).positionAbsolute;c=[[e.extent[0][0]+m,e.extent[0][1]+h],[e.extent[1][0]+m,e.extent[1][1]+h]]}let d={x:0,y:0};if(a){const p=n.get(a);d=Wt(p,r).positionAbsolute}const u=c&&c!=="parent"?ro(t,c):t;return{position:{x:u.x-d.x,y:u.y-d.y},positionAbsolute:u}}function nr({nodeId:e,dragItems:t,nodeInternals:n}){const s=t.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[e?s.find(r=>r.id===e):s[0],s]}const yi=(e,t,n,s)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const o=Array.from(r),i=t.getBoundingClientRect(),c={x:i.width*s[0],y:i.height*s[1]};return o.map(a=>{const d=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(d.left-i.left-c.x)/n,y:(d.top-i.top-c.y)/n,...so(a)}})};function hn(e,t,n){return n===void 0?n:s=>{const r=t().nodeInternals.get(e);r&&n(s,{...r})}}function Cr({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:i,nodeInternals:c,onError:a}=t.getState(),d=c.get(e);if(!d){a==null||a("012",De.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&i)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var u;return(u=s==null?void 0:s.current)==null?void 0:u.blur()})):r([e])}function oE(){const e=we();return f.useCallback(({sourceEvent:n})=>{const{transform:s,snapGrid:r,snapToGrid:o}=e.getState(),i=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,a={x:(i-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:o?r[0]*Math.round(a.x/r[0]):a.x,ySnapped:o?r[1]*Math.round(a.y/r[1]):a.y,...a}},[])}function sr(e){return(t,n,s)=>e==null?void 0:e(t,s)}function ta({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:o,selectNodesOnDrag:i}){const c=we(),[a,d]=f.useState(!1),u=f.useRef([]),p=f.useRef({x:null,y:null}),m=f.useRef(0),h=f.useRef(null),E=f.useRef({x:0,y:0}),y=f.useRef(null),w=f.useRef(!1),j=f.useRef(!1),C=f.useRef(!1),v=oE();return f.useEffect(()=>{if(e!=null&&e.current){const R=Ze(e.current),b=({x:O,y:N})=>{const{nodeInternals:D,onNodeDrag:T,onSelectionDrag:M,updateNodePositions:z,nodeExtent:S,snapGrid:L,snapToGrid:k,nodeOrigin:I,onError:B}=c.getState();p.current={x:O,y:N};let A=!1,V={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&S){const H=uo(u.current,I);V=oo(H)}if(u.current=u.current.map(H=>{const G={x:O-H.distance.x,y:N-H.distance.y};k&&(G.x=L[0]*Math.round(G.x/L[0]),G.y=L[1]*Math.round(G.y/L[1]));const U=[[S[0][0],S[0][1]],[S[1][0],S[1][1]]];u.current.length>1&&S&&!H.extent&&(U[0][0]=H.positionAbsolute.x-V.x+S[0][0],U[1][0]=H.positionAbsolute.x+(H.width??0)-V.x2+S[1][0],U[0][1]=H.positionAbsolute.y-V.y+S[0][1],U[1][1]=H.positionAbsolute.y+(H.height??0)-V.y2+S[1][1]);const Q=ea(H,G,D,U,I,B);return A=A||H.position.x!==Q.position.x||H.position.y!==Q.position.y,H.position=Q.position,H.positionAbsolute=Q.positionAbsolute,H}),!A)return;z(u.current,!0,!0),d(!0);const F=r?T:sr(M);if(F&&y.current){const[H,G]=nr({nodeId:r,dragItems:u.current,nodeInternals:D});F(y.current,H,G)}},_=()=>{if(!h.current)return;const[O,N]=jc(E.current,h.current);if(O!==0||N!==0){const{transform:D,panBy:T}=c.getState();p.current.x=(p.current.x??0)-O/D[2],p.current.y=(p.current.y??0)-N/D[2],T({x:O,y:N})&&b(p.current)}m.current=requestAnimationFrame(_)},$=O=>{var I;const{nodeInternals:N,multiSelectionActive:D,nodesDraggable:T,unselectNodesAndEdges:M,onNodeDragStart:z,onSelectionDragStart:S}=c.getState();j.current=!0;const L=r?z:sr(S);(!i||!o)&&!D&&r&&((I=N.get(r))!=null&&I.selected||M()),r&&o&&i&&Cr({id:r,store:c,nodeRef:e});const k=v(O);if(p.current=k,u.current=sE(N,T,k,r),L&&u.current){const[B,A]=nr({nodeId:r,dragItems:u.current,nodeInternals:N});L(O.sourceEvent,B,A)}};if(t)R.on(".drag",null);else{const O=Vg().on("start",N=>{const{domNode:D,nodeDragThreshold:T}=c.getState();T===0&&$(N),C.current=!1;const M=v(N);p.current=M,h.current=(D==null?void 0:D.getBoundingClientRect())||null,E.current=pt(N.sourceEvent,h.current)}).on("drag",N=>{var z,S;const D=v(N),{autoPanOnNodeDrag:T,nodeDragThreshold:M}=c.getState();if(N.sourceEvent.type==="touchmove"&&N.sourceEvent.touches.length>1&&(C.current=!0),!C.current){if(!w.current&&j.current&&T&&(w.current=!0,_()),!j.current){const L=D.xSnapped-(((z=p==null?void 0:p.current)==null?void 0:z.x)??0),k=D.ySnapped-(((S=p==null?void 0:p.current)==null?void 0:S.y)??0);Math.sqrt(L*L+k*k)>M&&$(N)}(p.current.x!==D.xSnapped||p.current.y!==D.ySnapped)&&u.current&&j.current&&(y.current=N.sourceEvent,E.current=pt(N.sourceEvent,h.current),b(D))}}).on("end",N=>{if(!(!j.current||C.current)&&(d(!1),w.current=!1,j.current=!1,cancelAnimationFrame(m.current),u.current)){const{updateNodePositions:D,nodeInternals:T,onNodeDragStop:M,onSelectionDragStop:z}=c.getState(),S=r?M:sr(z);if(D(u.current,!1,!1),S){const[L,k]=nr({nodeId:r,dragItems:u.current,nodeInternals:T});S(N.sourceEvent,L,k)}}}).filter(N=>{const D=N.target;return!N.button&&(!n||!gi(D,`.${n}`,e))&&(!s||gi(D,s,e))});return R.call(O),()=>{R.on(".drag",null)}}}},[e,t,n,s,o,c,r,i,v]),a}function na(){const e=we();return f.useCallback(n=>{const{nodeInternals:s,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:c,snapGrid:a,onError:d,nodesDraggable:u}=e.getState(),p=i().filter(C=>C.selected&&(C.draggable||u&&typeof C.draggable>"u")),m=c?a[0]:5,h=c?a[1]:5,E=n.isShiftPressed?4:1,y=n.x*m*E,w=n.y*h*E,j=p.map(C=>{if(C.positionAbsolute){const v={x:C.positionAbsolute.x+y,y:C.positionAbsolute.y+w};c&&(v.x=a[0]*Math.round(v.x/a[0]),v.y=a[1]*Math.round(v.y/a[1]));const{positionAbsolute:R,position:b}=ea(C,v,s,r,void 0,d);C.position=b,C.positionAbsolute=R}return C});o(j,!0,!1)},[])}const Kt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var gn=e=>{const t=({id:n,type:s,data:r,xPos:o,yPos:i,xPosOrigin:c,yPosOrigin:a,selected:d,onClick:u,onMouseEnter:p,onMouseMove:m,onMouseLeave:h,onContextMenu:E,onDoubleClick:y,style:w,className:j,isDraggable:C,isSelectable:v,isConnectable:R,isFocusable:b,selectNodesOnDrag:_,sourcePosition:$,targetPosition:O,hidden:N,resizeObserver:D,dragHandle:T,zIndex:M,isParent:z,noDragClassName:S,noPanClassName:L,initialized:k,disableKeyboardA11y:I,ariaLabel:B,rfId:A,hasHandleBounds:V})=>{const F=we(),H=f.useRef(null),G=f.useRef(null),U=f.useRef($),Q=f.useRef(O),ie=f.useRef(s),le=v||C||u||p||m||h,de=na(),he=hn(n,F.getState,p),xe=hn(n,F.getState,m),Le=hn(n,F.getState,h),W=hn(n,F.getState,E),ce=hn(n,F.getState,y),fe=me=>{const{nodeDragThreshold:K}=F.getState();if(v&&(!_||!C||K>0)&&Cr({id:n,store:F,nodeRef:H}),u){const $e=F.getState().nodeInternals.get(n);$e&&u(me,{...$e})}},pe=me=>{if(!Er(me)&&!I)if(bc.includes(me.key)&&v){const K=me.key==="Escape";Cr({id:n,store:F,unselect:K,nodeRef:H})}else C&&d&&Object.prototype.hasOwnProperty.call(Kt,me.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${me.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~i}`}),de({x:Kt[me.key].x,y:Kt[me.key].y,isShiftPressed:me.shiftKey}))};f.useEffect(()=>()=>{G.current&&(D==null||D.unobserve(G.current),G.current=null)},[]),f.useEffect(()=>{if(H.current&&!N){const me=H.current;(!k||!V||G.current!==me)&&(G.current&&(D==null||D.unobserve(G.current)),D==null||D.observe(me),G.current=me)}},[N,k,V]),f.useEffect(()=>{const me=ie.current!==s,K=U.current!==$,$e=Q.current!==O;H.current&&(me||K||$e)&&(me&&(ie.current=s),K&&(U.current=$),$e&&(Q.current=O),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,s,$,O]);const Be=ta({nodeRef:H,disabled:N||!C,noDragClassName:S,handleSelector:T,nodeId:n,isSelectable:v,selectNodesOnDrag:_});return N?null:f.createElement("div",{className:ze(["react-flow__node",`react-flow__node-${s}`,{[L]:C},j,{selected:d,selectable:v,parent:z,dragging:Be}]),ref:H,style:{zIndex:M,transform:`translate(${c}px,${a}px)`,pointerEvents:le?"all":"none",visibility:k?"visible":"hidden",...w},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:he,onMouseMove:xe,onMouseLeave:Le,onContextMenu:W,onClick:fe,onDoubleClick:ce,onKeyDown:b?pe:void 0,tabIndex:b?0:void 0,role:b?"button":void 0,"aria-describedby":I?void 0:`${qc}-${A}`,"aria-label":B},f.createElement(ES,{value:n},f.createElement(e,{id:n,data:r,type:s,xPos:o,yPos:i,selected:d,isConnectable:R,sourcePosition:$,targetPosition:O,dragging:Be,dragHandle:T,zIndex:M})))};return t.displayName="NodeWrapper",f.memo(t)};const iE=e=>{const t=e.getNodes().filter(n=>n.selected);return{...uo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function lE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=we(),{width:r,height:o,x:i,y:c,transformString:a,userSelectionActive:d}=ye(iE,Ne),u=na(),p=f.useRef(null);if(f.useEffect(()=>{var E;n||(E=p.current)==null||E.focus({preventScroll:!0})},[n]),ta({nodeRef:p}),d||!r||!o)return null;const m=e?E=>{const y=s.getState().getNodes().filter(w=>w.selected);e(E,y)}:void 0,h=E=>{Object.prototype.hasOwnProperty.call(Kt,E.key)&&u({x:Kt[E.key].x,y:Kt[E.key].y,isShiftPressed:E.shiftKey})};return f.createElement("div",{className:ze(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a}},f.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:o,top:c,left:i}}))}var cE=f.memo(lE);const aE=e=>e.nodesSelectionActive,sa=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:i,deleteKeyCode:c,onMove:a,onMoveStart:d,onMoveEnd:u,selectionKeyCode:p,selectionOnDrag:m,selectionMode:h,onSelectionStart:E,onSelectionEnd:y,multiSelectionKeyCode:w,panActivationKeyCode:j,zoomActivationKeyCode:C,elementsSelectable:v,zoomOnScroll:R,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:$,panOnScrollMode:O,zoomOnDoubleClick:N,panOnDrag:D,defaultViewport:T,translateExtent:M,minZoom:z,maxZoom:S,preventScrolling:L,onSelectionContextMenu:k,noWheelClassName:I,noPanClassName:B,disableKeyboardA11y:A})=>{const V=ye(aE),F=Nn(p),H=Nn(j),G=H||D,U=H||_,Q=F||m&&G!==!0;return GS({deleteKeyCode:c,multiSelectionKeyCode:w}),f.createElement(QS,{onMove:a,onMoveStart:d,onMoveEnd:u,onPaneContextMenu:o,elementsSelectable:v,zoomOnScroll:R,zoomOnPinch:b,panOnScroll:U,panOnScrollSpeed:$,panOnScrollMode:O,zoomOnDoubleClick:N,panOnDrag:!F&&G,defaultViewport:T,translateExtent:M,minZoom:z,maxZoom:S,zoomActivationKeyCode:C,preventScrolling:L,noWheelClassName:I,noPanClassName:B},f.createElement(Qc,{onSelectionStart:E,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:G,isSelecting:!!Q,selectionMode:h},e,V&&f.createElement(cE,{onSelectionContextMenu:k,noPanClassName:B,disableKeyboardA11y:A})))};sa.displayName="FlowRenderer";var uE=f.memo(sa);function dE(e){return ye(f.useCallback(n=>e?Tc(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function xE(e){const t={input:gn(e.input||Vc),default:gn(e.default||wr),output:gn(e.output||Zc),group:gn(e.group||fo)},n={},s=Object.keys(e).filter(r=>!["input","default","output","group"].includes(r)).reduce((r,o)=>(r[o]=gn(e[o]||wr),r),n);return{...t,...s}}const fE=({x:e,y:t,width:n,height:s,origin:r})=>!n||!s?{x:e,y:t}:r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-s*r[1]},pE=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ra=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,updateNodeDimensions:o,onError:i}=ye(pE,Ne),c=dE(e.onlyRenderVisibleElements),a=f.useRef(),d=f.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(p=>{const m=p.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(m)});return a.current=u,u},[]);return f.useEffect(()=>()=>{var u;(u=a==null?void 0:a.current)==null||u.disconnect()},[]),f.createElement("div",{className:"react-flow__nodes",style:po},c.map(u=>{var b,_,$;let p=u.type||"default";e.nodeTypes[p]||(i==null||i("003",De.error003(p)),p="default");const m=e.nodeTypes[p]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),E=!!(u.selectable||r&&typeof u.selectable>"u"),y=!!(u.connectable||n&&typeof u.connectable>"u"),w=!!(u.focusable||s&&typeof u.focusable>"u"),j=e.nodeExtent?ro(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,C=(j==null?void 0:j.x)??0,v=(j==null?void 0:j.y)??0,R=fE({x:C,y:v,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return f.createElement(m,{key:u.id,id:u.id,className:u.className,style:u.style,type:p,data:u.data,sourcePosition:u.sourcePosition||Y.Bottom,targetPosition:u.targetPosition||Y.Top,hidden:u.hidden,xPos:C,yPos:v,xPosOrigin:R.x,yPosOrigin:R.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:E,isConnectable:y,isFocusable:w,resizeObserver:d,dragHandle:u.dragHandle,zIndex:((b=u[ge])==null?void 0:b.z)??0,isParent:!!((_=u[ge])!=null&&_.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!(($=u[ge])!=null&&$.handleBounds)})}))};ra.displayName="NodeRenderer";var mE=f.memo(ra);const hE=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,gE=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Si="react-flow__edgeupdater",Ei=({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:o,onMouseOut:i,type:c})=>f.createElement("circle",{onMouseDown:r,onMouseEnter:o,onMouseOut:i,className:ze([Si,`${Si}-${c}`]),cx:hE(t,s,e),cy:gE(n,s,e),r:s,stroke:"transparent",fill:"transparent"}),yE=()=>!0;var qt=e=>{const t=({id:n,className:s,type:r,data:o,onClick:i,onEdgeDoubleClick:c,selected:a,animated:d,label:u,labelStyle:p,labelShowBg:m,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,style:w,source:j,target:C,sourceX:v,sourceY:R,targetX:b,targetY:_,sourcePosition:$,targetPosition:O,elementsSelectable:N,hidden:D,sourceHandleId:T,targetHandleId:M,onContextMenu:z,onMouseEnter:S,onMouseMove:L,onMouseLeave:k,reconnectRadius:I,onReconnect:B,onReconnectStart:A,onReconnectEnd:V,markerEnd:F,markerStart:H,rfId:G,ariaLabel:U,isFocusable:Q,isReconnectable:ie,pathOptions:le,interactionWidth:de,disableKeyboardA11y:he})=>{const xe=f.useRef(null),[Le,W]=f.useState(!1),[ce,fe]=f.useState(!1),pe=we(),Be=f.useMemo(()=>`url('#${Rr(H,G)}')`,[H,G]),me=f.useMemo(()=>`url('#${Rr(F,G)}')`,[F,G]);if(D)return null;const K=Pe=>{var We;const{edges:Fe,addSelectedEdges:bt,unselectNodesAndEdges:wt,multiSelectionActive:Ct}=pe.getState(),tt=Fe.find(dn=>dn.id===n);tt&&(N&&(pe.setState({nodesSelectionActive:!1}),tt.selected&&Ct?(wt({nodes:[],edges:[tt]}),(We=xe.current)==null||We.blur()):bt([n])),i&&i(Pe,tt))},$e=mn(n,pe.getState,c),Et=mn(n,pe.getState,z),an=mn(n,pe.getState,S),Dt=mn(n,pe.getState,L),zt=mn(n,pe.getState,k),et=(Pe,Fe)=>{if(Pe.button!==0)return;const{edges:bt,isValidConnection:wt}=pe.getState(),Ct=Fe?C:j,tt=(Fe?M:T)||null,We=Fe?"target":"source",dn=wt||yE,Ds=Fe,xn=bt.find(vt=>vt.id===n);fe(!0),A==null||A(Pe,xn,We);const zs=vt=>{fe(!1),V==null||V(vt,xn,We)};Dc({event:Pe,handleId:tt,nodeId:Ct,onConnect:vt=>B==null?void 0:B(xn,vt),isTarget:Ds,getState:pe.getState,setState:pe.setState,isValidConnection:dn,edgeUpdaterType:We,onReconnectEnd:zs})},Bt=Pe=>et(Pe,!0),jt=Pe=>et(Pe,!1),Rt=()=>W(!0),It=()=>W(!1),Vt=!N&&!i,un=Pe=>{var Fe;if(!he&&bc.includes(Pe.key)&&N){const{unselectNodesAndEdges:bt,addSelectedEdges:wt,edges:Ct}=pe.getState();Pe.key==="Escape"?((Fe=xe.current)==null||Fe.blur(),bt({edges:[Ct.find(We=>We.id===n)]})):wt([n])}};return f.createElement("g",{className:ze(["react-flow__edge",`react-flow__edge-${r}`,s,{selected:a,animated:d,inactive:Vt,updating:Le}]),onClick:K,onDoubleClick:$e,onContextMenu:Et,onMouseEnter:an,onMouseMove:Dt,onMouseLeave:zt,onKeyDown:Q?un:void 0,tabIndex:Q?0:void 0,role:Q?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":U===null?void 0:U||`Edge from ${j} to ${C}`,"aria-describedby":Q?`${Yc}-${G}`:void 0,ref:xe},!ce&&f.createElement(e,{id:n,source:j,target:C,selected:a,animated:d,label:u,labelStyle:p,labelShowBg:m,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,data:o,style:w,sourceX:v,sourceY:R,targetX:b,targetY:_,sourcePosition:$,targetPosition:O,sourceHandleId:T,targetHandleId:M,markerStart:Be,markerEnd:me,pathOptions:le,interactionWidth:de}),ie&&f.createElement(f.Fragment,null,(ie==="source"||ie===!0)&&f.createElement(Ei,{position:$,centerX:v,centerY:R,radius:I,onMouseDown:Bt,onMouseEnter:Rt,onMouseOut:It,type:"source"}),(ie==="target"||ie===!0)&&f.createElement(Ei,{position:O,centerX:b,centerY:_,radius:I,onMouseDown:jt,onMouseEnter:Rt,onMouseOut:It,type:"target"})))};return t.displayName="EdgeWrapper",f.memo(t)};function SE(e){const t={default:qt(e.default||ys),straight:qt(e.bezier||co),step:qt(e.step||lo),smoothstep:qt(e.step||Ls),simplebezier:qt(e.simplebezier||io)},n={},s=Object.keys(e).filter(r=>!["default","bezier"].includes(r)).reduce((r,o)=>(r[o]=qt(e[o]||ys),r),n);return{...t,...s}}function ji(e,t,n=null){const s=((n==null?void 0:n.x)||0)+t.x,r=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,i=(n==null?void 0:n.height)||t.height;switch(e){case Y.Top:return{x:s+o/2,y:r};case Y.Right:return{x:s+o,y:r+i/2};case Y.Bottom:return{x:s+o/2,y:r+i};case Y.Left:return{x:s,y:r+i/2}}}function Ri(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const EE=(e,t,n,s,r,o)=>{const i=ji(n,e,t),c=ji(o,s,r);return{sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}};function jE({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:s,targetWidth:r,targetHeight:o,width:i,height:c,transform:a}){const d={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+s,t.y+o)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=oo({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:i/a[2],height:c/a[2]}),p=Math.max(0,Math.min(u.x2,d.x2)-Math.max(u.x,d.x)),m=Math.max(0,Math.min(u.y2,d.y2)-Math.max(u.y,d.y));return Math.ceil(p*m)>0}function bi(e){var s,r,o,i,c;const t=((s=e==null?void 0:e[ge])==null?void 0:s.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((r=e==null?void 0:e.positionAbsolute)==null?void 0:r.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const RE=[{level:0,isMaxLevel:!0,edges:[]}];function bE(e,t,n=!1){let s=-1;const r=e.reduce((i,c)=>{var u,p;const a=Ve(c.zIndex);let d=a?c.zIndex:0;if(n){const m=t.get(c.target),h=t.get(c.source),E=c.selected||(m==null?void 0:m.selected)||(h==null?void 0:h.selected),y=Math.max(((u=h==null?void 0:h[ge])==null?void 0:u.z)||0,((p=m==null?void 0:m[ge])==null?void 0:p.z)||0,1e3);d=(a?c.zIndex:0)+(E?y:0)}return i[d]?i[d].push(c):i[d]=[c],s=d>s?d:s,i},{}),o=Object.entries(r).map(([i,c])=>{const a=+i;return{edges:c,level:a,isMaxLevel:a===s}});return o.length===0?RE:o}function wE(e,t,n){const s=ye(f.useCallback(r=>e?r.edges.filter(o=>{const i=t.get(o.source),c=t.get(o.target);return(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&jE({sourcePos:i.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:i.width,sourceHeight:i.height,targetWidth:c.width,targetHeight:c.height,width:r.width,height:r.height,transform:r.transform})}):r.edges,[e,t]));return bE(s,t,n)}const CE=({color:e="none",strokeWidth:t=1})=>f.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),vE=({color:e="none",strokeWidth:t=1})=>f.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),wi={[gs.Arrow]:CE,[gs.ArrowClosed]:vE};function _E(e){const t=we();return f.useMemo(()=>{var r,o;return Object.prototype.hasOwnProperty.call(wi,e)?wi[e]:((o=(r=t.getState()).onError)==null||o.call(r,"009",De.error009(e)),null)},[e])}const kE=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:c="auto-start-reverse"})=>{const a=_E(t);return a?f.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0"},f.createElement(a,{color:n,strokeWidth:i})):null},PE=({defaultColor:e,rfId:t})=>n=>{const s=[];return n.edges.reduce((r,o)=>([o.markerStart,o.markerEnd].forEach(i=>{if(i&&typeof i=="object"){const c=Rr(i,t);s.includes(c)||(r.push({id:c,color:i.color||e,...i}),s.push(c))}}),r),[]).sort((r,o)=>r.id.localeCompare(o.id))},oa=({defaultColor:e,rfId:t})=>{const n=ye(f.useCallback(PE({defaultColor:e,rfId:t}),[e,t]),(s,r)=>!(s.length!==r.length||s.some((o,i)=>o.id!==r[i].id)));return f.createElement("defs",null,n.map(s=>f.createElement(kE,{id:s.id,key:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient})))};oa.displayName="MarkerDefinitions";var NE=f.memo(oa);const ME=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),ia=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:s,edgeTypes:r,noPanClassName:o,onEdgeContextMenu:i,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:d,onEdgeClick:u,onEdgeDoubleClick:p,onReconnect:m,onReconnectStart:h,onReconnectEnd:E,reconnectRadius:y,children:w,disableKeyboardA11y:j})=>{const{edgesFocusable:C,edgesUpdatable:v,elementsSelectable:R,width:b,height:_,connectionMode:$,nodeInternals:O,onError:N}=ye(ME,Ne),D=wE(t,O,n);return b?f.createElement(f.Fragment,null,D.map(({level:T,edges:M,isMaxLevel:z})=>f.createElement("svg",{key:T,style:{zIndex:T},width:b,height:_,className:"react-flow__edges react-flow__container"},z&&f.createElement(NE,{defaultColor:e,rfId:s}),f.createElement("g",null,M.map(S=>{const[L,k,I]=bi(O.get(S.source)),[B,A,V]=bi(O.get(S.target));if(!I||!V)return null;let F=S.type||"default";r[F]||(N==null||N("011",De.error011(F)),F="default");const H=r[F]||r.default,G=$===ht.Strict?A.target:(A.target??[]).concat(A.source??[]),U=Ri(k.source,S.sourceHandle),Q=Ri(G,S.targetHandle),ie=(U==null?void 0:U.position)||Y.Bottom,le=(Q==null?void 0:Q.position)||Y.Top,de=!!(S.focusable||C&&typeof S.focusable>"u"),he=S.reconnectable||S.updatable,xe=typeof m<"u"&&(he||v&&typeof he>"u");if(!U||!Q)return N==null||N("008",De.error008(U,S)),null;const{sourceX:Le,sourceY:W,targetX:ce,targetY:fe}=EE(L,U,ie,B,Q,le);return f.createElement(H,{key:S.id,id:S.id,className:ze([S.className,o]),type:F,data:S.data,selected:!!S.selected,animated:!!S.animated,hidden:!!S.hidden,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,style:S.style,source:S.source,target:S.target,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerEnd:S.markerEnd,markerStart:S.markerStart,sourceX:Le,sourceY:W,targetX:ce,targetY:fe,sourcePosition:ie,targetPosition:le,elementsSelectable:R,onContextMenu:i,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,onClick:u,onEdgeDoubleClick:p,onReconnect:m,onReconnectStart:h,onReconnectEnd:E,reconnectRadius:y,rfId:s,ariaLabel:S.ariaLabel,isFocusable:de,isReconnectable:xe,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:j})})))),w):null};ia.displayName="EdgeRenderer";var TE=f.memo(ia);const AE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LE({children:e}){const t=ye(AE);return f.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function $E(e){const t=rt(),n=f.useRef(!1);f.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const OE={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top},la=({nodeId:e,handleType:t,style:n,type:s=ut.Bezier,CustomComponent:r,connectionStatus:o})=>{var _,$,O;const{fromNode:i,handleId:c,toX:a,toY:d,connectionMode:u}=ye(f.useCallback(N=>({fromNode:N.nodeInternals.get(e),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[e]),Ne),p=(_=i==null?void 0:i[ge])==null?void 0:_.handleBounds;let m=p==null?void 0:p[t];if(u===ht.Loose&&(m=m||(p==null?void 0:p[t==="source"?"target":"source"])),!i||!m)return null;const h=c?m.find(N=>N.id===c):m[0],E=h?h.x+h.width/2:(i.width??0)/2,y=h?h.y+h.height/2:i.height??0,w=((($=i.positionAbsolute)==null?void 0:$.x)??0)+E,j=(((O=i.positionAbsolute)==null?void 0:O.y)??0)+y,C=h==null?void 0:h.position,v=C?OE[C]:null;if(!C||!v)return null;if(r)return f.createElement(r,{connectionLineType:s,connectionLineStyle:n,fromNode:i,fromHandle:h,fromX:w,fromY:j,toX:a,toY:d,fromPosition:C,toPosition:v,connectionStatus:o});let R="";const b={sourceX:w,sourceY:j,sourcePosition:C,targetX:a,targetY:d,targetPosition:v};return s===ut.Bezier?[R]=kc(b):s===ut.Step?[R]=jr({...b,borderRadius:0}):s===ut.SmoothStep?[R]=jr(b):s===ut.SimpleBezier?[R]=_c(b):R=`M${w},${j} ${a},${d}`,f.createElement("path",{d:R,fill:"none",className:"react-flow__connection-path",style:n})};la.displayName="ConnectionLine";const DE=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function zE({containerStyle:e,style:t,type:n,component:s}){const{nodeId:r,handleType:o,nodesConnectable:i,width:c,height:a,connectionStatus:d}=ye(DE,Ne);return!(r&&o&&c&&i)?null:f.createElement("svg",{style:e,width:c,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container"},f.createElement("g",{className:ze(["react-flow__connection",d])},f.createElement(la,{nodeId:r,handleType:o,style:t,type:n,CustomComponent:s,connectionStatus:d})))}function Ci(e,t){const n=f.useRef(null),s=we();return f.useMemo(()=>{var o,i;if(process.env.NODE_ENV==="development"){const c=Object.keys(e);Ne(n.current,c)&&((i=(o=s.getState()).onError)==null||i.call(o,"002",De.error002())),n.current=c}return t(e)},[e])}const ca=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:s,onMoveEnd:r,onInit:o,onNodeClick:i,onEdgeClick:c,onNodeDoubleClick:a,onEdgeDoubleClick:d,onNodeMouseEnter:u,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:h,onSelectionContextMenu:E,onSelectionStart:y,onSelectionEnd:w,connectionLineType:j,connectionLineStyle:C,connectionLineComponent:v,connectionLineContainerStyle:R,selectionKeyCode:b,selectionOnDrag:_,selectionMode:$,multiSelectionKeyCode:O,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:M,elementsSelectable:z,selectNodesOnDrag:S,defaultViewport:L,translateExtent:k,minZoom:I,maxZoom:B,preventScrolling:A,defaultMarkerColor:V,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Q,zoomOnDoubleClick:ie,panOnDrag:le,onPaneClick:de,onPaneMouseEnter:he,onPaneMouseMove:xe,onPaneMouseLeave:Le,onPaneScroll:W,onPaneContextMenu:ce,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:Be,onEdgeMouseLeave:me,onReconnect:K,onReconnectStart:$e,onReconnectEnd:Et,reconnectRadius:an,noDragClassName:Dt,noWheelClassName:zt,noPanClassName:et,elevateEdgesOnSelect:Bt,disableKeyboardA11y:jt,nodeOrigin:Rt,nodeExtent:It,rfId:Vt})=>{const un=Ci(e,xE),Pe=Ci(t,SE);return $E(o),f.createElement(uE,{onPaneClick:de,onPaneMouseEnter:he,onPaneMouseMove:xe,onPaneMouseLeave:Le,onPaneContextMenu:ce,onPaneScroll:W,deleteKeyCode:T,selectionKeyCode:b,selectionOnDrag:_,selectionMode:$,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:O,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:z,onMove:n,onMoveStart:s,onMoveEnd:r,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:ie,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Q,panOnDrag:le,defaultViewport:L,translateExtent:k,minZoom:I,maxZoom:B,onSelectionContextMenu:E,preventScrolling:A,noDragClassName:Dt,noWheelClassName:zt,noPanClassName:et,disableKeyboardA11y:jt},f.createElement(LE,null,f.createElement(TE,{edgeTypes:Pe,onEdgeClick:c,onEdgeDoubleClick:d,onlyRenderVisibleElements:M,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:Be,onEdgeMouseLeave:me,onReconnect:K,onReconnectStart:$e,onReconnectEnd:Et,reconnectRadius:an,defaultMarkerColor:V,noPanClassName:et,elevateEdgesOnSelect:!!Bt,disableKeyboardA11y:jt,rfId:Vt},f.createElement(zE,{style:C,type:j,component:v,containerStyle:R})),f.createElement("div",{className:"react-flow__edgelabel-renderer"}),f.createElement(mE,{nodeTypes:un,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:u,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:h,selectNodesOnDrag:S,onlyRenderVisibleElements:M,noPanClassName:et,noDragClassName:Dt,disableKeyboardA11y:jt,nodeOrigin:Rt,nodeExtent:It,rfId:Vt})))};ca.displayName="GraphView";var BE=f.memo(ca);const vr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ct={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:vr,nodeExtent:vr,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ht.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:ms,isValidConnection:void 0},IE=()=>Jm((e,t)=>({...ct,setNodes:n=>{const{nodeInternals:s,nodeOrigin:r,elevateNodesOnSelect:o}=t();e({nodeInternals:er(n,s,r,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:s={}}=t();e({edges:n.map(r=>({...s,...r}))})},setDefaultNodesAndEdges:(n,s)=>{const r=typeof n<"u",o=typeof s<"u",i=r?er(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:o?s:[],hasDefaultNodes:r,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:s,nodeInternals:r,fitViewOnInit:o,fitViewOnInitDone:i,fitViewOnInitOptions:c,domNode:a,nodeOrigin:d}=t(),u=a==null?void 0:a.querySelector(".react-flow__viewport");if(!u)return;const p=window.getComputedStyle(u),{m22:m}=new window.DOMMatrixReadOnly(p.transform),h=n.reduce((y,w)=>{const j=r.get(w.id);if(j!=null&&j.hidden)r.set(j.id,{...j,[ge]:{...j[ge],handleBounds:void 0}});else if(j){const C=so(w.nodeElement);!!(C.width&&C.height&&(j.width!==C.width||j.height!==C.height||w.forceUpdate))&&(r.set(j.id,{...j,[ge]:{...j[ge],handleBounds:{source:yi(".source",w.nodeElement,m,d),target:yi(".target",w.nodeElement,m,d)}},...C}),y.push({id:j.id,type:"dimensions",dimensions:C}))}return y},[]);Gc(r,d);const E=i||o&&!i&&Wc(t,{initial:!0,...c});e({nodeInternals:new Map(r),fitViewOnInitDone:E}),(h==null?void 0:h.length)>0&&(s==null||s(h))},updateNodePositions:(n,s=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=n.map(c=>{const a={id:c.id,type:"position",dragging:r};return s&&(a.positionAbsolute=c.positionAbsolute,a.position=c.position),a});o(i)},triggerNodeChanges:n=>{const{onNodesChange:s,nodeInternals:r,hasDefaultNodes:o,nodeOrigin:i,getNodes:c,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(o){const d=Xc(n,c()),u=er(d,r,i,a);e({nodeInternals:u})}s==null||s(n)}},addSelectedNodes:n=>{const{multiSelectionActive:s,edges:r,getNodes:o}=t();let i,c=null;s?i=n.map(a=>at(a,!0)):(i=Ut(o(),n),c=Ut(r,[])),Zn({changedNodes:i,changedEdges:c,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:s,edges:r,getNodes:o}=t();let i,c=null;s?i=n.map(a=>at(a,!0)):(i=Ut(r,n),c=Ut(o(),[])),Zn({changedNodes:c,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:s}={})=>{const{edges:r,getNodes:o}=t(),i=n||o(),c=s||r,a=i.map(u=>(u.selected=!1,at(u.id,!1))),d=c.map(u=>at(u.id,!1));Zn({changedNodes:a,changedEdges:d,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:s,maxZoom:r}=t();s==null||s.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:s,minZoom:r}=t();s==null||s.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{var s;(s=t().d3Zoom)==null||s.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:s}=t(),o=s().filter(c=>c.selected).map(c=>at(c.id,!1)),i=n.filter(c=>c.selected).map(c=>at(c.id,!1));Zn({changedNodes:o,changedEdges:i,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:s}=t();s.forEach(r=>{r.positionAbsolute=ro(r.position,n)}),e({nodeExtent:n,nodeInternals:new Map(s)})},panBy:n=>{const{transform:s,width:r,height:o,d3Zoom:i,d3Selection:c,translateExtent:a}=t();if(!i||!c||!n.x&&!n.y)return!1;const d=ft.translate(s[0]+n.x,s[1]+n.y).scale(s[2]),u=[[0,0],[r,o]],p=i==null?void 0:i.constrain()(d,u,a);return i.transform(c,p),s[0]!==p.x||s[1]!==p.y||s[2]!==p.k},cancelConnection:()=>e({connectionNodeId:ct.connectionNodeId,connectionHandleId:ct.connectionHandleId,connectionHandleType:ct.connectionHandleType,connectionStatus:ct.connectionStatus,connectionStartHandle:ct.connectionStartHandle,connectionEndHandle:ct.connectionEndHandle}),reset:()=>e({...ct})}),Object.is),mo=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=IE()),f.createElement(iS,{value:t.current},e)};mo.displayName="ReactFlowProvider";const aa=({children:e})=>f.useContext(As)?f.createElement(f.Fragment,null,e):f.createElement(mo,null,e);aa.displayName="ReactFlowWrapper";const VE={input:Vc,default:wr,output:Zc,group:fo},FE={default:ys,straight:co,step:lo,smoothstep:Ls,simplebezier:io},ZE=[0,0],HE=[15,15],qE={x:0,y:0,zoom:1},YE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ua=f.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:o=VE,edgeTypes:i=FE,onNodeClick:c,onEdgeClick:a,onInit:d,onMove:u,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:v,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:_,onNodeDragStart:$,onNodeDrag:O,onNodeDragStop:N,onNodesDelete:D,onEdgesDelete:T,onSelectionChange:M,onSelectionDragStart:z,onSelectionDrag:S,onSelectionDragStop:L,onSelectionContextMenu:k,onSelectionStart:I,onSelectionEnd:B,connectionMode:A=ht.Strict,connectionLineType:V=ut.Bezier,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:G,deleteKeyCode:U="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:ie=!1,selectionMode:le=tn.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:he=hs()?"Meta":"Control",zoomActivationKeyCode:xe=hs()?"Meta":"Control",snapToGrid:Le=!1,snapGrid:W=HE,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:fe=!0,nodesDraggable:pe,nodesConnectable:Be,nodesFocusable:me,nodeOrigin:K=ZE,edgesFocusable:$e,edgesUpdatable:Et,elementsSelectable:an,defaultViewport:Dt=qE,minZoom:zt=.5,maxZoom:et=2,translateExtent:Bt=vr,preventScrolling:jt=!0,nodeExtent:Rt,defaultMarkerColor:It="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:un=!0,panOnScroll:Pe=!1,panOnScrollSpeed:Fe=.5,panOnScrollMode:bt=kt.Free,zoomOnDoubleClick:wt=!0,panOnDrag:Ct=!0,onPaneClick:tt,onPaneMouseEnter:We,onPaneMouseMove:dn,onPaneMouseLeave:Ds,onPaneScroll:xn,onPaneContextMenu:zs,children:So,onEdgeContextMenu:vt,onEdgeDoubleClick:Td,onEdgeMouseEnter:Ad,onEdgeMouseMove:Ld,onEdgeMouseLeave:$d,onEdgeUpdate:Od,onEdgeUpdateStart:Dd,onEdgeUpdateEnd:zd,onReconnect:Bd,onReconnectStart:Id,onReconnectEnd:Vd,reconnectRadius:Fd=10,edgeUpdaterRadius:Zd=10,onNodesChange:Hd,onEdgesChange:qd,noDragClassName:Yd="nodrag",noWheelClassName:Ud="nowheel",noPanClassName:Eo="nopan",fitView:Gd=!1,fitViewOptions:Wd,connectOnClick:Kd=!0,attributionPosition:Xd,proOptions:Qd,defaultEdgeOptions:Jd,elevateNodesOnSelect:ex=!0,elevateEdgesOnSelect:tx=!1,disableKeyboardA11y:jo=!1,autoPanOnConnect:nx=!0,autoPanOnNodeDrag:sx=!0,connectionRadius:rx=20,isValidConnection:ox,onError:ix,style:lx,id:Ro,nodeDragThreshold:cx,...ax},ux)=>{const Bs=Ro||"1";return f.createElement("div",{...ax,style:{...lx,...YE},ref:ux,className:ze(["react-flow",r]),"data-testid":"rf__wrapper",id:Ro},f.createElement(aa,null,f.createElement(BE,{onInit:d,onMove:u,onMoveStart:p,onMoveEnd:m,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:C,onNodeMouseMove:v,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:_,nodeTypes:o,edgeTypes:i,connectionLineType:V,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:G,selectionKeyCode:Q,selectionOnDrag:ie,selectionMode:le,deleteKeyCode:U,multiSelectionKeyCode:he,panActivationKeyCode:de,zoomActivationKeyCode:xe,onlyRenderVisibleElements:ce,selectNodesOnDrag:fe,defaultViewport:Dt,translateExtent:Bt,minZoom:zt,maxZoom:et,preventScrolling:jt,zoomOnScroll:Vt,zoomOnPinch:un,zoomOnDoubleClick:wt,panOnScroll:Pe,panOnScrollSpeed:Fe,panOnScrollMode:bt,panOnDrag:Ct,onPaneClick:tt,onPaneMouseEnter:We,onPaneMouseMove:dn,onPaneMouseLeave:Ds,onPaneScroll:xn,onPaneContextMenu:zs,onSelectionContextMenu:k,onSelectionStart:I,onSelectionEnd:B,onEdgeContextMenu:vt,onEdgeDoubleClick:Td,onEdgeMouseEnter:Ad,onEdgeMouseMove:Ld,onEdgeMouseLeave:$d,onReconnect:Bd??Od,onReconnectStart:Id??Dd,onReconnectEnd:Vd??zd,reconnectRadius:Fd??Zd,defaultMarkerColor:It,noDragClassName:Yd,noWheelClassName:Ud,noPanClassName:Eo,elevateEdgesOnSelect:tx,rfId:Bs,disableKeyboardA11y:jo,nodeOrigin:K,nodeExtent:Rt}),f.createElement(OS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:j,nodesDraggable:pe,nodesConnectable:Be,nodesFocusable:me,edgesFocusable:$e,edgesUpdatable:Et,elementsSelectable:an,elevateNodesOnSelect:ex,minZoom:zt,maxZoom:et,nodeExtent:Rt,onNodesChange:Hd,onEdgesChange:qd,snapToGrid:Le,snapGrid:W,connectionMode:A,translateExtent:Bt,connectOnClick:Kd,defaultEdgeOptions:Jd,fitView:Gd,fitViewOptions:Wd,onNodesDelete:D,onEdgesDelete:T,onNodeDragStart:$,onNodeDrag:O,onNodeDragStop:N,onSelectionDrag:S,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:Eo,nodeOrigin:K,rfId:Bs,autoPanOnConnect:nx,autoPanOnNodeDrag:sx,onError:ix,connectionRadius:rx,isValidConnection:ox,nodeDragThreshold:cx}),f.createElement(LS,{onSelectionChange:M}),So,f.createElement(aS,{proOptions:Qd,position:Xd}),f.createElement(VS,{rfId:Bs,disableKeyboardA11y:jo})))});ua.displayName="ReactFlow";function UE(){const e=we();return f.useCallback(t=>{const{domNode:n,updateNodeDimensions:s}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((i,c)=>{const a=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${c}"]`);return a&&i.push({id:c,nodeElement:a,forceUpdate:!0}),i},[]);requestAnimationFrame(()=>s(o))},[])}function GE({onStart:e,onChange:t,onEnd:n}){const s=we();f.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),f.useEffect(()=>{s.setState({onViewportChange:t})},[t]),f.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}var qe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(qe||(qe={}));function WE({color:e,dimensions:t,lineWidth:n}){return f.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function KE({color:e,radius:t}){return f.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const XE={[qe.Dots]:"#91919a",[qe.Lines]:"#eee",[qe.Cross]:"#e2e2e2"},QE={[qe.Dots]:1,[qe.Lines]:1,[qe.Cross]:6},JE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function da({id:e,variant:t=qe.Dots,gap:n=20,size:s,lineWidth:r=1,offset:o=2,color:i,style:c,className:a}){const d=f.useRef(null),{transform:u,patternId:p}=ye(JE,Ne),m=i||XE[t],h=s||QE[t],E=t===qe.Dots,y=t===qe.Cross,w=Array.isArray(n)?n:[n,n],j=[w[0]*u[2]||1,w[1]*u[2]||1],C=h*u[2],v=y?[C,C]:j,R=E?[C/o,C/o]:[v[0]/o,v[1]/o];return f.createElement("svg",{className:ze(["react-flow__background",a]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},f.createElement("pattern",{id:p+e,x:u[0]%j[0],y:u[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`},E?f.createElement(KE,{color:m,radius:C/o}):f.createElement(WE,{dimensions:v,color:m,lineWidth:r})),f.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}da.displayName="Background";var ej=f.memo(da);const ho=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ae=(e,t)=>{const n=ho(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return x.Eo.construct(s.position,x.q.scale(x.Eo.dims(x.Eo.construct(n)),1/e.getZoom()))},tj=(e,t)=>$s.fromFlow(e,t);class xa{constructor(t,n){Ke(this,"node_",null);Ke(this,"position");Ke(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return x.q.translate(x.Eo.topLeft(this.node.box),this.position)}}class $s{constructor(t,n,s){Ke(this,"key");Ke(this,"box");Ke(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Ae(n,t),r=ho(t),o=r.getElementsByClassName("react-flow__handle"),i=x.Eo.construct(r),c=Array.from(o).map(a=>{const d=x.Eo.center(x.Eo.construct(a)),u=x.q.translation(x.Eo.topLeft(i),d),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=x.J.construct(p[0]);return new xa(u,m)});return new $s(t,s,c)}}const nj=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:o,fromNode:i,connectionLineStyle:c,connectionStatus:a})=>{const d=document.querySelector(".react-flow__handle-connecting"),u=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);if(u!=null){const E=x.J.outer.safeParse(u[1]);E.success&&(o=E.data)}const p=Yt({sourcePos:x.q.construct(e,t),targetPos:x.q.construct(n,s),sourceOrientation:r,targetOrientation:o,sourceBox:Ae(rt(),(i==null?void 0:i.id)??""),targetBox:Ae(rt(),(i==null?void 0:i.id)??"")}),m=rt(),h=Zl(x.q.construct(e,t),p,m.getZoom(),!1);return l.jsxRuntimeExports.jsx($t,{path:fa(h),style:{...c,stroke:x.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},sj=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:o,style:i,segments:c=[],onSegmentsChange:a,color:d="var(--pluto-gray-l9)",selected:u=!1,...p})=>{const m=x.q.construct(p.sourceX,p.sourceY),h=f.useRef(m),E=x.q.equals(m,h.current),y=x.q.construct(p.targetX,p.targetY),w=f.useRef(y),j=x.q.equals(y,w.current),C=rt(),[v,R,b]=g.useCombinedStateAndRef(()=>c.length>0?c:Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),_=f.useRef(o),$=f.useRef(s),O=g.useDebouncedCallback(a,100,[a]);if(!E||!j){let M=v;const z=x.q.translation(h.current,m),S=x.q.translation(y,w.current);x.q.equals(z,x.q.scale(S,-1),.001)?(h.current=m,w.current=y):(E?j||(M=Dm({delta:S,segments:M}),_.current!==o&&(_.current=o,M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),Do({sourcePos:m,targetPos:y,next:M,prev:v})||(M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),w.current=y):(M=Om({delta:z,segments:M}),$.current!==s&&($.current=s,M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),Do({sourcePos:m,targetPos:y,next:M,prev:v})||(M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),h.current=m),O(M),R(M))}const N=f.useRef(null),D=js({onStart:f.useCallback((M,z,S)=>{N.current={index:Number(S.currentTarget.id.split("-")[1]),segments:[...b.current]}},[]),onMove:f.useCallback(M=>{if(N.current==null)return;const z=Tm({segments:N.current.segments,index:N.current.index,magnitude:x.Eo.dim(M,x.g.swap(N.current.segments[N.current.index].direction),!0)/C.getZoom()});R(z)},[]),onEnd:f.useCallback(()=>a(b.current),[a])}),T=Zl(m,v,C.getZoom(),!0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx($t,{path:fa(T),style:{...i,stroke:x.cssString(d)},...p}),u&&rj(T).map((M,z)=>{const S=v[z].direction,L=x.g.swap(S),k={[x.g.dimension(S)]:"18px",[x.g.dimension(L)]:"4px"},I={[S]:M[S]-9,[L]:M[L]-2};return l.jsxRuntimeExports.jsxs(f.Fragment,{children:[l.jsxRuntimeExports.jsx("rect",{className:x.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...k,...I,rx:"2px",ry:"2px"}),l.jsxRuntimeExports.jsx("foreignObject",{x:M.x-9,y:M.y-9,width:"18px",height:"18px",children:l.jsxRuntimeExports.jsx("div",{id:`handle-${z}`,className:x.CSS(x.CSS.BE("diagram-edge-handle","dragger"),x.CSS.dir(S)),draggable:!0,onDragStart:D})})]},z)})]})},fa=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const o=e[r%e.length],i=e[(r+1)%e.length],c=Math.min(6/Math.hypot(i.x-o.x,i.y-o.y),.5);r>0&&(t+=`Q${o.x},${o.y} ${o.x*(1-c)+i.x*c},${o.y*(1-c)+i.y*c}`),r===0?t+=`M${o.x},${o.y}`:r===0&&(t+=`M${o.x*(1-c)+i.x*c},${o.y*(1-c)+i.y*c}`),r===s-1?t+=`L${i.x},${i.y}`:r<s-1&&(t+=`L${o.x*c+i.x*(1-c)},${o.y*c+i.y*(1-c)}`)}return t},rj=e=>e.slice(1).map((t,n)=>{const s=e[n];return x.q.construct((t.x+s.x)/2,(t.y+s.y)/2)}),oj=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:x.q.ZERO,zoom:1}})=>{const[r,o]=f.useState(n),[i,c]=f.useState(e),[a,d]=f.useState(t),[u,p]=f.useState(s),[m,h]=f.useState(!1);return{viewport:u,onViewportChange:p,edges:a,nodes:i,onNodesChange:c,onEdgesChange:d,editable:r,onEditableChange:o,fitViewOnResize:m,setFitViewOnResize:h}},ij=e=>e.source!==e.target,lj={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},cj={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},pa={maxZoom:1,minZoom:.5},aj={hideAttribution:!0},ma=f.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Ln=()=>f.useContext(ma),ha=f.memo(({children:e})=>{const{registerNodeRenderer:t}=Ln();return f.useEffect(()=>t(e),[t,e]),null});ha.displayName="NodeRenderer";const uj=["Backspace","Delete"],dj=g.wrap$1(P.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:r,edges:o,onEditableChange:i,editable:c,viewport:a,triggers:d,onViewportChange:u,fitViewOnResize:p,setFitViewOnResize:m,visible:h,...E})=>{const y=g.useMemoDeepEqualProps({visible:h}),[{path:w},,j]=g.use$3({aetherKey:e,type:P.Diagram$1.TYPE,schema:P.diagramStateZ,initialState:{position:a.position,region:x.Eo.ZERO,zoom:a.zoom,...y}});f.useEffect(()=>j(W=>({...W,...y})),[y]);const C=g.use().colors.gray.l9.hex,v=g.useMemoCompare(()=>d??Br.zoom,g.compareModeConfigs,[d]),{fitView:R}=rt(),b=g.useDebouncedCallback(W=>R(W),50,[R]),_=ws(f.useCallback(W=>{p&&b({maxZoom:1}),j(ce=>({...ce,region:W}))},[j,b,p])),$=f.useRef(null),O=f.useCallback(W=>{const ce=$.current;ce!=null&&ce.x===W.x&&ce.y===W.y&&ce.zoom===W.zoom||($.current=W,!(isNaN(W.x)||isNaN(W.y)||isNaN(W.zoom))&&(j(fe=>({...fe,position:W,zoom:W.zoom})),u(Wl(W))))},[j,u]);GE({onStart:O,onChange:O,onEnd:O});const[N,D]=f.useState(()=>()=>null),T=f.useCallback(W=>D(()=>W),[]),M=f.useMemo(()=>({custom:({id:W,xPos:ce,yPos:fe,selected:pe})=>N({symbolKey:W,position:{x:ce,y:fe},selected:pe})}),[N]),z=f.useRef(o),S=f.useMemo(()=>(z.current=o,Xr(o)),[o]),L=f.useRef(r),k=f.useMemo(()=>(L.current=r,Kr(r)),[r]),I=f.useCallback(W=>n(Kl(L.current,ce=>Xc(W,ce))),[n]),B=f.useCallback(W=>s(Wn(z.current,ce=>tE(W,ce),C)),[s,C]),A=f.useCallback((W,ce)=>s(Wn(z.current,fe=>wS(W,ce,fe),C)),[]),V=f.useCallback(W=>{s(Wn(z.current,ce=>Nc(W,ce),C))},[s,C]),F=f.useCallback((W,ce)=>{const fe=[...z.current],pe=fe.findIndex(Be=>Be.key===W);pe!==-1&&(fe[pe]={...fe[pe],segments:ce},z.current=fe,s(fe))},[s]),H=c?lj:cj,G=g.useSyncedRef(F),U=f.useMemo(()=>({default:W=>l.jsxRuntimeExports.jsx(sj,{...W,segments:W.data.segments,color:W.data.color,onSegmentsChange:f.useCallback(ce=>G.current(W.id,ce),[W.id])},W.id)}),[]),Q=f.useRef(null);g.use$1({triggers:v.zoomReset,callback:f.useCallback(({stage:W,cursor:ce})=>{const fe=Q.current;fe==null||W!=="start"||!x.Eo.contains(fe,ce)||R()},[R])});const ie=g.purgeMouse(v.select)[0]??null,le=g.purgeMouse(v.pan)[0]??null,de=g.purgeMouse(v.zoom)[0]??null,he={selectionOnDrag:ie==null,panOnDrag:le==null,selectionKeyCode:ie,panActivationKeyCode:le,zoomActivationKeyCode:de},xe=g.useCombinedRefs(Q,_),Le=f.useMemo(()=>({visible:h,editable:c,onEditableChange:i,registerNodeRenderer:T,fitViewOnResize:p,setFitViewOnResize:m}),[c,h,i,T,p]);return l.jsxRuntimeExports.jsx(ma.Provider,{value:Le,children:l.jsxRuntimeExports.jsx(g.Composite,{path:w,children:h&&l.jsxRuntimeExports.jsx(ua,{...he,className:x.CSS(x.CSS.B("diagram"),x.CSS.editable(c)),nodes:k,edges:S,nodeTypes:M,edgeTypes:U,ref:xe,fitView:!0,onNodesChange:I,onEdgesChange:B,onConnect:V,onEdgeUpdate:A,defaultViewport:Gl(a),connectionLineComponent:nj,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:ij,connectionMode:ht.Loose,snapGrid:[3,3],fitViewOptions:pa,selectionMode:tn.Partial,proOptions:aj,deleteKeyCode:uj,...E,style:{[x.CSS.var("diagram-zoom")]:a.zoom,...E.style},...H,children:t})})})}),xj=()=>{const{editable:e}=Ln();return e?l.jsxRuntimeExports.jsx(ej,{}):null},fj=({children:e,...t})=>l.jsxRuntimeExports.jsx(X.Pack,{direction:"y",borderShade:4,className:x.CSS.BE("diagram","controls"),...t,children:e}),pj=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Ln();return l.jsxRuntimeExports.jsx(g.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:x.J.RIGHT_CENTER,tooltip:n?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Disable edit mode"}):l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?l.jsxRuntimeExports.jsx(g.Qt.EditOff,{}):l.jsxRuntimeExports.jsx(g.Qt.Edit,{})})},mj=({onClick:e,...t})=>{const{fitView:n}=rt(),{fitViewOnResize:s,setFitViewOnResize:r}=Ln();return l.jsxRuntimeExports.jsx(g.ToggleIcon,{onClick:o=>{n(pa),e==null||e(o)},value:s,onChange:o=>r(o),rightClickToggle:!0,tooltip:l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:x.J.RIGHT_CENTER,variant:"outlined",...t,children:l.jsxRuntimeExports.jsx(g.Qt.Expand,{})})},hj=e=>l.jsxRuntimeExports.jsx(mo,{children:l.jsxRuntimeExports.jsx(dj,{...e})}),gj=Object.freeze(Object.defineProperty({__proto__:null,Background:xj,Controls:fj,Diagram:hj,FitViewControl:mj,HandleLayout:xa,NodeLayout:$s,NodeRenderer:ha,ToggleEditControl:pj,alignNodes:Vm,edgeConverter:Wn,edgeZ:Bm,nodeConverter:Kl,nodeZ:Im,rfEdgeDataZ:ql,selectNode:ho,selectNodeBox:Ae,selectNodeLayout:tj,translateEdgesBackward:Ul,translateEdgesForward:Xr,translateNodesBackward:Yl,translateNodesForward:Kr,translateViewportBackward:Wl,translateViewportForward:Gl,use:oj,useContext:Ln,viewportZ:zm},Symbol.toStringTag,{value:"Module"})),yj=g.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=l.jsxRuntimeExports.jsx(g.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:o,telem:i,...c})=>{const a=g.useMemoDeepEqualProps({font:t,color:o,telem:i,visible:s}),[,{scrolling:d,empty:u},p]=g.use$3({aetherKey:e,type:P.Log.TYPE,schema:P.logState,initialState:{empty:!0,region:x.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});f.useEffect(()=>{p(h=>({...h,...a}))},[a,p]);const m=ws(f.useCallback(h=>p(E=>({...E,region:h})),[p]));return l.jsxRuntimeExports.jsx("div",{ref:m,className:x.CSS(x.CSS.B("log"),n),onWheel:h=>{p(E=>({...E,wheelPos:E.wheelPos-h.deltaY,scrolling:E.scrolling?E.scrolling:h.deltaY<0}))},...c,children:u?r:l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.BE("log","live"),d&&x.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",children:l.jsxRuntimeExports.jsx(g.Qt.Dynamic,{})})})}),Sj=Object.freeze(Object.defineProperty({__proto__:null,Log:yj},Symbol.toStringTag,{value:"Module"})),Ej=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:r}=e,o=i=>()=>s({...e,...i});return t?l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[l.jsxRuntimeExports.jsx(xt,{selected:r==="top",onClick:o({outer:"top"})}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[l.jsxRuntimeExports.jsx(xt,{selected:r==="left",onClick:o({outer:"left"})}),l.jsxRuntimeExports.jsx(vi,{showInner:n,value:e,onChange:s}),l.jsxRuntimeExports.jsx(xt,{selected:r==="right",onClick:o({outer:"right"})})]}),l.jsxRuntimeExports.jsx(xt,{selected:r==="bottom",onClick:o({outer:"bottom"})})]}):l.jsxRuntimeExports.jsx(vi,{className:x.CSS.B("orientation-control"),value:e,onChange:s})},vi=({value:e,onChange:t,className:n,showInner:s=!0,...r})=>{const{inner:o}=e,i=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS(n,x.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,className:x.CSS(x.CSS.dir("y")),selected:o==="top",onClick:i({inner:"top"})}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",justify:"center",children:[l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,selected:o==="left",onClick:i({inner:"left"})}),l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,selected:o==="right",onClick:i({inner:"right"})})]}),l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,className:x.CSS(x.CSS.dir("y")),selected:o==="bottom",onClick:i({inner:"bottom"})})]})},xt=({selected:e,className:t,...n})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:"text",className:x.CSS(t,x.CSS.selected(e)),...n,children:l.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ge=({className:e,direction:t,...n})=>l.jsxRuntimeExports.jsx(X.Space,{direction:t,align:"stretch",className:x.CSS(x.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ln=({showOuter:e,showInner:t,...n})=>l.jsxRuntimeExports.jsx(je,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var o;return l.jsxRuntimeExports.jsx(Ej,{value:{inner:s.orientation??"top",outer:((o=s.label)==null?void 0:o.orientation)??"top"},showInner:t,showOuter:e,onChange:i=>r({...s,orientation:i.inner,label:{...s.label,orientation:i.outer}})})}}),$n=({path:e,omit:t=[]})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsx(je,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:n=>l.jsxRuntimeExports.jsx(g.Text$1,{selectOnFocus:!0,...n})}),l.jsxRuntimeExports.jsx(vs,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:e+".maxInlineSize",hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,visible:!t.includes("level"),path:e+".level",label:"Label Size",padHelpText:!1,children:n=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...n})}),l.jsxRuntimeExports.jsx(je,{visible:!t.includes("align"),path:e+".align",label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>l.jsxRuntimeExports.jsx(zr,{...n})})]}),At=e=>l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>l.jsxRuntimeExports.jsx(_r.Swatch,{value:t??x.ZERO.setAlpha(1).rgba255,onChange:o=>n(o.rgba255),...r,bordered:!0})}),jj=e=>l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>l.jsxRuntimeExports.jsx(g.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),Te=({omit:e})=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{omit:e,path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",grow:!0,children:[l.jsxRuntimeExports.jsx(At,{path:"color",optional:!0}),l.jsxRuntimeExports.jsx(je,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>l.jsxRuntimeExports.jsx(g.Switch$1,{...t})}),l.jsxRuntimeExports.jsx(jj,{path:"scale"})]})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]}),Rj=({path:e})=>{var d,u;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=P.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=P.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p=p??0;const m=P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:p}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p=p??0;const m=P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:p}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=P.authoritySource({channel:p}),E=P.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:E,source:h},indicator:{statusSource:h}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"State Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:o.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Command Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:i.channel,onChange:a})}),l.jsxRuntimeExports.jsx(Zr,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},go=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Ce=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(Rj,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},yn={y:2,x:.25},Sn={lower:0,upper:2e3},ga=({includeBorderRadius:e=!1})=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(At,{path:"backgroundColor",label:"Background Color"}),l.jsxRuntimeExports.jsx(je,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"%",...n})}),l.jsxRuntimeExports.jsx(je,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"%",...n})}),e&&l.jsxRuntimeExports.jsx(je,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"px",...n})}),l.jsxRuntimeExports.jsx(je,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t??200,dragScale:yn,bounds:Sn,endContent:"px",...n})}),l.jsxRuntimeExports.jsx(je,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t??200,dragScale:yn,bounds:Sn,endContent:"px",...n})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showInner:!1})]}),ya=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],bj=({path:e})=>{var p;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((p=t.telem)==null?void 0:p.props),r=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),o=P.stringifyNumberProps.parse(s.segments.stringifier.props),i=P.rollingAverageProps.parse(s.segments.rollingAverage.props),c=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:m??0}),stringifier:P.stringifyNumber({precision:o.precision??2}),rollingAverage:P.rollingAverage({windowSize:i.windowSize??1})},outlet:"stringifier"});n({...t,telem:h})},a=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:r.channel}),stringifier:P.stringifyNumber({precision:m}),rollingAverage:P.rollingAverage({windowSize:i.windowSize})},outlet:"stringifier"});n({...t,telem:h})},d=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:P.stringifyNumber({precision:o.precision??2}),valueStream:P.streamChannelValue({channel:r.channel}),rollingAverage:P.rollingAverage({windowSize:m})},outlet:"stringifier"});n({...t,telem:h})},u=bs(r.channel);return f.useEffect(()=>{n({...t,tooltip:[u]})},[u]),l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"Input Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Precision",align:"start",children:l.jsxRuntimeExports.jsx(g.Numeric,{value:o.precision??2,bounds:{lower:0,upper:10},onChange:a})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Averaging Window",align:"start",children:l.jsxRuntimeExports.jsx(g.Numeric,{value:i.windowSize??1,bounds:{lower:1,upper:100},onChange:d})})]})},wj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return l.jsxRuntimeExports.jsx(bj,{path:""});default:return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(je,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>l.jsxRuntimeExports.jsx(g.Text$1,{...s})}),l.jsxRuntimeExports.jsx(vs,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),l.jsxRuntimeExports.jsx(je,{path:"level",label:"Value Size",hideIfNull:!0,padHelpText:!1,children:s=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...s})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showInner:!1})]})}},[]),t=be.useStatic({tabs:ya,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Cj=({path:e})=>{var c;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((c=t.source)==null?void 0:c.props),r=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),o=a=>{a=a??0;const d=P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:a}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:d})},i=bs(r.channel);return f.useEffect(()=>n({...t}),[i]),l.jsxRuntimeExports.jsx(Ge,{direction:"x",align:"stretch",children:l.jsxRuntimeExports.jsx(He.Item,{label:"Input Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:o})})})},vj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return l.jsxRuntimeExports.jsx(Cj,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{})}},[]),t=be.useStatic({tabs:ya,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},_j=({path:e})=>{var i;const{value:t,onChange:n}=yt({path:e}),s=P.sinkPipelinePropsZ.parse((i=t.sink)==null?void 0:i.props),r=P.setChannelValuePropsZ.parse(s.segments.setter.props),o=c=>{c=c??0;const a=P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:c}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),d=P.authoritySource({channel:c}),u=P.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:u,source:d},showIndicator:!0,indicator:{statusSource:d}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"Output Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:o})}),l.jsxRuntimeExports.jsx(vs,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),l.jsxRuntimeExports.jsx(Zr,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},kj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(_j,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{omit:["align","maxInlineSize"]})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Pj=({path:e})=>{var d,u;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=P.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=P.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p=p??0;const m=P.sourcePipeline("number",{connections:[],segments:{valueStream:P.streamChannelValue({channel:p})},outlet:"valueStream"});n({...t,source:m})},a=p=>{p=p??0;const m=P.sinkPipeline("number",{connections:[],segments:{setter:P.setChannelValue({channel:p})},inlet:"setter"}),h=P.authoritySource({channel:p}),E=P.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{...t.control,showChip:!0,chip:{sink:E,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"State Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:o.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Command Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:i.channel,onChange:a})})]})},Nj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(Pj,{path:""});default:return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsx(yl,{path:"units",label:"Units",align:"start",padHelpText:!1}),l.jsxRuntimeExports.jsx(At,{path:"color"})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Mj=()=>{const e=yt({path:"autoFit",optional:!0});return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsx(je,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>l.jsxRuntimeExports.jsx(g.Text$1,{selectOnFocus:!0,...t})}),l.jsxRuntimeExports.jsx(je,{path:"level",label:"Text Size",padHelpText:!1,children:t=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...t})}),l.jsxRuntimeExports.jsx(je,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>l.jsxRuntimeExports.jsx(zr,{...t})})]}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(je,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>l.jsxRuntimeExports.jsx(g.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:l.jsxRuntimeExports.jsx(g.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:l.jsxRuntimeExports.jsx(g.Qt.AutoFitWidth,{})})})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]})},Tj=()=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label",omit:["maxInlineSize","align"]}),l.jsxRuntimeExports.jsx(At,{path:"color"})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showOuter:!1})]}),J=e=>l.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),cn=e=>l.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ot=e=>l.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),ae=e=>l.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Aj={left:{left:Y.Left,right:Y.Right,top:Y.Top,bottom:Y.Bottom},right:{left:Y.Right,right:Y.Left,top:Y.Bottom,bottom:Y.Top},top:{left:Y.Bottom,right:Y.Top,top:Y.Left,bottom:Y.Right},bottom:{left:Y.Top,right:Y.Bottom,top:Y.Right,bottom:Y.Left}},Lj=(e,t)=>Aj[t][e],$j=(e,t=!1)=>{if(t)return e;switch(e){case Y.Left:return Y.Right;case Y.Right:return Y.Left;case Y.Top:return Y.Bottom;case Y.Bottom:return Y.Top;default:return Y.Top}},Oj=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},se=({children:e,orientation:t})=>{let n;try{n=UE()}catch{return l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{})}const s=f.useRef(null),r=f.useRef(!0);return f.useEffect(()=>{if(s.current==null)return;if(r.current){r.current=!1;return}const o=s.current.closest(".react-flow__node"),i=o==null?void 0:o.getAttribute("data-id");i!=null&&(n==null||n(i))},[t]),l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("span",{ref:s}),e]})},q=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:o,...i})=>{const c=Oj(o,s,t,n);return l.jsxRuntimeExports.jsx(Pn,{position:$j(Lj(e,t),!r),...i,type:"source",onClick:a=>a.stopPropagation(),className:(x.CSS.B("handle"),x.CSS.BE("handle",i.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},ke=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...o})=>l.jsxRuntimeExports.jsx("button",{className:x.CSS(x.CSS.B("symbol-primitive"),x.CSS.B("symbol-primitive-toggle"),s!=null&&x.CSS.loc(s),t&&x.CSS.M("enabled"),n&&x.CSS.M("triggered"),e),color:x.cssString(r),...o}),Re=({className:e,...t})=>l.jsxRuntimeExports.jsx("div",{className:x.CSS(x.CSS.B("symbol-primitive"),e),...t}),Dj=.8,ue=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:o={},scale:i=1,...c})=>{e=x.g.construct(t)==="y"?x._.swap(e):e;const d=x.cssString(r),u=g.use();return r!=null&&(o[x.CSS.var("symbol-color")]=new x.Color(r).rgbString,o[x.CSS.var("symbol-color-contrast")]=new x.Color(r).pickByContrast(u.colors.gray.l0,u.colors.gray.l10).rgbString),l.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:x._.svgViewBox(e),className:x.CSS(x.CSS.loc(t),s),fill:d,stroke:d,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:x._.scale(e,i*Dj).width,...o},children:l.jsxRuntimeExports.jsx("g",{children:n})})},Sa=({className:e,orientation:t,scale:n,color:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,orientation:t,className:x.CSS(x.CSS.B("four-way-valve"),e),children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:87},color:s,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Ea=({color:e,orientation:t="left",scale:n,...s})=>l.jsxRuntimeExports.jsxs(ke,{...s,className:x.CSS(x.CSS.B("three-way-valve")),orientation:t,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),l.jsxRuntimeExports.jsx(J,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),ja=({orientation:e="left",color:t,scale:n,...s})=>l.jsxRuntimeExports.jsxs(ke,{...s,children:[l.jsxRuntimeExports.jsxs(se,{orientation:e,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:l.jsxRuntimeExports.jsx(J,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Ra=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{className:x.CSS(x.CSS.B("solenoid-valve"),s&&x.CSS.M("normally-open"),e),...o,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(J,{className:x.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),l.jsxRuntimeExports.jsx(ae,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),l.jsxRuntimeExports.jsx(cn,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),ba=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("relief-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),wa=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("check-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Ca=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,orientation:n,className:x.CSS(x.CSS.B("angled-valve"),t),children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),l.jsxRuntimeExports.jsx(J,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),va=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)})]})]}),_a=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const o=x.cssString(t);return l.jsxRuntimeExports.jsxs(Re,{...r,className:x.CSS(x.CSS.B("symbol"),e),children:[l.jsxRuntimeExports.jsx(se,{orientation:n,children:l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:5,top:50,id:"1"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),l.jsxRuntimeExports.jsx(J,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:o}),l.jsxRuntimeExports.jsx(J,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ka=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("cap"),e),...r,children:[l.jsxRuntimeExports.jsx(se,{orientation:t,children:l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),l.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:l.jsxRuntimeExports.jsx(J,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Pa=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("manual-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),l.jsxRuntimeExports.jsx(J,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),Na=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("filter"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:l.jsxRuntimeExports.jsx(J,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),zj=e=>typeof e=="number"?{topLeft:x.q.construct(e),topRight:x.q.construct(e),bottomLeft:x.q.construct(e),bottomRight:x.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:x.q.construct(e.topLeft),topRight:x.q.construct(e.topRight),bottomLeft:x.q.construct(e.bottomLeft),bottomRight:x.q.construct(e.bottomRight)}:e,Bj=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Ij={width:40,height:80},Ma={x:50,y:10},Os=({className:e,dimensions:t=Ij,borderRadius:n=Ma,boxBorderRadius:s,color:r,backgroundColor:o,...i})=>{const c=zj(n),a=s==null,d=g.use();return l.jsxRuntimeExports.jsx(Re,{className:x.CSS(e,x.CSS.B("tank")),style:{...t,borderRadius:s??Bj(c),borderColor:x.cssString(r??d.colors.gray.l9),backgroundColor:o==null?void 0:x.cssString(o)},...i,children:l.jsxRuntimeExports.jsxs(se,{children:[l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},Ta=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(e,x.CSS.B("regulator")),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),l.jsxRuntimeExports.jsx(J,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),l.jsxRuntimeExports.jsx(ae,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Aa=({className:e,orientation:t="left",scale:n,color:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("orifice"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),La=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("needle-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:x.cssString(n)}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),$a=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("angled-relief-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),l.jsxRuntimeExports.jsx(J,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Oa=({className:e,color:t,dimensions:n,orientation:s,units:r="psi",unitsLevel:o="small",children:i,inlineSize:c=80,...a})=>{const d=x.cssString(t),u=g.use(),p=t==null?"var(--pluto-gray-l0)":x.cssString(new x.Color(t).pickByContrast(u.colors.gray.l0,u.colors.gray.l9)),m=2.5*((n==null?void 0:n.width)??0)/500;return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("value"),e),...a,style:{borderColor:d,height:n==null?void 0:n.height,width:"100%"},children:[l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:i}),l.jsxRuntimeExports.jsxs(se,{orientation:s,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:-2+m,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:102-m,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),l.jsxRuntimeExports.jsx("div",{className:x.CSS(x.CSS.BE("value","units"),x.CSS.M(o)),style:{background:d},children:l.jsxRuntimeExports.jsx(g.Text,{level:o,color:p,children:r})})]})},Da=({enabled:e=!1,onClick:t,orientation:n="left"})=>l.jsxRuntimeExports.jsxs(Re,{orientation:n,children:[l.jsxRuntimeExports.jsx(g.Switch$1,{value:e,onClick:t,onChange:()=>{}}),l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:0,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),za=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:o,onClickDelay:i})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,children:[l.jsxRuntimeExports.jsx(g.Button,{onClick:e,color:s,size:r,level:o,onClickDelay:i,children:n}),l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:0,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:100,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:50,top:0,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Ba=({className:e,orientation:t="left",text:n="",width:s,color:r,level:o,autoFit:i,align:c="center"})=>{const a=g.use(),d=x.cssString(r??a.colors.gray.l0),u={borderColor:d,textAlign:c};return x.g.construct(t)==="y"?u.height=i?"fit-content":s:u.width=i?"fit-content":s,l.jsxRuntimeExports.jsx(Re,{style:u,orientation:t,className:x.CSS(x.CSS.B("text-box"),x.CSS.loc(t),e),children:l.jsxRuntimeExports.jsx(g.Text,{color:d,level:o,children:n})})},Ia=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:o,color:i,onChange:c,...a})=>{const[d,u]=f.useState(r);return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("setpoint"),t),orientation:e,...a,children:[l.jsxRuntimeExports.jsxs(se,{orientation:e,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:e,left:1,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:e,left:100,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:e,left:50,top:-2,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),l.jsxRuntimeExports.jsx(g.Numeric,{size:"small",value:d,onChange:u,showDragHandle:!1,selectOnFocus:!0,endContent:o,color:i,style:{[x.CSS.var("pack-border-shade")]:x.cssString(i)},borderWidth:2,children:l.jsxRuntimeExports.jsx(g.Button,{variant:"outlined",size:"small",onClick:()=>c(d),color:i,children:"Set"})})]})},Va=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("screw-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Fa=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("vacuum-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Za=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("cavity-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Ha=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("piston-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 23 32, h 16, m 0 -8, v 16",className:x.CSS(x.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),qa=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{...r,className:x.CSS(x.CSS.B("static-mixer"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:98.4848,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(cn,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),l.jsxRuntimeExports.jsx(J,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Ya=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("rotary-mixer"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Ua=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(Re,{...o,orientation:n,className:x.CSS(x.CSS.B("light"),s&&x.CSS.M("enabled"),e),children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"})})]}),Ga=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(e,x.CSS.B("regulator")),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),l.jsxRuntimeExports.jsx(cn,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),l.jsxRuntimeExports.jsx(ae,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Wa=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Ka=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:51,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Xa=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Qa=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),l.jsxRuntimeExports.jsx(ae,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"49",x2:"43",y2:"83",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Ja=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),eu=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",left:50,top:2,id:"4",orientation:n})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),tu=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("compressor"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"35",cy:"25",r:"23"}),l.jsxRuntimeExports.jsx(J,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),l.jsxRuntimeExports.jsx(ae,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),l.jsxRuntimeExports.jsx(ae,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),nu=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:o="p",...i})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const a=x.g.construct(n)==="y";return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("arrow"),x.CSS.loc(n),t),orientation:n,...i,children:[l.jsxRuntimeExports.jsx("div",{className:"wrapper",children:l.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:x.cssString(r)},children:l.jsxRuntimeExports.jsx("div",{className:"bg",children:l.jsxRuntimeExports.jsx(g.Text,{level:o,className:x.CSS.BE("symbol","label"),children:s})})})}),l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:a,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:a,id:"2"})]}),l.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:l.jsxRuntimeExports.jsx("defs",{children:l.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[l.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),l.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),l.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Vj=({aetherKey:e,sink:t})=>{const n=g.useMemoDeepEqualProps({sink:t}),[,,s]=g.use$3({aetherKey:e,type:P.Button.TYPE,schema:P.buttonStateZ,initialState:{trigger:0,sink:t}});return f.useEffect(()=>{s(o=>({...o,...n}))},[n]),{click:f.useCallback(()=>{s(o=>({...o,trigger:o.trigger+1}))},[s])}},Fj=({aetherKey:e,source:t})=>{const n=g.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=g.use$3({aetherKey:e,type:P.Light.TYPE,schema:P.lightStateZ,initialState:{enabled:!1,...n}});return f.useEffect(()=>r(o=>({...o,...n})),[n,r]),{enabled:s}},re=f.forwardRef(({label:e="",onChange:t,level:n="p",children:s,orientation:r="top",style:o,className:i,maxInlineSize:c=150,...a},d)=>l.jsxRuntimeExports.jsxs(X.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...o},size:2/3,direction:r,ref:d,className:x.CSS(x.CSS.B("symbol"),i),align:"center",justify:"center",...a,children:[e.length>0&&l.jsxRuntimeExports.jsx(g.Editable,{className:x.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:c},onChange:f.useCallback(u=>t({label:{label:u,level:n,orientation:r}}),[t,n]),level:n}),s]}));re.displayName="Labeled";const Zj=({aetherKey:e,source:t,sink:n})=>{const s=g.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},o]=g.use$3({aetherKey:e,type:P.Setpoint.TYPE,schema:P.setpointStateZ,initialState:{trigger:0,value:0,...s}});return f.useEffect(()=>{o(c=>({...c,...s}))},[s,o]),{set:f.useCallback(c=>o(a=>({...a,trigger:a.trigger+1,command:c})),[o]),value:r}},ve=({aetherKey:e,source:t,sink:n})=>{const s=g.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:o},i]=g.use$3({aetherKey:e,type:P.Toggle.TYPE,schema:P.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return f.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{toggle:f.useCallback(()=>i(a=>({...a,triggered:!a.triggered})),[i]),triggered:r,enabled:o}},Hj=P.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),su=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:o,level:i="small"})=>{const c=g.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:i,minWidth:o}),[,a,d]=g.use$3({aetherKey:e,type:P.Value.TYPE,schema:P.Value.z,initialState:c});return f.useEffect(()=>d(u=>({...u,...c})),[c]),{width:a.width??a.minWidth}},qj=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Hj,use:su},Symbol.toStringTag,{value:"Module"})),ru=e=>x.g.construct(e)==="x"?x.J.swap(e):e,Yj=e=>x.g.construct(e)==="y"?x.J.swap(e):e,Se=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:s="left",chip:r,children:o,show:i=!0,...c})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:x.J.rotate90(s),align:"center",justify:"center",empty:!0,...c,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:x.g.construct(s),align:"center",className:x.CSS(x.CSS.B("control-state")),size:"small",children:[i&&e&&l.jsxRuntimeExports.jsx(Ol,{size:"small",...r}),i&&t&&l.jsxRuntimeExports.jsx(Bl,{...n})]}),o]}),ou=g.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:s,source:r,sink:o,orientation:i="left",...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:r,sink:o});return l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Se,{...s,orientation:ru(i),children:l.jsxRuntimeExports.jsx(Ea,{enabled:a,triggered:d,onClick:u,orientation:i,...c})})})}),iu=e=>l.jsxRuntimeExports.jsx(Ea,{...e}),lu=g.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:s,source:r,sink:o,orientation:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:t,source:r,sink:o});return l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...e,orientation:i,children:l.jsxRuntimeExports.jsx(ja,{enabled:a,triggered:d,onClick:u,orientation:i,...c})})})}),cu=e=>l.jsxRuntimeExports.jsx(ja,{...e}),au=g.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:s="left",normallyOpen:r,source:o,sink:i,control:c,...a})=>{const{enabled:d,triggered:u,toggle:p}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Se,{...c,orientation:Yj(s),children:l.jsxRuntimeExports.jsx(Ra,{enabled:d,triggered:u,onClick:p,orientation:s,normallyOpen:r,...a})})})}),uu=e=>l.jsxRuntimeExports.jsx(Ra,{...e}),du=g.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...t,orientation:r,children:l.jsxRuntimeExports.jsx(Sa,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),xu=e=>l.jsxRuntimeExports.jsx(Sa,{...e}),fu=g.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:s,orientation:r="left",source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:ru(r),children:l.jsxRuntimeExports.jsx(Ca,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),pu=e=>l.jsxRuntimeExports.jsx(Ca,{...e}),mu=g.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(va,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),hu=e=>l.jsxRuntimeExports.jsx(va,{...e}),gu=({backgroundColor:e,label:t,onChange:n,orientation:s,color:r,dimensions:o,borderRadius:i})=>l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Os,{onResize:c=>n({dimensions:c}),orientation:s,color:r,dimensions:o,borderRadius:i,backgroundColor:e})}),yu=e=>l.jsxRuntimeExports.jsx(Os,{...e,dimensions:{width:25,height:50}}),Su=({backgroundColor:e,borderRadius:t,label:n,onChange:s,orientation:r,color:o,dimensions:i})=>l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Os,{onResize:c=>s({dimensions:c}),orientation:r,color:o,dimensions:i,boxBorderRadius:t,backgroundColor:e})}),Eu=e=>l.jsxRuntimeExports.jsx(Os,{...e,dimensions:{width:25,height:50},borderRadius:0}),ju=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(ba,{...s})}),Ru=e=>l.jsxRuntimeExports.jsx(ba,{...e}),bu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Ta,{...s})}),wu=e=>l.jsxRuntimeExports.jsx(Ta,{...e}),Cu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Ga,{...s})}),vu=e=>l.jsxRuntimeExports.jsx(Ga,{...e}),_u=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(_a,{...s})}),ku=e=>l.jsxRuntimeExports.jsx(_a,{...e}),Pu=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(ka,{...s})}),Nu=e=>l.jsxRuntimeExports.jsx(ka,{...e}),Mu=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(Pa,{...s})}),Tu=e=>l.jsxRuntimeExports.jsx(Pa,{...e}),Au=g.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:s,units:r,source:o,sink:i,color:c,onChange:a})=>{const{value:d,set:u}=Zj({aetherKey:t,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...e,onChange:a,children:l.jsxRuntimeExports.jsx(Se,{...s,className:x.CSS.B("symbol"),orientation:n,children:l.jsxRuntimeExports.jsx(Ia,{value:d,onChange:u,units:r,color:c,orientation:n})})})}),Lu=e=>l.jsxRuntimeExports.jsx(Ia,{value:12,onChange:()=>{},units:"mV",...e,children:l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:"10.0"})}),$u=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(Na,{...s})}),Ou=e=>l.jsxRuntimeExports.jsx(Na,{...e}),Du=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(La,{...s})}),zu=e=>l.jsxRuntimeExports.jsx(La,{...e}),Bu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(wa,{...s})}),Iu=e=>l.jsxRuntimeExports.jsx(wa,{...e}),Vu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Aa,{...s})}),Fu=e=>l.jsxRuntimeExports.jsx(Aa,{...e}),Zu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx($a,{...s})}),Hu=e=>l.jsxRuntimeExports.jsx($a,{...e}),qu=g.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:s,className:r,textColor:o,color:i,telem:c,units:a,onChange:d,tooltip:u,inlineSize:p})=>{const m=g.useTypography(n),[h,E]=f.useState({outerBox:x.Eo.ZERO,labelDims:x._.ZERO}),y=rt(),w=(m.lineHeight+.5)*m.baseSize+2,j=g.useResize(f.useCallback(R=>{const b=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);if(b==null)return;const _=x._.scale(x.Eo.dims(x.Eo.construct(b)),1/(Uj*y.getZoom()));E({outerBox:R,labelDims:_})},[]),{}),C=Gj({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:w,position:s,...h}),{width:v}=su({aetherKey:e,color:o,level:n,box:C,telem:c,minWidth:p});return l.jsxRuntimeExports.jsxs(g.Dialog$1,{location:{y:"top"},hide:u==null||u.length===0,children:[l.jsxRuntimeExports.jsx(X.Space,{direction:"y",children:u==null?void 0:u.map((R,b)=>l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:R},b))}),l.jsxRuntimeExports.jsx(re,{className:x.CSS(r,x.CSS.B("value-labeled")),ref:j,onChange:d,...t,children:l.jsxRuntimeExports.jsx(Oa,{color:i,dimensions:{height:w,width:v},inlineSize:p,units:a,unitsLevel:Z.downLevel(n)})})]})}),Uj=.9,Gj=({labelOrientation:e,outerBox:t,labelDims:n,valueBoxHeight:s,position:r,hasLabel:o})=>(x.g.construct(e)==="x"&&(r=x.q.translate(r,"y",Math.max((n.height-s)/2-1,1))),o&&e==="left"?r=x.q.translate(r,{x:n.width+6,y:0}):o&&e==="top"&&(r=x.q.translate(r,"y",n.height+6)),x.Eo.construct(r.x,r.y,x.Eo.width(t),s)),Yu=({color:e})=>l.jsxRuntimeExports.jsx(Oa,{color:e,dimensions:{width:60,height:25},units:"psi",children:l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:"50.00"})}),Uu=g.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Da,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),Gu=e=>l.jsxRuntimeExports.jsx(Da,{...e}),Wu=g.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:s,control:r,...o})=>{const{click:i}=Vj({aetherKey:e,sink:s});return l.jsxRuntimeExports.jsx(Se,{...r,className:x.CSS.B("symbol"),orientation:n,children:l.jsxRuntimeExports.jsx(za,{...t,onClick:i,...o})})}),Ku=({label:e,...t})=>l.jsxRuntimeExports.jsx(za,{label:"Button",...t}),Xu=g.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Va,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),Qu=e=>l.jsxRuntimeExports.jsx(Va,{...e}),Ju=g.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Fa,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),ed=e=>l.jsxRuntimeExports.jsx(Fa,{...e}),td=g.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Za,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),nd=e=>l.jsxRuntimeExports.jsx(Za,{...e}),sd=g.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Ha,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),rd=e=>l.jsxRuntimeExports.jsx(Ha,{...e}),od=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(qa,{...s})}),id=e=>l.jsxRuntimeExports.jsx(qa,{...e}),ld=g.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Ya,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),cd=e=>l.jsxRuntimeExports.jsx(Ya,{...e}),ad=g.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:s,...r})=>{const{enabled:o}=Fj({aetherKey:e,source:n});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Ua,{enabled:o,...r})})}),ud=e=>l.jsxRuntimeExports.jsx(Ua,{...e}),dd=g.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Wa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),xd=e=>l.jsxRuntimeExports.jsx(Wa,{...e}),fd=g.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Ka,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),pd=e=>l.jsxRuntimeExports.jsx(Ka,{...e}),md=g.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Xa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),hd=e=>l.jsxRuntimeExports.jsx(Xa,{...e}),gd=g.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Qa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),yd=e=>l.jsxRuntimeExports.jsx(Qa,{...e}),Sd=g.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Ja,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),Ed=e=>l.jsxRuntimeExports.jsx(Ja,{...e}),jd=g.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(eu,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),Rd=e=>l.jsxRuntimeExports.jsx(eu,{...e}),bd=g.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(tu,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),wd=e=>l.jsxRuntimeExports.jsx(tu,{...e}),Cd=e=>l.jsxRuntimeExports.jsx(Ba,{...e}),vd=({level:e="p",width:t=100,...n})=>l.jsxRuntimeExports.jsx(Ba,{className:x.CSS.B("symbol"),level:e,width:t,...n}),_d=({label:{label:e,level:t},aetherKey:n,position:s,...r})=>l.jsxRuntimeExports.jsx(nu,{label:e,level:t,...r,className:x.CSS.B("symbol")}),kd=({label:e,...t})=>l.jsxRuntimeExports.jsx(nu,{label:"Off Page",...t,orientation:"right"}),oe=4,Pd=2,Wj=["agitator","angledReliefValve","angledValve","offPageReference","box","burstDisc","button","cap","cavityPump","checkValve","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","light","manualValve","needleValve","orifice","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve"],Kj=ne.z.enum(Wj),Ee={orientation:"left",scale:1},Xj={...Ee,source:P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:0}),rollingAverage:P.rollingAverage({windowSize:1}),stringifier:P.stringifyNumber({precision:2})},outlet:"stringifier"})},Qj={...Ee,source:P.sourcePipeline("number",{connections:[],segments:{valueStream:P.streamChannelValue({channel:0})},outlet:"valueStream"})},Jj={...Ee,sink:P.sinkPipeline("number",{connections:[],segments:{setter:P.setChannelValue({channel:0})},inlet:"setter"})},Nd={...Ee,source:P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:0}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Md={...Ee,control:{show:!0},sink:P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:0}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},_e={...Nd,...Md},ee=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),e0={width:125,height:200},yo={dimensions:e0},t0=3,n0={name:"Three Way Valve",key:"threeWayValve",Form:Ce,Symbol:ou,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Three Way Valve"),..._e}),Preview:iu,zIndex:oe},s0={name:"Valve",key:"valve",Form:Ce,Symbol:lu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Valve"),..._e}),Preview:cu,zIndex:oe},r0={name:"Solenoid Valve",key:"solenoidValve",Form:Ce,Symbol:au,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:uu,zIndex:oe},o0={name:"Four Way Valve",key:"fourWayValve",Form:Ce,Symbol:du,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Four Way Valve"),..._e}),Preview:xu,zIndex:oe},i0={name:"Angled Valve",key:"angledValve",Form:Ce,Symbol:fu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Angled Valve"),..._e}),Preview:pu,zIndex:oe},l0={name:"Pump",key:"pump",Form:Ce,Symbol:mu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Pump"),..._e}),Preview:hu,zIndex:oe},c0={name:"Screw Pump",key:"screwPump",Form:Ce,Symbol:Xu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Screw Pump"),..._e}),Preview:Qu,zIndex:oe},a0={name:"Tank",key:"tank",Form:ga,Symbol:gu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...ee("Tank"),borderRadius:Ma,...yo,...Ee}),Preview:yu,zIndex:Pd},u0={name:"Box",key:"box",Form:()=>ga({includeBorderRadius:!0}),Symbol:Su,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...ee("Box"),borderRadius:t0,...yo,...Ee}),Preview:Eu,zIndex:Pd},d0={name:"Relief Valve",key:"reliefValve",Form:Te,Symbol:ju,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Relief Valve"),...Ee}),Preview:Ru,zIndex:oe},x0={name:"Regulator",key:"regulator",Form:Te,Symbol:bu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Regulator"),...Ee}),Preview:wu,zIndex:oe},f0={name:"Electric Regulator",key:"electricRegulator",Form:Te,Symbol:Cu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Electric Regulator"),...Ee}),Preview:vu,zIndex:oe},p0={name:"Burst Disc",key:"burstDisc",Form:Te,Symbol:_u,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Burst Disc"),...Ee}),Preview:ku,zIndex:oe},m0={name:"Cap",key:"cap",Form:Te,Symbol:Pu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cap"),...Ee}),Preview:Nu,zIndex:oe},h0={name:"Manual Valve",key:"manualValve",Form:Te,Symbol:Mu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Manual Valve"),...Ee}),Preview:Tu,zIndex:oe},g0={name:"Filter",key:"filter",Form:Te,Symbol:$u,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Filter"),...Ee}),Preview:Ou,zIndex:oe},y0={name:"Needle Valve",key:"needleValve",Form:Te,Symbol:Du,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Needle Valve"),...Ee}),Preview:zu,zIndex:oe},S0={name:"Check Valve",key:"checkValve",Form:Te,Symbol:Bu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Check Valve"),...Ee}),Preview:Iu,zIndex:oe},E0={name:"Orifice",key:"orifice",Form:Te,Symbol:Vu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Orifice"),...Ee}),Preview:Fu,zIndex:oe},j0={name:"Angled Relief Valve",key:"angledReliefValve",Form:Te,Symbol:Zu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Angled Relief Valve"),...Ee}),Preview:Hu,zIndex:oe},R0={name:"Value",key:"value",Form:wj,Symbol:qu,Preview:Yu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...ee("Value"),...Ee,telem:Xj.source}),zIndex:oe},b0={name:"Button",key:"button",Symbol:Wu,Form:kj,Preview:Ku,defaultProps:e=>({color:e.colors.primary.z.rgba255,...ee("Button"),...Md,onClickDelay:0,scale:null}),zIndex:oe},w0={name:"Switch",key:"switch",Symbol:Uu,Preview:Gu,Form:Ce,defaultProps:()=>({...ee("Switch"),..._e,scale:null}),zIndex:oe},C0={name:"Vacuum Pump",key:"vacuumPump",Symbol:Ju,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Vacuum Pump"),..._e}),Preview:ed,zIndex:oe},v0={name:"Cavity Pump",key:"cavityPump",Symbol:td,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cavity Pump"),..._e}),Preview:nd,zIndex:oe},_0={name:"Piston Pump",key:"pistonPump",Symbol:sd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Piston Pump"),..._e}),Preview:rd,zIndex:oe},k0={name:"Static Mixer",key:"staticMixer",Symbol:od,Form:Te,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Static Mixer"),...Ee}),Preview:id,zIndex:oe},P0={name:"Rotary Mixer",key:"rotaryMixer",Symbol:ld,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Rotary Mixer"),..._e}),Preview:cd,zIndex:oe},N0={name:"Light",key:"light",Symbol:ad,Form:vj,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Light"),...Nd}),Preview:ud,zIndex:oe},M0={name:"Setpoint",key:"setpoint",Symbol:Au,Form:Nj,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...ee("Setpoint"),...Qj,...Jj}),Preview:Lu,zIndex:oe},T0={name:"Agitator",key:"agitator",Symbol:dd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Agitator"),..._e}),Preview:xd,zIndex:oe},A0={name:"Propeller Agitator",key:"propellerAgitator",Symbol:fd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Propeller Agitator"),..._e}),Preview:pd,zIndex:oe},L0={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:md,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Flat Blade Agitator"),..._e}),Preview:hd,zIndex:oe},$0={name:"Paddle Agitator",key:"paddleAgitator",Symbol:gd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Paddle Agitator"),..._e}),Preview:yd,zIndex:oe},O0={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Sd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cross Beam Agitator"),..._e}),Preview:Ed,zIndex:oe},D0={name:"Helical Agitator",key:"helicalAgitator",Symbol:jd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Helical Agitator"),..._e}),Preview:Rd,zIndex:oe},z0={name:"Compressor",key:"compressor",Symbol:bd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Compressor"),..._e}),Preview:wd,zIndex:oe},B0={name:"Text Box",key:"textBox",Symbol:Cd,Form:Mj,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...ee("Text Box"),...Ee,...yo,level:"p",text:"Text Box",width:75}),Preview:vd,zIndex:oe},I0={name:"Off Page Reference",key:"offPageReference",Form:Tj,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...ee("Off Page Reference")}),Preview:kd,zIndex:oe},V0={value:R0,button:b0,tank:a0,switch:w0,offPageReference:I0,light:N0,setpoint:M0,box:u0,textBox:B0,valve:s0,solenoidValve:r0,threeWayValve:n0,fourWayValve:o0,angledValve:i0,manualValve:h0,needleValve:y0,reliefValve:d0,angledReliefValve:j0,checkValve:S0,regulator:x0,electricRegulator:f0,pump:l0,pistonPump:_0,screwPump:c0,cavityPump:v0,vacuumPump:C0,staticMixer:k0,rotaryMixer:P0,burstDisc:p0,cap:m0,filter:g0,orifice:E0,agitator:T0,propellerAgitator:A0,flatBladeAgitator:L0,paddleAgitator:$0,crossBeamAgitator:O0,helicalAgitator:D0,compressor:z0},F0=Object.freeze(Object.defineProperty({__proto__:null,Agitator:dd,AgitatorPreview:xd,AngledReliefValve:Zu,AngledReliefValvePreview:Hu,AngledValve:fu,AngledValvePreview:pu,Box:Su,BoxPreview:Eu,BurstDisc:_u,BurstDiscPreview:ku,Button:Wu,ButtonPreview:Ku,Cap:Pu,CapPreview:Nu,CavityPump:td,CavityPumpPreview:nd,CheckValve:Bu,CheckValvePreview:Iu,Compressor:bd,CompressorPreview:wd,CrossBeamAgitator:Sd,CrossBeamAgitatorPreview:Ed,ElectricRegulator:Cu,ElectricRegulatorPreview:vu,Filter:$u,FilterPreview:Ou,FlatBladeAgitator:md,FlatBladeAgitatorPreview:hd,FourWayValve:du,FourWayValvePreview:xu,HelicalAgitator:jd,HelicalAgitatorPreview:Rd,Light:ad,LightPreview:ud,ManualValve:Mu,ManualValvePreview:Tu,NeedleValve:Du,NeedleValvePreview:zu,OffPageReference:_d,OffPageReferencePreview:kd,Orifice:Vu,OrificePreview:Fu,PaddleAgitator:gd,PaddleAgitatorPreview:yd,PistonPump:sd,PistonPumpPreview:rd,PropellerAgitator:fd,PropellerAgitatorPreview:pd,Pump:mu,PumpPreview:hu,Regulator:bu,RegulatorPreview:wu,ReliefValve:ju,ReliefValvePreview:Ru,RotaryMixer:ld,RotaryMixerPreview:cd,SYMBOLS:V0,ScrewPump:Xu,ScrewPumpPreview:Qu,Setpoint:Au,SetpointPreview:Lu,SolenoidValve:au,SolenoidValvePreview:uu,StaticMixer:od,StaticMixerPreview:id,Switch:Uu,SwitchPreview:Gu,Tank:gu,TankPreview:yu,TextBox:Cd,TextBoxPreview:vd,ThreeWayValve:ou,ThreeWayValvePreview:iu,VacuumPump:Ju,VacuumPumpPreview:ed,Value:qu,ValuePreview:Yu,Valve:lu,ValvePreview:cu,typeZ:Kj},Symbol.toStringTag,{value:"Module"}));exports.Aether=g.main;exports.Dialog=g.use$4;exports.Divider=g.Divider$1;exports.Dropdown=g.Dropdown;exports.Haul=g.Haul;exports.Worker=g.Context$1;exports.compareArrayDeps=g.compareArrayDeps;exports.componentRenderProp=g.componentRenderProp;exports.isRenderProp=g.isRenderProp;exports.useAsyncEffect=g.useAsyncEffect;exports.useClickOutside=g.useClickOutside;exports.useCombinedRefs=g.useCombinedRefs;exports.useCombinedStateAndRef=g.useCombinedStateAndRef;exports.useDebouncedCallback=g.useDebouncedCallback;exports.useEffectCompare=g.useEffectCompare;exports.useMemoCompare=g.useMemoCompare;exports.useMemoDeepEqualProps=g.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=g.useMemoPrimitiveArray;exports.usePrevious=g.usePrevious;exports.useResize=g.useResize;exports.useStateRef=g.useStateRef;exports.useSyncedRef=g.useSyncedRef;exports.useTransforms=g.useTransforms;exports.CSS=x.CSS;exports.newBEM=x.newBEM;exports.Header=qn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Ct;exports.Rate=Z.P;exports.Series=Z.V;exports.TimeRange=Z.E;exports.TimeSpan=Z.y;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=X.Generic;exports.Align=fx.external;exports.Icon=be.Icon;exports.Tabs=be.external;exports.Button=px.external;exports.Caret=_i.Animated$1;exports.telem=P.external;exports.Color=_r.external;exports.Text=Me.external;exports.Triggers=ki.external;exports.List=nn.external;exports.createFilterTransform=nn.createFilterTransform;exports.fuseFilter=nn.fuseFilter;exports.proxyMemo=nn.proxyMemo;exports.createHexOpacityVariants=Pi.createHexOpacityVariants;exports.unitProperty=Pi.unitProperty;exports.Input=He.external;exports.Menu=hx.external;exports.Theming=gx.external;exports.Tree=yx.external;exports.Video=Sx.Video;exports.Accordion=zx;exports.Breadcrumb=Vx;exports.Canvas=of;exports.Channel=ep;exports.Control=dm;exports.Device=yp;exports.Diagram=gj;exports.Eraser=Yp;exports.Form=mp;exports.Label=wp;exports.Legend=df;exports.Line=ff;exports.LinePlot=If;exports.Log=Sj;exports.Measure=Hf;exports.Modal=vp;exports.Mosaic=Zp;exports.Nav=Wp;exports.Note=Xp;exports.OS=nm;exports.Observe=fp;exports.Override=rm;exports.Pluto=mm;exports.Portal=$p;exports.Progress=gm;exports.Range=Ff;exports.Ranger=wm;exports.Resize=Nx;exports.Rule=qf;exports.Schematic=F0;exports.Select=kf;exports.Status=Rx;exports.Steps=vm;exports.Synnax=Hx;exports.Tag=vf;exports.Telem=lm;exports.Tooltip=bx;exports.Value=qj;exports.Viewport=Bf;exports.axis=ef;exports.control=tf;
|