@synnaxlabs/pluto 0.19.3 → 0.19.4

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/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var So=Object.defineProperty;var Ro=(e,t,s)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ue=(e,t,s)=>(Ro(e,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-evvPGacs.cjs"),d=require("react"),u=require("./Toggle-gI8p0RTp.cjs"),l=require("./css-GrX88dMz.cjs"),Ve=require("./external-MumF6LLV.cjs"),_=require("./Center-lo-2hAUF.cjs"),G=require("./aggregator-yaOS5ssk.cjs");require("react-hook-form");const h=require("./toggle-Q_MUr7QV.cjs"),ft=require("./external-jrqozW8h.cjs"),jt=require("./external-wyVM10Ar.cjs"),Q=require("./external-HTp9xtZn.cjs"),bo=require("react-dom"),be=require("./external-aW9whcmL.cjs"),yo=require("./external-IHwNLvQR.cjs"),Co=require("./external-CcE-7tWF.cjs"),es=require("./color-6phEmmYG.cjs"),de=require("./external-SzIapfu1.cjs"),vo=require("./external-9J76ZORL.cjs"),W=require("./external-STz8oBh5.cjs"),wo=require("./external-Ftshae2F.cjs"),$o=require("./external-gGr-IQyL.cjs"),ko=require("./Video-gFSP_PM3.cjs"),Po=require("zod"),Lo=({variant:e,...t})=>n.jsxRuntimeExports.jsx(u.u0.Circle,{color:u.variantColors[e],...t}),To=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:u.Aggregator,Circle:Lo,Text:u.Text$2,VARIANTS:G.VARIANTS,specZ:G.specZ$1,useAggregator:u.useAggregator,useContext:u.useContext$2,useNotifications:u.useNotifications,variantZ:G.variantZ},Symbol.toStringTag,{value:"Module"})),Mo=Object.freeze(Object.defineProperty({__proto__:null,Config:u.Config,Context:u.Context,Dialog:u.Dialog$1,chooseLocation:u.chooseLocation,formatTip:u.formatTip,useConfig:u.useConfig,wrap:u.wrap},Symbol.toStringTag,{value:"Module"})),Fe=e=>e.preventDefault(),Ke=d.forwardRef(({location:e,style:t,size:s,className:o,children:r,onDragStart:i,sizeUnits:a="px",showHandle:c=!0,...x},m)=>{const p=l.location.construct(e),f=l.location.direction(p),j=l.direction$1.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(p),l.CSS.dir(f),o),style:{[j]:`${s}${a}`,...t},ref:m,...x,children:[r,c&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.location.swap(p))),onDragStart:i,onDrag:Fe,onDragEnd:Fe})]})});Ke.displayName="Resize.Core";const ht=({onResize:e,count:t,initialSizes:s=[],minSize:o=100,direction:r="x"})=>{const i=d.useRef(null),[a,c]=d.useState({sizeDistribution:No(s,t),root:null}),x=d.useCallback((f,j,g)=>{if(i.current==null)return;const E=l.box$1.dim(l.box$1.construct(i.current),r);c(y=>ot(y,E,f,o,j,g))},[o,c,r]);d.useEffect(()=>e==null?void 0:e(a.sizeDistribution),[a.sizeDistribution,e]);const m=d.useCallback((f,j)=>{f.preventDefault();const g=r==="x"?"clientX":"clientY",E=b=>x(j,b[g]),y=()=>{c(b=>({...b,root:null})),document.removeEventListener("mousemove",E)};c(b=>({...b,root:f[g]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",y,{once:!0})},[c,r,ot]);return{setSize:d.useCallback((f,j)=>x(f,void 0,j),[ot]),props:{direction:r,sizeDistribution:a.sizeDistribution,onDragHandle:m,ref:i}}},Je=d.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:o,className:r,...i},a)=>{const c=l.direction$1.construct(e),x=d.Children.toArray(t);return n.jsxRuntimeExports.jsx(_.Space,{...i,ref:a,direction:c,className:l.CSS(l.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:x.map((m,p)=>n.jsxRuntimeExports.jsx(Ke,{onDragStart:f=>o(f,p),location:l.direction$1.location(c),size:s[p]*100,sizeUnits:"%",showHandle:p!==x.length-1,children:m},p))})});Je.displayName="Resize.Multiple";const No=(e,t)=>{const s=e.reduce((r,i)=>r+i,0),o=t-e.length;if(o<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(o).fill(r/o)]}return e.map(()=>1/t)},ot=(e,t,s,o,r,i)=>{const a=ts(e,t,s,r,i),[c,x]=Bo(e.sizeDistribution,s,a,o/t),m=x?r??null:e.root;return{...e,sizeDistribution:c,root:m}},ts=(e,t,s,o,r)=>{let i;if(r!=null)r>1&&(r=r/t),i=r-e.sizeDistribution[s];else if(o!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(o-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Bo=(e,t,s,o)=>{let r=t;for(;r>0&&e[r]+s<=o;)r--;const i=e[r]+s,a=_o(r,e,o,s),c=e[a]-s;return i<o||c<o?[e,!1]:[e.map((x,m)=>m===r?i:m===a?c:x),!0]},_o=(e,t,s,o)=>(e===t.length-1?Oo:Do)(e,t,s,o),Do=(e,t,s,o)=>{let r=e+1;for(;r<t.length-1&&t[r]-o<=s;)r++;return r},Oo=(e,t,s,o)=>{let r=e-1;for(;r>0&&t[r]-o<=s;)r--;return r},Qe=({onMove:e,onStart:t,onEnd:s})=>d.useCallback(o=>{o.preventDefault();const r=l.xy.construct(o),i=u.mouseKey(o.button);t==null||t(r,i,o);const a=x=>{if(x.buttons===0)return c(x);const m=l.xy.construct(x);e==null||e(l.box$1.construct(r,m),i,x)};window.addEventListener("mousemove",a);const c=x=>{window.removeEventListener("mousemove",a);const m=l.xy.construct(x);s==null||s(l.box$1.construct(r,m),i,x)};window.addEventListener("mouseup",c,{once:!0})},[e,t,s]),rt=2,ss=({onCollapse:e,onResize:t,location:s="left",minSize:o=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:a=1/0,className:c,...x})=>{const[m,p]=d.useState(l.clamp(i,o,r)),f=d.useRef(null),j=l.location.construct(s),g=d.useCallback(R=>{if(f.current===null)return 0;const C=l.box$1.dim(R,l.location.direction(j),!0)*(1-2*Number(["bottom","right"].includes(j))),w=f.current+C,$=l.clamp(w,o,r);return($-w)/o>a?rt:$},[j,o,r,a]),E=d.useRef(null),y=d.useCallback(R=>{const C=g(R);p(C),E.current!=null&&(t==null||t(C,l.box$1.construct(E.current)))},[t,g]),b=d.useCallback(()=>p(R=>(f.current=R,R)),[p]),S=d.useCallback(R=>g(R)===rt&&(e==null?void 0:e()),[e,g]);d.useEffect(()=>p(R=>{const C=l.clamp(R,o,r);return f.current=C,C}),[o,r]);const v=Qe({onMove:y,onStart:b,onEnd:S});return n.jsxRuntimeExports.jsx(Ke,{ref:E,location:j,size:m,onDragStart:v,className:l.clsx(c,l.CSS.expanded(m!==rt)),...x})},zo=Object.freeze(Object.defineProperty({__proto__:null,Core:Ke,Multiple:Je,Single:ss,calculateDiffPercentage:ts,useMultiple:ht},Symbol.toStringTag,{value:"Module"})),Ae="y",Dt=28,Vo=32,Ao=40,Io=.5,Zo=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:o,ref:r,...i}}=ht({direction:Ae,count:e.length,minSize:Dt}),a=c=>{if(r.current==null)return;const x=l.box$1.dim(l.box$1.construct(r.current),Ae);o[c]<Ao/x?s(c,e[c].initialSize??Io):s(c,Dt+1)};return n.jsxRuntimeExports.jsx(Je,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:o,ref:r,...t,...i,children:e.map((c,x)=>d.createElement(Go,{...c,key:c.key,index:x,direction:Ae,onExpand:a,parent:r,size:o[x]}))})},Fo=n.jsxRuntimeExports.jsx(u.u0.Caret.Down,{"aria-label":"contract"}),Ho=n.jsxRuntimeExports.jsx(u.u0.Caret.Right,{"aria-label":"expand"}),Go=({index:e,name:t,content:s,actions:o,size:r,parent:i,onExpand:a})=>{let c=!0;if(i.current!=null){const m=l.box$1.dim(l.box$1.construct(i.current),Ae);c=r*m>Vo}const x=c?Fo:Ho;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Ve.Header,{level:"p",className:l.CSS.expanded(c),empty:!0,children:[n.jsxRuntimeExports.jsx(Ve.ButtonTitle,{startIcon:x,onClick:()=>a(e),children:t}),o!=null&&n.jsxRuntimeExports.jsx(Ve.Actions,{children:o})]}),s]})},Yo=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Zo},Symbol.toStringTag,{value:"Module"})),te="channel",Ot=(e,t)=>{if(t.current==null)return{display:"none"};const s={},o=l.box$1.construct(t.current.parentElement),r=l.box$1.construct(t.current);return e.x>.8?s.right=`${(1-e.x)*l.box$1.width(o)-l.box$1.width(r)}px`:e.x<.2?s.left=`${e.x*l.box$1.width(o)}px`:s.left=`${e.x*100}%`,e.y>.8?s.bottom=`${(1-e.y)*l.box$1.height(o)-l.box$1.height(r)}px`:e.y<.2?s.top=`${e.y*l.box$1.height(o)}px`:s.top=`${e.y*100}%`,s},ns=d.memo(({className:e,value:t,onChange:s,style:o,draggable:r=!0,...i})=>{const[a,c]=G.usePurePassthrough({value:t,onChange:s,initial:l.xy.construct(.1,.01)}),x=d.useRef(a),m=u.useSyncedRef(!r),p=d.useRef(null),[f,j]=d.useState({});a!==null&&(o={...o,...f});const g=d.useCallback(b=>{p.current=b,j(Ot(l.xy.construct(a),p))},[]),E=d.useCallback(b=>{var $;if((($=p.current)==null?void 0:$.parentElement)==null)return x.current;const S=l.box$1.construct(p.current.parentElement),v=l.box$1.reRoot(l.box$1.DECIMAL,l.location.TOP_LEFT),R=l.scale.XY.scale(S).scale(v),C=R.box(l.box$1.construct(p.current));return l.scale.XY.clamp(l.box$1.construct(l.box$1.topLeft(v),{width:l.box$1.width(v)-l.box$1.width(C),height:l.box$1.height(v)-l.box$1.height(C)})).pos(l.xy.translate(l.xy.construct(x.current),l.box$1.signedDims(R.box(b))))},[]),y=Qe({onMove:d.useCallback(b=>{if(m.current)return;const S=E(b);j(Ot(l.xy.construct(S),p))},[c]),onEnd:d.useCallback(b=>{m.current||(x.current=E(b))},[])});return n.jsxRuntimeExports.jsx(_.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:o,onDragStart:y,draggable:r,ref:g,...i,onDrag:Fe,onDragEnd:Fe,empty:!0})});ns.displayName="Legend.Container";const os=({data:e=[],onEntryChange:t,position:s,onPositionChange:o,...r})=>{const[i,a]=d.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(ns,{...r,draggable:!i,value:s,onChange:o,children:e.sort((c,x)=>c.label.localeCompare(x.label)).map(({key:c,color:x,label:m})=>n.jsxRuntimeExports.jsxs(_.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(ft.Swatch,{value:x,onChange:p=>t==null?void 0:t({key:c,color:p,label:m}),onVisibleChange:a,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(u.MaybeEditable,{level:"small",value:m,onChange:p=>t==null?void 0:t({key:c,color:x,label:p}),noWrap:!0})]},c))})},qo={region:l.box$1.ZERO,dpr:1,os:l.external$1.getOS()},Uo={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Wo=u.wrap$1(h.Canvas.TYPE,({children:e,resizeDebounce:t=100,className:s,aetherKey:o,...r})=>{const[{path:i},{bootstrapped:a},c]=u.use$3({aetherKey:o,type:h.Canvas.TYPE,schema:h.canvasStateZ,initialState:qo}),x=d.useRef({...Uo}),m=d.useCallback(j=>{x.current.bootstrapped&&c(()=>({bootstrapped:!0,region:j,dpr:window.devicePixelRatio,os:l.external$1.getOS({default:"Windows"})}))},[c]),p=u.useResize(m,{debounce:t}),f=d.useCallback(j=>{if(p(j),j==null)return;j.className.includes("gl")?x.current.gl=j:j.className.includes("upper2d")?x.current.upper2d=j:x.current.lower2d=j;const{gl:g,lower2d:E,upper2d:y,bootstrapped:b}=x.current;if(g==null||E==null||y==null||b)return;x.current.bootstrapped=!0;const S=g.transferControlToOffscreen(),v=y.transferControlToOffscreen(),R=E.transferControlToOffscreen();c({glCanvas:S,upper2dCanvas:v,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:l.box$1.construct(g),dpr:window.devicePixelRatio,os:l.external$1.getOS({default:"Windows"})},[S,v,R])},[c]);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","lower2d"),s),...r}),n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","gl"),s),...r}),n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","upper2d"),s),...r}),n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:a&&e})]})}),gt=e=>u.useResize(d.useCallback((t,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");if(o==null)return;const r=l.box$1.construct(o);t=l.scale.XY.translate(l.xy.scale(l.box$1.topLeft(r),-1)).box(t),e(t,s)},[e])),Xo=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Wo,useRegion:gt},Symbol.toStringTag,{value:"Module"})),rs=d.createContext(null),pe=e=>{const t=d.useContext(rs);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},ls=e=>{const t=pe("Viewport"),{addViewportHandler:s}=t;d.useEffect(()=>s(e),[s,e])},Et=(e,t)=>{const{setAxis:s,removeAxis:o}=pe(t),{key:r}=e;return u.useEffectCompare(()=>{l.location.outer.parse(e.loc),s(e)},([c],[x])=>l.external.equal(c,x),[e]),d.useEffect(()=>()=>o(r),[]),{gridArea:l.direction$1.swap(l.location.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},is=u.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverscan:o,children:r,hold:i,...a})=>{const[c,x,m]=u.useCombinedStateAndRef([]),p=u.useMemoDeepEqualProps({clearOverscan:o,hold:i}),[{path:f},{grid:j},g]=u.use$3({aetherKey:e,type:h.LinePlot.TYPE,schema:h.linePlotStateZ,initialState:{container:l.box$1.ZERO,viewport:l.box$1.DECIMAL,grid:{},...p}});d.useEffect(()=>g(L=>({...L,...p})),[p]);const E=d.useRef(new Map),y=d.useCallback(L=>(E.current.set(L,null),()=>E.current.delete(L)),[E]),b=d.useCallback(L=>{const{mode:B,box:A,stage:T}=L;(B==="pan"&&T!=="start"||B==="zoom"||B==="zoomReset"&&T==="start")&&g(N=>({...N,viewport:A})),E.current.forEach((N,O)=>O(L))},[g]),S=d.useCallback(L=>g(B=>({...B,container:L})),[g]),v=gt(S),R=d.useCallback(L=>g(B=>({...B,grid:{...B.grid,[L.key]:L}})),[g]),C=d.useCallback(L=>g(B=>{const{[L]:A,...T}=B.grid;return{...B,grid:T}}),[g]),w=d.useCallback(L=>{x(B=>[...B.filter(({key:A})=>A!==L.key),L])},[x,b]),$=d.useCallback(L=>x(B=>B.filter(({key:A})=>A!==L)),[w]),P=d.useMemo(()=>Ko(j),[j]),z=d.useMemo(()=>({lines:c,setAxis:R,removeAxis:C,setLine:w,removeLine:$,setViewport:b,addViewportHandler:y}),[c,R,C,w,$,b,y]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...P},ref:v,...a,children:n.jsxRuntimeExports.jsx(rs.Provider,{value:z,children:n.jsxRuntimeExports.jsx(u.Composite,{path:f,children:r})})})}),Ko=e=>{const t=l.CSS.newGridBuilder();return h.filterGridPositions("top",e).forEach(({key:s,size:o})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,o)),t.addRow("plot-start","plot-end","minmax(0, 1fr)"),h.filterGridPositions("bottom",e).forEach(({key:s,size:o})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,o)),h.filterGridPositions("left",e).forEach(({key:s,size:o})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,o)),t.addColumn("plot-start","plot-end","minmax(0, 1fr)"),h.filterGridPositions("right",e).forEach(({key:s,size:o})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,o)),t.build()},cs=({className:e,style:t,onLineChange:s,...o})=>{const{lines:r}=pe("Legend");return pe("Legend"),n.jsxRuntimeExports.jsx(os,{data:r,onEntryChange:s,...o})},as=u.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=u.use$3({aetherKey:e,type:h.Line.TYPE,schema:h.stateZ,initialState:t}),o=u.useMemoDeepEqualProps(t);return d.useLayoutEffect(()=>s(o),[o]),null}),Jo=Object.freeze(Object.defineProperty({__proto__:null,Line:as},Symbol.toStringTag,{value:"Module"})),St=u.wrap$1("Line",({aetherKey:e,color:t,label:s="",...o})=>{const{setLine:r,removeLine:i}=pe("Line");return d.useEffect(()=>(r({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(as,{aetherKey:e,color:t,label:s,...o})}),us=({level:e="h2",...t})=>{const s=u.useUniqueKey(),o=u.useTypography(e),r=Et({key:s,size:(o.lineHeight+2)*o.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(_.Space,{justify:"center",align:"center",style:r,children:n.jsxRuntimeExports.jsx(u.MaybeEditable,{...t,level:e})})},Qo={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Rt=d.forwardRef(({className:e,mode:t,maskBox:s,children:o,style:r,...i},a)=>n.jsxRuntimeExports.jsxs("div",{ref:a,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:Qo[t],...r},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.box$1.css(s),display:l.box$1.isZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),o]}));Rt.displayName="ZoomPanMask";const ut=4,er=["zoom","pan","select","zoomReset"],Ie=[...er,"click"],xs=["zoom","select"],Ze={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},ds={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},ps={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},bt={zoom:Ze,pan:ds,select:ps,zoomReset:Ze,click:Ze},tr=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,o])=>s==="defaultMode"?[s,o]:[s,o.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},sr=l.box$1.construct(0,0,1,1,l.location.TOP_LEFT),nr={width:30,height:50},ms=({onChange:e,triggers:t,initial:s=sr,threshold:o=nr,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[a,c]=d.useState(l.box$1.ZERO),[x,m]=d.useState(i),[p,f]=u.useStateRef(s),j=d.useRef(null),g=l.dimensions.construct(o);d.useEffect(()=>f(()=>l.box$1.truncate(s,3)),[s]),d.useEffect(()=>m(i),[i]);const[E,y,b,S]=u.useMemoCompare(()=>{const w={...bt[i],...t},$=u.flattenConfig(w),P=tr(w);return[w,$,P,u.flattenConfig(P)]},u.compareModeConfigs,[t]),v=d.useCallback(({box:w,triggers:$,stage:P,cursor:z})=>{if(j.current==null)return;const L=u.determineMode(E,$),B=l.box$1.construct(j.current);if(L==null)return;if(L==="zoomReset")return c(l.box$1.ZERO),e==null||e({box:l.box$1.DECIMAL,mode:L,stage:P,cursor:z}),f(l.box$1.DECIMAL);if(P==="end"){if(l.box$1.width(w)<5&&l.box$1.height(w)<5){L==="zoom"&&c(l.box$1.ZERO),e==null||e({box:p.current,mode:"click",stage:P,cursor:z});return}return f(T=>{if(L==="pan"){const O=zt(w,T,B);return O===null?T:(e==null||e({box:O,mode:L,stage:P,cursor:z}),O)}const N=R(w,T,B);return N===null?T:(e==null||e({box:N,mode:L,stage:P,cursor:z}),L==="zoom"?(c(l.box$1.ZERO),N):l.box$1.truncate(T,ut))})}if(xs.includes(L))return l.box$1.height(w)<5&&l.box$1.width(w)<5?void 0:c(l.scale.XY.scale(B).clamp(B).translate({x:-l.box$1.left(B),y:-l.box$1.top(B)}).box(Vt(g,w,B)));c(T=>l.box$1.isZero(T)?T:l.box$1.ZERO);const A=zt(w,p.current,B);l.box$1.equals(A,p.current)||e==null||e({box:A,mode:L,stage:P,cursor:z})},[c,m,e,E,o.height,o.width,f,j]);d.useImperativeHandle(r,()=>({reset:()=>{c(l.box$1.ZERO),f(l.box$1.DECIMAL),e==null||e({box:l.box$1.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.xy.ZERO})}}),[e]);const R=d.useCallback((w,$,P)=>l.box$1.truncate(fs($,P).box(Vt(g,w,P)),ut),[o]);jt.useDrag({bound:j,onDrag:v,triggers:y,loose:!0});const C=d.useCallback(({triggers:w,stage:$})=>{if($==="end")return m(i);const P=u.determineMode(b,w);P!=null&&m(P)},[b,i,e]);return u.use$2({triggers:S,callback:C,region:j}),{maskBox:a,ref:j,mode:x}},fs=(e,t)=>l.scale.XY.scale(t).clamp(t).scale(e),zt=(e,t,s)=>{let o=l.box$1.signedDims(fs(t,s).box(e));return o={signedWidth:-o.signedWidth,signedHeight:-o.signedHeight},l.box$1.truncate(l.scale.XY.translate(l.xy.construct(o)).box(t),ut)},Vt=(e,t,s)=>l.box$1.height(t)<=e.height?l.box$1.construct(l.box$1.left(t),l.box$1.top(s),l.box$1.width(t),l.box$1.height(s)):l.box$1.width(t)<=e.width?l.box$1.construct(l.box$1.left(s),l.box$1.top(t),l.box$1.width(s),l.box$1.height(t)):t,js=e=>n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(u.u0.Close,{"aria-label":"clear"})}),He=({children:e="",size:t="medium",variant:s="filled",color:o,icon:r,onClose:i,className:a,onDragStart:c,...x})=>{const m=l.cssString(o);r==null&&o!=null&&(r=n.jsxRuntimeExports.jsx(u.u0.Circle,{fill:m}));const p=i==null?void 0:n.jsxRuntimeExports.jsx(u.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:f=>{f.stopPropagation(),i()},children:n.jsxRuntimeExports.jsx(u.u0.Close,{})});return n.jsxRuntimeExports.jsx(u.WithIcon,{startIcon:r,endIcon:p,className:l.CSS(a,l.CSS.B("tag"),i!=null&&l.CSS.BM("tag","closeable")),level:G.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:c,...x,children:e})},or=Object.freeze(Object.defineProperty({__proto__:null,Tag:He},Symbol.toStringTag,{value:"Module"})),yt=({onChange:e,value:t,location:s,className:o,data:r,columns:i=[],tagKey:a="key",emptyContent:c,searcher:x,renderTag:m,placeholder:p,onTagDragStart:f,allowMultiple:j,allowNone:g,replaceOnSingle:E,onTagDragEnd:y,style:b,...S})=>{const{visible:v,open:R,close:C}=u.use$1(),[w,$]=d.useState([]),[P,z]=d.useState(!1),L=x!=null;u.useAsyncEffect(async()=>{z(!0),u.selectValueIsZero(t)&&$([]);const T=w.map(J=>J.key),N=l.toArray(t);if(l.compare.unorderedPrimitiveArrays(T,N)===l.compare.EQUAL)return;let O=[];if(L)try{O=await x.retrieve(N)}finally{z(!1)}else r!=null&&(O=r.filter(J=>N.includes(J.key)));$(O)},[x,L,t,r]);const B=d.useCallback((T,N)=>{$(N.entries),e(T,N)},[e]),A=d.useMemo(()=>L?u.Search:be.Filter,[L]);return n.jsxRuntimeExports.jsx(Q.Core,{close:C,open:R,data:r,emtpyContent:c,visible:v,value:t,onChange:B,allowNone:g,replaceOnSingle:E,columns:i,allowMultiple:!0,...S,children:n.jsxRuntimeExports.jsx(A,{searcher:x,children:({onChange:T,value:N})=>n.jsxRuntimeExports.jsx(rr,{value:N,selectedKeys:t,className:o,onChange:T,loading:P,selected:w,onFocus:R,tagKey:a,visible:v,renderTag:m,placeholder:p,onTagDragStart:f,onTagDragEnd:y,style:b})})})},rr=({selectedKeys:e,loading:t,selected:s,onChange:o,onFocus:r,visible:i,tagKey:a,renderTag:c=u.componentRenderProp(hs),placeholder:x="Select...",onTagDragStart:m,onTagDragEnd:p,value:f,className:j,...g})=>{const{onSelect:E,clear:y}=u.useSelectionUtils(),b=d.useRef(null);d.useLayoutEffect(()=>{var C;i&&((C=b.current)==null||C.focus())},[i,s]);const S=C=>{i||o(""),r==null||r()},v=C=>{i||r==null||r()},R=()=>{i||o("")};return n.jsxRuntimeExports.jsxs(u.Text$1,{ref:b,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),j),onBlur:R,placeholder:x,value:f,onChange:o,onFocus:S,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:v,...g,children:[n.jsxRuntimeExports.jsx(_.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:l.toArray(e).map((C,w)=>{const $=s[w];return c({key:C,entryKey:C,tagKey:a,loading:t,entry:$,onClose:()=>E==null?void 0:E(C),onDragStart:P=>m==null?void 0:m(P,C),onDragEnd:P=>p==null?void 0:p(P,C)})})}),n.jsxRuntimeExports.jsx(js,{onClick:y})]})},hs=({entryKey:e,tagKey:t,entry:s,loading:o,...r})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),d.createElement(He,{size:"small",variant:"outlined",className:l.CSS(s==null&&!o&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},l.convertRenderV(i))},gs=({onChange:e,value:t,tagKey:s="key",columns:o=[],data:r,emptyContent:i,inputProps:a,allowNone:c,searcher:x,className:m,variant:p,hideColumnHeader:f=!1,disabled:j,...g})=>{const{visible:E,open:y,close:b}=u.use$1(),[S,v]=d.useState(null),R=x!=null;u.useAsyncEffect(async()=>{if((S==null?void 0:S.key)===t)return;if(u.selectValueIsZero(t))return v(null);let $=null;if(R){const[P]=await x.retrieve([t]);$=P??null}else r!=null&&($=r.find(P=>P.key===t)??null);v($)},[x,t]);const C=d.useCallback(($,P)=>{v($==null?null:P.entries[0]),b(),e($,P)},[e,c]),w=d.useMemo(()=>R?u.Search:be.Filter,[R]);return n.jsxRuntimeExports.jsx(Q.Core,{close:b,open:y,data:r,emtpyContent:i,allowMultiple:!1,visible:E,value:t,hideColumnHeader:f,onChange:C,allowNone:c,columns:o,...g,children:n.jsxRuntimeExports.jsx(w,{searcher:x,children:({onChange:$})=>n.jsxRuntimeExports.jsx(lr,{variant:p,onChange:$,onFocus:y,selected:S,tagKey:s,visible:E,allowNone:c,className:m,disabled:j})})})},lr=({tagKey:e,selected:t,visible:s,onChange:o,onFocus:r,allowNone:i=!0,debounceSearch:a=250,placeholder:c="Select...",className:x,...m})=>{const{clear:p}=u.useSelectionUtils(),[f,j]=d.useState("");d.useEffect(()=>{if(!s){if(l.primitiveIsZero(t==null?void 0:t.key))return j("");if(t!=null)return j(typeof e=="function"?e(t).toString():(t==null?void 0:t[e]).toString())}},[t,s,e]);const g=S=>{o(S),j(S)},E=S=>{j(""),r==null||r()},y=S=>{s||(S.preventDefault(),r==null||r())},b=()=>{j(""),p==null||p()};return n.jsxRuntimeExports.jsx(u.Text$1,{className:l.CSS(l.CSS.BE("select","input"),x),value:f,onChange:g,onFocus:E,style:{flexGrow:1},onClick:y,placeholder:c,...m,children:i&&n.jsxRuntimeExports.jsx(js,{onClick:b})})},ir=[{key:"x",icon:n.jsxRuntimeExports.jsx(u.u0.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(u.u0.Arrow.Down,{})}],cr=({key:e,entry:t,onClick:s,selected:o})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:o?"filled":"outlined",onClick:s,children:t.icon},e),ar=({children:e=cr,allowMultiple:t=!1,...s})=>n.jsxRuntimeExports.jsx(Q.Button,{...s,data:ir,children:e}),ur=l.DataType.ALL.filter(e=>e!==l.DataType.UNKNOWN).map(e=>({key:e.toString(),name:l.Case.capitalize(e.toString())})),xr=[{key:"name",name:"Name"}],dr=e=>n.jsxRuntimeExports.jsx(Q.DropdownButton,{...e,data:ur,columns:xr,tagKey:"name"}),pr=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Q.BaseButton,Button:Q.Button,DataType:dr,Direction:ar,DropdownButton:Q.DropdownButton,Multiple:yt,MultipleTag:hs,Single:gs,defaultButton:Q.defaultButton},Symbol.toStringTag,{value:"Module"})),mr=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:l.Case.capitalize(e)}),n.jsxRuntimeExports.jsx(jt.Text,{trigger:t[0],level:"small"})]}),fr={zoom:n.jsxRuntimeExports.jsx(u.u0.Zoom,{}),pan:n.jsxRuntimeExports.jsx(u.u0.Pan,{}),select:n.jsxRuntimeExports.jsx(u.u0.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(u.u0.Expand,{}),click:n.jsxRuntimeExports.jsx(u.u0.Bolt,{})},jr=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const o=Object.entries(e).filter(([r])=>!t.includes(r)&&Ie.includes(r)).map(([r,i])=>({key:r,icon:fr[r],tooltip:n.jsxRuntimeExports.jsx(mr,{mode:r,triggers:i})})).sort((r,i)=>Ie.indexOf(r.key)-Ie.indexOf(i.key));return n.jsxRuntimeExports.jsx(Q.Button,{...s,data:o,entryRenderKey:"icon",children:({title:r,entry:i,...a})=>d.createElement(u.Icon,{...a,key:i.key,variant:a.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},hr=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:bt,MASK_MODES:xs,MODES:Ie,Mask:Rt,PAN_DEFAULT_TRIGGERS:ds,SELECT_DEFAULT_TRIGGERS:ps,SelectMode:jr,ZOOM_DEFAULT_TRIGGERS:Ze,use:ms},Symbol.toStringTag,{value:"Module"})),Es=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ss=d.forwardRef(({children:e,initial:t=l.box$1.DECIMAL,onChange:s,...o},r)=>{const{setViewport:i}=pe("Viewport");d.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.xy.ZERO,stage:"start"})},[i,t]);const a=d.useCallback(x=>{i(x),s==null||s(x)},[s,i]),c=ms({onChange:a,initial:t,ref:r,...o});return n.jsxRuntimeExports.jsx(Rt,{className:l.CSS.BE("line-plot","viewport"),...c,children:e})}),Ct=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?h.XAxis.TYPE:h.YAxis.TYPE,o=`${e}-axis`;return u.wrap$1(s,({aetherKey:r,children:i,resizeDebounce:a=0,location:c=t,label:x="",labelLevel:m="small",labelDirection:p=e,onLabelChange:f,color:j,labelSize:g,showGrid:E,type:y,bounds:b,className:S,tickSpacing:v,autoBounds:R,autoBoundUpdateInterval:C,onAutoBoundsChange:w,style:$,...P})=>{const z=((x==null?void 0:x.length)??0)>0,L=u.useMemoDeepEqualProps({location:c,showGrid:E,type:y,bounds:b,label:x,labelDirection:p,tickSpacing:v,autoBounds:R,autoBoundUpdateInterval:C}),[{path:B},{size:A,labelSize:T,...N},O]=u.use$3({aetherKey:r,type:s,schema:h.coreAxisStateZ,initialState:L});d.useEffect(()=>O(ae=>({...ae,...L})),[L]),d.useEffect(()=>{const{lower:ae,upper:X}=h.parseAutoBounds(N.autoBounds);N.bounds!=null&&(ae&&(b==null?void 0:b.lower)!==N.bounds.lower||X&&(b==null?void 0:b.upper)!==N.bounds.upper)&&(w==null||w(N.bounds))},[N.autoBounds,N.bounds]);const J=Et({loc:c,key:`${s}-${r}`,size:A+T,order:"last"},"XAxis"),le=u.useTypography(m).toString(),ge=d.useRef(0);return d.useEffect(()=>{if(e==="y"){if(x==null)return;let X=G.dimensions(x,le)[l.direction$1.dimension(l.direction$1.construct(p))];X>0&&(X+=6),O(Ee=>({...Ee,labelSize:X}))}else{const X=G.dimensions(x,le).height+12,Ee=ge.current;h.withinSizeThreshold(Ee,X)||(ge.current=X,O(Oe=>({...Oe,labelSize:X})))}},[x,p,le]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(_.Space,{className:l.CSS(S,l.CSS.B("axis"),l.CSS.B(o),l.CSS.loc(c)),style:{...$,...J},align:"center",justify:e==="x"?"end":"start",direction:l.direction$1.swap(e),...P,children:z&&n.jsxRuntimeExports.jsx(u.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:x,onChange:f,level:m})}),n.jsxRuntimeExports.jsx(u.Composite,{path:B,children:i})]})})},Rs=Ct("x"),bs=Ct("y"),gr=Object.freeze(Object.defineProperty({__proto__:null,Legend:cs,Line:St,LinePlot:is,Title:us,Viewport:Ss,XAxis:Rs,YAxis:bs,axisFactory:Ct,selectViewportEl:Es,useContext:pe,useGridPosition:Et,useViewport:ls},Symbol.toStringTag,{value:"Module"})),Er=u.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:h.Tooltip.TYPE,schema:h.tooltipStateZ,initialState:{position:null}}),s=d.useRef(null),o=d.useCallback(i=>t({position:l.xy.construct(i)}),[t]),r=d.useCallback(()=>t({position:null}),[t]);return d.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",o),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",o),i.removeEventListener("mouseleave",r)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),ys={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Sr=u.flattenConfig(ys),Cs=u.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:h.Measure.TYPE,schema:h.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=d.useRef(null),o=u.useHeldRef({triggers:Sr,loose:!0}),r=d.useCallback(({mode:c,cursor:x})=>{if(c==="click"){const m=u.determineMode(ys,o.current.triggers,!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,o]);ls(r);const i=d.useCallback(c=>t(x=>({...x,hover:l.xy.construct(c)})),[t]),a=d.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return d.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",a)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),Rr=Object.freeze(Object.defineProperty({__proto__:null,Measure:Cs},Symbol.toStringTag,{value:"Module"})),vt=u.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:o,onPositionChange:r,units:i="",color:a,lineWidth:c,lineDash:x})=>{const[m,p]=G.usePurePassthrough({value:t,onChange:o,initial:""}),[,{position:f,pixelPosition:j},g]=u.use$3({aetherKey:e,type:h.Rule.TYPE,schema:h.ruleStateZ,initialState:{color:a,dragging:!1,position:s,lineWidth:c,lineDash:x}});d.useEffect(()=>{if(f==null)return;if(s==null)return r==null?void 0:r(f);const C=l.bounds.construct(f+.01,f-.01);s!=null&&!l.bounds.contains(C,s)&&(r==null||r(Math.trunc(f*100)/100))},[f]);const E=d.useRef(j);j!==E.current&&(E.current=j);const y=d.useRef(j);d.useEffect(()=>{g(C=>({...C,position:s,color:a,lineWidth:c,lineDash:x}))},[s,a,c,x]);const b=Qe({onStart:d.useCallback(()=>{g(C=>({...C,dragging:!0})),y.current=E.current},[]),onMove:C=>{g(w=>({...w,pixelPosition:(y.current??0)+l.box$1.signedHeight(C)}))},onEnd:d.useCallback(()=>{g(C=>({...C,dragging:!1})),y.current=j},[])}),S=d.useRef(null);if(f==null||j==null)return null;const v=Es(S==null?void 0:S.current),R=n.jsxRuntimeExports.jsxs("div",{ref:S,className:l.CSS.B("rule"),style:{top:`calc(${j}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:b,draggable:!0}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(u.Editable,{level:"p",value:m,onChange:p}),n.jsxRuntimeExports.jsx(u.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return v==null?R:bo.createPortal(R,v)}),br=Object.freeze(Object.defineProperty({__proto__:null,Rule:vt},Symbol.toStringTag,{value:"Module"})),vs=u.canDropOfType(te),yr=({lines:e,axes:t,showTitle:s=!0,title:o="",onTitleChange:r,showLegend:i=!0,titleLevel:a="h4",onLineChange:c,onRuleChange:x,onAxisChannelDrop:m,onAxisChange:p,rules:f,enableTooltip:j=!0,enableMeasure:g=!1,initialViewport:E=l.box$1.DECIMAL,onViewportChange:y,viewportTriggers:b,...S})=>{var $;const v=t.filter(({location:P})=>l.location.isY(P)),R=d.useRef(),C=u.usePrevious(e.length),w=u.usePrevious(S.hold);return(C===0&&e.length!==0||w===!0&&S.hold===!1)&&(($=R.current)==null||$.reset()),n.jsxRuntimeExports.jsxs(is,{...S,children:[v.map((P,z)=>{const L=e.filter(T=>T.axes.x===P.key),B=t.filter(({location:T})=>l.location.isX(T)),A=f==null?void 0:f.filter(T=>[...B.map(({key:N})=>N),P.key].includes(T.axis));return n.jsxRuntimeExports.jsx(Cr,{axis:P,index:z,lines:L,yAxes:B,rules:A,onAxisChannelDrop:m,onAxisChange:p},P.key)}),i&&n.jsxRuntimeExports.jsx(cs,{onLineChange:c}),s&&n.jsxRuntimeExports.jsx(us,{value:o,onChange:r,level:a}),n.jsxRuntimeExports.jsxs(Ss,{initial:E,onChange:y,triggers:b,ref:R,children:[j&&n.jsxRuntimeExports.jsx(Er,{}),g&&n.jsxRuntimeExports.jsx(Cs,{})]})]})},Cr=({yAxes:e,lines:t,index:s,rules:o,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a,axis:{location:c,key:x,showGrid:m,...p}})=>{const f=u.useDrop({type:"Channel.LinePlot.XAxis",canDrop:vs,onDrop:d.useCallback(({items:g})=>{const E=u.filterByType(te,g);return i==null||i(x,E.map(({key:y})=>y)),E},[x,i])}),j=o==null?void 0:o.filter(g=>g.axis===x);return n.jsxRuntimeExports.jsxs(Rs,{...p,...f,location:c,showGrid:m??s===0,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(te)(u.useDraggingState()))),onAutoBoundsChange:g=>a==null?void 0:a({key:x,bounds:g}),children:[e.map((g,E)=>{const y=t.filter(S=>S.axes.y===g.key),b=o==null?void 0:o.filter(S=>S.axis===g.key);return n.jsxRuntimeExports.jsx(wr,{axis:{...g,showGrid:m??(s===0&&E===0)},lines:y,rules:b,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a},g.key)}),j==null?void 0:j.map(g=>d.createElement(vt,{aetherKey:g.key,...g,key:g.key,onLabelChange:E=>r==null?void 0:r({key:g.key,label:E}),onPositionChange:E=>r==null?void 0:r({key:g.key,position:E})}))]})},vr=({channels:{x:e,y:t}})=>`${e??0}-${t}`,wr=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:o,onAxisChange:r,axis:{key:i,location:a,...c}})=>{const x=u.useDrop({type:"Channel.LinePlot.YAxis",canDrop:vs,onDrop:d.useCallback(({items:p})=>{const f=u.filterByType(te,p);return o==null||o(i,f.map(({key:j})=>j)),f},[i,o])}),m=u.useDraggingState();return n.jsxRuntimeExports.jsxs(bs,{...c,...x,location:a,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(te)(m))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>n.jsxRuntimeExports.jsx($r,{line:p},vr(p))),t==null?void 0:t.map(p=>d.createElement(vt,{aetherKey:p.key,...p,key:p.key,onLabelChange:f=>s==null?void 0:s({key:p.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:p.key,position:f})}))]})},$r=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(Pr,{line:e}):n.jsxRuntimeExports.jsx(kr,{line:e}),kr=({line:{key:e,timeSpan:t,channels:{x:s,y:o},...r}})=>{const i=t.valueOf()*3,a=h.streamChannelData({timeSpan:t,channel:o,keepFor:i}),c=s!=null&&s!==0,x=h.streamChannelData({timeSpan:t,channel:c?s:o,useIndexOfChannel:!c,keepFor:i});return n.jsxRuntimeExports.jsx(St,{aetherKey:e,y:a,x,...r})},Pr=({line:{timeRange:e,key:t,channels:{x:s,y:o},...r}})=>{const i=h.channelData({timeRange:e,channel:o}),a=s!=null&&s!==0,c=h.channelData({timeRange:e,channel:a?s:o,useIndexOfChannel:!a});return n.jsxRuntimeExports.jsx(St,{aetherKey:t,y:i,x:c,...r})},wt=d.createContext(h.ZERO_CONTEXT_VALUE),Me=()=>d.useContext(wt).synnax,Lr=()=>d.useContext(wt).state,At={connected:"success",connecting:"info",disconnected:"info",failed:"error"},ws=u.wrap$1(h.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[o,r,i]=u.useCombinedStateAndRef(h.ZERO_CONTEXT_VALUE),[{path:a},,c]=u.use$3({aetherKey:e,type:h.Provider.TYPE,schema:h.Provider.stateZ,initialState:{props:t??null,state:null}}),x=u.useAggregator(),m=d.useCallback(p=>{i.current.state.status!==p.status&&x({variant:At[p.status],message:p.message??l.Case.capitalize(p.status)}),r(f=>({...f,state:p}))},[x]);return u.useAsyncEffect(async()=>{if(o.synnax!=null&&o.synnax.close(),t==null)return r(h.ZERO_CONTEXT_VALUE);const p=new G.Zb({...t,connectivityPollFrequency:G.Le.seconds(5)});r({synnax:p,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await p.connectivity.check();return r({synnax:p,state:f}),x({variant:At[f.status],message:f.message??f.status.toUpperCase()}),p.connectivity.onChange(m),c({props:t,state:f}),()=>{p.close(),r(h.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,m]),n.jsxRuntimeExports.jsx(wt.Provider,{value:o,children:n.jsxRuntimeExports.jsx(u.Composite,{path:a,children:s})})}),Tr=Object.freeze(Object.defineProperty({__proto__:null,Provider:ws,use:Me,useConnectionState:Lr},Symbol.toStringTag,{value:"Module"})),ye=d.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),$s=()=>d.useContext(ye),ks=e=>{const{aliases:t}=d.useContext(ye);return t[e]??null},et=()=>{const{aliases:e}=d.useContext(ye);return e},$t=(e,t="")=>{const{getName:s}=d.useContext(ye),[o,r]=d.useState(t);return u.useAsyncEffect(async()=>{const i=await s(e);i!=null&&r(i)},[e,s]),o},kt=()=>{const{activeRange:e}=d.useContext(ye);return e??void 0},Ps=({activeRange:e,children:t})=>{const s=Me(),[o,r]=d.useState({}),i=d.useCallback(x=>{r(m=>{const p={...m};return x.forEach(({variant:f,key:j,value:g})=>{const E=Number(j.split("---")[1]);f==="delete"?delete p[E]:p[g.channel]=g.alias}),p})},[r]),a=d.useCallback(async(x,m)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(x,m)},[s,e]),c=d.useCallback(async x=>{if(s==null||x===0)return;const m=o[x];return m??(await s.channels.retrieve(x)).name},[o,s]);return u.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const x=await s.ranges.retrieve(e),m=await x.listAliases();r(m);const p=await x.openAliasTracker(),f=p.onChange(i);return()=>{f(),p.close()}},[s,e]),n.jsxRuntimeExports.jsx(ye.Provider,{value:{aliases:o,activeRange:e,setAlias:e!=null?a:null,getName:c},children:t})},Mr=({channelKey:e,value:t,shadow:s,className:o,...r})=>{const[i,a]=d.useState(!1),{setAlias:c}=$s(),x=ks(e),m=$t(e);let p=n.jsxRuntimeExports.jsx(u.u0.Rename,{});i?p=n.jsxRuntimeExports.jsx(u.u0.Loading,{}):x===t&&(p=n.jsxRuntimeExports.jsx(u.u0.Check,{}));const f=c!=null&&!i&&x!==t&&e!==0,j=()=>{f&&(async()=>(a(!0),await c(e,t),a(!1)))()},g=()=>{var y;x!=null&&((y=r.onChange)==null||y.call(r,x))},E=()=>e===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):x===t?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Sync alias for ",m," with this label"]});return n.jsxRuntimeExports.jsxs(u.Text$1,{value:t,...r,children:[f&&n.jsxRuntimeExports.jsx(u.Icon,{onClick:g,tooltip:n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Set ",m," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(u.u0.Sync,{})}),n.jsxRuntimeExports.jsx(u.Icon,{onClick:j,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},It=[{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"}],Ge=({items:e},t)=>{const s=u.filterByType(te,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Ls=["name","alias"],Ts=e=>{const t=et();return d.useMemo(()=>e.length===0?It:It.filter(s=>e.includes(s.key)),[e,t])},Nr=({columns:e=Ls,onChange:t,className:s,value:o,...r})=>{const i=Me(),a=et(),c=Ts(e),x=kt(),m=d.useMemo(()=>i==null?void 0:i.channels.newSearcherUnderRange(x),[i,x]),p=i!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:j,...g}=u.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:d.useCallback(v=>Ge(v,l.toArray(o)),[o]),onDrop:d.useCallback(({items:v})=>{const R=u.filterByType(te,v);if(R.length===0)return[];const C=l.unique([...l.toArray(o),...R.map(w=>w.key)]);return t(C,{clickedIndex:null,clicked:null,entries:[]}),R},[t,o])}),E=u.useDraggingState(),y=d.useCallback(({dropped:v})=>{t(l.toArray(o).filter(R=>!v.some(C=>C.key===R)),{clickedIndex:null,clicked:null,entries:[]})},[t,o]),b=d.useCallback((v,R)=>f([{key:R,type:te}],y),[f,y]),S=d.useCallback(v=>a[v.key]??v.name,[a]);return n.jsxRuntimeExports.jsx(yt,{className:l.CSS(s,l.CSS.dropRegion(Ge(E,l.toArray(o)))),value:o,onTagDragStart:b,onTagDragEnd:j,searcher:m,onChange:t,columns:c,emptyContent:p,tagKey:S,...g,...r})},Te=({columns:e=Ls,onChange:t,value:s,className:o,data:r,...i})=>{const a=Me(),c=et(),x=Ts(e),m=kt(),p=d.useMemo(()=>{if(!(r!=null&&r.length>0))return a==null?void 0:a.channels.newSearcherUnderRange(m)},[a,m,r==null?void 0:r.length]),f=a!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),j=d.useId(),g=d.useMemo(()=>({key:j,type:"Channel.SelectMultiple"}),[j]),{startDrag:E,onDragEnd:y,...b}=u.useDragAndDrop({type:"Channel.SelectSingle",canDrop:d.useCallback(C=>Ge(C,l.nullToArr(s)),[s]),onDrop:d.useCallback(({items:C})=>{const w=u.filterByType(te,C);return w.length===0?[]:(t(w[0].key,{clickedIndex:null,clicked:null,entries:[]}),w)},[g,t])}),S=u.useDraggingState(),v=d.useCallback(()=>s!=null&&E([{type:te,key:s}]),[E,s]),R=d.useCallback(C=>c[C.key]??C.name,[c]);return n.jsxRuntimeExports.jsx(gs,{data:r,className:l.CSS(o,l.CSS.dropRegion(Ge(S,l.nullToArr(s)))),value:s,onDragStart:v,onDragEnd:y,onChange:t,searcher:p,columns:x,emptyContent:f,tagKey:R,...b,...i})},Br=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Mr,AliasProvider:Ps,LinePlot:yr,SelectMultiple:Nr,SelectSingle:Te,useActiveRange:kt,useAlias:ks,useAliases:et,useContext:$s,useName:$t},Symbol.toStringTag,{value:"Module"})),Ye=d.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:o,direction:r,first:i,last:a,key:c,size:x},emptyContent:m,...p}=s,f=d.useCallback(([E])=>t(c,E),[t]),{props:j}=ht({direction:r,onResize:f,count:2,initialSizes:x!=null?[x]:void 0});let g;return o!==void 0?g=n.jsxRuntimeExports.jsx(Ms,{emptyContent:m,...s}):i!=null&&a!=null?g=n.jsxRuntimeExports.jsxs(Je,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...j,children:[n.jsxRuntimeExports.jsx(Ye,{...p,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(Ye,{...p,root:a,onResize:t},a.key)]}):(g=null,console.warn("Mosaic tree is malformed")),c===1?n.jsxRuntimeExports.jsx(u.Provider$2,{children:g}):g});Ye.displayName="Mosaic";const qe="pluto-mosaic-tab-drop",Pt="pluto-mosaic-tab-create",_r=(e,t)=>{const s=u.filterByType(qe,t).map(i=>i.key),o=e.filter(i=>!s.includes(i.tabKey)).length>0;return u.filterByType(Pt,t).length>0||s.length>0&&(o||e.length===0)},Ms=d.memo(({root:e,onDrop:t,onCreate:s,...o})=>{const{key:r,tabs:i}=e,[a,c]=d.useState(null),x=d.useCallback(({items:b})=>_r(i,b),[i]),m=d.useCallback(({items:b,event:S})=>{c(null);const v=u.filterByType(qe,b),R=i.length===0?"center":Ft(Zt(S));if(v.length>0){const w=v.map(({key:$})=>$)[0];t(r,w,R)}const C=u.filterByType(Pt,b);if(C.length>0){const w=C.map(({key:$})=>$);s==null||s(r,R,w)}return v},[t,i.length]),p=d.useCallback(({event:b})=>{const S=i.length===0?"center":Ft(Zt(b));c(S)},[i.length]),{startDrag:f,...j}=u.useDragAndDrop({type:"Mosaic",canDrop:x,onDrop:m,onDragOver:p}),g=d.useCallback(()=>c(null),[]),E=d.useCallback((b,{tabKey:S})=>f([{key:S,type:qe}]),[f]),y=d.useCallback(()=>s==null?void 0:s(r,"center"),[r]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsx(W.Tabs,{tabs:i,onDragLeave:g,selected:e.selected,onDragStart:E,onCreate:y,...o,...j}),a!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Dr[a]})]})});Ms.displayName="MosaicTabLeaf";const Dr={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%"}},Zt=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return o<24?{px:.5,py:.5}:{px:s/t.width,py:o/t.height}},Or=e=>e,zr=e=>1-e,Ft=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,o]=[Or(e),zr(e)];if(t>s&&t>o)return"bottom";if(t<s&&t<o)return"top";if(t>s&&t<o)return"left";if(t<s&&t>o)return"right";throw new Error("[bug] - invalid insert position")},Lt=new Error("Tab not found"),Vr=new Error("Invalid Mosaic"),Ns=(e,t,s="center",o)=>{var x;if(e=fe(e),o===void 0)return xt(e,t);const r=zs(e,o);if(s==="center")return(x=r.tabs)==null||x.push(t),r.selected=t.tabKey,e;if(r.tabs==null||r.tabs.length===0)return e;const[i,a,c]=Zr(s);if(r.direction=c,r[i]={key:0,tabs:[t],selected:t.tabKey},r[a]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw Vr;return r.first.key=r.key*2,r.last.key=r.key*2+1,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},xt=(e,t)=>(e=fe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=xt(e.first,t):e.last!=null&&(e.last=xt(e.last,t)),e)),Ue=e=>{e=fe(e);const t=[];if(e.tabs!=null&&(e.selected=W.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,o]=Ue(e.first);e.first=s,t.push(...o)}if(e.last!=null){const[s,o]=Ue(e.last);e.last=s,t.push(...o)}return[e,t]},Tt=(e,t)=>{var i;e=fe(e);const[,s]=Re(e,t);if(s==null)return[e,null];s.tabs=(i=s.tabs)==null?void 0:i.filter(a=>a.tabKey!==t),s.selected=W.resetSelection(s.selected,s.tabs);const o=Ir(e),r=s.selected??We(o);return[o,r]},We=e=>e.selected!=null?e.selected:e.first!=null?We(e.first):e.last!=null?We(e.last):null,Bs=(e,t)=>{e=fe(e);const[s,o]=Re(e,t);if(s==null||o==null)throw Lt;return o.selected=t,e},_s=(e,t,s,o)=>{e=fe(e);const[r,i]=Re(e,t);if(r==null||i==null)throw Lt;const[a,c]=Tt(e,t);return[Ns(a,r,s,o),c]},Ds=(e,t,s)=>{const o=Xe(e,t);if(o==null)throw new Error("Node not found");return o.size=s,e},Os=(e,t,s)=>{e=fe(e);const[,o]=Re(e,t);if((o==null?void 0:o.tabs)==null)throw Lt;return o.tabs=W.rename(t,s,(o==null?void 0:o.tabs)??[]),e},Ar=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,zs=(e,t)=>{const s=Xe(e,t);if(s!=null)return s;const o=Math.floor(t/2);return o===0?e:zs(e,o)},Ir=e=>{let t=!0;for(;t;)[e,t]=dt(e);return e},dt=e=>{if(e.first==null||e.last==null)return[e,!1];if(Gt(e.first))return[Ht(e.last,!0),!0];if(Gt(e.last))return[Ht(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=dt(e.first),[e.last,s]=dt(e.last),[e,t||s]},Ht=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Gt=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Re=(e,t)=>{if(e.tabs!=null){const a=e.tabs.find(c=>c.tabKey===t);if(a!=null)return[a,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,o]=Re(e.first,t);if(s!=null&&o!=null)return[s,o];const[r,i]=Re(e.last,t);return[r,i]},Xe=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=Xe(e.first,t);return s??Xe(e.last,t)},Zr=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")}},fe=e=>l.external.copy(e),Fr=({allowRename:e=!1,initialTree:t})=>{const[s,o]=d.useState(t);return d.useEffect(()=>o(Ue(t)[0]),[t]),{root:s,onDrop:(m,p,f)=>o(j=>_s(j,p,f,m)[0]),onClose:m=>o(p=>Tt(p,m)[0]),onSelect:m=>o(p=>Bs(p,m)),onResize:(m,p)=>o(f=>Ds(f,m,p)),onRename:e?(m,p)=>o(f=>Os(f,m,p)):void 0}},Hr=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Pt,HAUL_DROP_TYPE:qe,Mosaic:Ye,autoSelectTabs:Ue,findSelected:We,insertTab:Ns,isEmpty:Ar,moveTab:_s,removeTab:Tt,renameTab:Os,resizeNode:Ds,selectTab:Bs,use:Fr},Symbol.toStringTag,{value:"Module"})),Mt=({aetherKey:e})=>{const[,{region:t},s]=u.use$3({aetherKey:e,type:h.Eraser$1.TYPE,schema:h.eraserStateZ,initialState:{region:l.box$1.ZERO,enabled:!0}}),o=u.useSyncedRef(t),r=d.useCallback(a=>{l.box$1.equals(a,o.current)||s(c=>({...c,region:a}))},[s]);return{setEnabled:d.useCallback(a=>s(c=>({...c,enabled:a})),[s]),erase:r}},Gr=u.wrap$1(h.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Mt({aetherKey:e}),o=u.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:o,className:l.CSS(l.CSS.inheritDims()),children:t})}),Yr=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Gr,use:Mt},Symbol.toStringTag,{value:"Module"})),qr=({items:e,initialKey:t})=>{const[s,o]=d.useState(t),r=a=>o(a===s?void 0:a),i=e.find(a=>a.key===s);return{onSelect:r,activeItem:i}},Ur=u.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:o,location:r="left",collapseThreshold:i=.65,className:a,onResize:c,...x})=>{const m=l.location.direction(r),p=d.useCallback(()=>t!=null&&(o==null?void 0:o(t.key)),[o,t==null?void 0:t.key]),{erase:f,setEnabled:j}=Mt({aetherKey:e}),g=d.useCallback((b,S)=>{c==null||c(b,S),f(S)},[c,f]);if(d.useLayoutEffect(()=>{j(t!=null)},[t,j]),t==null)return null;const{content:E,...y}=t;return n.jsxRuntimeExports.jsx(ss,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(m),a),collapseThreshold:i,onCollapse:p,location:r,onResize:g,...y,...x,children:t.content})}),Wr=({location:e="left",size:t="9rem",className:s,style:o,...r})=>{const i=l.location.construct(e),a=l.location.direction(i),c=l.direction$1.swap(a);return n.jsxRuntimeExports.jsx(_.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.location.swap(i)),l.CSS.dir(c),l.CSS.loc(i),s),direction:c,style:{[l.direction$1.dimension(a)]:t,...o},align:"center",empty:!0,...r})},Ne=e=>({bordered:t=!1,className:s,...o})=>n.jsxRuntimeExports.jsx(_.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),s),align:"center",...o}),Vs=Ne("start");Vs.displayName="NavbarStart";const As=Ne("end");As.displayName="NavbarEnd";const Is=Ne("center");Is.displayName="NavbarCenter";const Zs=Ne("");Zs.displayName="NavbarContent";const Fs=Ne("absolute-center");Fs.displayName="NavbarAbsoluteCenter";const Ce=Wr;Ce.Start=Vs;Ce.Center=Is;Ce.End=As;Ce.AbsoluteCenter=Fs;Ce.Content=Zs;const Xr=Object.freeze(Object.defineProperty({__proto__:null,Bar:Ce,Drawer:Ur,useDrawer:qr},Symbol.toStringTag,{value:"Module"})),lt={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.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"}),n.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"})]})},Kr=({disabled:e=[],className:t,focused:s=!0,onMinimize:o,onMaximize:r,onFullscreen:i,onClose:a,...c})=>n.jsxRuntimeExports.jsxs(_.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...c,children:[n.jsxRuntimeExports.jsx(it,{onClick:a,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:lt.Close}),n.jsxRuntimeExports.jsx(it,{onClick:o,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:lt.Minimize}),n.jsxRuntimeExports.jsx(it,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:lt.Maximize})]}),it=({className:e,...t})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),e),tabIndex:-1,size:"",...t}),ct=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:o,onFullscreen:r,...i})=>n.jsxRuntimeExports.jsxs(_.Pack,{...i,children:[n.jsxRuntimeExports.jsx(at,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(u.u0.Subtract,{})}),n.jsxRuntimeExports.jsx(at,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(u.u0.Box,{})}),n.jsxRuntimeExports.jsx(at,{onClick:o,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(u.u0.Close,{})})]}),at=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),Hs=e=>l.external$1.getOS(e),Jr={MacOS:Kr,Windows:ct,Linux:ct,Docker:ct},Qr="Windows",el=({forceOS:e,visibleIfOS:t,...s})=>{const o=Hs({force:e,default:Qr}),r=Jr[o];return t!=null&&t!==o?null:n.jsxRuntimeExports.jsx(r,{...s})},tl=Object.freeze(Object.defineProperty({__proto__:null,Controls:el,use:Hs},Symbol.toStringTag,{value:"Module"}));var ee;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ee||(ee={}));function sl({color:e,dimensions:t,lineWidth:s}){return d.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function nl({color:e,radius:t}){return d.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const ol={[ee.Dots]:"#91919a",[ee.Lines]:"#eee",[ee.Cross]:"#e2e2e2"},rl={[ee.Dots]:1,[ee.Lines]:1,[ee.Cross]:6},ll=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Gs({id:e,variant:t=ee.Dots,gap:s=20,size:o,lineWidth:r=1,offset:i=2,color:a,style:c,className:x}){const m=d.useRef(null),{transform:p,patternId:f}=h.useStore(ll,h.shallow$1),j=a||ol[t],g=o||rl[t],E=t===ee.Dots,y=t===ee.Cross,b=Array.isArray(s)?s:[s,s],S=[b[0]*p[2]||1,b[1]*p[2]||1],v=g*p[2],R=y?[v,v]:S,C=E?[v/i,v/i]:[R[0]/i,R[1]/i];return d.createElement("svg",{className:h.cc(["react-flow__background",x]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:m,"data-testid":"rf__background"},d.createElement("pattern",{id:f+e,x:p[0]%S[0],y:p[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},E?d.createElement(nl,{color:j,radius:v/i}):d.createElement(sl,{dimensions:R,color:j,lineWidth:r})),d.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Gs.displayName="Background";var il=d.memo(Gs);const Yt=({sourcePos:e,targetPos:t,next:s,prev:o})=>{const r=Le(e,...s);return l.xy.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",s),console.log("Prev segments",o),!1)},qt=({sourceStumpTip:e,sourceOrientation:t,sourceBox:s,targetStumpTip:o,targetOrientation:r,targetBox:i})=>{if(!cl({sourcePos:e,sourceOrientation:t,targetPos:o}))return;const a=l.direction$1.construct(t),c=l.direction$1.swap(a);let x=xe(c,o[c]-e[c]);const m=l.box$1.loc(s,x);if(l.location.swap(t)===r){const p=l.box$1.loc(i,l.location.swap(x));Math.abs(m-p)<K&&(x=l.location.swap(x))}return{direction:c,length:m-e[c]+me(x,K)}},Le=(e,...t)=>{let s=e;for(const o of t)s=l.xy.translate(s,o.direction,o.length);return s},Ys=(e,t,s,o)=>{try{let r=e;const i=[e,...t.map(j=>(r=l.xy.translate(r,j.direction,j.length),r))];if(!o)return i;const a=t[0],c=xe(a.direction,a.length),x=Ut(c);i[0]=l.xy.translate(i[0],{[a.direction]:-1*x*4*s,[l.direction$1.swap(a.direction)]:0});const m=t[t.length-1],p=xe(m.direction,m.length),f=Ut(p);return i[i.length-1]=l.xy.translate(i[i.length-1],{[m.direction]:f*4*s,[l.direction$1.swap(m.direction)]:0}),i}catch{return[]}},K=10,Ut=e=>e==="top"||e==="left"?-1:1,me=(e,t)=>e==="top"||e==="left"?-t:t,xe=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ce=e=>xe(e.direction,e.length),cl=({sourcePos:e,targetPos:t,sourceOrientation:s})=>{const o=l.direction$1.construct(s),r=t[o]-e[o];return me(s,r)<0},ze=e=>({direction:l.direction$1.construct(e),length:me(e,K)}),Wt={top:ze("top"),bottom:ze("bottom"),left:ze("left"),right:ze("right")},al=4,ul=.25,tt=e=>pt(xl(pt(e))),xl=e=>{const t=[...e],s=e.findIndex((o,r)=>{const i=Math.abs(o.length);if(i<al){if(i<ul)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const a=t[r+2];if(a.direction!==o.direction)return!1;t[r+2]={...a,length:a.length+o.length}}else{const a=t[r-2];if(a.direction!==o.direction)return!1;t[r-2]={...a,length:a.length+o.length}}return!0}return!1});return s!==-1&&t.splice(s,1),t},pt=e=>{const t=[...e];return e.findIndex((o,r)=>{const i=t[r-1];if(r===0||o.direction!==i.direction)return!1;if(r===1){const a=r-1,c=r,x=ce(i),m=ce(o);if(x===m)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(i.length)===K)return!1;const p=me(x,K),f=t[a].length-p,j=t[c].length+f;return Math.abs(j)<K?!1:(t[a]={...t[a],length:p},t[c]={...t[c],length:j},!0)}if(r===e.length-1){const a=r,c=r-1,x=ce(o),m=ce(i);if(x===m)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)===K)return!1;const p=me(x,K),f=t[a].length-p,j=t[c].length+f;return Math.abs(j)<K?!1:(t[a]={...t[a],length:p},t[c]={...t[c],length:j},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?pt(t):t},Se=e=>tt(dl(e)),dl=({sourceBox:e,targetBox:t,sourcePos:s,targetPos:o,targetOrientation:r,sourceOrientation:i})=>{let a=i,c=r,x={...Wt[i]},m=Le(s,x);const p={...Wt[r]};let f=Le(o,p);const j=[x],g=qt({sourceStumpTip:m,sourceOrientation:i,sourceBox:e,targetStumpTip:f,targetOrientation:r,targetBox:t});g!=null&&(j.push(g),m=Le(m,g),a=ce(g),x=g);const E=qt({sourceStumpTip:f,sourceOrientation:c,sourceBox:t,targetStumpTip:m,targetOrientation:a,targetBox:e});E!=null&&(f=Le(f,E),c=xe(E.direction,E.length));const y=()=>{E!=null&&(E.length*=-1,j.push(E)),p.length*=-1,j.push(p)};if(l.location.swap(a)===r){const w=l.direction$1.construct(a),$=(f[w]-m[w])/2;j.push({direction:w,length:$});const P=l.direction$1.swap(w);return j.push({direction:P,length:f[P]-m[P]}),j.push({direction:w,length:$}),y(),j}const b=f[x.direction]-m[x.direction];let S=l.direction$1.swap(x.direction);const v=m[S]-f[S];let R;xe(x.direction,b)===a&&xe(S,v)===c?R={direction:x.direction,length:b}:(R={direction:S,length:f[S]-m[S]},S=l.direction$1.swap(S)),j.push(R);const C={direction:S,length:f[S]-m[S]};return j.push(C),y(),j},pl=e=>tt(ml(e)),ml=({segments:e,index:t,magnitude:s})=>{const o=[...e],r=o[t],i=l.direction$1.swap(r.direction),a=ce(r);if(t===0){o.unshift({direction:i,length:s});const c=me(a,K);o.unshift({direction:r.direction,length:c}),t+=2,o[t]={...o[t],length:o[t].length-c}}else o[t-1]={direction:o[t-1].direction,length:o[t-1].length+s};if(t===o.length-1){o.push({direction:i,length:-s});const c=me(a,K);o.push({direction:r.direction,length:c}),o[t]={...o[t],length:o[t].length-c}}else o[t+1]={direction:o[t+1].direction,length:o[t+1].length-s};return o},fl=(e,t)=>{for(let s=e.length-1;s>=0;s--)if(t(e[s],s))return s;return-1},jl=(e,t,s=!1,...o)=>{const r=(i,a)=>!o.includes(a)&&t(i,a);return s?fl(e,r):e.findIndex(r)},hl=({delta:e,segments:t})=>tt(qs(e,t,!1)),gl=({delta:e,segments:t})=>tt(qs(e,t,!0)),qs=(e,t,s)=>{let o=[...t];return e.x!==0&&(o=Kt("x",e,o,s)),e.y!==0&&(o=Kt("y",e,o,s)),o},Xt=(e,t,s)=>{if(t.direction!==e)return!1;const o={...t,length:t.length-s[e]},r=ce(t),i=ce(o);return Math.abs(o.length)>K&&r===i},Kt=(e,t,s,o)=>{const r=l.direction$1.swap(e),i=o?s.length-1:0,a=s[i];if(Xt(e,a,t))return s[i]={...a,length:a.length-t[e]},s;const c=o?0:s.length-1,m=jl(s,f=>f.direction===e,o,i);if(m===c){const f=s[c];return Xt(e,f,t)?(s[c]={...f,length:f.length-t[e]},s):(a.direction===e?s[i]={...a,length:a.length-t[e]}:s[c]={...f,length:f.length-t[e]},s)}if(m===-1)return s.length===1?s[0].direction===e?[{direction:e,length:s[0].length-t[e]}]:[{direction:r,length:s[0].length/2},{direction:e,length:-t[e]},{direction:r,length:s[0].length/2}]:a.direction===e?(s[i]={...a,length:a.length-t[e]},s):[{direction:r,length:s[0].length},{direction:e,length:-t[e]},...s.slice(1)];const p=s[m];return s[m]={...p,length:p.length-t[e]},s},Nt=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[pid] - cannot find node with key: ${e}`);return t},q=(e,t)=>{const s=Nt(t),o=e.getNodes().find(r=>r.id===t);if(o==null)throw new Error(`[pid] - cannot find node with key: ${t}`);return l.box$1.construct(o.position,l.box$1.dims(l.box$1.construct(s)))},El=(e,t)=>st.fromFlow(e,t);class Us{constructor(t,s){ue(this,"node_",null);ue(this,"position");ue(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[pid] - handle has no node");return this.node_}get absolutePosition(){return l.xy.translate(l.box$1.topLeft(this.node.box),this.position)}}class st{constructor(t,s,o){ue(this,"key");ue(this,"box");ue(this,"handles");this.key=t,this.box=s,this.handles=o,o.forEach(r=>r.node=this)}static fromFlow(t,s){const o=q(s,t),r=Nt(t),i=r.getElementsByClassName("react-flow__handle"),a=l.box$1.construct(r),c=Array.from(i).map(x=>{const m=l.box$1.center(l.box$1.construct(x)),p=l.xy.translation(l.box$1.topLeft(a),m),f=x.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[pid] - cannot find handle orientation");const j=l.location.construct(f[0]);return new Us(p,j)});return new st(t,o,c)}}const Sl=({fromX:e,fromY:t,toX:s,toY:o,fromPosition:r,toPosition:i,fromNode:a,connectionLineStyle:c,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.location.outer.safeParse(p[1]);E.success&&(i=E.data)}const f=Se({sourcePos:l.xy.construct(e,t),targetPos:l.xy.construct(s,o),sourceOrientation:r,targetOrientation:i,sourceBox:q(h.useReactFlow(),(a==null?void 0:a.id)??""),targetBox:q(h.useReactFlow(),(a==null?void 0:a.id)??"")}),j=h.useReactFlow(),g=Ys(l.xy.construct(e,t),f,j.getZoom(),!1);return n.jsxRuntimeExports.jsx(h.BaseEdge,{path:Ws(g),style:{...c,stroke:l.cssString(x==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Rl=({id:e,source:t,target:s,sourcePosition:o,targetHandleId:r,targetPosition:i,style:a,segments:c=[],onSegmentsChange:x,color:m="var(--pluto-gray-l9)",selected:p=!1,...f})=>{const j=l.xy.construct(f.sourceX,f.sourceY),g=d.useRef(j),E=l.xy.equals(j,g.current),y=l.xy.construct(f.targetX,f.targetY),b=d.useRef(y),S=l.xy.equals(y,b.current),v=h.useReactFlow(),[R,C,w]=u.useCombinedStateAndRef(()=>c.length>0?c:Se({sourcePos:j,targetPos:y,sourceOrientation:o,targetOrientation:i,sourceBox:q(v,t),targetBox:q(v,s)})),$=d.useRef(i),P=d.useRef(o),z=u.useDebouncedCallback(x,100,[x]);if(!E||!S){let T=R;const N=l.xy.translation(g.current,j),O=l.xy.translation(y,b.current);l.xy.equals(N,l.xy.scale(O,-1),.001)?(g.current=j,b.current=y):(E?S||(T=gl({delta:O,segments:T}),$.current!==i&&($.current=i,T=Se({sourcePos:j,targetPos:y,sourceOrientation:o,targetOrientation:i,sourceBox:q(v,t),targetBox:q(v,s)})),Yt({sourcePos:j,targetPos:y,next:T,prev:R})||(T=Se({sourcePos:j,targetPos:y,sourceOrientation:o,targetOrientation:i,sourceBox:q(v,t),targetBox:q(v,s)})),b.current=y):(T=hl({delta:N,segments:T}),P.current!==o&&(P.current=o,T=Se({sourcePos:j,targetPos:y,sourceOrientation:o,targetOrientation:i,sourceBox:q(v,t),targetBox:q(v,s)})),Yt({sourcePos:j,targetPos:y,next:T,prev:R})||(T=Se({sourcePos:j,targetPos:y,sourceOrientation:o,targetOrientation:i,sourceBox:q(v,t),targetBox:q(v,s)})),g.current=j),z(T),C(T))}const L=d.useRef(null),B=Qe({onStart:d.useCallback((T,N,O)=>{L.current={index:Number(O.currentTarget.id.split("-")[1]),segments:[...w.current]}},[]),onMove:d.useCallback(T=>{if(L.current==null)return;const N=pl({segments:L.current.segments,index:L.current.index,magnitude:l.box$1.dim(T,l.direction$1.swap(L.current.segments[L.current.index].direction),!0)/v.getZoom()});C(N)},[]),onEnd:d.useCallback(()=>x(w.current),[x])}),A=Ys(j,R,v.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(h.BaseEdge,{path:Ws(A),style:{...a,stroke:l.cssString(m)},...f}),p&&bl(A).map((T,N)=>{const O=R[N].direction,J=l.direction$1.swap(O),le={[l.direction$1.dimension(O)]:"18px",[l.direction$1.dimension(J)]:"4px"},ge={[O]:T[O]-9,[J]:T[J]-2};return n.jsxRuntimeExports.jsxs(d.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...le,...ge,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:T.x-9,y:T.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${N}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(O)),draggable:!0,onDragStart:B})})]},N)})]})},Ws=e=>{let t="";const o=e.length+-1;for(let r=0;r<o;r++){const i=e[r%e.length],a=e[(r+1)%e.length],c=Math.min(6/Math.hypot(a.x-i.x,a.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+a.x*c},${i.y*(1-c)+a.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+a.x*c},${i.y*(1-c)+a.y*c}`),r===o-1?t+=`L${a.x},${a.y}`:r<o-1&&(t+=`L${i.x*c+a.x*(1-c)},${i.y*c+a.y*(1-c)}`)}return t},bl=e=>e.slice(1).map((t,s)=>{const o=e[s];return l.xy.construct((t.x+o.x)/2,(t.y+o.y)/2)}),yl=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:o={position:l.xy.ZERO,zoom:1}})=>{const[r,i]=d.useState(s),[a,c]=d.useState(e),[x,m]=d.useState(t),[p,f]=d.useState(o);return{viewport:p,onViewportChange:f,edges:x,nodes:a,onNodesChange:c,onEdgesChange:m,editable:r,onEditableChange:i}},Cl=e=>e.source!==e.target,vl={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},wl={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},Xs={padding:0,maxZoom:1,minZoom:.5},$l={hideAttribution:!0},Ks=d.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{}}),nt=()=>d.useContext(Ks),Js=d.memo(({children:e})=>{const{registerNodeRenderer:t}=nt();return d.useEffect(()=>t(e),[t,e]),null});Js.displayName="NodeRenderer";const kl=u.wrap$1(h.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:o,nodes:r,edges:i,onEditableChange:a,editable:c,viewport:x,triggers:m,onViewportChange:p,...f})=>{const[{path:j},,g]=u.use$3({aetherKey:e,type:h.Diagram$1.TYPE,schema:h.diagramStateZ,initialState:{position:x.position,region:l.box$1.ZERO,zoom:x.zoom}}),E=u.use().colors.gray.l9.hex,y=u.useMemoCompare(()=>m??bt.zoom,u.compareModeConfigs,[m]),{fitView:b}=h.useReactFlow(),S=gt(d.useCallback(D=>{g(V=>({...V,region:D}))},[g])),v=d.useRef(null),R=d.useCallback(D=>{const V=v.current;V!=null&&V.x===D.x&&V.y===D.y&&V.zoom===D.zoom||(v.current=D,g(Y=>({...Y,position:D,zoom:D.zoom})),p(h.translateViewportBackward(D)))},[g,p]);h.useOnViewportChange({onStart:R,onChange:R,onEnd:R});const[C,w]=d.useState(()=>()=>null),$=d.useCallback(D=>w(()=>D),[]),P=d.useMemo(()=>({custom:({id:D,xPos:V,yPos:Y,selected:Pe})=>C({symbolKey:D,position:{x:V,y:Y},selected:Pe})}),[C]),z=d.useRef(i),L=d.useMemo(()=>(z.current=i,h.translateEdgesForward(i)),[i]),B=d.useRef(r),A=d.useMemo(()=>(B.current=r,h.translateNodesForward(r)),[r]),T=d.useCallback(D=>s(h.nodeConverter(B.current,V=>h.applyNodeChanges(D,V))),[s]),N=d.useCallback(D=>o(h.edgeConverter(z.current,V=>h.applyEdgeChanges(D,V),E)),[o,E]),O=d.useCallback((D,V)=>o(h.edgeConverter(z.current,Y=>h.updateEdge(D,V,Y),E)),[]),J=d.useCallback(D=>{o(h.edgeConverter(z.current,V=>h.addEdge(D,V),E))},[o,E]),le=d.useCallback((D,V)=>{const Y=[...z.current],Pe=Y.findIndex(Eo=>Eo.key===D);Pe!==-1&&(Y[Pe]={...Y[Pe],segments:V},z.current=Y,o(Y))},[o]),ge=c?vl:wl,ae=d.useMemo(()=>({default:D=>n.jsxRuntimeExports.jsx(Rl,{...D,segments:D.data.segments,color:D.data.color,onSegmentsChange:d.useCallback(V=>le(D.id,V),[D.id])},D.id)}),[le]),X=d.useRef(null);u.use$2({triggers:y.zoomReset,callback:d.useCallback(({stage:D,cursor:V})=>{const Y=X.current;Y==null||D!=="start"||!l.box$1.contains(Y,V)||b()},[b])});const Ee=u.purgeMouse(y.select)[0]??null,Oe=u.purgeMouse(y.pan)[0]??null,jo=u.purgeMouse(y.zoom)[0]??null,ho={selectionOnDrag:Ee==null,panOnDrag:Oe==null,selectionKeyCode:Ee,panActivationKeyCode:Oe,zoomActivationKeyCode:jo},go=u.useCombinedRefs(X,S);return n.jsxRuntimeExports.jsx(Ks.Provider,{value:{editable:c,onEditableChange:a,registerNodeRenderer:$},children:n.jsxRuntimeExports.jsx(u.Composite,{path:j,children:n.jsxRuntimeExports.jsx(h.ReactFlow,{...ho,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(c)),nodes:A,edges:L,nodeTypes:P,edgeTypes:ae,ref:go,fitView:!0,onNodesChange:T,onEdgesChange:N,onConnect:J,onEdgeUpdate:O,defaultViewport:h.translateViewportForward(x),connectionLineComponent:Sl,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Cl,connectionMode:h.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Xs,selectionMode:h.SelectionMode.Partial,proOptions:$l,...f,style:{[l.CSS.var("diagram-zoom")]:x.zoom,...f.style},...ge,children:t})})})}),Pl=()=>{const{editable:e}=nt();return e?n.jsxRuntimeExports.jsx(il,{}):null},Ll=({children:e,...t})=>n.jsxRuntimeExports.jsx(_.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Tl=({onClick:e,...t})=>{const{editable:s,onEditableChange:o}=nt();return n.jsxRuntimeExports.jsx(u.ToggleIcon,{onChange:()=>o(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.location.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(u.u0.EditOff,{}):n.jsxRuntimeExports.jsx(u.u0.Edit,{})})},Ml=({onClick:e,...t})=>{const{fitView:s}=h.useReactFlow();return n.jsxRuntimeExports.jsx(u.Icon,{onClick:o=>{s(Xs),e==null||e(o)},tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.location.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(u.u0.Expand,{})})},Nl=e=>n.jsxRuntimeExports.jsx(h.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(kl,{...e})}),Bl=(e,t="x")=>{if(e.length===0)return[];const s=l.location.construct(t),o=l.location.swap(s);return e.sort((r,i)=>l.box$1.loc(r.box,s)-l.box$1.loc(i.box,s)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(g=>g.orientation===o),x=r.handles.find(g=>g.orientation===s);if(c==null||x==null)return;const m=c.absolutePosition,p=x.absolutePosition,f=l.xy.set(l.xy.translation(p,m),t,0),j=l.xy.translate(l.box$1.topLeft(r.box),f);r.box=l.box$1.construct(j,l.box$1.dims(r.box))}),e},_l=Object.freeze(Object.defineProperty({__proto__:null,Background:Pl,Controls:Ll,Diagram:Nl,FitViewControl:Ml,HandleLayout:Us,NodeLayout:st,NodeRenderer:Js,ToggleEditControl:Tl,alignNodes:Bl,selectNode:Nt,selectNodeBox:q,selectNodeLayout:El,use:yl,useContext:nt},Symbol.toStringTag,{value:"Module"})),Dl=h.Value.z.omit({font:!0}).partial({color:!0}).extend({level:G.levelZ.optional()}),Qs=({aetherKey:e,box:t,telem:s,color:o,precision:r,minWidth:i,level:a="small"})=>{const c=u.useMemoDeepEqualProps({box:t,telem:s,color:o,precision:r,level:a,minWidth:i}),[,x,m]=u.use$3({aetherKey:e,type:h.Value.TYPE,schema:h.Value.z,initialState:c});return d.useLayoutEffect(()=>m(p=>({...p,...c})),[c]),{width:x.width??x.minWidth}},Ol=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Dl,use:Qs},Symbol.toStringTag,{value:"Module"})),en=d.createContext({needsControlOf:[]}),tn=()=>d.useContext(en),zl=u.wrap$1(h.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...o})=>{const r=u.useMemoDeepEqualProps(o),[{path:i},{status:a,needsControlOf:c},x]=u.use$3({aetherKey:e,type:h.Controller$1.TYPE,schema:h.controllerStateZ,initialState:r});return d.useEffect(()=>{a!=null&&(s==null||s(a))},[a,s]),d.useEffect(()=>{x(m=>({...m,...r}))},[r,x]),d.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(en.Provider,{value:{needsControlOf:c},children:[n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:t}),";"]})}),sn=u.wrap$1(h.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=u.use$3({aetherKey:e,type:h.StateProvider.TYPE,schema:h.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:t})}),nn=u.wrap$1(h.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var x;const o=u.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:i},a]=u.use$3({aetherKey:e,type:h.Indicator.TYPE,initialState:{...o,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:l.TimeStamp.now()}},schema:h.indicatorStateZ});d.useEffect(()=>{a(m=>({...m,...o}))},[o,a]);let c;return((x=i.data)==null?void 0:x.color)!=null?c=l.Color.z.parse(i.data.color):r!=null&&!r.isZero?c=r:c="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{x:"center",y:"right"},children:[n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(c),flexGrow:1}})]})}),Vl=e=>{var t,s;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",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((s=e.data)==null?void 0:s.authority)===G.b0.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)"}}},on=u.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:o,...r})=>{const i=u.useMemoDeepEqualProps({source:t,sink:s}),[,{status:a},c]=u.use$3({aetherKey:e,type:h.Chip.TYPE,schema:h.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:l.TimeStamp.now()}}});d.useEffect(()=>{c(g=>({...g,...i}))},[i,c]);const x=d.useCallback(()=>c(g=>({...g,triggered:!g.triggered})),[c]),{message:m,chipColor:p,buttonStyle:f,disabled:j}=Vl(a);return n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),o),disabled:j,onClick:x,tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:m}),style:f,...r,children:n.jsxRuntimeExports.jsx(u.u0.Circle,{color:p})})}),Al=u.wrap$1(h.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=tn(),[,{states:o},r]=u.use$3({aetherKey:e,type:h.Legend.TYPE,schema:h.legendStateZ,initialState:{states:[],needsControlOf:s}});d.useEffect(()=>{r(c=>({...c,needsControlOf:s}))},[s]);const a=l.unique(o.map(c=>c.subject.key)).map(c=>{const x=o.find(m=>m.subject.key===c);if(x==null)throw new G.Bn("Legend subject not found");return{key:x.subject.key,label:x.subject.name,color:x.subjectColor}});return n.jsxRuntimeExports.jsx(os,{data:a,...t})}),Il=Object.freeze(Object.defineProperty({__proto__:null,Chip:on,Controller:zl,Indicator:nn,Legend:Al,StateProvider:sn,useContext:tn},Symbol.toStringTag,{value:"Module"})),Zl=({aetherKey:e,sink:t})=>{const s=u.useMemoDeepEqualProps({sink:t}),[,,o]=u.use$3({aetherKey:e,type:h.Button.TYPE,schema:h.buttonStateZ,initialState:{trigger:0,sink:t}});return d.useEffect(()=>{o(i=>({...i,...s}))},[s]),{click:d.useCallback(()=>{o(i=>({...i,trigger:i.trigger+1}))},[o])}},I=d.forwardRef(({label:e="",onChange:t,level:s="p",children:o,orientation:r="top",style:i,className:a,...c},x)=>n.jsxRuntimeExports.jsxs(_.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...i},size:2/3,direction:r,ref:x,className:l.CSS(l.CSS.B("symbol"),a),align:"center",justify:"center",...c,children:[e.length>0&&n.jsxRuntimeExports.jsx(u.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:d.useCallback(m=>t({label:{label:m,level:s,orientation:r}}),[t,s]),level:s}),o]}));I.displayName="Labeled";const M=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Fl=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Hl=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),mt=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Gl={left:{left:h.Position.Left,right:h.Position.Right,top:h.Position.Top,bottom:h.Position.Bottom},right:{left:h.Position.Right,right:h.Position.Left,top:h.Position.Bottom,bottom:h.Position.Top},top:{left:h.Position.Bottom,right:h.Position.Top,top:h.Position.Left,bottom:h.Position.Right},bottom:{left:h.Position.Top,right:h.Position.Bottom,top:h.Position.Right,bottom:h.Position.Left}},Yl=(e,t)=>Gl[t][e],ql=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},Z=({children:e,orientation:t})=>{let s;try{s=h.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const o=d.useRef(null),r=d.useRef(!0);return d.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const i=o.current.closest(".react-flow__node"),a=i==null?void 0:i.getAttribute("data-id");a!=null&&(s==null||s(a))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:o}),e]})},k=({location:e,orientation:t,left:s,top:o,...r})=>{const i=ql(o,s,t);return n.jsxRuntimeExports.jsx(h.Handle$1,{position:Yl(e,t),...r,type:"source",onClick:a=>a.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",r.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},ve=({className:e,enabled:t=!1,triggered:s=!1,color:o,orientation:r="left",...i})=>n.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"),s&&l.CSS.M("triggered"),e),...i}),U=({className:e,orientation:t="left",...s})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...s}),Ul=.8,H=({dimensions:e,orientation:t="left",children:s,className:o,color:r,style:i={},scale:a=1,...c})=>{e=l.direction$1.construct(t)==="y"?l.dimensions.swap(e):e;const m=l.cssString(r);return r!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(r).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l.dimensions.svgViewBox(e),className:l.CSS(l.CSS.loc(t),o),fill:m,stroke:m,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:l.dimensions.scale(e,a*Ul).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},rn=({className:e,orientation:t,scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:87},color:o,scale:s,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{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"})]})]}),ln=({color:e,orientation:t="left",scale:s,...o})=>n.jsxRuntimeExports.jsxs(ve,{...o,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{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"})]})]}),cn=({orientation:e="left",color:t,scale:s,...o})=>n.jsxRuntimeExports.jsxs(ve,{...o,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(H,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(M,{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"})})]}),an=({className:e,color:t,orientation:s="left",normallyOpen:o=!1,scale:r,...i})=>n.jsxRuntimeExports.jsxs(ve,{className:l.CSS(l.CSS.B("solenoid-valve"),o&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:69},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(Fl,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),un=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:58},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),xn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:45,height:43},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(M,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{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"})]})]}),dn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),pn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:39,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:95,top:3,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:68,height:61},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Hl,{cx:"35",cy:"25",r:"23"}),n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(mt,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),n.jsxRuntimeExports.jsx(mt,{x1:"1",y1:"24",x2:"35",y2:"24"})]})]}),mn=({className:e,color:t,orientation:s="left",scale:o,...r})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(U,{...r,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(Z,{orientation:s,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:40,height:48},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{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}),n.jsxRuntimeExports.jsx(M,{d:"M33 24H3",strokeLinecap:"round"})]})]})},fn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("cap"),e),...r,children:[n.jsxRuntimeExports.jsx(Z,{orientation:t,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(H,{color:s,dimensions:{width:26,height:48},orientation:t,scale:o,children:n.jsxRuntimeExports.jsx(M,{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"})})]}),jn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("manual-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:48},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(mt,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(M,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{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"})]})]}),hn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("filter"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(H,{dimensions:{width:52,height:34},orientation:t,color:s,scale:o,children:n.jsxRuntimeExports.jsx(M,{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 17M6 17H1M46 17H51"})})]}),Wl=e=>typeof e=="number"?{topLeft:l.xy.construct(e),topRight:l.xy.construct(e),bottomLeft:l.xy.construct(e),bottomRight:l.xy.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.xy.construct(e.topLeft),topRight:l.xy.construct(e.topRight),bottomLeft:l.xy.construct(e.bottomLeft),bottomRight:l.xy.construct(e.bottomRight)}:e,Xl=e=>{const{topLeft:t,topRight:s,bottomLeft:o,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${o.x}% / ${t.y}% ${s.y}% ${r.y}% ${o.y}%`},Kl={width:40,height:80},Jl={x:50,y:10},gn=({className:e,dimensions:t=Kl,borderRadius:s=Jl,color:o,onResize:r,...i})=>{const a=Wl(s),c=u.use();return n.jsxRuntimeExports.jsx(U,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Xl(a),borderColor:l.cssString(o??c.colors.gray.l9)},...i,children:n.jsxRuntimeExports.jsxs(Z,{children:[n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:-.5,top:a.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:101,top:a.topRight.y-1,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:-.5,top:100-a.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:101,top:100-a.bottomRight.y+1,id:"6"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},En=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:84,height:58},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(M,{d:"M42 36.5L5.41845 16.8709C3.41989 15.7985 1 17.2463 1 19.5144V53.4856C1 55.7537 3.4199 57.2015 5.41846 56.1291L42 36.5ZM42 36.5L78.5815 16.8709C80.5801 15.7985 83 17.2463 83 19.5144V53.4856C83 55.7537 80.5801 57.2015 78.5815 56.1291L42 36.5Z"}),n.jsxRuntimeExports.jsx(M,{d:"M40 1.5H27.1522C24.8526 1.5 23.4081 3.9809 24.5432 5.98082L41.1303 35.2058C41.6373 36.099 43 35.7392 43 34.7122V4.5C43 2.84315 41.6569 1.5 40 1.5Z"})]})]}),Sn=({className:e,orientation:t="left",scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("orifice"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:70,height:34},orientation:t,color:o,scale:s,children:[n.jsxRuntimeExports.jsx(M,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Rn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("needle-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:42},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(M,{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(s)}),n.jsxRuntimeExports.jsx(M,{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"})]})]}),bn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(U,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:64,height:79},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(M,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{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"}),n.jsxRuntimeExports.jsx(M,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),yn=({className:e,color:t,dimensions:s,orientation:o,units:r="psi",children:i,...a})=>{const c=l.cssString(t),x=u.use();let m="var(--pluto-gray-l0)";return t!=null&&(m=l.cssString(new l.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9))),n.jsxRuntimeExports.jsxs(U,{className:l.CSS(l.CSS.B("value"),e),...a,style:{borderColor:c,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(Z,{orientation:o,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:c},children:n.jsxRuntimeExports.jsx(u.Text,{level:"small",color:m,children:r})})]})},Cn=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(U,{orientation:s,children:[n.jsxRuntimeExports.jsx(u.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),vn=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(U,{orientation:t,children:[n.jsxRuntimeExports.jsx(u.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),je=({aetherKey:e,source:t,sink:s})=>{const o=u.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:i},a]=u.use$3({aetherKey:e,type:h.Toggle.TYPE,schema:h.toggleStateZ,initialState:{triggered:!1,enabled:!1,...o}});return d.useEffect(()=>{a(x=>({...x,...o}))},[o,a]),{toggle:d.useCallback(()=>a(x=>({...x,triggered:!x.triggered})),[a]),triggered:r,enabled:i}},wn=e=>l.direction$1.construct(e)==="x"?l.location.swap(e):e,Ql=e=>l.direction$1.construct(e)==="y"?l.location.swap(e):e,oe=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:o="left",chip:r,children:i,...a})=>n.jsxRuntimeExports.jsxs(_.Space,{direction:l.location.rotate90(o),align:"center",justify:"center",empty:!0,...a,children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:l.direction$1.construct(o),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(on,{size:"small",...r}),t&&n.jsxRuntimeExports.jsx(nn,{...s})]}),i]}),$n=u.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:o,source:r,sink:i,orientation:a="left",color:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:r,sink:i});return n.jsxRuntimeExports.jsx(I,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(oe,{...o,orientation:wn(a),children:n.jsxRuntimeExports.jsx(ln,{enabled:x,triggered:m,onClick:p,orientation:a,color:c})})})}),kn=e=>n.jsxRuntimeExports.jsx(ln,{...e}),Pn=u.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:o,source:r,sink:i,orientation:a,color:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:t,source:r,sink:i});return n.jsxRuntimeExports.jsx(I,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...e,orientation:a,children:n.jsxRuntimeExports.jsx(cn,{enabled:x,triggered:m,onClick:p,orientation:a,color:c})})})}),Ln=e=>n.jsxRuntimeExports.jsx(cn,{...e}),Tn=u.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:o="left",normallyOpen:r,color:i,source:a,sink:c,control:x})=>{const{enabled:m,triggered:p,toggle:f}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(oe,{...x,orientation:Ql(o),children:n.jsxRuntimeExports.jsx(an,{enabled:m,triggered:p,onClick:f,orientation:o,color:i,normallyOpen:r})})})}),Mn=e=>n.jsxRuntimeExports.jsx(an,{...e}),Nn=u.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...t,orientation:r,children:n.jsxRuntimeExports.jsx(rn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),Bn=e=>n.jsxRuntimeExports.jsx(rn,{...e}),_n=u.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:o,orientation:r="left",color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:wn(r),children:n.jsxRuntimeExports.jsx(dn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),Dn=e=>n.jsxRuntimeExports.jsx(dn,{...e}),On=u.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(pn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),zn=e=>n.jsxRuntimeExports.jsx(pn,{...e}),Vn=u.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:o,dimensions:r,borderRadius:i})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(gn,{onResize:a=>t({dimensions:a}),orientation:s,color:o,dimensions:r,borderRadius:i})})),An=e=>n.jsxRuntimeExports.jsx(gn,{...e,dimensions:{width:25,height:50}}),In=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(un,{orientation:s,color:o})}),Zn=e=>n.jsxRuntimeExports.jsx(un,{...e}),Fn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(En,{orientation:s,color:o})}),Hn=e=>n.jsxRuntimeExports.jsx(En,{...e}),Gn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(mn,{orientation:s,color:o})}),Yn=e=>n.jsxRuntimeExports.jsx(mn,{...e}),qn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(fn,{orientation:s,color:o})}),Un=e=>n.jsxRuntimeExports.jsx(fn,{...e}),Wn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(jn,{orientation:s,color:o})}),Xn=e=>n.jsxRuntimeExports.jsx(jn,{...e}),Kn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(hn,{orientation:s,color:o})}),Jn=e=>n.jsxRuntimeExports.jsx(hn,{...e}),Qn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Rn,{orientation:s,color:o})}),eo=e=>n.jsxRuntimeExports.jsx(Rn,{...e}),to=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(xn,{orientation:s,color:o})}),so=e=>n.jsxRuntimeExports.jsx(xn,{...e}),no=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Sn,{orientation:s,color:o})}),oo=e=>n.jsxRuntimeExports.jsx(Sn,{...e}),ro=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(bn,{orientation:s,color:o})}),lo=e=>n.jsxRuntimeExports.jsx(bn,{...e}),io=u.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:o,className:r,textColor:i,color:a,telem:c,units:x,onChange:m,tooltip:p})=>{const f=u.useTypography(s),[j,g]=d.useState({outerBox:l.box$1.ZERO,labelBox:l.box$1.ZERO}),E=(f.lineHeight+.5)*f.baseSize+2,y=u.useResize(d.useCallback(R=>{const C=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let w={...l.box$1.ZERO};C!=null&&(w=l.box$1.construct(C),w=l.box$1.resize(w,{width:l.box$1.width(w),height:l.box$1.height(w)})),g({outerBox:R,labelBox:w})},[]),{}),{zoom:b}=h.useInitialViewport(),S=ti({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:E,position:o,zoom:b,...j}),{width:v}=Qs({aetherKey:e,color:i,level:s,box:S,telem:c,minWidth:60});return n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{y:"top"},hide:p==null||p.length===0,children:[n.jsxRuntimeExports.jsx(_.Space,{direction:"y",children:p==null?void 0:p.map((R,C)=>n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:R},C))}),n.jsxRuntimeExports.jsx(I,{className:l.CSS(r,l.CSS.B("value-labeled")),ref:y,onChange:m,...t,children:n.jsxRuntimeExports.jsx(yn,{color:a,dimensions:{height:E,width:v},units:x})})]})}),ei=.9,ti=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:o,position:r,hasLabel:i,zoom:a})=>{const c=l.xy.scale(l.box$1.dims(s),1/(ei*a));return l.direction$1.construct(e)==="x"&&(r=l.xy.translateY(r,Math.max((c.y-o)/2-1,0))),i&&e==="left"?r=l.xy.translateX(r,c.x+4):i&&e==="top"&&(r=l.xy.translateY(r,c.y+4)),l.box$1.construct(r.x,r.y,l.box$1.width(t),o)},co=({color:e})=>n.jsxRuntimeExports.jsx(yn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"50.00"})}),ao=u.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Cn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),uo=e=>n.jsxRuntimeExports.jsx(Cn,{...e}),xo=u.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:o,control:r})=>{const{click:i}=Zl({aetherKey:e,sink:o});return n.jsxRuntimeExports.jsx(oe,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(vn,{label:t==null?void 0:t.label,onClick:i})})}),po=({label:e,...t})=>n.jsxRuntimeExports.jsx(vn,{label:"Button",...t}),Be=({path:e,allowNull:t=!1})=>{const{bind:s,get:o,set:r}=_e(),[i,a]=d.useState(o(e,t));if(d.useLayoutEffect(()=>(a(o(e,t)),s(e,a,!1)),[e,s,a]),i==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}return{onChange:d.useCallback(c=>r(e,c),[e,r]),...i}},si=(e,t)=>{const s=_e();d.useLayoutEffect(()=>s.bind(e,o=>t(o,s),!1),[e,s])},ni=({path:e,allowNull:t=!1})=>{const{bind:s,get:o}=_e(),[r,i]=d.useState(o(e,t));if(d.useLayoutEffect(()=>(i(o(e,t)),s(e,a=>i({...a,value:l.shallowCopy(a.value)}),!0)),[e,s,o]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},oi=({path:e,updateOnChildren:t=!1})=>{const{bind:s,get:o,set:r}=_e(),[i,a]=d.useState(o(e,!1).value);d.useLayoutEffect(()=>(a(o(e,!1).value),s(e,m=>a(l.shallowCopy(m.value)),t)),[e,s,o,a]);const c=d.useCallback(m=>{const p=l.shallowCopy(o(e,!1).value);p.push(...l.toArray(m)),r(e,p)},[e,o,r]),x=d.useCallback(m=>{const p=l.shallowCopy(o(e,!1).value);l.toArray(m).sort((j,g)=>g-j).forEach(j=>p.splice(j,1)),r(e,p)},[e,i,o]);return{value:i,push:c,remove:x}},ri=u.componentRenderProp(u.Text$1),ne=({path:e,children:t=ri,label:s,padHelpText:o=!0,visible:r=!0,hideIfNull:i=!1,...a})=>{const c=Be({path:e,allowNull:i});if(c==null)return null;if(e==null)throw new Error("Path is required");if(s==null&&(s=l.Case.capitalize(l.external.element(e,-1))),r=typeof r=="function"?r(c):r,!r)return null;const x=c.touched?c.status.message:"",{onChange:m,value:p}=c;return n.jsxRuntimeExports.jsx(de.Item,{padHelpText:o,helpText:x,label:s,...a,children:t({onChange:m,value:p})})},Bt=d.createContext({bind:()=>()=>{},set:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1}),validate:()=>!1,value:()=>({}),has:()=>!1}),_e=()=>d.useContext(Bt),li=e=>({key:e,variant:"success",message:""}),ii=({values:e,sync:t=!1,schema:s,onChange:o})=>{const r=d.useRef({state:e,status:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=u.useSyncedRef(s),a=u.useSyncedRef(o),c=d.useCallback((j,g,E)=>{var v;const{parentListeners:y,listeners:b}=r.current,S=E?y:b;return S.has(j)||S.set(j,new Set),(v=S.get(j))==null||v.add(g),()=>{var R;return(R=S.get(j))==null?void 0:R.delete(g)}},[]),x=d.useCallback((j,g)=>{const{state:E,status:y,touched:b}=r.current,S=l.external.get(E,j,g);return S==null?null:{value:S,status:y.get(j)??li(j),touched:b.has(j)}},[]),m=d.useCallback(j=>{if(i.current==null)return!0;const{state:g,status:E,listeners:y}=r.current,b=i.current.safeParse(g);if(b.success){const v=Array.from(E.keys());return E.clear(),v.forEach(R=>{var w;const C=x(R,!0);C!=null&&((w=y.get(R))==null||w.forEach($=>$(C)))}),!0}const S=new Set(b.error.issues.map(v=>v.path.join(".")));return b.error.issues.forEach(v=>{var w;const R=v.path.join(".");E.set(R,{key:R,variant:"error",message:v.message});const C=x(R,!1);(w=y.get(R))==null||w.forEach($=>$(C))}),E.forEach((v,R)=>{var C;if(!S.has(R)){E.delete(R);const w=x(R,!1);(C=y.get(R))==null||C.forEach($=>$(w))}}),!1},[]),p=d.useCallback((j,g)=>{var v,R;const{state:E,touched:y,listeners:b,parentListeners:S}=r.current;y.add(j),j.length===0?r.current.state=g:l.external.set(E,j,g),m(),(v=b.get(j))==null||v.forEach(C=>C(x(j,!1))),S.forEach((C,w)=>{if(j.startsWith(w)){const $=x(w,!1);C.forEach(P=>P($))}}),(R=a.current)==null||R.call(a,r.current.state)},[]),f=d.useCallback(j=>{const{state:g}=r.current;return l.external.has(g,j)},[]);return d.useEffect(()=>{if(!t)return;const{listeners:j}=r.current;r.current.state=e,j.forEach((g,E)=>{const y=x(E,!0);y!=null&&g.forEach(b=>b(y))})},[t,e]),d.useMemo(()=>({bind:c,set:p,get:x,validate:m,value:()=>r.current.state,has:f}),[c,p,x,m])},ci=e=>n.jsxRuntimeExports.jsx(Bt.Provider,{value:e,children:e.children}),ai=Object.freeze(Object.defineProperty({__proto__:null,Context:Bt,Field:ne,Form:ci,use:ii,useChildFieldValues:ni,useContext:_e,useField:Be,useFieldArray:oi,useFieldListener:si},Symbol.toStringTag,{value:"Module"})),ui=({value:e,onChange:t})=>{const{inner:s,outer:o}=e,r=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(_.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ie,{selected:o==="top",onClick:r({outer:"top"})}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ie,{selected:o==="left",onClick:r({outer:"left"})}),n.jsxRuntimeExports.jsxs(_.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(ie,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:r({inner:"top"})}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(ie,{selected:s==="left",onClick:r({inner:"left"})}),n.jsxRuntimeExports.jsx(ie,{selected:s==="right",onClick:r({inner:"right"})})]}),n.jsxRuntimeExports.jsx(ie,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(ie,{selected:o==="right",onClick:r({outer:"right"})})]}),n.jsxRuntimeExports.jsx(ie,{selected:o==="bottom",onClick:r({outer:"bottom"})})]})},ie=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),_t=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],re=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(_.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),we=e=>n.jsxRuntimeExports.jsx(ne,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var o;return n.jsxRuntimeExports.jsx(ui,{value:{inner:t.orientation??"top",outer:((o=t.label)==null?void 0:o.orientation)??"top"},onChange:r=>s({...t,orientation:r.inner,label:{...t.label,orientation:r.outer}})})}}),$e=({path:e})=>n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(ne,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(u.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(ne,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(Q.SelectLevel,{...t})})]}),De=e=>n.jsxRuntimeExports.jsx(ne,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...o})=>n.jsxRuntimeExports.jsx(ft.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:r=>s(r.rgba255),...o})}),mo=({path:e})=>{var m,p;const{value:t,onChange:s}=Be({path:e}),o=h.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),r=h.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=h.streamChannelValuePropsZ.parse(o.segments.valueStream.props),a=h.setChannelValuePropsZ.parse(r.segments.setter.props),c=f=>{f=f??0;const j=h.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:h.streamChannelValue({channel:f}),threshold:h.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:j})},x=f=>{f=f??0;const j=h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:f}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),g=h.authoritySource({channel:f}),E=h.acquireChannelControl({channel:f,authority:255});s({...t,sink:j,control:{...t.control,showChip:!0,chip:{sink:E,source:g},showIndicator:!0,indicator:{statusSource:g}}})};return n.jsxRuntimeExports.jsxs(re,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(de.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:i.channel,onChange:c})}),n.jsxRuntimeExports.jsx(de.Item,{label:"Output Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:a.channel,onChange:x})})]})},ke=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(mo,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color"})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=W.useStatic({tabs:_t,content:e});return n.jsxRuntimeExports.jsx(W.Tabs,{...t})},xi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(mo,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Switch$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=W.useStatic({tabs:_t,content:e});return n.jsxRuntimeExports.jsx(W.Tabs,{...t})},se=()=>n.jsxRuntimeExports.jsxs(re,{direction:"x",children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color"})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),Jt={y:2,x:.25},Qt={lower:0,upper:2e3},di=()=>n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:Jt,bounds:Qt,...t})}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:Jt,bounds:Qt,...t})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),pi=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],mi=({path:e})=>{var m;const{value:t,onChange:s}=Be({path:e}),o=h.sourcePipelinePropsZ.parse((m=t.telem)==null?void 0:m.props),r=h.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=h.stringifyNumberProps.parse(o.segments.stringifier.props),a=p=>{const f=h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:p??0}),stringifier:h.stringifyNumber({precision:i.precision??2})},outlet:"stringifier"});s({...t,telem:f})},c=p=>{const f=h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:r.channel}),stringifier:h.stringifyNumber({precision:p})},outlet:"stringifier"});s({...t,telem:f})},x=$t(r.channel);return d.useEffect(()=>{s({...t,tooltip:[x]})},[x]),n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(de.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:r.channel,onChange:a})}),n.jsxRuntimeExports.jsx(de.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(u.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:c})})]})},fi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(mi,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",children:[n.jsxRuntimeExports.jsxs(_.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Text$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=W.useStatic({tabs:pi,content:e});return n.jsxRuntimeExports.jsx(W.Tabs,{...t})},ji=({path:e})=>{var a;const{value:t,onChange:s}=Be({path:e}),o=h.sinkPipelinePropsZ.parse((a=t.sink)==null?void 0:a.props),r=h.setChannelValuePropsZ.parse(o.segments.setter.props),i=c=>{const x=h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:c}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=h.authoritySource({channel:c}),p=h.acquireChannelControl({channel:c,authority:255});s({...t,sink:x,control:{...t.control,showChip:!0,chip:{sink:p,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return n.jsxRuntimeExports.jsx(re,{direction:"y",children:n.jsxRuntimeExports.jsx(de.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Te,{value:r.channel,onChange:i})})})},hi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(ji,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(_.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx($e,{path:"label"})}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=W.useStatic({tabs:_t,content:e});return n.jsxRuntimeExports.jsx(W.Tabs,{...t})},F=4,gi=2,Ei=["threeWayValve","valve","solenoidValve","fourWayValve","angledValve","pump","tank","reliefValve","regulator","burstDisc","cap","manualValve","filter","needleValve","checkValve","orifice","angledReliefValve","value","button","switch"];Po.z.enum(Ei);const he={source:h.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:h.streamChannelValue({channel:0}),threshold:h.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:0}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Si={name:"Three Way Valve",key:"threeWayValve",Form:ke,Symbol:$n,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...he,orientation:"left"}),Preview:kn,zIndex:F},Ri={name:"Valve",key:"valve",Form:ke,Symbol:Pn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Ln,zIndex:F},bi={name:"Pneumatic Valve",key:"solenoidValve",Form:xi,Symbol:Tn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pneumatic Valve",level:"p",orientation:"top"},orientation:"left",normallyOpen:!1,...he}),Preview:Mn,zIndex:F},yi={name:"Four Way Valve",key:"fourWayValve",Form:ke,Symbol:Nn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Bn,zIndex:F},Ci={name:"Angled Valve",key:"angledValve",Form:ke,Symbol:_n,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Dn,zIndex:F},vi={name:"Pump",key:"pump",Form:ke,Symbol:On,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left",...he}),Preview:zn,zIndex:F},wi={name:"Tank",key:"tank",Form:di,Symbol:Vn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:An,zIndex:gi},$i={name:"Relief Valve",key:"reliefValve",Form:se,Symbol:In,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Zn,zIndex:F},ki={name:"Regulator",key:"regulator",Form:se,Symbol:Fn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:Hn,zIndex:F},Pi={name:"Burst Disc",key:"burstDisc",Form:se,Symbol:Gn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:Yn,zIndex:F},Li={name:"Cap",key:"cap",Form:se,Symbol:qn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:Un,zIndex:F},Ti={name:"Manual Valve",key:"manualValve",Form:se,Symbol:Wn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Xn,zIndex:F},Mi={name:"Filter",key:"filter",Form:se,Symbol:Kn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:Jn,zIndex:F},Ni={name:"Needle Valve",key:"needleValve",Form:se,Symbol:Qn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:eo,zIndex:F},Bi={name:"Check Valve",key:"checkValve",Form:se,Symbol:to,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:so,zIndex:F},_i={name:"Orifice",key:"orifice",Form:se,Symbol:no,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:oo,zIndex:F},Di={name:"Angled Relief Valve",key:"angledReliefValve",Form:se,Symbol:ro,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:lo,zIndex:F},Oi={name:"Value",key:"value",Form:fi,Symbol:io,Preview:co,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:0}),stringifier:h.stringifyNumber({precision:2})},outlet:"stringifier"})}),zIndex:F},zi={name:"Button",key:"button",Symbol:xo,Form:hi,Preview:po,defaultProps:e=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:0}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})}),zIndex:F},Vi={name:"Switch",key:"switch",Symbol:ao,Preview:uo,Form:ke,defaultProps:e=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...he}),zIndex:F},Ai={value:Oi,threeWayValve:Si,valve:Ri,solenoidValve:bi,fourWayValve:yi,angledValve:Ci,pump:vi,tank:wi,reliefValve:$i,regulator:ki,burstDisc:Pi,cap:Li,manualValve:Ti,filter:Mi,needleValve:Ni,checkValve:Bi,orifice:_i,angledReliefValve:Di,button:zi,switch:Vi},Ii=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:ro,AngledReliefValvePreview:lo,AngledValve:_n,AngledValvePreview:Dn,BurstDisc:Gn,BurstDiscPreview:Yn,Button:xo,ButtonPreview:po,Cap:qn,CapPreview:Un,CheckValve:to,CheckValvePreview:so,ControlState:oe,Filter:Kn,FilterPreview:Jn,FourWayValve:Nn,FourWayValvePreview:Bn,ManualValve:Wn,ManualValvePreview:Xn,NeedleValve:Qn,NeedleValvePreview:eo,Orifice:no,OrificePreview:oo,Pump:On,PumpPreview:zn,Regulator:Fn,RegulatorPreview:Hn,ReliefValve:In,ReliefValvePreview:Zn,SYMBOLS:Ai,SolenoidValve:Tn,SolenoidValvePreview:Mn,Switch:ao,SwitchPreview:uo,Tank:Vn,TankPreview:An,ThreeWayValve:$n,ThreeWayValvePreview:kn,Value:io,ValuePreview:co,Valve:Pn,ValvePreview:Ln},Symbol.toStringTag,{value:"Module"}));d.createContext({instrumentation:G.B.NOOP});const Zi=u.wrap$1(h.Provider$1.TYPE,({aetherKey:e,children:t,...s})=>{const o=u.useMemoDeepEqualProps(s),[{path:r},,i]=u.use$3({aetherKey:e,type:h.Provider$1.TYPE,schema:h.providerStateZ,initialState:o});return d.useEffect(()=>{i(o)},[o,i]),n.jsxRuntimeExports.jsx(u.Composite,{path:r,children:t})}),Fi="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjMgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",fo=u.wrap$1(h.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=u.use$3({aetherKey:t,type:h.BaseProvider.TYPE,schema:h.providerStateZ$1,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:e})}),Hi=Object.freeze(Object.defineProperty({__proto__:null,Provider:fo},Symbol.toStringTag,{value:"Module"})),Gi=({children:e,connParams:t,workerEnabled:s=!0,workerURL:o,theme:r,toggleTheme:i,setTheme:a,tooltip:c,triggers:x,alamos:m,haul:p,channelAlias:f})=>n.jsxRuntimeExports.jsx(u.Provider$1,{...x,children:n.jsxRuntimeExports.jsx(u.Config,{...c,children:n.jsxRuntimeExports.jsx(u.Provider$2,{...p,children:n.jsxRuntimeExports.jsx(u.Provider$3,{url:o??Fi,enabled:s,children:n.jsxRuntimeExports.jsx(u.Provider$4,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(Zi,{...m,children:n.jsxRuntimeExports.jsx(u.Aggregator,{children:n.jsxRuntimeExports.jsx(ws,{connParams:t,children:n.jsxRuntimeExports.jsx(Ps,{...f,children:n.jsxRuntimeExports.jsx(fo,{children:n.jsxRuntimeExports.jsx(u.Provider,{theme:r,toggleTheme:i,setTheme:a,children:n.jsxRuntimeExports.jsx(sn,{children:e})})})})})})})})})})})}),Yi=Object.freeze(Object.defineProperty({__proto__:null,Provider:Gi},Symbol.toStringTag,{value:"Module"})),qi=({timeRange:e})=>{const t=new l.TimeStamp(e.start),s=t.isToday?"time":"dateTime",o=new l.TimeStamp(e.end),r=o.equals(l.TimeStamp.MAX),i=o.span(t)<l.TimeSpan.DAY?"time":"dateTime";return n.jsxRuntimeExports.jsxs(_.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",children:[t.isToday&&n.jsxRuntimeExports.jsx(u.Text,{level:"p",shade:7,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:s,shade:7,weight:450,children:t}),n.jsxRuntimeExports.jsx(u.u0.Arrow.Right,{color:"var(--pluto-text-color)"}),r?n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"Now"}):n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:i,shade:7,weight:450,children:o})]})},Ui=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(u.u0.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Wi=e=>{const t=Me();return n.jsxRuntimeExports.jsx(yt,{...e,searcher:t==null?void 0:t.labels,columns:Ui,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(He,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(He,{color:s.entry.color,children:s.entry.name})})},Xi=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:Wi,TimeRangeChip:qi},Symbol.toStringTag,{value:"Module"})),Ki=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Ji=Object.freeze(Object.defineProperty({__proto__:null,Progress:Ki},Symbol.toStringTag,{value:"Module"}));exports.Aether=u.main;exports.Divider=u.Divider$1;exports.Dropdown=u.Dropdown;exports.Haul=u.Haul;exports.Worker=u.Context$1;exports.compareArrayDeps=u.compareArrayDeps;exports.componentRenderProp=u.componentRenderProp;exports.isRenderProp=u.isRenderProp;exports.useAsyncEffect=u.useAsyncEffect;exports.useClickOutside=u.useClickOutside;exports.useCombinedRefs=u.useCombinedRefs;exports.useCombinedStateAndRef=u.useCombinedStateAndRef;exports.useDebouncedCallback=u.useDebouncedCallback;exports.useEffectCompare=u.useEffectCompare;exports.useMemoCompare=u.useMemoCompare;exports.useMemoDeepEqualProps=u.useMemoDeepEqualProps;exports.usePrevious=u.usePrevious;exports.useResize=u.useResize;exports.useStateRef=u.useStateRef;exports.useSyncedRef=u.useSyncedRef;exports.useTransforms=u.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ve.external;exports.Generic=_.Generic;exports.state=G.state;exports.telem=h.external;exports.Color=ft.external;exports.Triggers=jt.external;exports.Text=Q.external;exports.List=be.external;exports.createFilterTransform=be.createFilterTransform;exports.fuseFilter=be.fuseFilter;exports.proxyMemo=be.proxyMemo;exports.Align=yo.external;exports.Button=Co.external;exports.createHexOpacityVariants=es.createHexOpacityVariants;exports.unitProperty=es.unitProperty;exports.Input=de.external;exports.Menu=vo.external;exports.Tabs=W.external;exports.Theming=wo.external;exports.Tree=$o.external;exports.Video=ko.Video;exports.Accordion=Yo;exports.Canvas=Xo;exports.Channel=Br;exports.Control=Il;exports.Diagram=_l;exports.Eraser=Yr;exports.Form=ai;exports.Line=Jo;exports.LinePlot=gr;exports.Measure=Rr;exports.Mosaic=Hr;exports.Nav=Xr;exports.OS=tl;exports.PID=Ii;exports.Pluto=Yi;exports.Progress=Ji;exports.Ranger=Xi;exports.Resize=zo;exports.Rule=br;exports.Select=pr;exports.Status=To;exports.Synnax=Tr;exports.Tag=or;exports.Telem=Hi;exports.Tooltip=Mo;exports.Value=Ol;exports.Viewport=hr;
1
+ "use strict";var So=Object.defineProperty;var Ro=(e,t,s)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ue=(e,t,s)=>(Ro(e,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-evvPGacs.cjs"),d=require("react"),u=require("./Toggle-gI8p0RTp.cjs"),l=require("./css-GrX88dMz.cjs"),Ve=require("./external-MumF6LLV.cjs"),D=require("./Center-lo-2hAUF.cjs"),Y=require("./aggregator-yaOS5ssk.cjs");require("react-hook-form");const h=require("./toggle-Q_MUr7QV.cjs"),jt=require("./external-jrqozW8h.cjs"),ht=require("./external-wyVM10Ar.cjs"),Q=require("./external-HTp9xtZn.cjs"),bo=require("react-dom"),be=require("./external-aW9whcmL.cjs"),yo=require("./external-IHwNLvQR.cjs"),Co=require("./external-CcE-7tWF.cjs"),ts=require("./color-6phEmmYG.cjs"),de=require("./external-SzIapfu1.cjs"),vo=require("./external-9J76ZORL.cjs"),X=require("./external-STz8oBh5.cjs"),wo=require("./external-Ftshae2F.cjs"),$o=require("./external-gGr-IQyL.cjs"),ko=require("./Video-gFSP_PM3.cjs"),Po=require("zod"),Lo=({variant:e,...t})=>n.jsxRuntimeExports.jsx(u.u0.Circle,{color:u.variantColors[e],...t}),To=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:u.Aggregator,Circle:Lo,Text:u.Text$2,VARIANTS:Y.VARIANTS,specZ:Y.specZ$1,useAggregator:u.useAggregator,useContext:u.useContext$2,useNotifications:u.useNotifications,variantZ:Y.variantZ},Symbol.toStringTag,{value:"Module"})),Mo=Object.freeze(Object.defineProperty({__proto__:null,Config:u.Config,Context:u.Context,Dialog:u.Dialog$1,chooseLocation:u.chooseLocation,formatTip:u.formatTip,useConfig:u.useConfig,wrap:u.wrap},Symbol.toStringTag,{value:"Module"})),Fe=e=>e.preventDefault(),Ke=d.forwardRef(({location:e,style:t,size:s,className:o,children:r,onDragStart:i,sizeUnits:a="px",showHandle:c=!0,...x},m)=>{const p=l.location.construct(e),f=l.location.direction(p),j=l.direction$1.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(p),l.CSS.dir(f),o),style:{[j]:`${s}${a}`,...t},ref:m,...x,children:[r,c&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.location.swap(p))),onDragStart:i,onDrag:Fe,onDragEnd:Fe})]})});Ke.displayName="Resize.Core";const gt=({onResize:e,count:t,initialSizes:s=[],minSize:o=100,direction:r="x"})=>{const i=d.useRef(null),[a,c]=d.useState({sizeDistribution:No(s,t),root:null}),x=d.useCallback((f,j,g)=>{if(i.current==null)return;const E=l.box$1.dim(l.box$1.construct(i.current),r);c(C=>ot(C,E,f,o,j,g))},[o,c,r]);d.useEffect(()=>e==null?void 0:e(a.sizeDistribution),[a.sizeDistribution,e]);const m=d.useCallback((f,j)=>{f.preventDefault();const g=r==="x"?"clientX":"clientY",E=b=>x(j,b[g]),C=()=>{c(b=>({...b,root:null})),document.removeEventListener("mousemove",E)};c(b=>({...b,root:f[g]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",C,{once:!0})},[c,r,ot]);return{setSize:d.useCallback((f,j)=>x(f,void 0,j),[ot]),props:{direction:r,sizeDistribution:a.sizeDistribution,onDragHandle:m,ref:i}}},Je=d.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:o,className:r,...i},a)=>{const c=l.direction$1.construct(e),x=d.Children.toArray(t);return n.jsxRuntimeExports.jsx(D.Space,{...i,ref:a,direction:c,className:l.CSS(l.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:x.map((m,p)=>n.jsxRuntimeExports.jsx(Ke,{onDragStart:f=>o(f,p),location:l.direction$1.location(c),size:s[p]*100,sizeUnits:"%",showHandle:p!==x.length-1,children:m},p))})});Je.displayName="Resize.Multiple";const No=(e,t)=>{const s=e.reduce((r,i)=>r+i,0),o=t-e.length;if(o<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(o).fill(r/o)]}return e.map(()=>1/t)},ot=(e,t,s,o,r,i)=>{const a=ss(e,t,s,r,i),[c,x]=Bo(e.sizeDistribution,s,a,o/t),m=x?r??null:e.root;return{...e,sizeDistribution:c,root:m}},ss=(e,t,s,o,r)=>{let i;if(r!=null)r>1&&(r=r/t),i=r-e.sizeDistribution[s];else if(o!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(o-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Bo=(e,t,s,o)=>{let r=t;for(;r>0&&e[r]+s<=o;)r--;const i=e[r]+s,a=_o(r,e,o,s),c=e[a]-s;return i<o||c<o?[e,!1]:[e.map((x,m)=>m===r?i:m===a?c:x),!0]},_o=(e,t,s,o)=>(e===t.length-1?Oo:Do)(e,t,s,o),Do=(e,t,s,o)=>{let r=e+1;for(;r<t.length-1&&t[r]-o<=s;)r++;return r},Oo=(e,t,s,o)=>{let r=e-1;for(;r>0&&t[r]-o<=s;)r--;return r},Qe=({onMove:e,onStart:t,onEnd:s})=>d.useCallback(o=>{o.preventDefault();const r=l.xy.construct(o),i=u.mouseKey(o.button);t==null||t(r,i,o);const a=x=>{if(x.buttons===0)return c(x);const m=l.xy.construct(x);e==null||e(l.box$1.construct(r,m),i,x)};window.addEventListener("mousemove",a);const c=x=>{window.removeEventListener("mousemove",a);const m=l.xy.construct(x);s==null||s(l.box$1.construct(r,m),i,x)};window.addEventListener("mouseup",c,{once:!0})},[e,t,s]),rt=2,ns=({onCollapse:e,onResize:t,location:s="left",minSize:o=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:a=1/0,className:c,...x})=>{const[m,p]=d.useState(l.clamp(i,o,r)),f=d.useRef(null),j=l.location.construct(s),g=d.useCallback(R=>{if(f.current===null)return 0;const y=l.box$1.dim(R,l.location.direction(j),!0)*(1-2*Number(["bottom","right"].includes(j))),$=f.current+y,w=l.clamp($,o,r);return(w-$)/o>a?rt:w},[j,o,r,a]),E=d.useRef(null),C=d.useCallback(R=>{const y=g(R);p(y),E.current!=null&&(t==null||t(y,l.box$1.construct(E.current)))},[t,g]),b=d.useCallback(()=>p(R=>(f.current=R,R)),[p]),S=d.useCallback(R=>g(R)===rt&&(e==null?void 0:e()),[e,g]);d.useEffect(()=>p(R=>{const y=l.clamp(R,o,r);return f.current=y,y}),[o,r]);const v=Qe({onMove:C,onStart:b,onEnd:S});return n.jsxRuntimeExports.jsx(Ke,{ref:E,location:j,size:m,onDragStart:v,className:l.clsx(c,l.CSS.expanded(m!==rt)),...x})},zo=Object.freeze(Object.defineProperty({__proto__:null,Core:Ke,Multiple:Je,Single:ns,calculateDiffPercentage:ss,useMultiple:gt},Symbol.toStringTag,{value:"Module"})),Ae="y",Ot=28,Vo=32,Ao=40,Io=.5,Zo=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:o,ref:r,...i}}=gt({direction:Ae,count:e.length,minSize:Ot}),a=c=>{if(r.current==null)return;const x=l.box$1.dim(l.box$1.construct(r.current),Ae);o[c]<Ao/x?s(c,e[c].initialSize??Io):s(c,Ot+1)};return n.jsxRuntimeExports.jsx(Je,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:o,ref:r,...t,...i,children:e.map((c,x)=>d.createElement(Go,{...c,key:c.key,index:x,direction:Ae,onExpand:a,parent:r,size:o[x]}))})},Fo=n.jsxRuntimeExports.jsx(u.u0.Caret.Down,{"aria-label":"contract"}),Ho=n.jsxRuntimeExports.jsx(u.u0.Caret.Right,{"aria-label":"expand"}),Go=({index:e,name:t,content:s,actions:o,size:r,parent:i,onExpand:a})=>{let c=!0;if(i.current!=null){const m=l.box$1.dim(l.box$1.construct(i.current),Ae);c=r*m>Vo}const x=c?Fo:Ho;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Ve.Header,{level:"p",className:l.CSS.expanded(c),empty:!0,children:[n.jsxRuntimeExports.jsx(Ve.ButtonTitle,{startIcon:x,onClick:()=>a(e),children:t}),o!=null&&n.jsxRuntimeExports.jsx(Ve.Actions,{children:o})]}),s]})},Yo=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Zo},Symbol.toStringTag,{value:"Module"})),te="channel",zt=(e,t)=>{if(t.current==null)return{display:"none"};const s={},o=l.box$1.construct(t.current.parentElement),r=l.box$1.construct(t.current);return e.x>.8?s.right=`${(1-e.x)*l.box$1.width(o)-l.box$1.width(r)}px`:e.x<.2?s.left=`${e.x*l.box$1.width(o)}px`:s.left=`${e.x*100}%`,e.y>.8?s.bottom=`${(1-e.y)*l.box$1.height(o)-l.box$1.height(r)}px`:e.y<.2?s.top=`${e.y*l.box$1.height(o)}px`:s.top=`${e.y*100}%`,s},os=d.memo(({className:e,value:t,onChange:s,style:o,draggable:r=!0,...i})=>{const[a,c]=Y.usePurePassthrough({value:t,onChange:s,initial:l.xy.construct(.1,.01)}),x=d.useRef(a),m=u.useSyncedRef(!r),p=d.useRef(null),[f,j]=d.useState({});a!==null&&(o={...o,...f});const g=d.useCallback(b=>{p.current=b,j(zt(l.xy.construct(a),p))},[]),E=d.useCallback(b=>{var w;if(((w=p.current)==null?void 0:w.parentElement)==null)return x.current;const S=l.box$1.construct(p.current.parentElement),v=l.box$1.reRoot(l.box$1.DECIMAL,l.location.TOP_LEFT),R=l.scale.XY.scale(S).scale(v),y=R.box(l.box$1.construct(p.current));return l.scale.XY.clamp(l.box$1.construct(l.box$1.topLeft(v),{width:l.box$1.width(v)-l.box$1.width(y),height:l.box$1.height(v)-l.box$1.height(y)})).pos(l.xy.translate(l.xy.construct(x.current),l.box$1.signedDims(R.box(b))))},[]),C=Qe({onMove:d.useCallback(b=>{if(m.current)return;const S=E(b);j(zt(l.xy.construct(S),p))},[c]),onEnd:d.useCallback(b=>{m.current||(x.current=E(b))},[])});return n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:o,onDragStart:C,draggable:r,ref:g,...i,onDrag:Fe,onDragEnd:Fe,empty:!0})});os.displayName="Legend.Container";const rs=({data:e=[],onEntryChange:t,position:s,onPositionChange:o,...r})=>{const[i,a]=d.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(os,{...r,draggable:!i,value:s,onChange:o,children:e.sort((c,x)=>c.label.localeCompare(x.label)).map(({key:c,color:x,label:m})=>n.jsxRuntimeExports.jsxs(D.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(jt.Swatch,{value:x,onChange:p=>t==null?void 0:t({key:c,color:p,label:m}),onVisibleChange:a,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(u.MaybeEditable,{level:"small",value:m,onChange:p=>t==null?void 0:t({key:c,color:x,label:p}),noWrap:!0})]},c))})},qo={region:l.box$1.ZERO,dpr:1,os:l.external$1.getOS()},Uo={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Wo=u.wrap$1(h.Canvas.TYPE,({children:e,resizeDebounce:t=100,className:s,aetherKey:o,...r})=>{const[{path:i},{bootstrapped:a},c]=u.use$3({aetherKey:o,type:h.Canvas.TYPE,schema:h.canvasStateZ,initialState:qo}),x=d.useRef({...Uo}),m=d.useCallback(j=>{x.current.bootstrapped&&c(()=>({bootstrapped:!0,region:j,dpr:window.devicePixelRatio,os:l.external$1.getOS({default:"Windows"})}))},[c]),p=u.useResize(m,{debounce:t}),f=d.useCallback(j=>{if(p(j),j==null)return;j.className.includes("gl")?x.current.gl=j:j.className.includes("upper2d")?x.current.upper2d=j:x.current.lower2d=j;const{gl:g,lower2d:E,upper2d:C,bootstrapped:b}=x.current;if(g==null||E==null||C==null||b)return;x.current.bootstrapped=!0;const S=g.transferControlToOffscreen(),v=C.transferControlToOffscreen(),R=E.transferControlToOffscreen();c({glCanvas:S,upper2dCanvas:v,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:l.box$1.construct(g),dpr:window.devicePixelRatio,os:l.external$1.getOS({default:"Windows"})},[S,v,R])},[c]);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","lower2d"),s),...r}),n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","gl"),s),...r}),n.jsxRuntimeExports.jsx("canvas",{ref:f,className:l.CSS(l.CSS.BM("canvas","upper2d"),s),...r}),n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:a&&e})]})}),Et=e=>u.useResize(d.useCallback((t,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");if(o==null)return;const r=l.box$1.construct(o);t=l.scale.XY.translate(l.xy.scale(l.box$1.topLeft(r),-1)).box(t),e(t,s)},[e])),Xo=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Wo,useRegion:Et},Symbol.toStringTag,{value:"Module"})),ls=d.createContext(null),pe=e=>{const t=d.useContext(ls);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},is=e=>{const t=pe("Viewport"),{addViewportHandler:s}=t;d.useEffect(()=>s(e),[s,e])},St=(e,t)=>{const{setAxis:s,removeAxis:o}=pe(t),{key:r}=e;return u.useEffectCompare(()=>{l.location.outer.parse(e.loc),s(e)},([c],[x])=>l.external.equal(c,x),[e]),d.useEffect(()=>()=>o(r),[]),{gridArea:l.direction$1.swap(l.location.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},cs=u.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverscan:o,children:r,hold:i,...a})=>{const[c,x,m]=u.useCombinedStateAndRef([]),p=u.useMemoDeepEqualProps({clearOverscan:o,hold:i}),[{path:f},{grid:j},g]=u.use$3({aetherKey:e,type:h.LinePlot.TYPE,schema:h.linePlotStateZ,initialState:{container:l.box$1.ZERO,viewport:l.box$1.DECIMAL,grid:{},...p}});d.useEffect(()=>g(L=>({...L,...p})),[p]);const E=d.useRef(new Map),C=d.useCallback(L=>(E.current.set(L,null),()=>E.current.delete(L)),[E]),b=d.useCallback(L=>{const{mode:B,box:V,stage:T}=L;(B==="pan"&&T!=="start"||B==="zoom"||B==="zoomReset"&&T==="start")&&g(M=>({...M,viewport:V})),E.current.forEach((M,z)=>z(L))},[g]),S=d.useCallback(L=>g(B=>({...B,container:L})),[g]),v=Et(S),R=d.useCallback(L=>g(B=>({...B,grid:{...B.grid,[L.key]:L}})),[g]),y=d.useCallback(L=>g(B=>{const{[L]:V,...T}=B.grid;return{...B,grid:T}}),[g]),$=d.useCallback(L=>{x(B=>[...B.filter(({key:V})=>V!==L.key),L])},[x,b]),w=d.useCallback(L=>x(B=>B.filter(({key:V})=>V!==L)),[$]),P=d.useMemo(()=>Ko(j),[j]),N=d.useMemo(()=>({lines:c,setAxis:R,removeAxis:y,setLine:$,removeLine:w,setViewport:b,addViewportHandler:C}),[c,R,y,$,w,b,C]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...P},ref:v,...a,children:n.jsxRuntimeExports.jsx(ls.Provider,{value:N,children:n.jsxRuntimeExports.jsx(u.Composite,{path:f,children:r})})})}),Ko=e=>{const t=l.CSS.newGridBuilder();return h.filterGridPositions("top",e).forEach(({key:s,size:o})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,o)),t.addRow("plot-start","plot-end","minmax(0, 1fr)"),h.filterGridPositions("bottom",e).forEach(({key:s,size:o})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,o)),h.filterGridPositions("left",e).forEach(({key:s,size:o})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,o)),t.addColumn("plot-start","plot-end","minmax(0, 1fr)"),h.filterGridPositions("right",e).forEach(({key:s,size:o})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,o)),t.build()},as=({className:e,style:t,onLineChange:s,...o})=>{const{lines:r}=pe("Legend");return pe("Legend"),n.jsxRuntimeExports.jsx(rs,{data:r,onEntryChange:s,...o})},us=u.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=u.use$3({aetherKey:e,type:h.Line.TYPE,schema:h.stateZ,initialState:t}),o=u.useMemoDeepEqualProps(t);return d.useLayoutEffect(()=>s(o),[o]),null}),Jo=Object.freeze(Object.defineProperty({__proto__:null,Line:us},Symbol.toStringTag,{value:"Module"})),Rt=u.wrap$1("Line",({aetherKey:e,color:t,label:s="",...o})=>{const{setLine:r,removeLine:i}=pe("Line");return d.useEffect(()=>(r({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(us,{aetherKey:e,color:t,label:s,...o})}),xs=({level:e="h2",...t})=>{const s=u.useUniqueKey(),o=u.useTypography(e),r=St({key:s,size:(o.lineHeight+2)*o.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(D.Space,{justify:"center",align:"center",style:r,children:n.jsxRuntimeExports.jsx(u.MaybeEditable,{...t,level:e})})},Qo={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},bt=d.forwardRef(({className:e,mode:t,maskBox:s,children:o,style:r,...i},a)=>n.jsxRuntimeExports.jsxs("div",{ref:a,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:Qo[t],...r},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.box$1.css(s),display:l.box$1.isZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),o]}));bt.displayName="ZoomPanMask";const ut=4,er=["zoom","pan","select","zoomReset"],Ie=[...er,"click"],ds=["zoom","select"],Ze={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},ps={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},ms={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},yt={zoom:Ze,pan:ps,select:ms,zoomReset:Ze,click:Ze},tr=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,o])=>s==="defaultMode"?[s,o]:[s,o.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},sr=l.box$1.construct(0,0,1,1,l.location.TOP_LEFT),nr={width:30,height:50},fs=({onChange:e,triggers:t,initial:s=sr,threshold:o=nr,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[a,c]=d.useState(l.box$1.ZERO),[x,m]=d.useState(i),[p,f]=u.useStateRef(s),j=d.useRef(null),g=l.dimensions.construct(o);d.useEffect(()=>f(()=>l.box$1.truncate(s,3)),[s]),d.useEffect(()=>m(i),[i]);const[E,C,b,S]=u.useMemoCompare(()=>{const w={...yt[i],...t},P=u.flattenConfig(w),N=tr(w);return[w,P,N,u.flattenConfig(N)]},u.compareModeConfigs,[t]),v=d.useCallback(({box:w,triggers:P,stage:N,cursor:L})=>{if(j.current==null)return;const B=u.determineMode(E,P),V=l.box$1.construct(j.current);if(B==null)return;if(B==="zoomReset")return c(l.box$1.ZERO),e==null||e({box:l.box$1.DECIMAL,mode:B,stage:N,cursor:L}),f(l.box$1.DECIMAL);if(N==="end"){if(l.box$1.width(w)<5&&l.box$1.height(w)<5){B==="zoom"&&c(l.box$1.ZERO),e==null||e({box:p.current,mode:"click",stage:N,cursor:L});return}return f(M=>{if(B==="pan"){const G=Vt(w,M,V);return G===null?M:(e==null||e({box:G,mode:B,stage:N,cursor:L}),G)}const z=R(w,M,V);return z===null?M:(e==null||e({box:z,mode:B,stage:N,cursor:L}),B==="zoom"?(c(l.box$1.ZERO),z):l.box$1.truncate(M,ut))})}if(ds.includes(B))return l.box$1.height(w)<5&&l.box$1.width(w)<5?void 0:c(l.scale.XY.scale(V).clamp(V).translate({x:-l.box$1.left(V),y:-l.box$1.top(V)}).box(At(g,w,V)));c(M=>l.box$1.isZero(M)?M:l.box$1.ZERO);const T=Vt(w,p.current,V);l.box$1.equals(T,p.current)||e==null||e({box:T,mode:B,stage:N,cursor:L})},[c,m,e,E,o.height,o.width,f,j]);d.useImperativeHandle(r,()=>({reset:()=>{c(l.box$1.ZERO),f(l.box$1.DECIMAL),e==null||e({box:l.box$1.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.xy.ZERO})}}),[e]);const R=d.useCallback((w,P,N)=>l.box$1.truncate(xt(P,N).box(At(g,w,N)),ut),[o]),y=u.useHeldRef({triggers:[["Control"]]});d.useEffect(()=>{const w=P=>{if(j.current==null)return;let N=1;P.deltaY<0?N+=.03:N-=.03;const L=l.box$1.construct(j.current),B=l.xy.construct(P);if(!l.box$1.contains(L,B)||P.target!==j.current)return;const T=xt(p.current,l.box$1.construct(j.current)).pos(l.xy.construct(P));let z=l.scale.XY.magnify({x:y.current.held?1:N,y:N}).box(p.current);z=l.box$1.translate(z,{x:y.current.held?0:T.x*(1-N),y:T.y*(1-N)}),f(z),e==null||e({stage:"end",box:z,cursor:l.xy.construct(P),mode:"zoom"})};return window.addEventListener("wheel",w),()=>window.removeEventListener("wheel",w)},[f,e]),ht.useDrag({bound:j,onDrag:v,triggers:C,loose:!0});const $=d.useCallback(({triggers:w,stage:P})=>{if(P==="end")return m(i);const N=u.determineMode(b,w);N!=null&&m(N)},[b,i,e]);return u.use$2({triggers:S,callback:$,region:j}),{maskBox:a,ref:j,mode:x}},xt=(e,t)=>l.scale.XY.scale(t).clamp(t).scale(e),Vt=(e,t,s)=>{let o=l.box$1.signedDims(xt(t,s).box(e));return o={signedWidth:-o.signedWidth,signedHeight:-o.signedHeight},l.box$1.truncate(l.scale.XY.translate(l.xy.construct(o)).box(t),ut)},At=(e,t,s)=>l.box$1.height(t)<=e.height?l.box$1.construct(l.box$1.left(t),l.box$1.top(s),l.box$1.width(t),l.box$1.height(s)):l.box$1.width(t)<=e.width?l.box$1.construct(l.box$1.left(s),l.box$1.top(t),l.box$1.width(s),l.box$1.height(t)):t,js=e=>n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(u.u0.Close,{"aria-label":"clear"})}),He=({children:e="",size:t="medium",variant:s="filled",color:o,icon:r,onClose:i,className:a,onDragStart:c,...x})=>{const m=l.cssString(o);r==null&&o!=null&&(r=n.jsxRuntimeExports.jsx(u.u0.Circle,{fill:m}));const p=i==null?void 0:n.jsxRuntimeExports.jsx(u.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:f=>{f.stopPropagation(),i()},children:n.jsxRuntimeExports.jsx(u.u0.Close,{})});return n.jsxRuntimeExports.jsx(u.WithIcon,{startIcon:r,endIcon:p,className:l.CSS(a,l.CSS.B("tag"),i!=null&&l.CSS.BM("tag","closeable")),level:Y.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:c,...x,children:e})},or=Object.freeze(Object.defineProperty({__proto__:null,Tag:He},Symbol.toStringTag,{value:"Module"})),Ct=({onChange:e,value:t,location:s,className:o,data:r,columns:i=[],tagKey:a="key",emptyContent:c,searcher:x,renderTag:m,placeholder:p,onTagDragStart:f,allowMultiple:j,allowNone:g,replaceOnSingle:E,onTagDragEnd:C,style:b,...S})=>{const{visible:v,open:R,close:y}=u.use$1(),[$,w]=d.useState([]),[P,N]=d.useState(!1),L=x!=null;u.useAsyncEffect(async()=>{N(!0),u.selectValueIsZero(t)&&w([]);const T=$.map(G=>G.key),M=l.toArray(t);if(l.compare.unorderedPrimitiveArrays(T,M)===l.compare.EQUAL)return;let z=[];if(L)try{z=await x.retrieve(M)}finally{N(!1)}else r!=null&&(z=r.filter(G=>M.includes(G.key)));w(z)},[x,L,t,r]);const B=d.useCallback((T,M)=>{w(M.entries),e(T,M)},[e]),V=d.useMemo(()=>L?u.Search:be.Filter,[L]);return n.jsxRuntimeExports.jsx(Q.Core,{close:y,open:R,data:r,emtpyContent:c,visible:v,value:t,onChange:B,allowNone:g,replaceOnSingle:E,columns:i,allowMultiple:!0,...S,children:n.jsxRuntimeExports.jsx(V,{searcher:x,children:({onChange:T,value:M})=>n.jsxRuntimeExports.jsx(rr,{value:M,selectedKeys:t,className:o,onChange:T,loading:P,selected:$,onFocus:R,tagKey:a,visible:v,renderTag:m,placeholder:p,onTagDragStart:f,onTagDragEnd:C,style:b})})})},rr=({selectedKeys:e,loading:t,selected:s,onChange:o,onFocus:r,visible:i,tagKey:a,renderTag:c=u.componentRenderProp(hs),placeholder:x="Select...",onTagDragStart:m,onTagDragEnd:p,value:f,className:j,...g})=>{const{onSelect:E,clear:C}=u.useSelectionUtils(),b=d.useRef(null);d.useLayoutEffect(()=>{var y;i&&((y=b.current)==null||y.focus())},[i,s]);const S=y=>{i||o(""),r==null||r()},v=y=>{i||r==null||r()},R=()=>{i||o("")};return n.jsxRuntimeExports.jsxs(u.Text$1,{ref:b,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),j),onBlur:R,placeholder:x,value:f,onChange:o,onFocus:S,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:v,...g,children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:l.toArray(e).map((y,$)=>{const w=s[$];return c({key:y,entryKey:y,tagKey:a,loading:t,entry:w,onClose:()=>E==null?void 0:E(y),onDragStart:P=>m==null?void 0:m(P,y),onDragEnd:P=>p==null?void 0:p(P,y)})})}),n.jsxRuntimeExports.jsx(js,{onClick:C})]})},hs=({entryKey:e,tagKey:t,entry:s,loading:o,...r})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),d.createElement(He,{size:"small",variant:"outlined",className:l.CSS(s==null&&!o&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},l.convertRenderV(i))},gs=({onChange:e,value:t,tagKey:s="key",columns:o=[],data:r,emptyContent:i,inputProps:a,allowNone:c,searcher:x,className:m,variant:p,hideColumnHeader:f=!1,disabled:j,...g})=>{const{visible:E,open:C,close:b}=u.use$1(),[S,v]=d.useState(null),R=x!=null;u.useAsyncEffect(async()=>{if((S==null?void 0:S.key)===t)return;if(u.selectValueIsZero(t))return v(null);let w=null;if(R){const[P]=await x.retrieve([t]);w=P??null}else r!=null&&(w=r.find(P=>P.key===t)??null);v(w)},[x,t]);const y=d.useCallback((w,P)=>{v(w==null?null:P.entries[0]),b(),e(w,P)},[e,c]),$=d.useMemo(()=>R?u.Search:be.Filter,[R]);return n.jsxRuntimeExports.jsx(Q.Core,{close:b,open:C,data:r,emtpyContent:i,allowMultiple:!1,visible:E,value:t,hideColumnHeader:f,onChange:y,allowNone:c,columns:o,...g,children:n.jsxRuntimeExports.jsx($,{searcher:x,children:({onChange:w})=>n.jsxRuntimeExports.jsx(lr,{variant:p,onChange:w,onFocus:C,selected:S,tagKey:s,visible:E,allowNone:c,className:m,disabled:j})})})},lr=({tagKey:e,selected:t,visible:s,onChange:o,onFocus:r,allowNone:i=!0,debounceSearch:a=250,placeholder:c="Select...",className:x,...m})=>{const{clear:p}=u.useSelectionUtils(),[f,j]=d.useState("");d.useEffect(()=>{if(!s){if(l.primitiveIsZero(t==null?void 0:t.key))return j("");if(t!=null)return j(typeof e=="function"?e(t).toString():(t==null?void 0:t[e]).toString())}},[t,s,e]);const g=S=>{o(S),j(S)},E=S=>{j(""),r==null||r()},C=S=>{s||(S.preventDefault(),r==null||r())},b=()=>{j(""),p==null||p()};return n.jsxRuntimeExports.jsx(u.Text$1,{className:l.CSS(l.CSS.BE("select","input"),x),value:f,onChange:g,onFocus:E,style:{flexGrow:1},onClick:C,placeholder:c,...m,children:i&&n.jsxRuntimeExports.jsx(js,{onClick:b})})},ir=[{key:"x",icon:n.jsxRuntimeExports.jsx(u.u0.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(u.u0.Arrow.Down,{})}],cr=({key:e,entry:t,onClick:s,selected:o})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:o?"filled":"outlined",onClick:s,children:t.icon},e),ar=({children:e=cr,allowMultiple:t=!1,...s})=>n.jsxRuntimeExports.jsx(Q.Button,{...s,data:ir,children:e}),ur=l.DataType.ALL.filter(e=>e!==l.DataType.UNKNOWN).map(e=>({key:e.toString(),name:l.Case.capitalize(e.toString())})),xr=[{key:"name",name:"Name"}],dr=e=>n.jsxRuntimeExports.jsx(Q.DropdownButton,{...e,data:ur,columns:xr,tagKey:"name"}),pr=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Q.BaseButton,Button:Q.Button,DataType:dr,Direction:ar,DropdownButton:Q.DropdownButton,Multiple:Ct,MultipleTag:hs,Single:gs,defaultButton:Q.defaultButton},Symbol.toStringTag,{value:"Module"})),mr=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:l.Case.capitalize(e)}),n.jsxRuntimeExports.jsx(ht.Text,{trigger:t[0],level:"small"})]}),fr={zoom:n.jsxRuntimeExports.jsx(u.u0.Zoom,{}),pan:n.jsxRuntimeExports.jsx(u.u0.Pan,{}),select:n.jsxRuntimeExports.jsx(u.u0.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(u.u0.Expand,{}),click:n.jsxRuntimeExports.jsx(u.u0.Bolt,{})},jr=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const o=Object.entries(e).filter(([r])=>!t.includes(r)&&Ie.includes(r)).map(([r,i])=>({key:r,icon:fr[r],tooltip:n.jsxRuntimeExports.jsx(mr,{mode:r,triggers:i})})).sort((r,i)=>Ie.indexOf(r.key)-Ie.indexOf(i.key));return n.jsxRuntimeExports.jsx(Q.Button,{...s,data:o,entryRenderKey:"icon",children:({title:r,entry:i,...a})=>d.createElement(u.Icon,{...a,key:i.key,variant:a.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},hr=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:yt,MASK_MODES:ds,MODES:Ie,Mask:bt,PAN_DEFAULT_TRIGGERS:ps,SELECT_DEFAULT_TRIGGERS:ms,SelectMode:jr,ZOOM_DEFAULT_TRIGGERS:Ze,use:fs},Symbol.toStringTag,{value:"Module"})),Es=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ss=d.forwardRef(({children:e,initial:t=l.box$1.DECIMAL,onChange:s,...o},r)=>{const{setViewport:i}=pe("Viewport");d.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.xy.ZERO,stage:"start"})},[i,t]);const a=d.useCallback(x=>{i(x),s==null||s(x)},[s,i]),c=fs({onChange:a,initial:t,ref:r,...o});return n.jsxRuntimeExports.jsx(bt,{className:l.CSS.BE("line-plot","viewport"),...c,children:e})}),vt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?h.XAxis.TYPE:h.YAxis.TYPE,o=`${e}-axis`;return u.wrap$1(s,({aetherKey:r,children:i,resizeDebounce:a=0,location:c=t,label:x="",labelLevel:m="small",labelDirection:p=e,onLabelChange:f,color:j,labelSize:g,showGrid:E,type:C,bounds:b,className:S,tickSpacing:v,autoBounds:R,autoBoundUpdateInterval:y,onAutoBoundsChange:$,style:w,...P})=>{const N=((x==null?void 0:x.length)??0)>0,L=u.useMemoDeepEqualProps({location:c,showGrid:E,type:C,bounds:b,label:x,labelDirection:p,tickSpacing:v,autoBounds:R,autoBoundUpdateInterval:y}),[{path:B},{size:V,labelSize:T,...M},z]=u.use$3({aetherKey:r,type:s,schema:h.coreAxisStateZ,initialState:L});d.useEffect(()=>z(ae=>({...ae,...L})),[L]),d.useEffect(()=>{const{lower:ae,upper:K}=h.parseAutoBounds(M.autoBounds);M.bounds!=null&&(ae&&(b==null?void 0:b.lower)!==M.bounds.lower||K&&(b==null?void 0:b.upper)!==M.bounds.upper)&&($==null||$(M.bounds))},[M.autoBounds,M.bounds]);const G=St({loc:c,key:`${s}-${r}`,size:V+T,order:"last"},"XAxis"),le=u.useTypography(m).toString(),ge=d.useRef(0);return d.useEffect(()=>{if(e==="y"){if(x==null)return;let K=Y.dimensions(x,le)[l.direction$1.dimension(l.direction$1.construct(p))];K>0&&(K+=6),z(Ee=>({...Ee,labelSize:K}))}else{const K=Y.dimensions(x,le).height+12,Ee=ge.current;h.withinSizeThreshold(Ee,K)||(ge.current=K,z(Oe=>({...Oe,labelSize:K})))}},[x,p,le]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(S,l.CSS.B("axis"),l.CSS.B(o),l.CSS.loc(c)),style:{...w,...G},align:"center",justify:e==="x"?"end":"start",direction:l.direction$1.swap(e),...P,children:N&&n.jsxRuntimeExports.jsx(u.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:x,onChange:f,level:m})}),n.jsxRuntimeExports.jsx(u.Composite,{path:B,children:i})]})})},Rs=vt("x"),bs=vt("y"),gr=Object.freeze(Object.defineProperty({__proto__:null,Legend:as,Line:Rt,LinePlot:cs,Title:xs,Viewport:Ss,XAxis:Rs,YAxis:bs,axisFactory:vt,selectViewportEl:Es,useContext:pe,useGridPosition:St,useViewport:is},Symbol.toStringTag,{value:"Module"})),Er=u.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:h.Tooltip.TYPE,schema:h.tooltipStateZ,initialState:{position:null}}),s=d.useRef(null),o=d.useCallback(i=>t({position:l.xy.construct(i)}),[t]),r=d.useCallback(()=>t({position:null}),[t]);return d.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",o),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",o),i.removeEventListener("mouseleave",r)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),ys={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Sr=u.flattenConfig(ys),Cs=u.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:h.Measure.TYPE,schema:h.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=d.useRef(null),o=u.useHeldRef({triggers:Sr,loose:!0}),r=d.useCallback(({mode:c,cursor:x})=>{if(c==="click"){const m=u.determineMode(ys,o.current.triggers,!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,o]);is(r);const i=d.useCallback(c=>t(x=>({...x,hover:l.xy.construct(c)})),[t]),a=d.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return d.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",a)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),Rr=Object.freeze(Object.defineProperty({__proto__:null,Measure:Cs},Symbol.toStringTag,{value:"Module"})),wt=u.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:o,onPositionChange:r,units:i="",color:a,lineWidth:c,lineDash:x})=>{const[m,p]=Y.usePurePassthrough({value:t,onChange:o,initial:""}),[,{position:f,pixelPosition:j},g]=u.use$3({aetherKey:e,type:h.Rule.TYPE,schema:h.ruleStateZ,initialState:{color:a,dragging:!1,position:s,lineWidth:c,lineDash:x}});d.useEffect(()=>{if(f==null)return;if(s==null)return r==null?void 0:r(f);const y=l.bounds.construct(f+.01,f-.01);s!=null&&!l.bounds.contains(y,s)&&(r==null||r(Math.trunc(f*100)/100))},[f]);const E=d.useRef(j);j!==E.current&&(E.current=j);const C=d.useRef(j);d.useEffect(()=>{g(y=>({...y,position:s,color:a,lineWidth:c,lineDash:x}))},[s,a,c,x]);const b=Qe({onStart:d.useCallback(()=>{g(y=>({...y,dragging:!0})),C.current=E.current},[]),onMove:y=>{g($=>({...$,pixelPosition:(C.current??0)+l.box$1.signedHeight(y)}))},onEnd:d.useCallback(()=>{g(y=>({...y,dragging:!1})),C.current=j},[])}),S=d.useRef(null);if(f==null||j==null)return null;const v=Es(S==null?void 0:S.current),R=n.jsxRuntimeExports.jsxs("div",{ref:S,className:l.CSS.B("rule"),style:{top:`calc(${j}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:b,draggable:!0}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(u.Editable,{level:"p",value:m,onChange:p}),n.jsxRuntimeExports.jsx(u.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return v==null?R:bo.createPortal(R,v)}),br=Object.freeze(Object.defineProperty({__proto__:null,Rule:wt},Symbol.toStringTag,{value:"Module"})),vs=u.canDropOfType(te),yr=({lines:e,axes:t,showTitle:s=!0,title:o="",onTitleChange:r,showLegend:i=!0,titleLevel:a="h4",onLineChange:c,onRuleChange:x,onAxisChannelDrop:m,onAxisChange:p,rules:f,enableTooltip:j=!0,enableMeasure:g=!1,initialViewport:E=l.box$1.DECIMAL,onViewportChange:C,viewportTriggers:b,...S})=>{var w;const v=t.filter(({location:P})=>l.location.isY(P)),R=d.useRef(),y=u.usePrevious(e.length),$=u.usePrevious(S.hold);return(y===0&&e.length!==0||$===!0&&S.hold===!1)&&((w=R.current)==null||w.reset()),n.jsxRuntimeExports.jsxs(cs,{...S,children:[v.map((P,N)=>{const L=e.filter(T=>T.axes.x===P.key),B=t.filter(({location:T})=>l.location.isX(T)),V=f==null?void 0:f.filter(T=>[...B.map(({key:M})=>M),P.key].includes(T.axis));return n.jsxRuntimeExports.jsx(Cr,{axis:P,index:N,lines:L,yAxes:B,rules:V,onAxisChannelDrop:m,onAxisChange:p},P.key)}),i&&n.jsxRuntimeExports.jsx(as,{onLineChange:c}),s&&n.jsxRuntimeExports.jsx(xs,{value:o,onChange:r,level:a}),n.jsxRuntimeExports.jsxs(Ss,{initial:E,onChange:C,triggers:b,ref:R,children:[j&&n.jsxRuntimeExports.jsx(Er,{}),g&&n.jsxRuntimeExports.jsx(Cs,{})]})]})},Cr=({yAxes:e,lines:t,index:s,rules:o,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a,axis:{location:c,key:x,showGrid:m,...p}})=>{const f=u.useDrop({type:"Channel.LinePlot.XAxis",canDrop:vs,onDrop:d.useCallback(({items:g})=>{const E=u.filterByType(te,g);return i==null||i(x,E.map(({key:C})=>C)),E},[x,i])}),j=o==null?void 0:o.filter(g=>g.axis===x);return n.jsxRuntimeExports.jsxs(Rs,{...p,...f,location:c,showGrid:m??s===0,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(te)(u.useDraggingState()))),onAutoBoundsChange:g=>a==null?void 0:a({key:x,bounds:g}),children:[e.map((g,E)=>{const C=t.filter(S=>S.axes.y===g.key),b=o==null?void 0:o.filter(S=>S.axis===g.key);return n.jsxRuntimeExports.jsx(wr,{axis:{...g,showGrid:m??(s===0&&E===0)},lines:C,rules:b,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:a},g.key)}),j==null?void 0:j.map(g=>d.createElement(wt,{aetherKey:g.key,...g,key:g.key,onLabelChange:E=>r==null?void 0:r({key:g.key,label:E}),onPositionChange:E=>r==null?void 0:r({key:g.key,position:E})}))]})},vr=({channels:{x:e,y:t}})=>`${e??0}-${t}`,wr=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:o,onAxisChange:r,axis:{key:i,location:a,...c}})=>{const x=u.useDrop({type:"Channel.LinePlot.YAxis",canDrop:vs,onDrop:d.useCallback(({items:p})=>{const f=u.filterByType(te,p);return o==null||o(i,f.map(({key:j})=>j)),f},[i,o])}),m=u.useDraggingState();return n.jsxRuntimeExports.jsxs(bs,{...c,...x,location:a,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(te)(m))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>n.jsxRuntimeExports.jsx($r,{line:p},vr(p))),t==null?void 0:t.map(p=>d.createElement(wt,{aetherKey:p.key,...p,key:p.key,onLabelChange:f=>s==null?void 0:s({key:p.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:p.key,position:f})}))]})},$r=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(Pr,{line:e}):n.jsxRuntimeExports.jsx(kr,{line:e}),kr=({line:{key:e,timeSpan:t,channels:{x:s,y:o},...r}})=>{const i=t.valueOf()*3,a=h.streamChannelData({timeSpan:t,channel:o,keepFor:i}),c=s!=null&&s!==0,x=h.streamChannelData({timeSpan:t,channel:c?s:o,useIndexOfChannel:!c,keepFor:i});return n.jsxRuntimeExports.jsx(Rt,{aetherKey:e,y:a,x,...r})},Pr=({line:{timeRange:e,key:t,channels:{x:s,y:o},...r}})=>{const i=h.channelData({timeRange:e,channel:o}),a=s!=null&&s!==0,c=h.channelData({timeRange:e,channel:a?s:o,useIndexOfChannel:!a});return n.jsxRuntimeExports.jsx(Rt,{aetherKey:t,y:i,x:c,...r})},$t=d.createContext(h.ZERO_CONTEXT_VALUE),Me=()=>d.useContext($t).synnax,Lr=()=>d.useContext($t).state,It={connected:"success",connecting:"info",disconnected:"info",failed:"error"},ws=u.wrap$1(h.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[o,r,i]=u.useCombinedStateAndRef(h.ZERO_CONTEXT_VALUE),[{path:a},,c]=u.use$3({aetherKey:e,type:h.Provider.TYPE,schema:h.Provider.stateZ,initialState:{props:t??null,state:null}}),x=u.useAggregator(),m=d.useCallback(p=>{i.current.state.status!==p.status&&x({variant:It[p.status],message:p.message??l.Case.capitalize(p.status)}),r(f=>({...f,state:p}))},[x]);return u.useAsyncEffect(async()=>{if(o.synnax!=null&&o.synnax.close(),t==null)return r(h.ZERO_CONTEXT_VALUE);const p=new Y.Zb({...t,connectivityPollFrequency:Y.Le.seconds(5)});r({synnax:p,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await p.connectivity.check();return r({synnax:p,state:f}),x({variant:It[f.status],message:f.message??f.status.toUpperCase()}),p.connectivity.onChange(m),c({props:t,state:f}),()=>{p.close(),r(h.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,m]),n.jsxRuntimeExports.jsx($t.Provider,{value:o,children:n.jsxRuntimeExports.jsx(u.Composite,{path:a,children:s})})}),Tr=Object.freeze(Object.defineProperty({__proto__:null,Provider:ws,use:Me,useConnectionState:Lr},Symbol.toStringTag,{value:"Module"})),ye=d.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),$s=()=>d.useContext(ye),ks=e=>{const{aliases:t}=d.useContext(ye);return t[e]??null},et=()=>{const{aliases:e}=d.useContext(ye);return e},kt=(e,t="")=>{const{getName:s}=d.useContext(ye),[o,r]=d.useState(t);return u.useAsyncEffect(async()=>{const i=await s(e);i!=null&&r(i)},[e,s]),o},Pt=()=>{const{activeRange:e}=d.useContext(ye);return e??void 0},Ps=({activeRange:e,children:t})=>{const s=Me(),[o,r]=d.useState({}),i=d.useCallback(x=>{r(m=>{const p={...m};return x.forEach(({variant:f,key:j,value:g})=>{const E=Number(j.split("---")[1]);f==="delete"?delete p[E]:p[g.channel]=g.alias}),p})},[r]),a=d.useCallback(async(x,m)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(x,m)},[s,e]),c=d.useCallback(async x=>{if(s==null||x===0)return;const m=o[x];return m??(await s.channels.retrieve(x)).name},[o,s]);return u.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const x=await s.ranges.retrieve(e),m=await x.listAliases();r(m);const p=await x.openAliasTracker(),f=p.onChange(i);return()=>{f(),p.close()}},[s,e]),n.jsxRuntimeExports.jsx(ye.Provider,{value:{aliases:o,activeRange:e,setAlias:e!=null?a:null,getName:c},children:t})},Mr=({channelKey:e,value:t,shadow:s,className:o,...r})=>{const[i,a]=d.useState(!1),{setAlias:c}=$s(),x=ks(e),m=kt(e);let p=n.jsxRuntimeExports.jsx(u.u0.Rename,{});i?p=n.jsxRuntimeExports.jsx(u.u0.Loading,{}):x===t&&(p=n.jsxRuntimeExports.jsx(u.u0.Check,{}));const f=c!=null&&!i&&x!==t&&e!==0,j=()=>{f&&(async()=>(a(!0),await c(e,t),a(!1)))()},g=()=>{var C;x!=null&&((C=r.onChange)==null||C.call(r,x))},E=()=>e===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):x===t?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Sync alias for ",m," with this label"]});return n.jsxRuntimeExports.jsxs(u.Text$1,{value:t,...r,children:[f&&n.jsxRuntimeExports.jsx(u.Icon,{onClick:g,tooltip:n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Set ",m," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(u.u0.Sync,{})}),n.jsxRuntimeExports.jsx(u.Icon,{onClick:j,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},Zt=[{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"}],Ge=({items:e},t)=>{const s=u.filterByType(te,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Ls=["name","alias"],Ts=e=>{const t=et();return d.useMemo(()=>e.length===0?Zt:Zt.filter(s=>e.includes(s.key)),[e,t])},Nr=({columns:e=Ls,onChange:t,className:s,value:o,...r})=>{const i=Me(),a=et(),c=Ts(e),x=Pt(),m=d.useMemo(()=>i==null?void 0:i.channels.newSearcherUnderRange(x),[i,x]),p=i!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:j,...g}=u.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:d.useCallback(v=>Ge(v,l.toArray(o)),[o]),onDrop:d.useCallback(({items:v})=>{const R=u.filterByType(te,v);if(R.length===0)return[];const y=l.unique([...l.toArray(o),...R.map($=>$.key)]);return t(y,{clickedIndex:null,clicked:null,entries:[]}),R},[t,o])}),E=u.useDraggingState(),C=d.useCallback(({dropped:v})=>{t(l.toArray(o).filter(R=>!v.some(y=>y.key===R)),{clickedIndex:null,clicked:null,entries:[]})},[t,o]),b=d.useCallback((v,R)=>f([{key:R,type:te}],C),[f,C]),S=d.useCallback(v=>a[v.key]??v.name,[a]);return n.jsxRuntimeExports.jsx(Ct,{className:l.CSS(s,l.CSS.dropRegion(Ge(E,l.toArray(o)))),value:o,onTagDragStart:b,onTagDragEnd:j,searcher:m,onChange:t,columns:c,emptyContent:p,tagKey:S,...g,...r})},Te=({columns:e=Ls,onChange:t,value:s,className:o,data:r,...i})=>{const a=Me(),c=et(),x=Ts(e),m=Pt(),p=d.useMemo(()=>{if(!(r!=null&&r.length>0))return a==null?void 0:a.channels.newSearcherUnderRange(m)},[a,m,r==null?void 0:r.length]),f=a!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),j=d.useId(),g=d.useMemo(()=>({key:j,type:"Channel.SelectMultiple"}),[j]),{startDrag:E,onDragEnd:C,...b}=u.useDragAndDrop({type:"Channel.SelectSingle",canDrop:d.useCallback(y=>Ge(y,l.nullToArr(s)),[s]),onDrop:d.useCallback(({items:y})=>{const $=u.filterByType(te,y);return $.length===0?[]:(t($[0].key,{clickedIndex:null,clicked:null,entries:[]}),$)},[g,t])}),S=u.useDraggingState(),v=d.useCallback(()=>s!=null&&E([{type:te,key:s}]),[E,s]),R=d.useCallback(y=>c[y.key]??y.name,[c]);return n.jsxRuntimeExports.jsx(gs,{data:r,className:l.CSS(o,l.CSS.dropRegion(Ge(S,l.nullToArr(s)))),value:s,onDragStart:v,onDragEnd:C,onChange:t,searcher:p,columns:x,emptyContent:f,tagKey:R,...b,...i})},Br=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Mr,AliasProvider:Ps,LinePlot:yr,SelectMultiple:Nr,SelectSingle:Te,useActiveRange:Pt,useAlias:ks,useAliases:et,useContext:$s,useName:kt},Symbol.toStringTag,{value:"Module"})),Ye=d.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:o,direction:r,first:i,last:a,key:c,size:x},emptyContent:m,...p}=s,f=d.useCallback(([E])=>t(c,E),[t]),{props:j}=gt({direction:r,onResize:f,count:2,initialSizes:x!=null?[x]:void 0});let g;return o!==void 0?g=n.jsxRuntimeExports.jsx(Ms,{emptyContent:m,...s}):i!=null&&a!=null?g=n.jsxRuntimeExports.jsxs(Je,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...j,children:[n.jsxRuntimeExports.jsx(Ye,{...p,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(Ye,{...p,root:a,onResize:t},a.key)]}):(g=null,console.warn("Mosaic tree is malformed")),c===1?n.jsxRuntimeExports.jsx(u.Provider$2,{children:g}):g});Ye.displayName="Mosaic";const qe="pluto-mosaic-tab-drop",Lt="pluto-mosaic-tab-create",_r=(e,t)=>{const s=u.filterByType(qe,t).map(i=>i.key),o=e.filter(i=>!s.includes(i.tabKey)).length>0;return u.filterByType(Lt,t).length>0||s.length>0&&(o||e.length===0)},Ms=d.memo(({root:e,onDrop:t,onCreate:s,...o})=>{const{key:r,tabs:i}=e,[a,c]=d.useState(null),x=d.useCallback(({items:b})=>_r(i,b),[i]),m=d.useCallback(({items:b,event:S})=>{c(null);const v=u.filterByType(qe,b),R=i.length===0?"center":Ht(Ft(S));if(v.length>0){const $=v.map(({key:w})=>w)[0];t(r,$,R)}const y=u.filterByType(Lt,b);if(y.length>0){const $=y.map(({key:w})=>w);s==null||s(r,R,$)}return v},[t,i.length]),p=d.useCallback(({event:b})=>{const S=i.length===0?"center":Ht(Ft(b));c(S)},[i.length]),{startDrag:f,...j}=u.useDragAndDrop({type:"Mosaic",canDrop:x,onDrop:m,onDragOver:p}),g=d.useCallback(()=>c(null),[]),E=d.useCallback((b,{tabKey:S})=>f([{key:S,type:qe}]),[f]),C=d.useCallback(()=>s==null?void 0:s(r,"center"),[r]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsx(X.Tabs,{tabs:i,onDragLeave:g,selected:e.selected,onDragStart:E,onCreate:C,...o,...j}),a!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Dr[a]})]})});Ms.displayName="MosaicTabLeaf";const Dr={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%"}},Ft=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return o<24?{px:.5,py:.5}:{px:s/t.width,py:o/t.height}},Or=e=>e,zr=e=>1-e,Ht=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,o]=[Or(e),zr(e)];if(t>s&&t>o)return"bottom";if(t<s&&t<o)return"top";if(t>s&&t<o)return"left";if(t<s&&t>o)return"right";throw new Error("[bug] - invalid insert position")},Tt=new Error("Tab not found"),Vr=new Error("Invalid Mosaic"),Ns=(e,t,s="center",o)=>{var x;if(e=fe(e),o===void 0)return dt(e,t);const r=zs(e,o);if(s==="center")return(x=r.tabs)==null||x.push(t),r.selected=t.tabKey,e;if(r.tabs==null||r.tabs.length===0)return e;const[i,a,c]=Zr(s);if(r.direction=c,r[i]={key:0,tabs:[t],selected:t.tabKey},r[a]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw Vr;return r.first.key=r.key*2,r.last.key=r.key*2+1,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},dt=(e,t)=>(e=fe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=dt(e.first,t):e.last!=null&&(e.last=dt(e.last,t)),e)),Ue=e=>{e=fe(e);const t=[];if(e.tabs!=null&&(e.selected=X.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,o]=Ue(e.first);e.first=s,t.push(...o)}if(e.last!=null){const[s,o]=Ue(e.last);e.last=s,t.push(...o)}return[e,t]},Mt=(e,t)=>{var i;e=fe(e);const[,s]=Re(e,t);if(s==null)return[e,null];s.tabs=(i=s.tabs)==null?void 0:i.filter(a=>a.tabKey!==t),s.selected=X.resetSelection(s.selected,s.tabs);const o=Ir(e),r=s.selected??We(o);return[o,r]},We=e=>e.selected!=null?e.selected:e.first!=null?We(e.first):e.last!=null?We(e.last):null,Bs=(e,t)=>{e=fe(e);const[s,o]=Re(e,t);if(s==null||o==null)throw Tt;return o.selected=t,e},_s=(e,t,s,o)=>{e=fe(e);const[r,i]=Re(e,t);if(r==null||i==null)throw Tt;const[a,c]=Mt(e,t);return[Ns(a,r,s,o),c]},Ds=(e,t,s)=>{const o=Xe(e,t);if(o==null)throw new Error("Node not found");return o.size=s,e},Os=(e,t,s)=>{e=fe(e);const[,o]=Re(e,t);if((o==null?void 0:o.tabs)==null)throw Tt;return o.tabs=X.rename(t,s,(o==null?void 0:o.tabs)??[]),e},Ar=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,zs=(e,t)=>{const s=Xe(e,t);if(s!=null)return s;const o=Math.floor(t/2);return o===0?e:zs(e,o)},Ir=e=>{let t=!0;for(;t;)[e,t]=pt(e);return e},pt=e=>{if(e.first==null||e.last==null)return[e,!1];if(Yt(e.first))return[Gt(e.last,!0),!0];if(Yt(e.last))return[Gt(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=pt(e.first),[e.last,s]=pt(e.last),[e,t||s]},Gt=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Yt=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Re=(e,t)=>{if(e.tabs!=null){const a=e.tabs.find(c=>c.tabKey===t);if(a!=null)return[a,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,o]=Re(e.first,t);if(s!=null&&o!=null)return[s,o];const[r,i]=Re(e.last,t);return[r,i]},Xe=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=Xe(e.first,t);return s??Xe(e.last,t)},Zr=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")}},fe=e=>l.external.copy(e),Fr=({allowRename:e=!1,initialTree:t})=>{const[s,o]=d.useState(t);return d.useEffect(()=>o(Ue(t)[0]),[t]),{root:s,onDrop:(m,p,f)=>o(j=>_s(j,p,f,m)[0]),onClose:m=>o(p=>Mt(p,m)[0]),onSelect:m=>o(p=>Bs(p,m)),onResize:(m,p)=>o(f=>Ds(f,m,p)),onRename:e?(m,p)=>o(f=>Os(f,m,p)):void 0}},Hr=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Lt,HAUL_DROP_TYPE:qe,Mosaic:Ye,autoSelectTabs:Ue,findSelected:We,insertTab:Ns,isEmpty:Ar,moveTab:_s,removeTab:Mt,renameTab:Os,resizeNode:Ds,selectTab:Bs,use:Fr},Symbol.toStringTag,{value:"Module"})),Nt=({aetherKey:e})=>{const[,{region:t},s]=u.use$3({aetherKey:e,type:h.Eraser$1.TYPE,schema:h.eraserStateZ,initialState:{region:l.box$1.ZERO,enabled:!0}}),o=u.useSyncedRef(t),r=d.useCallback(a=>{l.box$1.equals(a,o.current)||s(c=>({...c,region:a}))},[s]);return{setEnabled:d.useCallback(a=>s(c=>({...c,enabled:a})),[s]),erase:r}},Gr=u.wrap$1(h.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Nt({aetherKey:e}),o=u.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:o,className:l.CSS(l.CSS.inheritDims()),children:t})}),Yr=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Gr,use:Nt},Symbol.toStringTag,{value:"Module"})),qr=({items:e,initialKey:t})=>{const[s,o]=d.useState(t),r=a=>o(a===s?void 0:a),i=e.find(a=>a.key===s);return{onSelect:r,activeItem:i}},Ur=u.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:o,location:r="left",collapseThreshold:i=.65,className:a,onResize:c,...x})=>{const m=l.location.direction(r),p=d.useCallback(()=>t!=null&&(o==null?void 0:o(t.key)),[o,t==null?void 0:t.key]),{erase:f,setEnabled:j}=Nt({aetherKey:e}),g=d.useCallback((b,S)=>{c==null||c(b,S),f(S)},[c,f]);if(d.useLayoutEffect(()=>{j(t!=null)},[t,j]),t==null)return null;const{content:E,...C}=t;return n.jsxRuntimeExports.jsx(ns,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(m),a),collapseThreshold:i,onCollapse:p,location:r,onResize:g,...C,...x,children:t.content})}),Wr=({location:e="left",size:t="9rem",className:s,style:o,...r})=>{const i=l.location.construct(e),a=l.location.direction(i),c=l.direction$1.swap(a);return n.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.location.swap(i)),l.CSS.dir(c),l.CSS.loc(i),s),direction:c,style:{[l.direction$1.dimension(a)]:t,...o},align:"center",empty:!0,...r})},Ne=e=>({bordered:t=!1,className:s,...o})=>n.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),s),align:"center",...o}),Vs=Ne("start");Vs.displayName="NavbarStart";const As=Ne("end");As.displayName="NavbarEnd";const Is=Ne("center");Is.displayName="NavbarCenter";const Zs=Ne("");Zs.displayName="NavbarContent";const Fs=Ne("absolute-center");Fs.displayName="NavbarAbsoluteCenter";const Ce=Wr;Ce.Start=Vs;Ce.Center=Is;Ce.End=As;Ce.AbsoluteCenter=Fs;Ce.Content=Zs;const Xr=Object.freeze(Object.defineProperty({__proto__:null,Bar:Ce,Drawer:Ur,useDrawer:qr},Symbol.toStringTag,{value:"Module"})),lt={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.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"}),n.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"})]})},Kr=({disabled:e=[],className:t,focused:s=!0,onMinimize:o,onMaximize:r,onFullscreen:i,onClose:a,...c})=>n.jsxRuntimeExports.jsxs(D.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...c,children:[n.jsxRuntimeExports.jsx(it,{onClick:a,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:lt.Close}),n.jsxRuntimeExports.jsx(it,{onClick:o,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:lt.Minimize}),n.jsxRuntimeExports.jsx(it,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:lt.Maximize})]}),it=({className:e,...t})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),e),tabIndex:-1,size:"",...t}),ct=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:o,onFullscreen:r,...i})=>n.jsxRuntimeExports.jsxs(D.Pack,{...i,children:[n.jsxRuntimeExports.jsx(at,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(u.u0.Subtract,{})}),n.jsxRuntimeExports.jsx(at,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(u.u0.Box,{})}),n.jsxRuntimeExports.jsx(at,{onClick:o,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(u.u0.Close,{})})]}),at=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),Hs=e=>l.external$1.getOS(e),Jr={MacOS:Kr,Windows:ct,Linux:ct,Docker:ct},Qr="Windows",el=({forceOS:e,visibleIfOS:t,...s})=>{const o=Hs({force:e,default:Qr}),r=Jr[o];return t!=null&&t!==o?null:n.jsxRuntimeExports.jsx(r,{...s})},tl=Object.freeze(Object.defineProperty({__proto__:null,Controls:el,use:Hs},Symbol.toStringTag,{value:"Module"}));var ee;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ee||(ee={}));function sl({color:e,dimensions:t,lineWidth:s}){return d.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function nl({color:e,radius:t}){return d.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const ol={[ee.Dots]:"#91919a",[ee.Lines]:"#eee",[ee.Cross]:"#e2e2e2"},rl={[ee.Dots]:1,[ee.Lines]:1,[ee.Cross]:6},ll=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Gs({id:e,variant:t=ee.Dots,gap:s=20,size:o,lineWidth:r=1,offset:i=2,color:a,style:c,className:x}){const m=d.useRef(null),{transform:p,patternId:f}=h.useStore(ll,h.shallow$1),j=a||ol[t],g=o||rl[t],E=t===ee.Dots,C=t===ee.Cross,b=Array.isArray(s)?s:[s,s],S=[b[0]*p[2]||1,b[1]*p[2]||1],v=g*p[2],R=C?[v,v]:S,y=E?[v/i,v/i]:[R[0]/i,R[1]/i];return d.createElement("svg",{className:h.cc(["react-flow__background",x]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:m,"data-testid":"rf__background"},d.createElement("pattern",{id:f+e,x:p[0]%S[0],y:p[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${y[0]},-${y[1]})`},E?d.createElement(nl,{color:j,radius:v/i}):d.createElement(sl,{dimensions:R,color:j,lineWidth:r})),d.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Gs.displayName="Background";var il=d.memo(Gs);const qt=({sourcePos:e,targetPos:t,next:s,prev:o})=>{const r=Le(e,...s);return l.xy.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",s),console.log("Prev segments",o),!1)},Ut=({sourceStumpTip:e,sourceOrientation:t,sourceBox:s,targetStumpTip:o,targetOrientation:r,targetBox:i})=>{if(!cl({sourcePos:e,sourceOrientation:t,targetPos:o}))return;const a=l.direction$1.construct(t),c=l.direction$1.swap(a);let x=xe(c,o[c]-e[c]);const m=l.box$1.loc(s,x);if(l.location.swap(t)===r){const p=l.box$1.loc(i,l.location.swap(x));Math.abs(m-p)<J&&(x=l.location.swap(x))}return{direction:c,length:m-e[c]+me(x,J)}},Le=(e,...t)=>{let s=e;for(const o of t)s=l.xy.translate(s,o.direction,o.length);return s},Ys=(e,t,s,o)=>{try{let r=e;const i=[e,...t.map(j=>(r=l.xy.translate(r,j.direction,j.length),r))];if(!o)return i;const a=t[0],c=xe(a.direction,a.length),x=Wt(c);i[0]=l.xy.translate(i[0],{[a.direction]:-1*x*4*s,[l.direction$1.swap(a.direction)]:0});const m=t[t.length-1],p=xe(m.direction,m.length),f=Wt(p);return i[i.length-1]=l.xy.translate(i[i.length-1],{[m.direction]:f*4*s,[l.direction$1.swap(m.direction)]:0}),i}catch{return[]}},J=10,Wt=e=>e==="top"||e==="left"?-1:1,me=(e,t)=>e==="top"||e==="left"?-t:t,xe=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ce=e=>xe(e.direction,e.length),cl=({sourcePos:e,targetPos:t,sourceOrientation:s})=>{const o=l.direction$1.construct(s),r=t[o]-e[o];return me(s,r)<0},ze=e=>({direction:l.direction$1.construct(e),length:me(e,J)}),Xt={top:ze("top"),bottom:ze("bottom"),left:ze("left"),right:ze("right")},al=4,ul=.25,tt=e=>mt(xl(mt(e))),xl=e=>{const t=[...e],s=e.findIndex((o,r)=>{const i=Math.abs(o.length);if(i<al){if(i<ul)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const a=t[r+2];if(a.direction!==o.direction)return!1;t[r+2]={...a,length:a.length+o.length}}else{const a=t[r-2];if(a.direction!==o.direction)return!1;t[r-2]={...a,length:a.length+o.length}}return!0}return!1});return s!==-1&&t.splice(s,1),t},mt=e=>{const t=[...e];return e.findIndex((o,r)=>{const i=t[r-1];if(r===0||o.direction!==i.direction)return!1;if(r===1){const a=r-1,c=r,x=ce(i),m=ce(o);if(x===m)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(i.length)===J)return!1;const p=me(x,J),f=t[a].length-p,j=t[c].length+f;return Math.abs(j)<J?!1:(t[a]={...t[a],length:p},t[c]={...t[c],length:j},!0)}if(r===e.length-1){const a=r,c=r-1,x=ce(o),m=ce(i);if(x===m)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)===J)return!1;const p=me(x,J),f=t[a].length-p,j=t[c].length+f;return Math.abs(j)<J?!1:(t[a]={...t[a],length:p},t[c]={...t[c],length:j},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?mt(t):t},Se=e=>tt(dl(e)),dl=({sourceBox:e,targetBox:t,sourcePos:s,targetPos:o,targetOrientation:r,sourceOrientation:i})=>{let a=i,c=r,x={...Xt[i]},m=Le(s,x);const p={...Xt[r]};let f=Le(o,p);const j=[x],g=Ut({sourceStumpTip:m,sourceOrientation:i,sourceBox:e,targetStumpTip:f,targetOrientation:r,targetBox:t});g!=null&&(j.push(g),m=Le(m,g),a=ce(g),x=g);const E=Ut({sourceStumpTip:f,sourceOrientation:c,sourceBox:t,targetStumpTip:m,targetOrientation:a,targetBox:e});E!=null&&(f=Le(f,E),c=xe(E.direction,E.length));const C=()=>{E!=null&&(E.length*=-1,j.push(E)),p.length*=-1,j.push(p)};if(l.location.swap(a)===r){const $=l.direction$1.construct(a),w=(f[$]-m[$])/2;j.push({direction:$,length:w});const P=l.direction$1.swap($);return j.push({direction:P,length:f[P]-m[P]}),j.push({direction:$,length:w}),C(),j}const b=f[x.direction]-m[x.direction];let S=l.direction$1.swap(x.direction);const v=m[S]-f[S];let R;xe(x.direction,b)===a&&xe(S,v)===c?R={direction:x.direction,length:b}:(R={direction:S,length:f[S]-m[S]},S=l.direction$1.swap(S)),j.push(R);const y={direction:S,length:f[S]-m[S]};return j.push(y),C(),j},pl=e=>tt(ml(e)),ml=({segments:e,index:t,magnitude:s})=>{const o=[...e],r=o[t],i=l.direction$1.swap(r.direction),a=ce(r);if(t===0){o.unshift({direction:i,length:s});const c=me(a,J);o.unshift({direction:r.direction,length:c}),t+=2,o[t]={...o[t],length:o[t].length-c}}else o[t-1]={direction:o[t-1].direction,length:o[t-1].length+s};if(t===o.length-1){o.push({direction:i,length:-s});const c=me(a,J);o.push({direction:r.direction,length:c}),o[t]={...o[t],length:o[t].length-c}}else o[t+1]={direction:o[t+1].direction,length:o[t+1].length-s};return o},fl=(e,t)=>{for(let s=e.length-1;s>=0;s--)if(t(e[s],s))return s;return-1},jl=(e,t,s=!1,...o)=>{const r=(i,a)=>!o.includes(a)&&t(i,a);return s?fl(e,r):e.findIndex(r)},hl=({delta:e,segments:t})=>tt(qs(e,t,!1)),gl=({delta:e,segments:t})=>tt(qs(e,t,!0)),qs=(e,t,s)=>{let o=[...t];return e.x!==0&&(o=Jt("x",e,o,s)),e.y!==0&&(o=Jt("y",e,o,s)),o},Kt=(e,t,s)=>{if(t.direction!==e)return!1;const o={...t,length:t.length-s[e]},r=ce(t),i=ce(o);return Math.abs(o.length)>J&&r===i},Jt=(e,t,s,o)=>{const r=l.direction$1.swap(e),i=o?s.length-1:0,a=s[i];if(Kt(e,a,t))return s[i]={...a,length:a.length-t[e]},s;const c=o?0:s.length-1,m=jl(s,f=>f.direction===e,o,i);if(m===c){const f=s[c];return Kt(e,f,t)?(s[c]={...f,length:f.length-t[e]},s):(a.direction===e?s[i]={...a,length:a.length-t[e]}:s[c]={...f,length:f.length-t[e]},s)}if(m===-1)return s.length===1?s[0].direction===e?[{direction:e,length:s[0].length-t[e]}]:[{direction:r,length:s[0].length/2},{direction:e,length:-t[e]},{direction:r,length:s[0].length/2}]:a.direction===e?(s[i]={...a,length:a.length-t[e]},s):[{direction:r,length:s[0].length},{direction:e,length:-t[e]},...s.slice(1)];const p=s[m];return s[m]={...p,length:p.length-t[e]},s},Bt=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[pid] - cannot find node with key: ${e}`);return t},U=(e,t)=>{const s=Bt(t),o=e.getNodes().find(r=>r.id===t);if(o==null)throw new Error(`[pid] - cannot find node with key: ${t}`);return l.box$1.construct(o.position,l.box$1.dims(l.box$1.construct(s)))},El=(e,t)=>st.fromFlow(e,t);class Us{constructor(t,s){ue(this,"node_",null);ue(this,"position");ue(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[pid] - handle has no node");return this.node_}get absolutePosition(){return l.xy.translate(l.box$1.topLeft(this.node.box),this.position)}}class st{constructor(t,s,o){ue(this,"key");ue(this,"box");ue(this,"handles");this.key=t,this.box=s,this.handles=o,o.forEach(r=>r.node=this)}static fromFlow(t,s){const o=U(s,t),r=Bt(t),i=r.getElementsByClassName("react-flow__handle"),a=l.box$1.construct(r),c=Array.from(i).map(x=>{const m=l.box$1.center(l.box$1.construct(x)),p=l.xy.translation(l.box$1.topLeft(a),m),f=x.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[pid] - cannot find handle orientation");const j=l.location.construct(f[0]);return new Us(p,j)});return new st(t,o,c)}}const Sl=({fromX:e,fromY:t,toX:s,toY:o,fromPosition:r,toPosition:i,fromNode:a,connectionLineStyle:c,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.location.outer.safeParse(p[1]);E.success&&(i=E.data)}const f=Se({sourcePos:l.xy.construct(e,t),targetPos:l.xy.construct(s,o),sourceOrientation:r,targetOrientation:i,sourceBox:U(h.useReactFlow(),(a==null?void 0:a.id)??""),targetBox:U(h.useReactFlow(),(a==null?void 0:a.id)??"")}),j=h.useReactFlow(),g=Ys(l.xy.construct(e,t),f,j.getZoom(),!1);return n.jsxRuntimeExports.jsx(h.BaseEdge,{path:Ws(g),style:{...c,stroke:l.cssString(x==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Rl=({id:e,source:t,target:s,sourcePosition:o,targetHandleId:r,targetPosition:i,style:a,segments:c=[],onSegmentsChange:x,color:m="var(--pluto-gray-l9)",selected:p=!1,...f})=>{const j=l.xy.construct(f.sourceX,f.sourceY),g=d.useRef(j),E=l.xy.equals(j,g.current),C=l.xy.construct(f.targetX,f.targetY),b=d.useRef(C),S=l.xy.equals(C,b.current),v=h.useReactFlow(),[R,y,$]=u.useCombinedStateAndRef(()=>c.length>0?c:Se({sourcePos:j,targetPos:C,sourceOrientation:o,targetOrientation:i,sourceBox:U(v,t),targetBox:U(v,s)})),w=d.useRef(i),P=d.useRef(o),N=u.useDebouncedCallback(x,100,[x]);if(!E||!S){let T=R;const M=l.xy.translation(g.current,j),z=l.xy.translation(C,b.current);l.xy.equals(M,l.xy.scale(z,-1),.001)?(g.current=j,b.current=C):(E?S||(T=gl({delta:z,segments:T}),w.current!==i&&(w.current=i,T=Se({sourcePos:j,targetPos:C,sourceOrientation:o,targetOrientation:i,sourceBox:U(v,t),targetBox:U(v,s)})),qt({sourcePos:j,targetPos:C,next:T,prev:R})||(T=Se({sourcePos:j,targetPos:C,sourceOrientation:o,targetOrientation:i,sourceBox:U(v,t),targetBox:U(v,s)})),b.current=C):(T=hl({delta:M,segments:T}),P.current!==o&&(P.current=o,T=Se({sourcePos:j,targetPos:C,sourceOrientation:o,targetOrientation:i,sourceBox:U(v,t),targetBox:U(v,s)})),qt({sourcePos:j,targetPos:C,next:T,prev:R})||(T=Se({sourcePos:j,targetPos:C,sourceOrientation:o,targetOrientation:i,sourceBox:U(v,t),targetBox:U(v,s)})),g.current=j),N(T),y(T))}const L=d.useRef(null),B=Qe({onStart:d.useCallback((T,M,z)=>{L.current={index:Number(z.currentTarget.id.split("-")[1]),segments:[...$.current]}},[]),onMove:d.useCallback(T=>{if(L.current==null)return;const M=pl({segments:L.current.segments,index:L.current.index,magnitude:l.box$1.dim(T,l.direction$1.swap(L.current.segments[L.current.index].direction),!0)/v.getZoom()});y(M)},[]),onEnd:d.useCallback(()=>x($.current),[x])}),V=Ys(j,R,v.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(h.BaseEdge,{path:Ws(V),style:{...a,stroke:l.cssString(m)},...f}),p&&bl(V).map((T,M)=>{const z=R[M].direction,G=l.direction$1.swap(z),le={[l.direction$1.dimension(z)]:"18px",[l.direction$1.dimension(G)]:"4px"},ge={[z]:T[z]-9,[G]:T[G]-2};return n.jsxRuntimeExports.jsxs(d.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...le,...ge,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:T.x-9,y:T.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${M}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(z)),draggable:!0,onDragStart:B})})]},M)})]})},Ws=e=>{let t="";const o=e.length+-1;for(let r=0;r<o;r++){const i=e[r%e.length],a=e[(r+1)%e.length],c=Math.min(6/Math.hypot(a.x-i.x,a.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+a.x*c},${i.y*(1-c)+a.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+a.x*c},${i.y*(1-c)+a.y*c}`),r===o-1?t+=`L${a.x},${a.y}`:r<o-1&&(t+=`L${i.x*c+a.x*(1-c)},${i.y*c+a.y*(1-c)}`)}return t},bl=e=>e.slice(1).map((t,s)=>{const o=e[s];return l.xy.construct((t.x+o.x)/2,(t.y+o.y)/2)}),yl=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:o={position:l.xy.ZERO,zoom:1}})=>{const[r,i]=d.useState(s),[a,c]=d.useState(e),[x,m]=d.useState(t),[p,f]=d.useState(o);return{viewport:p,onViewportChange:f,edges:x,nodes:a,onNodesChange:c,onEdgesChange:m,editable:r,onEditableChange:i}},Cl=e=>e.source!==e.target,vl={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},wl={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},Xs={padding:0,maxZoom:1,minZoom:.5},$l={hideAttribution:!0},Ks=d.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{}}),nt=()=>d.useContext(Ks),Js=d.memo(({children:e})=>{const{registerNodeRenderer:t}=nt();return d.useEffect(()=>t(e),[t,e]),null});Js.displayName="NodeRenderer";const kl=u.wrap$1(h.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:o,nodes:r,edges:i,onEditableChange:a,editable:c,viewport:x,triggers:m,onViewportChange:p,...f})=>{const[{path:j},,g]=u.use$3({aetherKey:e,type:h.Diagram$1.TYPE,schema:h.diagramStateZ,initialState:{position:x.position,region:l.box$1.ZERO,zoom:x.zoom}}),E=u.use().colors.gray.l9.hex,C=u.useMemoCompare(()=>m??yt.zoom,u.compareModeConfigs,[m]),{fitView:b}=h.useReactFlow(),S=Et(d.useCallback(O=>{g(A=>({...A,region:O}))},[g])),v=d.useRef(null),R=d.useCallback(O=>{const A=v.current;A!=null&&A.x===O.x&&A.y===O.y&&A.zoom===O.zoom||(v.current=O,g(q=>({...q,position:O,zoom:O.zoom})),p(h.translateViewportBackward(O)))},[g,p]);h.useOnViewportChange({onStart:R,onChange:R,onEnd:R});const[y,$]=d.useState(()=>()=>null),w=d.useCallback(O=>$(()=>O),[]),P=d.useMemo(()=>({custom:({id:O,xPos:A,yPos:q,selected:Pe})=>y({symbolKey:O,position:{x:A,y:q},selected:Pe})}),[y]),N=d.useRef(i),L=d.useMemo(()=>(N.current=i,h.translateEdgesForward(i)),[i]),B=d.useRef(r),V=d.useMemo(()=>(B.current=r,h.translateNodesForward(r)),[r]),T=d.useCallback(O=>s(h.nodeConverter(B.current,A=>h.applyNodeChanges(O,A))),[s]),M=d.useCallback(O=>o(h.edgeConverter(N.current,A=>h.applyEdgeChanges(O,A),E)),[o,E]),z=d.useCallback((O,A)=>o(h.edgeConverter(N.current,q=>h.updateEdge(O,A,q),E)),[]),G=d.useCallback(O=>{o(h.edgeConverter(N.current,A=>h.addEdge(O,A),E))},[o,E]),le=d.useCallback((O,A)=>{const q=[...N.current],Pe=q.findIndex(Eo=>Eo.key===O);Pe!==-1&&(q[Pe]={...q[Pe],segments:A},N.current=q,o(q))},[o]),ge=c?vl:wl,ae=d.useMemo(()=>({default:O=>n.jsxRuntimeExports.jsx(Rl,{...O,segments:O.data.segments,color:O.data.color,onSegmentsChange:d.useCallback(A=>le(O.id,A),[O.id])},O.id)}),[le]),K=d.useRef(null);u.use$2({triggers:C.zoomReset,callback:d.useCallback(({stage:O,cursor:A})=>{const q=K.current;q==null||O!=="start"||!l.box$1.contains(q,A)||b()},[b])});const Ee=u.purgeMouse(C.select)[0]??null,Oe=u.purgeMouse(C.pan)[0]??null,jo=u.purgeMouse(C.zoom)[0]??null,ho={selectionOnDrag:Ee==null,panOnDrag:Oe==null,selectionKeyCode:Ee,panActivationKeyCode:Oe,zoomActivationKeyCode:jo},go=u.useCombinedRefs(K,S);return n.jsxRuntimeExports.jsx(Ks.Provider,{value:{editable:c,onEditableChange:a,registerNodeRenderer:w},children:n.jsxRuntimeExports.jsx(u.Composite,{path:j,children:n.jsxRuntimeExports.jsx(h.ReactFlow,{...ho,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(c)),nodes:V,edges:L,nodeTypes:P,edgeTypes:ae,ref:go,fitView:!0,onNodesChange:T,onEdgesChange:M,onConnect:G,onEdgeUpdate:z,defaultViewport:h.translateViewportForward(x),connectionLineComponent:Sl,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Cl,connectionMode:h.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Xs,selectionMode:h.SelectionMode.Partial,proOptions:$l,...f,style:{[l.CSS.var("diagram-zoom")]:x.zoom,...f.style},...ge,children:t})})})}),Pl=()=>{const{editable:e}=nt();return e?n.jsxRuntimeExports.jsx(il,{}):null},Ll=({children:e,...t})=>n.jsxRuntimeExports.jsx(D.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Tl=({onClick:e,...t})=>{const{editable:s,onEditableChange:o}=nt();return n.jsxRuntimeExports.jsx(u.ToggleIcon,{onChange:()=>o(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.location.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(u.u0.EditOff,{}):n.jsxRuntimeExports.jsx(u.u0.Edit,{})})},Ml=({onClick:e,...t})=>{const{fitView:s}=h.useReactFlow();return n.jsxRuntimeExports.jsx(u.Icon,{onClick:o=>{s(Xs),e==null||e(o)},tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.location.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(u.u0.Expand,{})})},Nl=e=>n.jsxRuntimeExports.jsx(h.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(kl,{...e})}),Bl=(e,t="x")=>{if(e.length===0)return[];const s=l.location.construct(t),o=l.location.swap(s);return e.sort((r,i)=>l.box$1.loc(r.box,s)-l.box$1.loc(i.box,s)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(g=>g.orientation===o),x=r.handles.find(g=>g.orientation===s);if(c==null||x==null)return;const m=c.absolutePosition,p=x.absolutePosition,f=l.xy.set(l.xy.translation(p,m),t,0),j=l.xy.translate(l.box$1.topLeft(r.box),f);r.box=l.box$1.construct(j,l.box$1.dims(r.box))}),e},_l=Object.freeze(Object.defineProperty({__proto__:null,Background:Pl,Controls:Ll,Diagram:Nl,FitViewControl:Ml,HandleLayout:Us,NodeLayout:st,NodeRenderer:Js,ToggleEditControl:Tl,alignNodes:Bl,selectNode:Bt,selectNodeBox:U,selectNodeLayout:El,use:yl,useContext:nt},Symbol.toStringTag,{value:"Module"})),Dl=h.Value.z.omit({font:!0}).partial({color:!0}).extend({level:Y.levelZ.optional()}),Qs=({aetherKey:e,box:t,telem:s,color:o,precision:r,minWidth:i,level:a="small"})=>{const c=u.useMemoDeepEqualProps({box:t,telem:s,color:o,precision:r,level:a,minWidth:i}),[,x,m]=u.use$3({aetherKey:e,type:h.Value.TYPE,schema:h.Value.z,initialState:c});return d.useLayoutEffect(()=>m(p=>({...p,...c})),[c]),{width:x.width??x.minWidth}},Ol=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Dl,use:Qs},Symbol.toStringTag,{value:"Module"})),en=d.createContext({needsControlOf:[]}),tn=()=>d.useContext(en),zl=u.wrap$1(h.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...o})=>{const r=u.useMemoDeepEqualProps(o),[{path:i},{status:a,needsControlOf:c},x]=u.use$3({aetherKey:e,type:h.Controller$1.TYPE,schema:h.controllerStateZ,initialState:r});return d.useEffect(()=>{a!=null&&(s==null||s(a))},[a,s]),d.useEffect(()=>{x(m=>({...m,...r}))},[r,x]),d.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(en.Provider,{value:{needsControlOf:c},children:[n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:t}),";"]})}),sn=u.wrap$1(h.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=u.use$3({aetherKey:e,type:h.StateProvider.TYPE,schema:h.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:t})}),nn=u.wrap$1(h.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var x;const o=u.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:i},a]=u.use$3({aetherKey:e,type:h.Indicator.TYPE,initialState:{...o,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:l.TimeStamp.now()}},schema:h.indicatorStateZ});d.useEffect(()=>{a(m=>({...m,...o}))},[o,a]);let c;return((x=i.data)==null?void 0:x.color)!=null?c=l.Color.z.parse(i.data.color):r!=null&&!r.isZero?c=r:c="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{x:"center",y:"right"},children:[n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(c),flexGrow:1}})]})}),Vl=e=>{var t,s;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",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((s=e.data)==null?void 0:s.authority)===Y.b0.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)"}}},on=u.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:o,...r})=>{const i=u.useMemoDeepEqualProps({source:t,sink:s}),[,{status:a},c]=u.use$3({aetherKey:e,type:h.Chip.TYPE,schema:h.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:l.TimeStamp.now()}}});d.useEffect(()=>{c(g=>({...g,...i}))},[i,c]);const x=d.useCallback(()=>c(g=>({...g,triggered:!g.triggered})),[c]),{message:m,chipColor:p,buttonStyle:f,disabled:j}=Vl(a);return n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),o),disabled:j,onClick:x,tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:m}),style:f,...r,children:n.jsxRuntimeExports.jsx(u.u0.Circle,{color:p})})}),Al=u.wrap$1(h.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=tn(),[,{states:o},r]=u.use$3({aetherKey:e,type:h.Legend.TYPE,schema:h.legendStateZ,initialState:{states:[],needsControlOf:s}});d.useEffect(()=>{r(c=>({...c,needsControlOf:s}))},[s]);const a=l.unique(o.map(c=>c.subject.key)).map(c=>{const x=o.find(m=>m.subject.key===c);if(x==null)throw new Y.Bn("Legend subject not found");return{key:x.subject.key,label:x.subject.name,color:x.subjectColor}});return n.jsxRuntimeExports.jsx(rs,{data:a,...t})}),Il=Object.freeze(Object.defineProperty({__proto__:null,Chip:on,Controller:zl,Indicator:nn,Legend:Al,StateProvider:sn,useContext:tn},Symbol.toStringTag,{value:"Module"})),Zl=({aetherKey:e,sink:t})=>{const s=u.useMemoDeepEqualProps({sink:t}),[,,o]=u.use$3({aetherKey:e,type:h.Button.TYPE,schema:h.buttonStateZ,initialState:{trigger:0,sink:t}});return d.useEffect(()=>{o(i=>({...i,...s}))},[s]),{click:d.useCallback(()=>{o(i=>({...i,trigger:i.trigger+1}))},[o])}},I=d.forwardRef(({label:e="",onChange:t,level:s="p",children:o,orientation:r="top",style:i,className:a,...c},x)=>n.jsxRuntimeExports.jsxs(D.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...i},size:2/3,direction:r,ref:x,className:l.CSS(l.CSS.B("symbol"),a),align:"center",justify:"center",...c,children:[e.length>0&&n.jsxRuntimeExports.jsx(u.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:d.useCallback(m=>t({label:{label:m,level:s,orientation:r}}),[t,s]),level:s}),o]}));I.displayName="Labeled";const _=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Fl=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Hl=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),ft=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Gl={left:{left:h.Position.Left,right:h.Position.Right,top:h.Position.Top,bottom:h.Position.Bottom},right:{left:h.Position.Right,right:h.Position.Left,top:h.Position.Bottom,bottom:h.Position.Top},top:{left:h.Position.Bottom,right:h.Position.Top,top:h.Position.Left,bottom:h.Position.Right},bottom:{left:h.Position.Top,right:h.Position.Bottom,top:h.Position.Right,bottom:h.Position.Left}},Yl=(e,t)=>Gl[t][e],ql=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},Z=({children:e,orientation:t})=>{let s;try{s=h.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const o=d.useRef(null),r=d.useRef(!0);return d.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const i=o.current.closest(".react-flow__node"),a=i==null?void 0:i.getAttribute("data-id");a!=null&&(s==null||s(a))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:o}),e]})},k=({location:e,orientation:t,left:s,top:o,...r})=>{const i=ql(o,s,t);return n.jsxRuntimeExports.jsx(h.Handle$1,{position:Yl(e,t),...r,type:"source",onClick:a=>a.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",r.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},ve=({className:e,enabled:t=!1,triggered:s=!1,color:o,orientation:r="left",...i})=>n.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"),s&&l.CSS.M("triggered"),e),...i}),W=({className:e,orientation:t="left",...s})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...s}),Ul=.8,H=({dimensions:e,orientation:t="left",children:s,className:o,color:r,style:i={},scale:a=1,...c})=>{e=l.direction$1.construct(t)==="y"?l.dimensions.swap(e):e;const m=l.cssString(r);return r!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(r).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l.dimensions.svgViewBox(e),className:l.CSS(l.CSS.loc(t),o),fill:m,stroke:m,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:l.dimensions.scale(e,a*Ul).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},rn=({className:e,orientation:t,scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:87},color:o,scale:s,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{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"})]})]}),ln=({color:e,orientation:t="left",scale:s,...o})=>n.jsxRuntimeExports.jsxs(ve,{...o,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{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"})]})]}),cn=({orientation:e="left",color:t,scale:s,...o})=>n.jsxRuntimeExports.jsxs(ve,{...o,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:e,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(H,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(_,{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"})})]}),an=({className:e,color:t,orientation:s="left",normallyOpen:o=!1,scale:r,...i})=>n.jsxRuntimeExports.jsxs(ve,{className:l.CSS(l.CSS.B("solenoid-valve"),o&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:69},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(Fl,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),un=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:58},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),xn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:45,height:43},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(_,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{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"})]})]}),dn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),pn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(ve,{...r,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:1,top:39,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:95,top:3,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:68,height:61},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Hl,{cx:"35",cy:"25",r:"23"}),n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(ft,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),n.jsxRuntimeExports.jsx(ft,{x1:"1",y1:"24",x2:"35",y2:"24"})]})]}),mn=({className:e,color:t,orientation:s="left",scale:o,...r})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(W,{...r,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(Z,{orientation:s,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:40,height:48},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{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}),n.jsxRuntimeExports.jsx(_,{d:"M33 24H3",strokeLinecap:"round"})]})]})},fn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("cap"),e),...r,children:[n.jsxRuntimeExports.jsx(Z,{orientation:t,children:n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(H,{color:s,dimensions:{width:26,height:48},orientation:t,scale:o,children:n.jsxRuntimeExports.jsx(_,{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"})})]}),jn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("manual-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:48},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(ft,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(_,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{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"})]})]}),hn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("filter"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(H,{dimensions:{width:52,height:34},orientation:t,color:s,scale:o,children:n.jsxRuntimeExports.jsx(_,{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 17M6 17H1M46 17H51"})})]}),Wl=e=>typeof e=="number"?{topLeft:l.xy.construct(e),topRight:l.xy.construct(e),bottomLeft:l.xy.construct(e),bottomRight:l.xy.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.xy.construct(e.topLeft),topRight:l.xy.construct(e.topRight),bottomLeft:l.xy.construct(e.bottomLeft),bottomRight:l.xy.construct(e.bottomRight)}:e,Xl=e=>{const{topLeft:t,topRight:s,bottomLeft:o,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${o.x}% / ${t.y}% ${s.y}% ${r.y}% ${o.y}%`},Kl={width:40,height:80},Jl={x:50,y:10},gn=({className:e,dimensions:t=Kl,borderRadius:s=Jl,color:o,onResize:r,...i})=>{const a=Wl(s),c=u.use();return n.jsxRuntimeExports.jsx(W,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Xl(a),borderColor:l.cssString(o??c.colors.gray.l9)},...i,children:n.jsxRuntimeExports.jsxs(Z,{children:[n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:0,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:-.5,top:a.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:101,top:a.topRight.y-1,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:-.5,top:100-a.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:101,top:100-a.bottomRight.y+1,id:"6"}),n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},En=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:84,height:58},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(_,{d:"M42 36.5L5.41845 16.8709C3.41989 15.7985 1 17.2463 1 19.5144V53.4856C1 55.7537 3.4199 57.2015 5.41846 56.1291L42 36.5ZM42 36.5L78.5815 16.8709C80.5801 15.7985 83 17.2463 83 19.5144V53.4856C83 55.7537 80.5801 57.2015 78.5815 56.1291L42 36.5Z"}),n.jsxRuntimeExports.jsx(_,{d:"M40 1.5H27.1522C24.8526 1.5 23.4081 3.9809 24.5432 5.98082L41.1303 35.2058C41.6373 36.099 43 35.7392 43 34.7122V4.5C43 2.84315 41.6569 1.5 40 1.5Z"})]})]}),Sn=({className:e,orientation:t="left",scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("orifice"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:70,height:34},orientation:t,color:o,scale:s,children:[n.jsxRuntimeExports.jsx(_,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Rn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("needle-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:87,height:42},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(_,{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(s)}),n.jsxRuntimeExports.jsx(_,{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"})]})]}),bn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(W,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(Z,{children:[n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(H,{dimensions:{width:64,height:79},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(_,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{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"}),n.jsxRuntimeExports.jsx(_,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),yn=({className:e,color:t,dimensions:s,orientation:o,units:r="psi",children:i,...a})=>{const c=l.cssString(t),x=u.use();let m="var(--pluto-gray-l0)";return t!=null&&(m=l.cssString(new l.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9))),n.jsxRuntimeExports.jsxs(W,{className:l.CSS(l.CSS.B("value"),e),...a,style:{borderColor:c,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(Z,{orientation:o,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:c},children:n.jsxRuntimeExports.jsx(u.Text,{level:"small",color:m,children:r})})]})},Cn=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(W,{orientation:s,children:[n.jsxRuntimeExports.jsx(u.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),vn=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(W,{orientation:t,children:[n.jsxRuntimeExports.jsx(u.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[n.jsxRuntimeExports.jsx(k,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(k,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(k,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(k,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),je=({aetherKey:e,source:t,sink:s})=>{const o=u.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:i},a]=u.use$3({aetherKey:e,type:h.Toggle.TYPE,schema:h.toggleStateZ,initialState:{triggered:!1,enabled:!1,...o}});return d.useEffect(()=>{a(x=>({...x,...o}))},[o,a]),{toggle:d.useCallback(()=>a(x=>({...x,triggered:!x.triggered})),[a]),triggered:r,enabled:i}},wn=e=>l.direction$1.construct(e)==="x"?l.location.swap(e):e,Ql=e=>l.direction$1.construct(e)==="y"?l.location.swap(e):e,oe=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:o="left",chip:r,children:i,...a})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:l.location.rotate90(o),align:"center",justify:"center",empty:!0,...a,children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:l.direction$1.construct(o),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(on,{size:"small",...r}),t&&n.jsxRuntimeExports.jsx(nn,{...s})]}),i]}),$n=u.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:o,source:r,sink:i,orientation:a="left",color:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:r,sink:i});return n.jsxRuntimeExports.jsx(I,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(oe,{...o,orientation:wn(a),children:n.jsxRuntimeExports.jsx(ln,{enabled:x,triggered:m,onClick:p,orientation:a,color:c})})})}),kn=e=>n.jsxRuntimeExports.jsx(ln,{...e}),Pn=u.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:o,source:r,sink:i,orientation:a,color:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:t,source:r,sink:i});return n.jsxRuntimeExports.jsx(I,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...e,orientation:a,children:n.jsxRuntimeExports.jsx(cn,{enabled:x,triggered:m,onClick:p,orientation:a,color:c})})})}),Ln=e=>n.jsxRuntimeExports.jsx(cn,{...e}),Tn=u.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:o="left",normallyOpen:r,color:i,source:a,sink:c,control:x})=>{const{enabled:m,triggered:p,toggle:f}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(oe,{...x,orientation:Ql(o),children:n.jsxRuntimeExports.jsx(an,{enabled:m,triggered:p,onClick:f,orientation:o,color:i,normallyOpen:r})})})}),Mn=e=>n.jsxRuntimeExports.jsx(an,{...e}),Nn=u.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...t,orientation:r,children:n.jsxRuntimeExports.jsx(rn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),Bn=e=>n.jsxRuntimeExports.jsx(rn,{...e}),_n=u.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:o,orientation:r="left",color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:wn(r),children:n.jsxRuntimeExports.jsx(dn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),Dn=e=>n.jsxRuntimeExports.jsx(dn,{...e}),On=u.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(pn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),zn=e=>n.jsxRuntimeExports.jsx(pn,{...e}),Vn=u.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:o,dimensions:r,borderRadius:i})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(gn,{onResize:a=>t({dimensions:a}),orientation:s,color:o,dimensions:r,borderRadius:i})})),An=e=>n.jsxRuntimeExports.jsx(gn,{...e,dimensions:{width:25,height:50}}),In=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(un,{orientation:s,color:o})}),Zn=e=>n.jsxRuntimeExports.jsx(un,{...e}),Fn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(En,{orientation:s,color:o})}),Hn=e=>n.jsxRuntimeExports.jsx(En,{...e}),Gn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(mn,{orientation:s,color:o})}),Yn=e=>n.jsxRuntimeExports.jsx(mn,{...e}),qn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(fn,{orientation:s,color:o})}),Un=e=>n.jsxRuntimeExports.jsx(fn,{...e}),Wn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(jn,{orientation:s,color:o})}),Xn=e=>n.jsxRuntimeExports.jsx(jn,{...e}),Kn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(hn,{orientation:s,color:o})}),Jn=e=>n.jsxRuntimeExports.jsx(hn,{...e}),Qn=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Rn,{orientation:s,color:o})}),eo=e=>n.jsxRuntimeExports.jsx(Rn,{...e}),to=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(xn,{orientation:s,color:o})}),so=e=>n.jsxRuntimeExports.jsx(xn,{...e}),no=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Sn,{orientation:s,color:o})}),oo=e=>n.jsxRuntimeExports.jsx(Sn,{...e}),ro=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(bn,{orientation:s,color:o})}),lo=e=>n.jsxRuntimeExports.jsx(bn,{...e}),io=u.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:o,className:r,textColor:i,color:a,telem:c,units:x,onChange:m,tooltip:p})=>{const f=u.useTypography(s),[j,g]=d.useState({outerBox:l.box$1.ZERO,labelBox:l.box$1.ZERO}),E=(f.lineHeight+.5)*f.baseSize+2,C=u.useResize(d.useCallback(R=>{const y=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let $={...l.box$1.ZERO};y!=null&&($=l.box$1.construct(y),$=l.box$1.resize($,{width:l.box$1.width($),height:l.box$1.height($)})),g({outerBox:R,labelBox:$})},[]),{}),{zoom:b}=h.useInitialViewport(),S=ti({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:E,position:o,zoom:b,...j}),{width:v}=Qs({aetherKey:e,color:i,level:s,box:S,telem:c,minWidth:60});return n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{y:"top"},hide:p==null||p.length===0,children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"y",children:p==null?void 0:p.map((R,y)=>n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:R},y))}),n.jsxRuntimeExports.jsx(I,{className:l.CSS(r,l.CSS.B("value-labeled")),ref:C,onChange:m,...t,children:n.jsxRuntimeExports.jsx(yn,{color:a,dimensions:{height:E,width:v},units:x})})]})}),ei=.9,ti=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:o,position:r,hasLabel:i,zoom:a})=>{const c=l.xy.scale(l.box$1.dims(s),1/(ei*a));return l.direction$1.construct(e)==="x"&&(r=l.xy.translateY(r,Math.max((c.y-o)/2-1,0))),i&&e==="left"?r=l.xy.translateX(r,c.x+4):i&&e==="top"&&(r=l.xy.translateY(r,c.y+4)),l.box$1.construct(r.x,r.y,l.box$1.width(t),o)},co=({color:e})=>n.jsxRuntimeExports.jsx(yn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"50.00"})}),ao=u.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:a,sink:c})=>{const{enabled:x,triggered:m,toggle:p}=je({aetherKey:e,source:a,sink:c});return n.jsxRuntimeExports.jsx(I,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(oe,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Cn,{enabled:x,triggered:m,onClick:p,orientation:r,color:i})})})}),uo=e=>n.jsxRuntimeExports.jsx(Cn,{...e}),xo=u.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:o,control:r})=>{const{click:i}=Zl({aetherKey:e,sink:o});return n.jsxRuntimeExports.jsx(oe,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(vn,{label:t==null?void 0:t.label,onClick:i})})}),po=({label:e,...t})=>n.jsxRuntimeExports.jsx(vn,{label:"Button",...t}),Be=({path:e,allowNull:t=!1})=>{const{bind:s,get:o,set:r}=_e(),[i,a]=d.useState(o(e,t));if(d.useLayoutEffect(()=>(a(o(e,t)),s(e,a,!1)),[e,s,a]),i==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}return{onChange:d.useCallback(c=>r(e,c),[e,r]),...i}},si=(e,t)=>{const s=_e();d.useLayoutEffect(()=>s.bind(e,o=>t(o,s),!1),[e,s])},ni=({path:e,allowNull:t=!1})=>{const{bind:s,get:o}=_e(),[r,i]=d.useState(o(e,t));if(d.useLayoutEffect(()=>(i(o(e,t)),s(e,a=>i({...a,value:l.shallowCopy(a.value)}),!0)),[e,s,o]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},oi=({path:e,updateOnChildren:t=!1})=>{const{bind:s,get:o,set:r}=_e(),[i,a]=d.useState(o(e,!1).value);d.useLayoutEffect(()=>(a(o(e,!1).value),s(e,m=>a(l.shallowCopy(m.value)),t)),[e,s,o,a]);const c=d.useCallback(m=>{const p=l.shallowCopy(o(e,!1).value);p.push(...l.toArray(m)),r(e,p)},[e,o,r]),x=d.useCallback(m=>{const p=l.shallowCopy(o(e,!1).value);l.toArray(m).sort((j,g)=>g-j).forEach(j=>p.splice(j,1)),r(e,p)},[e,i,o]);return{value:i,push:c,remove:x}},ri=u.componentRenderProp(u.Text$1),ne=({path:e,children:t=ri,label:s,padHelpText:o=!0,visible:r=!0,hideIfNull:i=!1,...a})=>{const c=Be({path:e,allowNull:i});if(c==null)return null;if(e==null)throw new Error("Path is required");if(s==null&&(s=l.Case.capitalize(l.external.element(e,-1))),r=typeof r=="function"?r(c):r,!r)return null;const x=c.touched?c.status.message:"",{onChange:m,value:p}=c;return n.jsxRuntimeExports.jsx(de.Item,{padHelpText:o,helpText:x,label:s,...a,children:t({onChange:m,value:p})})},_t=d.createContext({bind:()=>()=>{},set:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1}),validate:()=>!1,value:()=>({}),has:()=>!1}),_e=()=>d.useContext(_t),li=e=>({key:e,variant:"success",message:""}),ii=({values:e,sync:t=!1,schema:s,onChange:o})=>{const r=d.useRef({state:e,status:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=u.useSyncedRef(s),a=u.useSyncedRef(o),c=d.useCallback((j,g,E)=>{var v;const{parentListeners:C,listeners:b}=r.current,S=E?C:b;return S.has(j)||S.set(j,new Set),(v=S.get(j))==null||v.add(g),()=>{var R;return(R=S.get(j))==null?void 0:R.delete(g)}},[]),x=d.useCallback((j,g)=>{const{state:E,status:C,touched:b}=r.current,S=l.external.get(E,j,g);return S==null?null:{value:S,status:C.get(j)??li(j),touched:b.has(j)}},[]),m=d.useCallback(j=>{if(i.current==null)return!0;const{state:g,status:E,listeners:C}=r.current,b=i.current.safeParse(g);if(b.success){const v=Array.from(E.keys());return E.clear(),v.forEach(R=>{var $;const y=x(R,!0);y!=null&&(($=C.get(R))==null||$.forEach(w=>w(y)))}),!0}const S=new Set(b.error.issues.map(v=>v.path.join(".")));return b.error.issues.forEach(v=>{var $;const R=v.path.join(".");E.set(R,{key:R,variant:"error",message:v.message});const y=x(R,!1);($=C.get(R))==null||$.forEach(w=>w(y))}),E.forEach((v,R)=>{var y;if(!S.has(R)){E.delete(R);const $=x(R,!1);(y=C.get(R))==null||y.forEach(w=>w($))}}),!1},[]),p=d.useCallback((j,g)=>{var v,R;const{state:E,touched:C,listeners:b,parentListeners:S}=r.current;C.add(j),j.length===0?r.current.state=g:l.external.set(E,j,g),m(),(v=b.get(j))==null||v.forEach(y=>y(x(j,!1))),S.forEach((y,$)=>{if(j.startsWith($)){const w=x($,!1);y.forEach(P=>P(w))}}),(R=a.current)==null||R.call(a,r.current.state)},[]),f=d.useCallback(j=>{const{state:g}=r.current;return l.external.has(g,j)},[]);return d.useEffect(()=>{if(!t)return;const{listeners:j}=r.current;r.current.state=e,j.forEach((g,E)=>{const C=x(E,!0);C!=null&&g.forEach(b=>b(C))})},[t,e]),d.useMemo(()=>({bind:c,set:p,get:x,validate:m,value:()=>r.current.state,has:f}),[c,p,x,m])},ci=e=>n.jsxRuntimeExports.jsx(_t.Provider,{value:e,children:e.children}),ai=Object.freeze(Object.defineProperty({__proto__:null,Context:_t,Field:ne,Form:ci,use:ii,useChildFieldValues:ni,useContext:_e,useField:Be,useFieldArray:oi,useFieldListener:si},Symbol.toStringTag,{value:"Module"})),ui=({value:e,onChange:t})=>{const{inner:s,outer:o}=e,r=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ie,{selected:o==="top",onClick:r({outer:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ie,{selected:o==="left",onClick:r({outer:"left"})}),n.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(ie,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:r({inner:"top"})}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(ie,{selected:s==="left",onClick:r({inner:"left"})}),n.jsxRuntimeExports.jsx(ie,{selected:s==="right",onClick:r({inner:"right"})})]}),n.jsxRuntimeExports.jsx(ie,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(ie,{selected:o==="right",onClick:r({outer:"right"})})]}),n.jsxRuntimeExports.jsx(ie,{selected:o==="bottom",onClick:r({outer:"bottom"})})]})},ie=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Dt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],re=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(D.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),we=e=>n.jsxRuntimeExports.jsx(ne,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var o;return n.jsxRuntimeExports.jsx(ui,{value:{inner:t.orientation??"top",outer:((o=t.label)==null?void 0:o.orientation)??"top"},onChange:r=>s({...t,orientation:r.inner,label:{...t.label,orientation:r.outer}})})}}),$e=({path:e})=>n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(ne,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(u.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(ne,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(Q.SelectLevel,{...t})})]}),De=e=>n.jsxRuntimeExports.jsx(ne,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...o})=>n.jsxRuntimeExports.jsx(jt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:r=>s(r.rgba255),...o})}),mo=({path:e})=>{var m,p;const{value:t,onChange:s}=Be({path:e}),o=h.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),r=h.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=h.streamChannelValuePropsZ.parse(o.segments.valueStream.props),a=h.setChannelValuePropsZ.parse(r.segments.setter.props),c=f=>{f=f??0;const j=h.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:h.streamChannelValue({channel:f}),threshold:h.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:j})},x=f=>{f=f??0;const j=h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:f}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),g=h.authoritySource({channel:f}),E=h.acquireChannelControl({channel:f,authority:255});s({...t,sink:j,control:{...t.control,showChip:!0,chip:{sink:E,source:g},showIndicator:!0,indicator:{statusSource:g}}})};return n.jsxRuntimeExports.jsxs(re,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(de.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:i.channel,onChange:c})}),n.jsxRuntimeExports.jsx(de.Item,{label:"Output Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:a.channel,onChange:x})})]})},ke=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(mo,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color"})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},xi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(mo,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Switch$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},se=()=>n.jsxRuntimeExports.jsxs(re,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color"})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),Qt={y:2,x:.25},es={lower:0,upper:2e3},di=()=>n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:Qt,bounds:es,...t})}),n.jsxRuntimeExports.jsx(ne,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:Qt,bounds:es,...t})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),pi=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],mi=({path:e})=>{var m;const{value:t,onChange:s}=Be({path:e}),o=h.sourcePipelinePropsZ.parse((m=t.telem)==null?void 0:m.props),r=h.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=h.stringifyNumberProps.parse(o.segments.stringifier.props),a=p=>{const f=h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:p??0}),stringifier:h.stringifyNumber({precision:i.precision??2})},outlet:"stringifier"});s({...t,telem:f})},c=p=>{const f=h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:r.channel}),stringifier:h.stringifyNumber({precision:p})},outlet:"stringifier"});s({...t,telem:f})},x=kt(r.channel);return d.useEffect(()=>{s({...t,tooltip:[x]})},[x]),n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(de.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{value:r.channel,onChange:a})}),n.jsxRuntimeExports.jsx(de.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(u.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:c})})]})},fi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(mi,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",children:[n.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx($e,{path:"label"}),n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(ne,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Text$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=X.useStatic({tabs:pi,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},ji=({path:e})=>{var a;const{value:t,onChange:s}=Be({path:e}),o=h.sinkPipelinePropsZ.parse((a=t.sink)==null?void 0:a.props),r=h.setChannelValuePropsZ.parse(o.segments.setter.props),i=c=>{const x=h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:c}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=h.authoritySource({channel:c}),p=h.acquireChannelControl({channel:c,authority:255});s({...t,sink:x,control:{...t.control,showChip:!0,chip:{sink:p,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return n.jsxRuntimeExports.jsx(re,{direction:"y",children:n.jsxRuntimeExports.jsx(de.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Te,{value:r.channel,onChange:i})})})},hi=()=>{const e=d.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(ji,{path:""});default:return n.jsxRuntimeExports.jsxs(re,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(D.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx($e,{path:"label"})}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},F=4,gi=2,Ei=["threeWayValve","valve","solenoidValve","fourWayValve","angledValve","pump","tank","reliefValve","regulator","burstDisc","cap","manualValve","filter","needleValve","checkValve","orifice","angledReliefValve","value","button","switch"];Po.z.enum(Ei);const he={source:h.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:h.streamChannelValue({channel:0}),threshold:h.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:0}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Si={name:"Three Way Valve",key:"threeWayValve",Form:ke,Symbol:$n,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...he,orientation:"left"}),Preview:kn,zIndex:F},Ri={name:"Valve",key:"valve",Form:ke,Symbol:Pn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Ln,zIndex:F},bi={name:"Pneumatic Valve",key:"solenoidValve",Form:xi,Symbol:Tn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pneumatic Valve",level:"p",orientation:"top"},orientation:"left",normallyOpen:!1,...he}),Preview:Mn,zIndex:F},yi={name:"Four Way Valve",key:"fourWayValve",Form:ke,Symbol:Nn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Bn,zIndex:F},Ci={name:"Angled Valve",key:"angledValve",Form:ke,Symbol:_n,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left",...he}),Preview:Dn,zIndex:F},vi={name:"Pump",key:"pump",Form:ke,Symbol:On,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left",...he}),Preview:zn,zIndex:F},wi={name:"Tank",key:"tank",Form:di,Symbol:Vn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:An,zIndex:gi},$i={name:"Relief Valve",key:"reliefValve",Form:se,Symbol:In,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Zn,zIndex:F},ki={name:"Regulator",key:"regulator",Form:se,Symbol:Fn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:Hn,zIndex:F},Pi={name:"Burst Disc",key:"burstDisc",Form:se,Symbol:Gn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:Yn,zIndex:F},Li={name:"Cap",key:"cap",Form:se,Symbol:qn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:Un,zIndex:F},Ti={name:"Manual Valve",key:"manualValve",Form:se,Symbol:Wn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Xn,zIndex:F},Mi={name:"Filter",key:"filter",Form:se,Symbol:Kn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:Jn,zIndex:F},Ni={name:"Needle Valve",key:"needleValve",Form:se,Symbol:Qn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:eo,zIndex:F},Bi={name:"Check Valve",key:"checkValve",Form:se,Symbol:to,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:so,zIndex:F},_i={name:"Orifice",key:"orifice",Form:se,Symbol:no,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:oo,zIndex:F},Di={name:"Angled Relief Valve",key:"angledReliefValve",Form:se,Symbol:ro,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:lo,zIndex:F},Oi={name:"Value",key:"value",Form:fi,Symbol:io,Preview:co,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:h.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:h.streamChannelValue({channel:0}),stringifier:h.stringifyNumber({precision:2})},outlet:"stringifier"})}),zIndex:F},zi={name:"Button",key:"button",Symbol:xo,Form:hi,Preview:po,defaultProps:e=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:h.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:h.setChannelValue({channel:0}),setpoint:h.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})}),zIndex:F},Vi={name:"Switch",key:"switch",Symbol:ao,Preview:uo,Form:ke,defaultProps:e=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...he}),zIndex:F},Ai={value:Oi,threeWayValve:Si,valve:Ri,solenoidValve:bi,fourWayValve:yi,angledValve:Ci,pump:vi,tank:wi,reliefValve:$i,regulator:ki,burstDisc:Pi,cap:Li,manualValve:Ti,filter:Mi,needleValve:Ni,checkValve:Bi,orifice:_i,angledReliefValve:Di,button:zi,switch:Vi},Ii=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:ro,AngledReliefValvePreview:lo,AngledValve:_n,AngledValvePreview:Dn,BurstDisc:Gn,BurstDiscPreview:Yn,Button:xo,ButtonPreview:po,Cap:qn,CapPreview:Un,CheckValve:to,CheckValvePreview:so,ControlState:oe,Filter:Kn,FilterPreview:Jn,FourWayValve:Nn,FourWayValvePreview:Bn,ManualValve:Wn,ManualValvePreview:Xn,NeedleValve:Qn,NeedleValvePreview:eo,Orifice:no,OrificePreview:oo,Pump:On,PumpPreview:zn,Regulator:Fn,RegulatorPreview:Hn,ReliefValve:In,ReliefValvePreview:Zn,SYMBOLS:Ai,SolenoidValve:Tn,SolenoidValvePreview:Mn,Switch:ao,SwitchPreview:uo,Tank:Vn,TankPreview:An,ThreeWayValve:$n,ThreeWayValvePreview:kn,Value:io,ValuePreview:co,Valve:Pn,ValvePreview:Ln},Symbol.toStringTag,{value:"Module"}));d.createContext({instrumentation:Y.B.NOOP});const Zi=u.wrap$1(h.Provider$1.TYPE,({aetherKey:e,children:t,...s})=>{const o=u.useMemoDeepEqualProps(s),[{path:r},,i]=u.use$3({aetherKey:e,type:h.Provider$1.TYPE,schema:h.providerStateZ,initialState:o});return d.useEffect(()=>{i(o)},[o,i]),n.jsxRuntimeExports.jsx(u.Composite,{path:r,children:t})}),Fi="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjMgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",fo=u.wrap$1(h.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=u.use$3({aetherKey:t,type:h.BaseProvider.TYPE,schema:h.providerStateZ$1,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:e})}),Hi=Object.freeze(Object.defineProperty({__proto__:null,Provider:fo},Symbol.toStringTag,{value:"Module"})),Gi=({children:e,connParams:t,workerEnabled:s=!0,workerURL:o,theme:r,toggleTheme:i,setTheme:a,tooltip:c,triggers:x,alamos:m,haul:p,channelAlias:f})=>n.jsxRuntimeExports.jsx(u.Provider$1,{...x,children:n.jsxRuntimeExports.jsx(u.Config,{...c,children:n.jsxRuntimeExports.jsx(u.Provider$2,{...p,children:n.jsxRuntimeExports.jsx(u.Provider$3,{url:o??Fi,enabled:s,children:n.jsxRuntimeExports.jsx(u.Provider$4,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(Zi,{...m,children:n.jsxRuntimeExports.jsx(u.Aggregator,{children:n.jsxRuntimeExports.jsx(ws,{connParams:t,children:n.jsxRuntimeExports.jsx(Ps,{...f,children:n.jsxRuntimeExports.jsx(fo,{children:n.jsxRuntimeExports.jsx(u.Provider,{theme:r,toggleTheme:i,setTheme:a,children:n.jsxRuntimeExports.jsx(sn,{children:e})})})})})})})})})})})}),Yi=Object.freeze(Object.defineProperty({__proto__:null,Provider:Gi},Symbol.toStringTag,{value:"Module"})),qi=({timeRange:e})=>{const t=new l.TimeStamp(e.start),s=t.isToday?"time":"dateTime",o=new l.TimeStamp(e.end),r=o.equals(l.TimeStamp.MAX),i=o.span(t)<l.TimeSpan.DAY?"time":"dateTime";return n.jsxRuntimeExports.jsxs(D.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",children:[t.isToday&&n.jsxRuntimeExports.jsx(u.Text,{level:"p",shade:7,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:s,shade:7,weight:450,children:t}),n.jsxRuntimeExports.jsx(u.u0.Arrow.Right,{color:"var(--pluto-text-color)"}),r?n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"Now"}):n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:i,shade:7,weight:450,children:o})]})},Ui=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(u.u0.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Wi=e=>{const t=Me();return n.jsxRuntimeExports.jsx(Ct,{...e,searcher:t==null?void 0:t.labels,columns:Ui,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(He,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(He,{color:s.entry.color,children:s.entry.name})})},Xi=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:Wi,TimeRangeChip:qi},Symbol.toStringTag,{value:"Module"})),Ki=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Ji=Object.freeze(Object.defineProperty({__proto__:null,Progress:Ki},Symbol.toStringTag,{value:"Module"}));exports.Aether=u.main;exports.Divider=u.Divider$1;exports.Dropdown=u.Dropdown;exports.Haul=u.Haul;exports.Worker=u.Context$1;exports.compareArrayDeps=u.compareArrayDeps;exports.componentRenderProp=u.componentRenderProp;exports.isRenderProp=u.isRenderProp;exports.useAsyncEffect=u.useAsyncEffect;exports.useClickOutside=u.useClickOutside;exports.useCombinedRefs=u.useCombinedRefs;exports.useCombinedStateAndRef=u.useCombinedStateAndRef;exports.useDebouncedCallback=u.useDebouncedCallback;exports.useEffectCompare=u.useEffectCompare;exports.useMemoCompare=u.useMemoCompare;exports.useMemoDeepEqualProps=u.useMemoDeepEqualProps;exports.usePrevious=u.usePrevious;exports.useResize=u.useResize;exports.useStateRef=u.useStateRef;exports.useSyncedRef=u.useSyncedRef;exports.useTransforms=u.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ve.external;exports.Generic=D.Generic;exports.state=Y.state;exports.telem=h.external;exports.Color=jt.external;exports.Triggers=ht.external;exports.Text=Q.external;exports.List=be.external;exports.createFilterTransform=be.createFilterTransform;exports.fuseFilter=be.fuseFilter;exports.proxyMemo=be.proxyMemo;exports.Align=yo.external;exports.Button=Co.external;exports.createHexOpacityVariants=ts.createHexOpacityVariants;exports.unitProperty=ts.unitProperty;exports.Input=de.external;exports.Menu=vo.external;exports.Tabs=X.external;exports.Theming=wo.external;exports.Tree=$o.external;exports.Video=ko.Video;exports.Accordion=Yo;exports.Canvas=Xo;exports.Channel=Br;exports.Control=Il;exports.Diagram=_l;exports.Eraser=Yr;exports.Form=ai;exports.Line=Jo;exports.LinePlot=gr;exports.Measure=Rr;exports.Mosaic=Hr;exports.Nav=Xr;exports.OS=tl;exports.PID=Ii;exports.Pluto=Yi;exports.Progress=Ji;exports.Ranger=Xi;exports.Resize=zo;exports.Rule=br;exports.Select=pr;exports.Status=To;exports.Synnax=Tr;exports.Tag=or;exports.Telem=Hi;exports.Tooltip=Mo;exports.Value=Ol;exports.Viewport=hr;
2
2
  //# sourceMappingURL=index.cjs.map