@synnaxlabs/pluto 0.33.2 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-C7iWxEah.cjs → Animated-Ck87AGOu.cjs} +1 -1
- package/dist/{Animated-VpxahF8t.js → Animated-CnvOerW9.js} +2 -2
- package/dist/{Item-Dpra-3n6.js → Item--wCat2DH.js} +5 -5
- package/dist/{Item-C1_OE8IF.cjs → Item-DuNQFmgk.cjs} +1 -1
- package/dist/{Keyboard-BBOcinRN.cjs → Keyboard-DPs95Etp.cjs} +1 -1
- package/dist/{Keyboard-CpJQuX-J.js → Keyboard-Dh_Fhwg4.js} +2 -2
- package/dist/LinePlot--yLT9nkT.cjs +34 -0
- package/dist/{LinePlot-DHy70Cb7.js → LinePlot-6KHKqa-2.js} +717 -704
- package/dist/Link-BHtl4aby.cjs +1 -0
- package/dist/{Link-Ctlz9WUQ.js → Link-CDG2-g6A.js} +2 -2
- package/dist/{List-DF0kzXpr.js → List-BjimX8fM.js} +5 -5
- package/dist/List-C8vXIE2j.cjs +1 -0
- package/dist/{Pack-BAJwD-n2.js → Pack-D6eMgf33.js} +9 -9
- package/dist/{Pack-DBtBeGnj.cjs → Pack-DijAGcm_.cjs} +1 -1
- package/dist/{Text-GGA7QNwA.cjs → Text-Cg0q7seY.cjs} +1 -1
- package/dist/{Text-D5o4o3OI.js → Text-CzgVM_22.js} +5 -5
- package/dist/Toggle-CP9KtybX.cjs +143 -0
- package/dist/{Toggle-CTjPdq8o.js → Toggle-Cdu7WaiC.js} +7038 -7049
- package/dist/{Video-B3geSdOZ.cjs → Video-BgDjKMJx.cjs} +1 -1
- package/dist/{Video-CXccd2Jl.js → Video-DYSz9XOF.js} +1 -1
- package/dist/aggregator-C0Ab25_o.cjs +67 -0
- package/dist/{aggregator-QFq5XDjf.js → aggregator-DzdAnRwI.js} +546 -552
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-DqBChhqm.js → css-B4FcyECk.js} +25 -20
- package/dist/css-Dh7n0EGs.cjs +1 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +5 -5
- package/dist/{external-CfOulkkd.js → external-B72rRj4o.js} +5 -5
- package/dist/{external-DT1bMgJw.js → external-BOIjtEGO.js} +2 -2
- package/dist/{external-CUwDGrme.cjs → external-BbS4QDTb.cjs} +1 -1
- package/dist/{external-BPnNv3RZ.cjs → external-CAIE4G3V.cjs} +1 -1
- package/dist/{external-ClRKAhnQ.cjs → external-CYsmC4uZ.cjs} +1 -1
- package/dist/{external-BZpriFW_.cjs → external-Cc9o20Al.cjs} +1 -1
- package/dist/{external-aTGyndBd.cjs → external-CjmMj11F.cjs} +1 -1
- package/dist/{external-Bm3VKQxs.js → external-CoQwrjWl.js} +15 -15
- package/dist/{external-CK8msIo3.js → external-CsqyDUsJ.js} +4 -4
- package/dist/external-CsrLjLOh.cjs +1 -0
- package/dist/{external-CKp_fJJC.js → external-D9Q5Xjko.js} +2 -2
- package/dist/{external-C2YHV6Dz.cjs → external-DRHWURjA.cjs} +1 -1
- package/dist/{external-mRJloDDi.js → external-DcMAC_pY.js} +13 -10
- package/dist/{external-X9NMQ2Zh.cjs → external-Dm2-owlq.cjs} +1 -1
- package/dist/{external-CKuO-iHz.cjs → external-DsKRFJxV.cjs} +1 -1
- package/dist/{external-Ct326ec4.js → external-DvRQ7lJU.js} +2 -2
- package/dist/{external-DyAGPLil.js → external-FVIwMFDr.js} +5 -5
- package/dist/{external-CI2s6wrc.js → external-Yf8Lv9AU.js} +69 -82
- package/dist/{external-Bksh4jhY.cjs → external-eI1p10Vf.cjs} +1 -1
- package/dist/{external-Dhg4bEfF.cjs → external-gz4sf3pG.cjs} +1 -1
- package/dist/{external-BNMsCMKL.js → external-k3Jbrj0m.js} +5 -5
- package/dist/{external-DmLFwKtu.js → external-lgZ2Gmbx.js} +4 -4
- package/dist/{external-EHlrAzYc.js → external-mE-a2ecU.js} +1 -1
- package/dist/{external-DYc6fMZC.cjs → external-mtlL4Z3a.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +11 -5
- package/dist/index.js +9877 -8656
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/aether/aether/aether.d.ts.map +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/caret/Animated.d.ts.map +1 -1
- package/dist/src/channel/AliasProvider.d.ts.map +1 -1
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/color/core/color.d.ts.map +1 -1
- package/dist/src/divider/Divider.d.ts.map +1 -1
- package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/form/Field.d.ts.map +1 -1
- package/dist/src/form/Form.d.ts.map +1 -1
- package/dist/src/form/synced.d.ts.map +1 -1
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/input/Item.d.ts.map +1 -1
- package/dist/src/input/Label.d.ts.map +1 -1
- package/dist/src/input/Numeric.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/label/Select.d.ts.map +1 -1
- package/dist/src/list/Item.d.ts.map +1 -1
- package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/menu/Item.d.ts.map +1 -1
- package/dist/src/modal/Modal.d.ts.map +1 -1
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/notation/SelectNotation.d.ts +12 -0
- package/dist/src/notation/SelectNotation.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts +33 -0
- package/dist/src/notation/notation.d.ts.map +1 -0
- package/dist/src/notation/notation.spec.d.ts +2 -0
- package/dist/src/notation/notation.spec.d.ts.map +1 -0
- package/dist/src/note/Note.d.ts.map +1 -1
- package/dist/src/observe/use.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/progress/Progress.d.ts.map +1 -1
- package/dist/src/ranger/Select.d.ts.map +1 -1
- package/dist/src/select/Alignment.d.ts.map +1 -1
- package/dist/src/select/List.d.ts.map +1 -1
- package/dist/src/select/Multiple.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/status/Notification.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts.map +1 -1
- package/dist/src/tabs/Selector.d.ts.map +1 -1
- package/dist/src/tabs/Tabs.d.ts.map +1 -1
- package/dist/src/tabs/types.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/Pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +9 -0
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
- package/dist/src/telem/client/reader.d.ts.map +1 -1
- package/dist/src/telem/control/Controller.d.ts.map +1 -1
- package/dist/src/telem/control/Legend.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/text/DateTime.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/SelectLevel.d.ts.map +1 -1
- package/dist/src/text/dimensions.d.ts.map +1 -1
- package/dist/src/tooltip/Dialog.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/triggers/Provider.d.ts.map +1 -1
- package/dist/src/triggers/hooks.d.ts.map +1 -1
- package/dist/src/util/zod.d.ts.map +1 -1
- package/dist/src/vis/button/aether/button.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +23 -14
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
- package/dist/src/vis/diagram/util.d.ts +1 -1
- package/dist/src/vis/diagram/util.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/draw2d/index.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/legend/Simple.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/vis/log/Log.d.ts.map +1 -1
- package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
- package/dist/src/vis/measure/Measure.d.ts.map +1 -1
- package/dist/src/vis/render/loop.d.ts.map +1 -1
- package/dist/src/vis/render/performance.d.ts.map +1 -1
- package/dist/src/vis/render/util.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
- package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts +9 -0
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +4 -1
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/src/worker/Context.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-6W_8ukD-.cjs → units-CR-P9eLW.cjs} +1 -1
- package/dist/{units-BHSMvrYX.js → units-rb5QAWjs.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +18 -18
- package/dist/LinePlot-Bwz2fEc0.cjs +0 -34
- package/dist/Link-Cxj-3A6p.cjs +0 -1
- package/dist/List-CcTL6wlO.cjs +0 -1
- package/dist/Toggle-Dim0E2D2.cjs +0 -143
- package/dist/aggregator-D6Mmsfj4.cjs +0 -67
- package/dist/css-CvXvQo39.cjs +0 -1
- package/dist/external-e143l3cy.cjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var dx=Object.defineProperty;var xx=(e,t,n)=>t in e?dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ke=(e,t,n)=>xx(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Cek9Ww4S.cjs"),f=require("react"),g=require("./Toggle-Dim0E2D2.cjs"),x=require("./css-CvXvQo39.cjs"),qn=require("./external-DYc6fMZC.cjs"),Z=require("./aggregator-D6Mmsfj4.cjs"),X=require("./Pack-DBtBeGnj.cjs"),fx=require("./external-ClRKAhnQ.cjs"),be=require("./external-BPnNv3RZ.cjs"),px=require("./external-C2YHV6Dz.cjs"),_i=require("./Animated-C7iWxEah.cjs"),P=require("./LinePlot-Bwz2fEc0.cjs"),ne=require("zod"),_r=require("./external-Dhg4bEfF.cjs"),Me=require("./external-X9NMQ2Zh.cjs"),mx=require("./Text-GGA7QNwA.cjs"),ki=require("./external-Bksh4jhY.cjs");require("./Item-C1_OE8IF.cjs");const kr=require("react-dom"),nn=require("./external-BZpriFW_.cjs"),Pi=require("./units-6W_8ukD-.cjs"),He=require("./external-CKuO-iHz.cjs"),hx=require("./external-CUwDGrme.cjs"),gx=require("./external-aTGyndBd.cjs"),yx=require("./external-e143l3cy.cjs"),Sx=require("./Video-B3geSdOZ.cjs"),Ni=({variant:e,...t})=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{color:g.variantColors[e],style:{color:g.variantColors[e]},...t}),Ex=({status:{key:e,time:t,count:n,message:s,description:r,variant:o},silence:i,actions:c,className:a,children:d,...u})=>l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS(x.CSS.B("notification"),a),direction:"y",empty:!0,...u,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",size:"small",children:[l.jsxRuntimeExports.jsx(Ni,{style:{height:"2.25rem",width:"2.5rem"},variant:o}),l.jsxRuntimeExports.jsx(g.Text,{level:"small",shade:7,children:`x${n}`}),l.jsxRuntimeExports.jsx(g.DateTime,{className:x.CSS(x.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>i(e),children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})})]}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",align:"start",className:x.CSS(x.CSS.BE("notification","content")),size:"small",children:[d??l.jsxRuntimeExports.jsx(g.Text,{className:x.CSS(x.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&l.jsxRuntimeExports.jsx(g.Text,{className:x.CSS(x.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&l.jsxRuntimeExports.jsx(X.Space,{direction:"x",align:"center",justify:"end",className:x.CSS(x.CSS.BE("notification","actions")),children:Z.A(c).map(p=>l.jsxRuntimeExports.jsx(jx,{action:p},p.key))})]},t.toString()),jx=({action:e})=>{if(!f.isValidElement(e)){const t=e;return l.jsxRuntimeExports.jsx(g.Button,{...t})}return e},Rx=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:g.Aggregator,Circle:Ni,Notification:Ex,Text:g.Text$2,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:g.useAggregator,useContext:g.useContext$2,useNotifications:g.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),bx=Object.freeze(Object.defineProperty({__proto__:null,Config:g.Config,Context:g.Context,Dialog:g.Dialog$1,chooseLocation:g.chooseLocation,formatTip:g.formatTip,useConfig:g.useConfig,wrap:g.wrap},Symbol.toStringTag,{value:"Module"})),es=e=>e.preventDefault(),Ss=f.forwardRef(({location:e,style:t,size:n,className:s,children:r,onDragStart:o,sizeUnits:i="px",showHandle:c=!0,...a},d)=>{const u=x.J.construct(e),p=x.J.direction(u),m=x.g.dimension(p);return l.jsxRuntimeExports.jsxs("div",{className:x.CSS(x.CSS.B("resize"),x.CSS.loc(u),x.CSS.dir(p),s),style:{[m]:`${n}${i}`,...t},ref:d,...a,children:[r,c&&l.jsxRuntimeExports.jsx("div",{draggable:!0,className:x.CSS(x.CSS.BE("resize","handle"),x.CSS.bordered(x.J.swap(u))),onDragStart:o,onDrag:es,onDragEnd:es})]})});Ss.displayName="Resize.Core";const Pr=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const o=f.useRef(null),[i,c]=f.useState({sizeDistribution:wx(n,t),root:null}),a=f.useCallback((p,m,h)=>{if(o.current==null)return;const E=x.Eo.dim(x.Eo.construct(o.current),r);c(y=>Vs(y,E,p,s,m,h))},[s,c,r]);f.useEffect(()=>e==null?void 0:e(i.sizeDistribution),[i.sizeDistribution,e]);const d=f.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",E=w=>a(m,w[h]),y=()=>{c(w=>({...w,root:null})),document.removeEventListener("mousemove",E)};c(w=>({...w,root:p[h]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",y,{once:!0})},[c,r,Vs]);return{setSize:f.useCallback((p,m)=>a(p,void 0,m),[Vs]),props:{direction:r,sizeDistribution:i.sizeDistribution,onDragHandle:d,ref:o}}},Es=f.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:s,className:r,...o},i)=>{const c=x.g.construct(e),a=f.Children.toArray(t);return n=Cx(n),l.jsxRuntimeExports.jsx(X.Space,{...o,ref:i,direction:c,className:x.CSS(x.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:a.map((d,u)=>l.jsxRuntimeExports.jsx(Ss,{onDragStart:p=>s(p,u),location:x.g.location(c),size:n[u]*100,sizeUnits:"%",showHandle:u!==a.length-1,children:d},u))})});Es.displayName="Resize.Multiple";const wx=(e,t)=>{const n=e.reduce((r,o)=>r+o,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},Is=.001,Cx=e=>e.every(t=>x.W.closeTo(t,1/e.length),Is)?e.map((t,n)=>n%2===0?t+Is:n===e.length-1?t:t-Is):e,Vs=(e,t,n,s,r,o)=>{const i=Mi(e,t,n,r,o),[c,a]=vx(e.sizeDistribution,n,i,s/t),d=a?r??null:e.root;return{...e,sizeDistribution:c,root:d}},Mi=(e,t,n,s,r)=>{let o;if(r!=null)r>1&&(r=r/t),o=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");o=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return o},vx=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const o=e[r]+n,i=_x(r,e,s,n),c=e[i]-n;return o<s||c<s?[e,!1]:[e.map((a,d)=>d===r?o:d===i?c:a),!0]},_x=(e,t,n,s)=>(e===t.length-1?Px:kx)(e,t,n,s),kx=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},Px=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},js=({onMove:e,onStart:t,onEnd:n})=>f.useCallback(s=>{s.preventDefault();const r=x.q.construct(s),o=g.mouseKey(s.button);t==null||t(r,o,s);const i=a=>{if(a.buttons===0)return c(a);const d=x.q.construct(a);e==null||e(x.Eo.construct(r,d),o,a)};window.addEventListener("mousemove",i);const c=a=>{window.removeEventListener("mousemove",i);const d=x.q.construct(a);n==null||n(x.Eo.construct(r,d),o,a)};window.addEventListener("mouseup",c,{once:!0})},[e,t,n]),Fs=2,Ti=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:o=200,collapseThreshold:i=1/0,className:c,...a})=>{const[d,u]=f.useState(x.j(o,s,r)),p=f.useRef(null),m=x.J.construct(n),h=f.useCallback(v=>{if(p.current===null)return 0;const R=x.Eo.dim(v,x.J.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),b=p.current+R,_=x.j(b,s,r);return(_-b)/s>i?Fs:_},[m,s,r,i]),E=f.useRef(null),y=f.useCallback(v=>{const R=h(v);u(R),E.current!=null&&(t==null||t(R,x.Eo.construct(E.current)))},[t,h]),w=f.useCallback(()=>u(v=>(p.current=v,v)),[u]),j=f.useCallback(v=>h(v)===Fs&&(e==null?void 0:e()),[e,h]);f.useEffect(()=>u(v=>{const R=x.j(v,s,r);return p.current=R,R}),[s,r]);const C=js({onMove:y,onStart:w,onEnd:j});return l.jsxRuntimeExports.jsx(Ss,{ref:E,location:m,size:d,onDragStart:C,className:x.clsx(c,x.CSS.expanded(d!==Fs)),...a})},Nx=Object.freeze(Object.defineProperty({__proto__:null,Core:Ss,Multiple:Es,Single:Ti,calculateDiffPercentage:Mi,useMultiple:Pr},Symbol.toStringTag,{value:"Module"})),Yn="y",bo=28,Mx=32,Tx=40,Ax=.5,Lx=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...o}}=Pr({direction:Yn,count:e.length,minSize:bo}),i=c=>{if(r.current==null)return;const a=x.Eo.dim(x.Eo.construct(r.current),Yn);s[c]<Tx/a?n(c,e[c].initialSize??Ax):n(c,bo+1)};return l.jsxRuntimeExports.jsx(Es,{empty:!0,className:x.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...o,children:e.map((c,a)=>f.createElement(Dx,{...c,key:c.key,index:a,direction:Yn,onExpand:i,parent:r,size:s[a]}))})},$x=l.jsxRuntimeExports.jsx(g.Qt.Caret.Down,{"aria-label":"contract"}),Ox=l.jsxRuntimeExports.jsx(g.Qt.Caret.Right,{"aria-label":"expand"}),Dx=({index:e,name:t,content:n,actions:s,size:r,parent:o,onExpand:i})=>{let c=!0;if(o.current!=null){const d=x.Eo.dim(x.Eo.construct(o.current),Yn);c=r*d>Mx}const a=c?$x:Ox;return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsxs(qn.Header,{level:"p",className:x.CSS.expanded(c),empty:!0,children:[l.jsxRuntimeExports.jsx(qn.ButtonTitle,{startIcon:a,onClick:()=>i(e),children:t}),s!=null&&l.jsxRuntimeExports.jsx(qn.Actions,{children:s})]}),n]})},zx=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Lx},Symbol.toStringTag,{value:"Module"})),Ai=(e,t,n)=>Z.A(e).map(o=>o.split(t)).flat().map((o,i)=>[l.jsxRuntimeExports.jsx(g.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:x.CSS.shade(n)}},`${o}-${i}`),o]).flat(),Bx=({children:e,icon:t,shade:n=7,weight:s=450,size:r=.5,url:o,level:i="p",separator:c=".",className:a,hideFirst:d=!1,...u})=>{o!=null&&(e=o);const p=Ai(e,c,n);return d&&p.shift(),l.jsxRuntimeExports.jsxs(g.WithIcon,{className:x.CSS(a,x.CSS.B("breadcrumb")),level:i,shade:n,weight:s,size:r,...u,children:[be.resolve(t),...p]})},Ix=({url:e,className:t,level:n="p",separator:s=".",shade:r=7})=>{const o=Ai(e,s,r);return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(t,x.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:o.map((i,c)=>{if(g.isValidElement(i))return i;if(i==null)return null;const d=e.split(s).indexOf(i);let u=e.split(s).slice(0,d+1).join("/");return u="/"+u,l.jsxRuntimeExports.jsx(g.Link,{level:n,href:u,children:i.split("-").map(p=>x._$1.capitalize(p)).join(" ")},c)})})},Vx=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Bx,URL:Ix},Symbol.toStringTag,{value:"Module"})),Nr=f.createContext(P.ZERO_CONTEXT_VALUE),Ye=()=>f.useContext(Nr).synnax,Fx=()=>f.useContext(Nr).state,wo={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Li="serverVersionMismatch",Zx=(e,t,n)=>`Cluster version ${n!=null?n+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,$i=g.wrap$1(P.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,r,o]=g.useCombinedStateAndRef(P.ZERO_CONTEXT_VALUE),[{path:i},,c]=g.use$3({aetherKey:e,type:P.Provider.TYPE,schema:P.Provider.stateZ,initialState:{props:t??null,state:null}}),a=g.useAggregator(),d=f.useCallback(u=>{o.current.state.status!==u.status&&a({variant:wo[u.status],message:u.message??x._$1.capitalize(u.status)}),r(p=>({...p,state:u}))},[a]);return g.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return r(P.ZERO_CONTEXT_VALUE);const u=new Z.Lf({...t,connectivityPollFrequency:Z.k.seconds(5)});r({synnax:u,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:u.clientVersion}});const p=await u.connectivity.check();if(r({synnax:u,state:p}),a({variant:wo[p.status],message:p.message??p.status.toUpperCase()}),p.status==="connected"&&!p.clientServerCompatible){const m=p.nodeVersion==null||Z.H.semVerOlder(p.nodeVersion,p.clientVersion),h=Zx(m,p.clientVersion,p.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:h,data:{type:Li,oldServer:m,nodeVersion:p.nodeVersion,clientVersion:p.clientVersion}})}return u.connectivity.onChange(d),c({props:t,state:p}),()=>{u.close(),r(P.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,d]),l.jsxRuntimeExports.jsx(Nr.Provider,{value:s,children:l.jsxRuntimeExports.jsx(g.Composite,{path:i,children:n})})}),Hx=Object.freeze(Object.defineProperty({__proto__:null,Provider:$i,SERVER_VERSION_MISMATCH:Li,use:Ye,useConnectionState:Fx},Symbol.toStringTag,{value:"Module"})),sn=f.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Oi=()=>f.useContext(sn),Di=e=>{const{aliases:t}=f.useContext(sn);return t[e]??null},Rs=()=>{const{aliases:e}=f.useContext(sn);return e},bs=(e,t="")=>{const{getName:n}=f.useContext(sn),[s,r]=f.useState(t);return g.useAsyncEffect(async()=>{const o=await n(e);o!=null&&r(o)},[e,n]),s??t},Mr=()=>{const{activeRange:e}=f.useContext(sn);return e??void 0},zi=({activeRange:e,children:t})=>{const n=Ye(),[s,r]=f.useState({}),o=f.useCallback(a=>{r(d=>{const u={...d};return a.forEach(({variant:p,key:m,value:h})=>{const E=Number(m.split("---")[1]);p==="delete"?delete u[E]:u[h.channel]=h.alias}),u})},[r]),i=f.useCallback(async(a,d)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,d)},[n,e]),c=f.useCallback(async a=>{if(n==null||a===0)return;const d=s[a];return d??(await n.channels.retrieve(a)).name},[s,n]);return g.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),d=await a.listAliases();r(d);const u=await a.openAliasTracker(),p=u.onChange(o);return()=>{p(),u.close()}},[n,e]),l.jsxRuntimeExports.jsx(sn.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?i:null,getName:c},children:t})},qx=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[o,i]=f.useState(!1),{setAlias:c}=Oi(),a=Di(e),d=bs(e);let u=l.jsxRuntimeExports.jsx(g.Qt.Rename,{});o?u=l.jsxRuntimeExports.jsx(g.Qt.Loading,{}):a===t&&(u=l.jsxRuntimeExports.jsx(g.Qt.Check,{}));const p=c!=null&&!o&&a!==t&&e!==0,m=()=>{p&&(async()=>(i(!0),await c(e,t),i(!1)))()},h=()=>{var y;a!=null&&((y=r.onChange)==null||y.call(r,a))},E=()=>e===0?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Alias synced with this label"}):l.jsxRuntimeExports.jsxs(g.Text,{level:"small",children:["Sync alias for ",d," with this label"]});return l.jsxRuntimeExports.jsxs(g.Text$1,{value:t,...r,children:[p&&l.jsxRuntimeExports.jsx(g.Icon,{onClick:h,tooltip:l.jsxRuntimeExports.jsxs(g.Text,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:l.jsxRuntimeExports.jsx(g.Qt.Sync,{})}),l.jsxRuntimeExports.jsx(g.Icon,{onClick:m,disabled:!p,tooltip:l.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:u})]})},Qe="channel";var Co=180/Math.PI,rr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bi(e,t,n,s,r,o){var i,c,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*Co,skewX:Math.atan(a)*Co,scaleX:i,scaleY:c}}var On;function Yx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rr:Bi(t.a,t.b,t.c,t.d,t.e,t.f)}function Ux(e){return e==null||(On||(On=document.createElementNS("http://www.w3.org/2000/svg","g")),On.setAttribute("transform",e),!(e=On.transform.baseVal.consolidate()))?rr:(e=e.matrix,Bi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ii(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function o(d,u,p,m,h,E){if(d!==p||u!==m){var y=h.push("translate(",null,t,null,n);E.push({i:y-4,x:P.interpolateNumber(d,p)},{i:y-2,x:P.interpolateNumber(u,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function i(d,u,p,m){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:P.interpolateNumber(d,u)})):u&&p.push(r(p)+"rotate("+u+s)}function c(d,u,p,m){d!==u?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:P.interpolateNumber(d,u)}):u&&p.push(r(p)+"skewX("+u+s)}function a(d,u,p,m,h,E){if(d!==p||u!==m){var y=h.push(r(h)+"scale(",null,",",null,")");E.push({i:y-4,x:P.interpolateNumber(d,p)},{i:y-2,x:P.interpolateNumber(u,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,u){var p=[],m=[];return d=e(d),u=e(u),o(d.translateX,d.translateY,u.translateX,u.translateY,p,m),i(d.rotate,u.rotate,p,m),c(d.skewX,u.skewX,p,m),a(d.scaleX,d.scaleY,u.scaleX,u.scaleY,p,m),d=u=null,function(h){for(var E=-1,y=m.length,w;++E<y;)p[(w=m[E]).i]=w.x(h);return p.join("")}}}var Gx=Ii(Yx,"px, ","px)","deg)"),Wx=Ii(Ux,", ",")",")"),Kx=1e-12;function vo(e){return((e=Math.exp(e))+1/e)/2}function Xx(e){return((e=Math.exp(e))-1/e)/2}function Qx(e){return((e=Math.exp(2*e))-1)/(e+1)}const Jx=function e(t,n,s){function r(o,i){var c=o[0],a=o[1],d=o[2],u=i[0],p=i[1],m=i[2],h=u-c,E=p-a,y=h*h+E*E,w,j;if(y<Kx)j=Math.log(m/d)/t,w=function($){return[c+$*h,a+$*E,d*Math.exp(t*$*j)]};else{var C=Math.sqrt(y),v=(m*m-d*d+s*y)/(2*d*n*C),R=(m*m-d*d-s*y)/(2*m*n*C),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(R*R+1)-R);j=(_-b)/t,w=function($){var O=$*j,N=vo(b),D=d/(n*C)*(N*Qx(t*O+b)-Xx(b));return[c+D*h,a+D*E,d*N/vo(t*O+b)]}}return w.duration=j*1e3*t/Math.SQRT2,w}return r.rho=function(o){var i=Math.max(.001,+o),c=i*i,a=c*c;return e(i,c,a)},r}(Math.SQRT2,2,4),ef=Object.freeze(Object.defineProperty({__proto__:null,Canvas:P.Canvas,axisStateZ:P.axisStateZ,newTickFactory:P.newTickFactory,tickFactoryProps:P.tickFactoryProps,tickType:P.tickType},Symbol.toStringTag,{value:"Module"})),tf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:P.AcquireChannelControl,AuthoritySource:P.AuthoritySource,Chip:P.Chip,Controller:P.Controller$1,Indicator:P.Indicator,Legend:P.Legend,REGISTRY:P.REGISTRY$3,STATUSES:P.STATUSES,SetChannelValue:P.SetChannelValue,StateProvider:P.StateProvider,acquireChannelControl:P.acquireChannelControl,acquireChannelControlPropsZ:P.acquireChannelControlPropsZ,authoritySource:P.authoritySource,authoritySourceProps:P.authoritySourceProps,chipStateZ:P.chipStateZ,controllerStateZ:P.controllerStateZ,indicatorStateZ:P.indicatorStateZ,legendStateZ:P.legendStateZ,setChannelValue:P.setChannelValue,setChannelValuePropsZ:P.setChannelValuePropsZ,stateProviderStateZ:P.stateProviderStateZ,statusZ:P.statusZ,sugaredStateZ:P.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),nf={region:x.Eo.ZERO,dpr:1,os:Z.w.getOS()},sf={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},rf=g.wrap$1(P.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...r})=>{const[{path:o},{bootstrapped:i,dpr:c},a]=g.use$3({aetherKey:n,type:P.Canvas$1.TYPE,schema:P.canvasStateZ,initialState:nf}),d=f.useRef({...sf}),u=f.useCallback(h=>{d.current.bootstrapped&&a(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})}))},[a]),p=g.useResize(u,{debounce:t});f.useEffect(()=>{const h=()=>{window.devicePixelRatio!==c&&a(E=>({...E,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",h,{once:!0})},[c]),f.useEffect(()=>{window.addEventListener("focus",()=>a(h=>({...h}))),window.addEventListener("blur",()=>a(h=>({...h})))},[a]);const m=f.useCallback(h=>{if(p(h),h==null)return;h.className.includes("gl")?d.current.gl=h:h.className.includes("upper2d")?d.current.upper2d=h:d.current.lower2d=h;const{gl:E,lower2d:y,upper2d:w,bootstrapped:j}=d.current;if(E==null||y==null||w==null||j)return;d.current.bootstrapped=!0;const C=E.transferControlToOffscreen(),v=w.transferControlToOffscreen(),R=y.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:v,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:x.Eo.construct(E),dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})},[C,v,R])},[a]);return l.jsxRuntimeExports.jsxs("div",{className:x.CSS(x.CSS.B("canvas-container"),s),...r,children:[l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","lower2d"))}),l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","gl"))}),l.jsxRuntimeExports.jsx("canvas",{ref:m,className:x.CSS(x.CSS.B("canvas"),x.CSS.BM("canvas","upper2d"))}),l.jsxRuntimeExports.jsx(g.Composite,{path:o,children:i&&e})]})}),ws=(e,t)=>g.useResize(f.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(x.k$2.XY.translate(x.q.scale(x.Eo.topLeft(r),-1)).box(n),s)},[e]),t),of=Object.freeze(Object.defineProperty({__proto__:null,Canvas:rf,useRegion:ws},Symbol.toStringTag,{value:"Module"})),Vi=f.createContext(null),ot=e=>{const t=f.useContext(Vi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Fi=e=>{const t=ot("Viewport"),{addViewportHandler:n}=t;f.useEffect(()=>n(e),[n,e])},Mn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=ot(t),{key:r}=e;return g.useEffectCompare(()=>{x.J.outer.parse(e.loc),n(e)},([c],[a])=>Z._.equal(c,a),[e]),f.useEffect(()=>()=>s(r),[]),{gridArea:x.g.swap(x.J.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Zi=g.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=x.q.ZERO,children:r,hold:o=!1,onHold:i,visible:c,...a})=>{const[d,u]=f.useState([]),p=g.useMemoDeepEqualProps({clearOverScan:s,hold:o,visible:c}),[{path:m},{grid:h},E]=g.use$3({aetherKey:e,type:P.LinePlot.TYPE,schema:P.linePlotStateZ,initialState:{container:x.Eo.ZERO,viewport:x.Eo.DECIMAL,grid:{},...p}});f.useEffect(()=>E(T=>({...T,...p})),[p]);const y=f.useRef(new Map),w=f.useCallback(T=>(y.current.set(T,null),()=>y.current.delete(T)),[y]),j=f.useCallback(T=>{const{mode:M,box:z,stage:S}=T;(M==="pan"&&S!=="start"||M==="zoom"||M==="zoomReset"&&S==="start")&&E(L=>({...L,viewport:z})),y.current.forEach((L,k)=>k(T))},[E]),C=f.useCallback(T=>E(M=>({...M,container:T})),[E]),v=ws(C,{debounce:n}),R=f.useCallback(T=>E(M=>({...M,grid:{...M.grid,[T.key]:T}})),[E]),b=f.useCallback(T=>E(M=>{const{[T]:z,...S}=M.grid;return{...M,grid:S}}),[E]),_=f.useCallback(T=>{u(M=>[...M.filter(({key:z})=>z!==T.key),T])},[u,j]),$=f.useCallback(T=>u(M=>M.filter(({key:z})=>z!==T)),[_]),O=f.useMemo(()=>lf(h),[h]),N=f.useCallback(T=>{E(M=>({...M,hold:T})),i==null||i(T)},[E,i]),D=f.useMemo(()=>({lines:d,setGridEntry:R,removeGridEntry:b,setLine:_,removeLine:$,setViewport:j,addViewportHandler:w,setHold:N}),[d,R,b,_,$,j,w,N]);return l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("line-plot"),style:{...t,...O},ref:v,...a,children:l.jsxRuntimeExports.jsx(Vi.Provider,{value:D,children:l.jsxRuntimeExports.jsx(g.Composite,{path:m,children:r})})})}),lf=e=>{const t=x.CSS.newGridBuilder();return P.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),P.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),P.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),P.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},Tr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?P.XAxis.TYPE:P.YAxis.TYPE,s=`${e}-axis`;return g.wrap$1(n,({aetherKey:r,children:o,location:i=t,label:c="",labelLevel:a="small",labelDirection:d=e,onLabelChange:u,color:p,labelSize:m,showGrid:h,type:E,bounds:y,className:w,tickSpacing:j,autoBounds:C,autoBoundUpdateInterval:v,onAutoBoundsChange:R,style:b,..._})=>{const $=((c==null?void 0:c.length)??0)>0,O=g.useMemoDeepEqualProps({location:i,showGrid:h,type:E,bounds:y,label:c,labelDirection:d,tickSpacing:j,autoBounds:C,autoBoundUpdateInterval:v}),[{path:N},{size:D,labelSize:T,...M},z]=g.use$3({aetherKey:r,type:n,schema:P.coreAxisStateZ,initialState:O});f.useEffect(()=>z(I=>({...I,...O})),[O]),f.useEffect(()=>{const{lower:I,upper:B}=P.parseAutoBounds(M.autoBounds);M.bounds!=null&&(I&&(y==null?void 0:y.lower)!==M.bounds.lower||B&&(y==null?void 0:y.upper)!==M.bounds.upper)&&(R==null||R(M.bounds))},[M.autoBounds,M.bounds]);const S=Mn({loc:i,key:`${n}-${r}`,size:D+T,order:1},`${e.toUpperCase()}Axis`),L=g.useTypography(a).toString(),k=f.useRef(0);return f.useEffect(()=>{if(e==="y"){if(c==null)return;let B=Z.dimensions(c,L)[x.g.dimension(x.g.construct(d))];B>0&&(B+=9),z(A=>({...A,labelSize:B}))}else{let B=Z.dimensions(c,L).height*1.3;B>0&&(B+=12);const A=k.current;P.withinSizeThreshold(A,B)||(k.current=B,z(V=>({...V,labelSize:B})))}},[c,d,L]),l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(w,x.CSS.B("axis"),x.CSS.B(s),x.CSS.loc(i)),style:{...b,...S},align:"center",justify:i!=="left"?"end":"start",direction:x.g.swap(e),..._,children:$&&l.jsxRuntimeExports.jsx(g.MaybeEditable,{className:x.CSS(x.CSS.BE("axis","label"),x.CSS.dir(d)),value:c,onChange:u,level:a})}),l.jsxRuntimeExports.jsx(g.Composite,{path:N,children:o})]})})},Hi=Tr("x"),qi=Tr("y"),Yi=x.q.xy.extend({root:x.J.corner,units:ne.z.object({x:ne.z.enum(["px","decimal"]),y:ne.z.enum(["px","decimal"])})}),cf=Yi.partial({root:!0,units:!0}),af=e=>{var n,s,r,o;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((o=e==null?void 0:e.units)==null?void 0:o.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},uf=(e,t)=>{var o,i,c,a,d,u;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=x.Eo.construct(t.current),r=x.Eo.construct(t.current.parentElement);return((o=e.units)==null?void 0:o.x)==="decimal"?((i=e.root)==null?void 0:i.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+x.Eo.width(s))/x.Eo.width(r):n.x/=x.Eo.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((d=e.root)==null?void 0:d.y)==="bottom"&&(n.y=1-e.y):((u=e.root)==null?void 0:u.y)==="bottom"?n.y=1-(e.y+x.Eo.height(s))/x.Eo.height(r):n.y/=x.Eo.height(r),n},Ui=(e,t)=>{if(t.current==null)return null;const n=x.Eo.construct(t.current.parentElement),s=x.Eo.construct(t.current),r={x:e.x,y:e.y,root:{...x.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*x.Eo.width(n)-x.Eo.width(s),r.root.x="right"):e.x<.2?r.x=e.x*x.Eo.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*x.Eo.height(n)-x.Eo.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*x.Eo.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...x.q.truncate(r,3)}},_o=x.Eo.reRoot(x.Eo.DECIMAL,x.J.TOP_LEFT),Ar=f.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...o})=>{const[i,c]=Z.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:x.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=f.useRef(i),d=g.useSyncedRef(r===!1),u=f.useRef(null);i!==null&&(s={...s,...af(i)});const p=f.useCallback(h=>{var R;if(((R=u.current)==null?void 0:R.parentElement)==null)return a.current;const E=x.Eo.construct(u.current.parentElement),y=x.k$2.XY.scale(E).scale(_o),w=y.box(x.Eo.construct(u.current)),j=x.k$2.XY.clamp(x.Eo.construct(x.Eo.topLeft(_o),{width:1-x.Eo.width(w),height:1-x.Eo.height(w)})),C=x.q.translate(x.q.construct(a.current),x.Eo.signedDims(y.box(h))),v=j.pos(C);return Ui(v,u)},[]),m=js({onStart:f.useCallback(()=>{a.current=uf(a.current,u)},[]),onMove:f.useCallback(h=>{if(d.current)return;const E=p(h);E!==null&&c(E)},[]),onEnd:f.useCallback(h=>{if(d.current)return;const E=p(h);E!==null&&(a.current=E)},[])});return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(e,x.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:u,...o,onDrag:es,onDragEnd:es,empty:!0})});Ar.displayName="Legend.Container";const Lr=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:o})=>l.jsxRuntimeExports.jsxs(X.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[l.jsxRuntimeExports.jsx(_r.Swatch,{value:r,onChange:i=>t==null?void 0:t({key:s,color:i,label:o}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),l.jsxRuntimeExports.jsx(g.MaybeEditable,{level:"small",value:o,onChange:i=>t==null?void 0:t({key:s,color:r,label:i}),noWrap:!0})]},s)),$r=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[o,i]=f.useState(!1);return e.length===0?null:l.jsxRuntimeExports.jsx(Ar,{...r,draggable:!o,value:n,onChange:s,children:Lr(e,t,i)})},df=Object.freeze(Object.defineProperty({__proto__:null,Container:Ar,Simple:$r,calcStickyPos:Ui,completeStickyXYz:Yi,legendSwatches:Lr,stickyXYz:cf},Symbol.toStringTag,{value:"Module"})),Gi=({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=ot("Legend");return ot("Legend"),l.jsxRuntimeExports.jsx($r,{data:r,onEntryChange:n,...s})},xf=({onLineChange:e})=>{const{lines:t}=ot("Legend"),n=g.useUniqueKey(),s=Mn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Lr(t,e)})},Wi=({variant:e="floating",...t})=>e==="floating"?l.jsxRuntimeExports.jsx(Gi,{...t}):l.jsxRuntimeExports.jsx(xf,{...t}),Ki=g.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=g.use$3({aetherKey:e,type:P.Line.TYPE,schema:P.stateZ,initialState:t}),s=g.useMemoDeepEqualProps(t);return f.useLayoutEffect(()=>n(s),[s]),null}),ff=Object.freeze(Object.defineProperty({__proto__:null,Line:Ki},Symbol.toStringTag,{value:"Module"})),Or=g.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:r,removeLine:o}=ot("Line");return f.useEffect(()=>(r({key:e,color:t,label:n}),()=>o(e)),[n,t]),l.jsxRuntimeExports.jsx(Ki,{aetherKey:e,color:t,label:n,...s})}),Xi=({level:e="h2",...t})=>{const n=g.useUniqueKey(),s=g.useTypography(e),r=Mn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return l.jsxRuntimeExports.jsx(X.Space,{justify:"center",align:"center",style:r,children:l.jsxRuntimeExports.jsx(g.MaybeEditable,{...t,level:e})})},Qi=g.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=g.use$3({aetherKey:e,type:P.Tooltip.TYPE,schema:P.tooltipStateZ,initialState:{position:null}}),n=f.useRef(null),s=f.useCallback(o=>{const i=document.querySelector(".pluto-canvas-container");if(i==null)return;const c=x.Eo.topLeft(i);t({position:x.q.translation(c,x.q.construct(o))})},[t]),r=f.useCallback(()=>t({position:null}),[t]);return f.useEffect(()=>{if(n.current===null)return;const o=n.current.parentElement;if(o!=null)return o.addEventListener("mousemove",s),o.addEventListener("mouseleave",r),()=>{o.removeEventListener("mousemove",s),o.removeEventListener("mouseleave",r)}},[s]),l.jsxRuntimeExports.jsx("span",{ref:n})}),pf=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Qi},Symbol.toStringTag,{value:"Module"})),mf={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Dr=f.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:r,...o},i)=>l.jsxRuntimeExports.jsxs("div",{ref:i,className:x.CSS(x.CSS.noSelect,x.CSS.BE("viewport-mask","container"),e),style:{cursor:mf[t],...r},...o,children:[l.jsxRuntimeExports.jsx("div",{style:{...x.Eo.css(n),display:x.Eo.areaIsZero(n)?"none":"block"},className:x.CSS.BE("viewport-mask","selection")}),s]}));Dr.displayName="ZoomPanMask";const hf=[{key:"start",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Left,{})},{key:"center",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Center,{})},{key:"end",icon:l.jsxRuntimeExports.jsx(g.Qt.TextAlign.Right,{})}],gf=({key:e,entry:t,onClick:n,selected:s})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),zr=({children:e=gf,...t})=>l.jsxRuntimeExports.jsx(Me.Button,{...t,allowMultiple:!1,data:hf,children:e}),yf=new Set([Z.g.UUID,Z.g.JSON]),Sf=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:yf.has(e)?e.toString().toUpperCase():x._$1.capitalize(e.toString())})),Ef=[{key:"name",name:"Name"}],jf=e=>l.jsxRuntimeExports.jsx(Me.DropdownButton,{...e,data:Sf,columns:Ef,entryRenderKey:"name"}),Rf=[{key:"x",icon:l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{})},{key:"y",icon:l.jsxRuntimeExports.jsx(g.Qt.Arrow.Up,{})}],bf=({key:e,entry:t,onClick:n,selected:s})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),wf=({children:e=bf,...t})=>l.jsxRuntimeExports.jsx(Me.Button,{...t,allowMultiple:!1,data:Rf,children:e}),Ji=e=>l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS.BE("select","clear"),variant:"outlined",...e,children:l.jsxRuntimeExports.jsx(g.Qt.Close,{"aria-label":"clear"})}),gt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:r,emptyContent:o,inputProps:i,allowNone:c=!0,searcher:a,className:d,variant:u="button",hideColumnHeader:p=!1,disabled:m,omit:h,children:E,dropdownVariant:y="connected",placeholder:w=Cs,inputPlaceholder:j=w,triggerTooltip:C,dropdownZIndex:v,filter:R,actions:b,..._})=>{const{visible:$,open:O,close:N,toggle:D}=g.use$2(),[T,M]=f.useState(null),z=a!=null;g.useAsyncEffect(async()=>{if(g.selectValueIsZero(t))return M(null);if((T==null?void 0:T.key)===t)return;let B=null;if(z)try{[B]=await a.retrieve([t])}finally{B??(B=null)}else r!=null&&(B=r.find(A=>A.key===t)??null);M(B)},[a,t,r]);const S=f.useCallback((B,A)=>{Array.isArray(B)||(M(B==null?null:A.entries[0]),N(),e(B,A))},[e,c]),L=f.useMemo(()=>z?g.Search:nn.Filter,[z]),k=l.jsxRuntimeExports.jsx(L,{searcher:a,filter:R,children:({onChange:B})=>l.jsxRuntimeExports.jsx(Cf,{autoFocus:y==="modal",variant:u,onChange:B,onFocus:O,selected:T,entryRenderKey:n,visible:$,allowNone:c,className:d,disabled:m,placeholder:j,children:b})}),I=l.jsxRuntimeExports.jsx(g.Button,{tooltip:C,variant:"outlined",onClick:D,disabled:m,children:T!=null?el(n,T):w});return l.jsxRuntimeExports.jsx(Me.Core,{close:N,zIndex:v,open:O,data:r,omit:h,emptyContent:o,allowMultiple:!1,visible:$,value:t,hideColumnHeader:p,onChange:S,allowNone:c,columns:s,listItem:E,variant:y,trigger:y!=="modal"?k:I,extraDialogContent:y==="modal"?k:void 0,keepMounted:!1,..._})},Cs="Select",el=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Cf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:o=!0,placeholder:i=Cs,className:c,disabled:a,...d})=>{const{clear:u}=g.useSelectionUtils(),[p,m]=f.useState("");f.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return m("");t!=null&&m(el(e,t))}},[t,n,e]);const h=j=>{s(j),m(j)},E=()=>{p===""&&s(""),m(""),r==null||r()},y=j=>{n||(j.preventDefault(),r==null||r())},w=()=>{m(""),u==null||u()};return l.jsxRuntimeExports.jsx(g.Text$1,{className:x.CSS(x.CSS.BE("select","input"),c),value:p,onChange:h,onFocus:E,onKeyDown:g.matchCallback([["Enter"]],j=>{j.preventDefault(),!n&&(r==null||r())}),endContent:l.jsxRuntimeExports.jsx(_i.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:y,placeholder:i,disabled:a,...d,children:o&&l.jsxRuntimeExports.jsx(Ji,{onClick:w,disabled:a})})},wn=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:o,onDragStart:i,...c})=>{const a=x.cssString(n);s==null&&n!=null&&(s=l.jsxRuntimeExports.jsx(g.Qt.Circle,{fill:a}));const d=r==null?void 0:l.jsxRuntimeExports.jsx(g.Icon,{"aria-label":"close",size:"small",className:x.CSS.BE("tag","close"),onClick:u=>{u.stopPropagation(),r()},children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})});return l.jsxRuntimeExports.jsx(g.WithIcon,{startIcon:s,endIcon:d,className:x.CSS(o,x.CSS.B("tag"),r!=null&&x.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:i,...c,children:e})},vf=Object.freeze(Object.defineProperty({__proto__:null,Tag:wn},Symbol.toStringTag,{value:"Module"})),rn=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:o="key",emptyContent:i,searcher:c,renderTag:a=g.componentRenderProp(tl),placeholder:d,onTagDragStart:u,allowMultiple:p,allowNone:m,replaceOnSingle:h,onTagDragEnd:E,style:y,addPlaceholder:w="Add",children:j,dropdownVariant:C="connected",actions:v,...R})=>{const{visible:b,open:_,close:$}=g.use$2(),[O,N]=f.useState([]),[D,T]=f.useState(!1),M=c!=null;g.useAsyncEffect(async()=>{T(!0),g.selectValueIsZero(t)&&N([]);const I=O.map(V=>V.key),B=Z.A(t);if(Z.F.unorderedPrimitiveArrays(I,B)===Z.F.EQUAL)return;let A=[];if(M)try{A=await c.retrieve(B)}finally{T(!1)}else s!=null&&(A=s.filter(V=>B.includes(V.key)));N(A)},[c,M,t,s]);const z=f.useCallback((I,B)=>{I!=null&&(N(B.entries),e(Z.A(I),B))},[e]),S=f.useMemo(()=>M?g.Search:nn.Filter,[M]);let L,k;if(C==="connected")k=l.jsxRuntimeExports.jsx(S,{searcher:c,children:({onChange:I,value:B})=>l.jsxRuntimeExports.jsx(_f,{value:B,selectedKeys:t,className:n,onChange:I,loading:D,selected:O,onFocus:_,entryRenderKey:o,visible:b,renderTag:a,placeholder:d,onTagDragStart:u,onTagDragEnd:E,style:y,children:v})});else{const I=Z.A(t);k=l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",grow:!0,style:y,size:"small",children:[I.map(B=>{const A=O.find(V=>V.key===B);return a({key:B,entryKey:B,entryRenderKey:o,loading:D,entry:A,onClose:()=>{const V=I.filter(F=>F!==B);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>u==null?void 0:u(V,B),onDragEnd:V=>E==null?void 0:E(V,B)})}),I.length>0?l.jsxRuntimeExports.jsx(g.Icon,{onClick:_,children:l.jsxRuntimeExports.jsx(g.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):l.jsxRuntimeExports.jsx(g.Button,{onClick:_,shade:7,startIcon:l.jsxRuntimeExports.jsx(g.Qt.Add,{}),variant:"text",children:w})]}),L=l.jsxRuntimeExports.jsx(S,{searcher:c,children:B=>l.jsxRuntimeExports.jsx(g.Text$1,{autoFocus:!0,placeholder:"Search",...B,children:v})})}return l.jsxRuntimeExports.jsx(Me.Core,{close:$,open:_,data:s,emptyContent:i,visible:b,value:t,onChange:z,allowNone:m,replaceOnSingle:h,columns:r,allowMultiple:!0,listItem:j,trigger:k,extraDialogContent:L,variant:C,...R})},_f=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:o,entryRenderKey:i,renderTag:c,placeholder:a=Cs,onTagDragStart:d,onTagDragEnd:u,value:p,className:m,children:h,...E})=>{const{onSelect:y,clear:w}=g.useSelectionUtils(),j=f.useRef(null);f.useLayoutEffect(()=>{var b;o&&((b=j.current)==null||b.focus())},[o,n]);const C=()=>{o||s(""),r==null||r()},v=()=>{o||r==null||r()},R=()=>{o||s("")};return l.jsxRuntimeExports.jsxs(g.Text$1,{ref:j,className:x.CSS(x.CSS.BE("select-multiple","input"),x.CSS.visible(o),m),onBlur:R,placeholder:a,value:p,onChange:s,onFocus:C,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:v,variant:"button",...E,children:[l.jsxRuntimeExports.jsx(X.Space,{direction:"x",className:x.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(b=>{const _=n.find($=>$.key===b);return c({key:b,entryKey:b,entryRenderKey:i,loading:t,entry:_,onClose:()=>y==null?void 0:y(b),onDragStart:$=>d==null?void 0:d($,b),onDragEnd:$=>u==null?void 0:u($,b)})})}),h,l.jsxRuntimeExports.jsx(Ji,{onClick:w})]})},tl=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let o=e;return n!=null&&(o=typeof t=="function"?t(n):n[t]),f.createElement(wn,{size:"small",variant:"outlined",className:x.CSS(n==null&&!s&&x.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},Z.Q(o))},kf=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Me.BaseButton,Button:Me.Button,DEFAULT_PLACEHOLDER:Cs,DataType:jf,Direction:wf,DropdownButton:Me.DropdownButton,Multiple:rn,MultipleTag:tl,Single:gt,TextAlignment:zr,defaultButton:Me.defaultButton},Symbol.toStringTag,{value:"Module"})),Un=6,Pf=2,ko=5,Nf=e=>x.Eo.width(e)<ko&&x.Eo.height(e)<ko,Mf=["zoom","pan","select","zoomReset"],bn=[...Mf,"click"],Tf=ne.z.enum(bn),nl=["zoom","select"],Gn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},sl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},rl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Br={zoom:Gn,pan:sl,select:rl,zoomReset:Gn,click:Gn},Af=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(o=>o!=="MouseLeft")).filter(r=>r.length>0)]))},Lf=x.Eo.construct(0,0,1,1,x.J.TOP_LEFT),$f={width:30,height:50},ol=({onChange:e,triggers:t,initial:n=Lf,threshold:s=$f,ref:r})=>{const o=(t==null?void 0:t.defaultMode)??"zoom",[i,c]=f.useState(x.Eo.ZERO),[a,d]=f.useState(o),[u,p]=g.useStateRef(n),m=f.useRef(x.q.ZERO),h=f.useRef(null),E=x._.construct(s);f.useEffect(()=>p(()=>x.Eo.truncate(n,Un)),[n]),f.useEffect(()=>d(o),[o]);const[y,w,j,C]=g.useMemoCompare(()=>{const O={...Br[o],...t},N=g.flattenConfig(O),D=Af(O);return[O,N,D,g.flattenConfig(D)]},g.compareModeConfigs,[t]),v=f.useCallback(({box:O,triggers:N,stage:D,cursor:T})=>{if(h.current==null)return;const M=g.determineMode(y,N),z=x.Eo.construct(h.current);if(M==null)return;if(M==="zoomReset")return c(x.Eo.ZERO),e==null||e({box:x.Eo.DECIMAL,mode:M,stage:D,cursor:T}),p(x.Eo.DECIMAL);const S=Nf(O);if(D==="end"){if(S){M==="zoom"&&c(x.Eo.ZERO),e==null||e({box:u.current,mode:"click",stage:D,cursor:T});return}return p(k=>{if(M==="pan"){const B=Po(O,k,z);return B===null||x.Eo.equals(B,k)?k:(e==null||e({box:B,mode:M,stage:D,cursor:T}),B)}const I=R(O,k,z);return I===null?k:(e==null||e({box:I,mode:M,stage:D,cursor:T}),M==="zoom"?(c(x.Eo.ZERO),I):x.Eo.truncate(k,Un))})}if(nl.includes(M))return S?void 0:c(x.k$2.XY.scale(z).clamp(z).translate({x:-x.Eo.left(z),y:-x.Eo.top(z)}).box(No(E,O,z)));if(c(k=>x.Eo.areaIsZero(k)?k:x.Eo.ZERO),x.q.distance(T,m.current)<Pf)return;m.current=T;const L=Po(O,u.current,z);e==null||e({box:L,mode:M,stage:D,cursor:T})},[c,d,e,y,s.height,s.width,p,h]);f.useImperativeHandle(r,()=>({reset:()=>{c(x.Eo.ZERO),p(x.Eo.DECIMAL),e==null||e({box:x.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:x.q.ZERO})}}),[e]);const R=f.useCallback((O,N,D)=>x.Eo.truncate(or(N,D).box(No(E,O,D)),Un),[s]),b=g.useHeldRef({triggers:[["Control"]]}),_=g.useHeldRef({triggers:[["Alt"]]});f.useEffect(()=>{const O=N=>{if(h.current==null)return;let D=1;N.deltaY<0?D-=.035:D+=.035;const T=x.Eo.construct(h.current),M=x.q.construct(N);if(!x.Eo.contains(T,M)||N.target!==h.current)return;const S=or(u.current,x.Eo.construct(h.current)).pos(x.q.construct(N));let k=x.k$2.XY.magnify({x:b.current.held?1:D,y:_.current.held?1:D}).box(u.current);k=x.Eo.translate(k,{x:b.current.held?0:S.x*(1-D),y:_.current.held?0:S.y*(1-D)}),p(k),e==null||e({stage:"end",box:k,cursor:x.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",O),()=>window.removeEventListener("wheel",O)},[p,e]),ki.useDrag({bound:h,onDrag:v,triggers:w,loose:!0});const $=f.useCallback(({triggers:O,stage:N})=>{if(N==="end")return d(o);const D=g.determineMode(j,O);D!=null&&d(D)},[j,o,e]);return g.use$1({triggers:C,callback:$,region:h}),{maskBox:i,ref:h,mode:a}},or=(e,t)=>x.k$2.XY.scale(t).clamp(t).scale(e),Po=(e,t,n)=>{let s=x.Eo.signedDims(or(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},x.Eo.truncate(x.k$2.XY.translate(x.q.construct(s)).box(t),Un)},No=(e,t,n)=>x.Eo.height(t)<=e.height?x.Eo.construct(x.Eo.left(t),x.Eo.top(n),x.Eo.width(t),x.Eo.height(n)):x.Eo.width(t)<=e.width?x.Eo.construct(x.Eo.left(n),x.Eo.top(t),x.Eo.width(n),x.Eo.height(t)):t,Of=({mode:e,triggers:t})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",children:[l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:x._$1.capitalize(e)}),l.jsxRuntimeExports.jsx(mx.Text,{trigger:t[0],level:"small"})]}),Df={zoom:l.jsxRuntimeExports.jsx(g.Qt.Zoom,{}),pan:l.jsxRuntimeExports.jsx(g.Qt.Pan,{}),select:l.jsxRuntimeExports.jsx(g.Qt.Selection,{}),zoomReset:l.jsxRuntimeExports.jsx(g.Qt.Expand,{}),click:l.jsxRuntimeExports.jsx(g.Qt.Bolt,{})},zf=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&bn.includes(r)).map(([r,o])=>({key:r,icon:Df[r],tooltip:l.jsxRuntimeExports.jsx(Of,{mode:r,triggers:o})})).sort((r,o)=>bn.indexOf(r.key)-bn.indexOf(o.key));return l.jsxRuntimeExports.jsx(Me.Button,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:o,...i})=>f.createElement(g.Icon,{...i,key:o.key,variant:i.selected?"filled":"text",size:"medium",tooltip:o.tooltip,tooltipLocation:{x:"right",y:"top"}},o.icon)})},Bf=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Br,MASK_MODES:nl,MODES:bn,Mask:Dr,PAN_DEFAULT_TRIGGERS:sl,SELECT_DEFAULT_TRIGGERS:rl,SelectMode:zf,ZOOM_DEFAULT_TRIGGERS:Gn,modeZ:Tf,use:ol},Symbol.toStringTag,{value:"Module"})),il=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ir=f.forwardRef(({children:e,initial:t=x.Eo.DECIMAL,onChange:n,...s},r)=>{const{setViewport:o}=ot("Viewport");f.useLayoutEffect(()=>{o({box:t,mode:"zoom",cursor:x.q.ZERO,stage:"start"})},[o,t]);const i=f.useCallback(a=>{o(a),n==null||n(a)},[n,o]),c=ol({onChange:i,initial:t,ref:r,...s});return l.jsxRuntimeExports.jsx(Dr,{className:x.CSS.BE("line-plot","viewport"),...c,children:e})});Ir.displayName="Viewport";const If=Object.freeze(Object.defineProperty({__proto__:null,Floating:Gi,Legend:Wi,Line:Or,LinePlot:Zi,Title:Xi,Tooltip:pf,Viewport:Ir,XAxis:Hi,YAxis:qi,axisFactory:Tr,selectViewportEl:il,useContext:ot,useGridEntry:Mn,useViewport:Fi},Symbol.toStringTag,{value:"Module"})),Vf=g.wrap$1("Tooltip",({aetherKey:e,...t})=>(g.use$3({aetherKey:e,type:P.Annotation.TYPE,schema:P.annotationStateZ,initialState:t}),null)),ll=g.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:r}=ot("Range.Provider"),[,{hovered:o,count:i},c]=g.use$3({aetherKey:e,type:P.Provider$1.TYPE,schema:P.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=Mn({key:e,loc:"top",size:i>0?32:0,order:3},"Annotation.Provider"),d=g.useContextMenu(),u=g.useSyncedRef(d.visible),p=f.useCallback(m=>{const h=y=>{c(w=>({...w,cursor:{x:y.clientX,y:y.clientY}}))},E=m.currentTarget;E.addEventListener("mousemove",h),E.addEventListener("mouseleave",()=>{E.removeEventListener("mousemove",h),u.current||c(y=>({...y,cursor:null}))},{once:!0})},[c]);return l.jsxRuntimeExports.jsx(g.ContextMenu,{style:{...a,cursor:o!=null?"pointer":"default"},...d,menu:()=>t==null||o==null?null:t(o),children:l.jsxRuntimeExports.jsx(X.Space,{style:{width:"100%",height:"100%"},onClick:()=>{o!=null&&(s({box:x.Eo.construct({x:o.viewport.lower,y:0},{x:o.viewport.upper,y:1}),mode:"zoom",cursor:x.q.ZERO,stage:"start"}),r(!0))},onMouseEnter:p})})}),Ff=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Vf,Provider:ll},Symbol.toStringTag,{value:"Module"})),cl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Zf=g.flattenConfig(cl),al=g.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=g.use$3({aetherKey:e,type:P.Measure.TYPE,schema:P.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=f.useRef(null),s=g.useHeldRef({triggers:Zf,loose:!0}),r=f.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const d=g.determineMode(cl,s.current.triggers,{loose:!0});if(["one","two"].includes(d))return t(u=>({...u,[d]:a}));t(d==="clear"?u=>({...u,one:null,two:null}):u=>({...u,one:u.one??a,two:u.one!==null?a:u.two}))}},[t,s]);Fi(r);const o=f.useCallback(c=>t(a=>({...a,hover:x.q.construct(c)})),[t]),i=f.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return f.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",o),c.addEventListener("mouseleave",i),()=>{c.removeEventListener("mousemove",o),c.removeEventListener("mouseleave",i)}},[r]),l.jsxRuntimeExports.jsx("span",{ref:n})}),Hf=Object.freeze(Object.defineProperty({__proto__:null,Measure:al},Symbol.toStringTag,{value:"Module"})),Vr=g.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,units:o="",color:i,lineWidth:c,lineDash:a})=>{const[d,u]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),[,{position:p,pixelPosition:m},h]=g.use$3({aetherKey:e,type:P.Rule.TYPE,schema:P.ruleStateZ,initialState:{color:i,dragging:!1,position:n,lineWidth:c,lineDash:a}});f.useEffect(()=>{if(p==null)return;if(n==null)return r==null?void 0:r(p);const R=x.G.construct(p+.01,p-.01);n!=null&&!x.G.contains(R,n)&&(r==null||r(Math.trunc(p*100)/100))},[p]);const E=f.useRef(m);m!==E.current&&(E.current=m);const y=f.useRef(m);f.useEffect(()=>{h(R=>({...R,position:n,color:i,lineWidth:c,lineDash:a}))},[n,i,c,a]);const w=js({onStart:f.useCallback(()=>{h(R=>({...R,dragging:!0})),y.current=E.current},[]),onMove:R=>{h(b=>({...b,pixelPosition:(y.current??0)+x.Eo.signedHeight(R)}))},onEnd:f.useCallback(()=>{h(R=>({...R,dragging:!1})),y.current=m},[])}),j=f.useRef(null);if(p==null||m==null)return null;const C=il(j==null?void 0:j.current),v=l.jsxRuntimeExports.jsxs("div",{ref:j,className:x.CSS.B("rule"),style:{top:`calc(${m}px - 0.5rem)`},children:[l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("rule","drag-handle"),onDragStart:w,draggable:!0}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[l.jsxRuntimeExports.jsx(g.Editable,{level:"p",value:d,onChange:u}),l.jsxRuntimeExports.jsx(g.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${p.toFixed(2)} ${o}`})]})]});return C==null?v:kr.createPortal(v,C)}),qf=Object.freeze(Object.defineProperty({__proto__:null,Rule:Vr},Symbol.toStringTag,{value:"Module"})),ul=g.canDropOfType(Qe),Yf=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:o=!0,legendPosition:i,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:d,onRuleChange:u,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:E=!0,enableMeasure:y=!1,initialViewport:w=x.Eo.DECIMAL,legendVariant:j,onViewportChange:C,viewportTriggers:v,annotationProvider:R,...b})=>{var D;const _=t.filter(({location:T})=>x.J.isY(T)),$=f.useRef(),O=g.usePrevious(e.length),N=g.usePrevious(b.hold);return(O===0&&e.length!==0||N===!0&&b.hold===!1)&&((D=$.current)==null||D.reset()),l.jsxRuntimeExports.jsxs(Zi,{...b,children:[_.map((T,M)=>{const z=e.filter(k=>k.axes.x===T.key),S=t.filter(({location:k})=>x.J.isX(k)),L=h==null?void 0:h.filter(k=>[...S.map(({key:I})=>I),T.key].includes(k.axis));return l.jsxRuntimeExports.jsx(Uf,{axis:T,index:M,lines:z,yAxes:S,rules:L,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:R},T.key)}),o&&l.jsxRuntimeExports.jsx(Wi,{onLineChange:d,position:i,onPositionChange:c,variant:j}),n&&l.jsxRuntimeExports.jsx(Xi,{value:s,onChange:r,level:a}),l.jsxRuntimeExports.jsxs(Ir,{initial:w,onChange:C,triggers:v,ref:$,children:[E&&l.jsxRuntimeExports.jsx(Qi,{}),y&&l.jsxRuntimeExports.jsx(al,{})]})]})},Uf=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onAxisChannelDrop:o,onAxisChange:i,axis:{location:c,key:a,showGrid:d,...u},annotationProvider:p})=>{const m=g.useDrop({type:"Channel.LinePlot.XAxis",canDrop:ul,onDrop:f.useCallback(({items:y})=>{const w=g.filterByType(Qe,y);return o==null||o(a,w.map(({key:j})=>j)),w},[a,o])}),h=s==null?void 0:s.filter(y=>y.axis===a),E=g.useDraggingState();return l.jsxRuntimeExports.jsxs(Hi,{...u,...m,location:c,showGrid:d??n===0,className:x.CSS(x.CSS.dropRegion(g.canDropOfType(Qe)(E))),onAutoBoundsChange:y=>i==null?void 0:i({key:a,bounds:y}),children:[e.map((y,w)=>{const j=t.filter(v=>v.axes.y===y.key),C=s==null?void 0:s.filter(v=>v.axis===y.key);return l.jsxRuntimeExports.jsx(Wf,{axis:{...y,showGrid:d??(n===0&&w===0)},lines:j,rules:C,onRuleChange:r,onAxisChannelDrop:o,onAxisChange:i},y.key)}),h==null?void 0:h.map(y=>f.createElement(Vr,{aetherKey:y.key,...y,key:y.key,onLabelChange:w=>r==null?void 0:r({key:y.key,label:w}),onPositionChange:w=>r==null?void 0:r({key:y.key,position:w})})),l.jsxRuntimeExports.jsx(ll,{...p})]})},Gf=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Wf=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:o,location:i,...c}})=>{const a=g.useDrop({type:"Channel.LinePlot.YAxis",canDrop:ul,onDrop:f.useCallback(({items:u})=>{const p=g.filterByType(Qe,u);return s==null||s(o,p.map(({key:m})=>m)),p},[o,s])}),d=g.useDraggingState();return l.jsxRuntimeExports.jsxs(qi,{...c,...a,location:i,className:x.CSS(x.CSS.dropRegion(g.canDropOfType(Qe)(d))),onAutoBoundsChange:u=>r==null?void 0:r({key:o,bounds:u}),children:[e.map(u=>l.jsxRuntimeExports.jsx(Kf,{line:u},Gf(u))),t==null?void 0:t.map(u=>f.createElement(Vr,{aetherKey:u.key,...u,key:u.key,onLabelChange:p=>n==null?void 0:n({key:u.key,label:p}),onPositionChange:p=>n==null?void 0:n({key:u.key,position:p})}))]})},Kf=({line:e})=>e.variant==="static"?l.jsxRuntimeExports.jsx(Qf,{line:e}):l.jsxRuntimeExports.jsx(Xf,{line:e}),Xf=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...r}})=>{const o=Number(t.valueOf())*3,i=P.streamChannelData({timeSpan:t,channel:s,keepFor:o}),c=n!=null&&n!==0,a=P.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:o});return l.jsxRuntimeExports.jsx(Or,{aetherKey:e,y:i,x:a,...r})},Qf=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const o=P.channelData({timeRange:e,channel:s}),i=n!=null&&n!==0,c=P.channelData({timeRange:e,channel:i?n:s,useIndexOfChannel:!i});return l.jsxRuntimeExports.jsx(Or,{aetherKey:t,y:o,x:c,...r})},Mo=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],ts=({items:e},t)=>{const n=g.filterByType(Qe,e);return n.length>0&&!n.every(s=>t.includes(s.key))},dl=["name","alias"],xl=e=>{const t=Rs();return f.useMemo(()=>e.length===0?Mo:Mo.filter(n=>e.includes(n.key)),[e,t])},Jf=({columns:e=dl,onChange:t,className:n,value:s,searchOptions:r,...o})=>{const i=Ye(),c=Rs(),a=xl(e),d=Mr(),u=g.useMemoDeepEqualProps(r),p=f.useMemo(()=>i==null?void 0:i.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...u}),[i,d,u]),m=i!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:h,onDragEnd:E,...y}=g.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:f.useCallback(R=>ts(R,Z.A(s)),[s]),onDrop:f.useCallback(({items:R})=>{const b=g.filterByType(Qe,R);if(b.length===0)return[];const _=Z.n([...Z.A(s),...b.map($=>$.key)]);return t(_,{clickedIndex:null,clicked:null,entries:[]}),b},[t,s])}),w=g.useDraggingState(),j=f.useCallback(({dropped:R})=>{t(Z.A(s).filter(b=>!R.some(_=>_.key===b)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),C=f.useCallback((R,b)=>h([{key:b,type:Qe}],j),[h,j]),v=f.useCallback(R=>c[R.key]??R.name,[c]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(n,x.CSS.dropRegion(ts(w,Z.A(s)))),value:s,onTagDragStart:C,onTagDragEnd:E,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:v,...y,...o})},mt=({columns:e=dl,onChange:t,value:n,className:s,data:r,searchOptions:o,...i})=>{const c=Ye(),a=Rs(),d=xl(e),u=Mr(),p=g.useMemoDeepEqualProps(o),m=f.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...p})},[c,u,r==null?void 0:r.length,p]),h=c!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),E=f.useId(),y=f.useMemo(()=>({key:E,type:"Channel.SelectMultiple"}),[E]),{startDrag:w,onDragEnd:j,...C}=g.useDragAndDrop({type:"Channel.SelectSingle",canDrop:f.useCallback(_=>ts(_,Z.o$1(n)),[n]),onDrop:f.useCallback(({items:_})=>{const $=g.filterByType(Qe,_);return $.length===0?[]:(t($[0].key,{clickedIndex:null,clicked:null,entries:[]}),$)},[y,t])}),v=g.useDraggingState(),R=f.useCallback(()=>n!=null&&w([{type:Qe,key:n}]),[w,n]),b=f.useCallback(_=>a[_.key]??_.name,[a]);return l.jsxRuntimeExports.jsx(gt,{data:r,className:x.CSS(s,x.CSS.dropRegion(ts(v,Z.o$1(n)))),value:n,onDragStart:R,onDragEnd:j,onChange:t,searcher:m,columns:d,emptyContent:h,entryRenderKey:b,...C,...i})},ep=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:qx,AliasProvider:zi,LinePlot:Yf,SelectMultiple:Jf,SelectSingle:mt,useActiveRange:Mr,useAlias:Di,useAliases:Rs,useContext:Oi,useName:bs},Symbol.toStringTag,{value:"Module"})),yt=({path:e,optional:t=!1,onChange:n})=>{const s=St(),{get:r,bind:o,set:i,setStatus:c}=s,[a,d]=f.useState(r(e,{optional:t}));f.useEffect(()=>(d(r(e,{optional:t})),o({path:e,onChange:d,listenToChildren:!1})),[e,n,o,r]);const u=f.useCallback(h=>{n==null||n(h,{...s,path:e}),i(e,h)},[e,i,n]),p=f.useCallback(h=>c(e,h),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:u,setStatus:p,variant:m,...a}},fl=(e,t=!1,n)=>{const{get:s,bind:r}=St(n),[,o]=f.useState(0);return f.useEffect(()=>(o(i=>i+1),r({path:e,onChange:()=>o(i=>i+1)})),[e,r]),s(e,{optional:t})??null},tp=(e,t=!1,n)=>{var i;const{get:s,bind:r}=St(n),[,o]=f.useState(0);return f.useEffect(()=>(o(c=>c+1),r({path:e,onChange:()=>o(c=>c+1)})),[e,r]),((i=s(e,{optional:t}))==null?void 0:i.value)??null},np=e=>{var t,n;return((n=(t=fl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},sp=({path:e,ctx:t,onChange:n})=>{const s=St(t);f.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},rp=({path:e,optional:t=!1})=>{const{bind:n,get:s}=St(),[r,o]=f.useState(s(e,{optional:t}));if(f.useEffect(()=>(o(s(e,{optional:t})),n({path:e,onChange:i=>o({...i,value:Z.U(i.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},pl=(e,t)=>({add:(n,s)=>{const r=Z.U(e.get(t).value);r.splice(s,0,...Z.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=Z.U(e.get(t).value);r.push(...Z.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((o,i)=>!r.has(i)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((o,i)=>r.has(i)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.U(e.get(t).value);s.sort(n),e.set(t,s)}}),op=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=St(n),{bind:r,get:o}=s,[i,c]=f.useState(o(e).value);return f.useEffect(()=>(c(o(e).value),r({path:e,onChange:a=>{c(Z.U(a.value))},listenToChildren:t})),[e,r,o,c]),f.useMemo(()=>({value:i,...pl(s,e)}),[i,s,e])},Fr=f.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),St=e=>{const t=f.useContext(Fr);return e??t},To=e=>({key:e,variant:"success",message:""}),ip=e=>e.code===ne.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",ml=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r})=>{const o=f.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=g.useSyncedRef(n),c=g.useSyncedRef(r),a=f.useCallback(({path:b,onChange:_,listenToChildren:$=!1})=>{var T;const{parentListeners:O,listeners:N}=o.current,D=$?O:N;return D.has(b)||D.set(b,new Set),(T=D.get(b))==null||T.add(_),()=>{var M;return(M=D.get(b))==null?void 0:M.delete(_)}},[]),d=f.useCallback((b,{optional:_}={optional:!1})=>{const{state:$,statuses:O,touched:N}=o.current,D=Z._.get($,b,{optional:_});if(D==null)return null;const T={value:D,status:O.get(b)??To(b),touched:N.has(b),required:!1};if(i.current==null)return T;const M=i.current,z=Z.N.getFieldSchema(M,b,{optional:!0});return z==null||(T.required=!z.isOptional()),T},[]),u=f.useCallback(b=>{const{state:_,statuses:$,touched:O,listeners:N,parentListeners:D}=o.current;Z._.remove(_,b),$.delete(b),O.delete(b),N.delete(b),D.delete(b)},[]),p=f.useCallback(b=>{const{statuses:_,touched:$}=o.current;o.current.state=b,h(""),_.clear(),$.clear()},[]),m=f.useCallback(b=>{var O;const{listeners:_}=o.current,$=d(b,{optional:!0});$!=null&&((O=_.get(b))==null||O.forEach(N=>N($)))},[]),h=f.useCallback(b=>{const{listeners:_,parentListeners:$}=o.current,O=_.get(b);if(b==""&&([..._.keys()].forEach(T=>{var z;const M=d(T,{optional:!0});M!=null&&((z=_.get(T))==null||z.forEach(S=>{S(M)}))}),[...$.keys()].forEach(T=>{var z;const M=d(T,{optional:!0});M!=null&&((z=$.get(T))==null||z.forEach(S=>{S(M)}))})),O!=null){const N=d(b,{optional:!0});N!=null&&O.forEach(D=>{D(N)})}$.forEach((N,D)=>{if(Z._.pathsMatch(b,D)){const M=d(D,{optional:!0});M!=null&&N.forEach(z=>{z(M)})}})},[]),E=f.useCallback((b,_="",$=!0)=>{const{statuses:O,listeners:N,touched:D}=o.current;if(b.success){const S=[...O.keys()];return O.clear(),S.forEach(L=>m(L)),!0}let T=!0;const M=new Set(b.error.issues.map(S=>S.path.join(".")));let z=(S,L)=>S===L;return $&&(z=(S,L)=>Z._.pathsMatch(S,L)),b.error.issues.forEach(S=>{var A;const{message:L}=S,k=S.path.join(".");if(!z(k,_))return;const I=ip(S);I!=="warning"&&(T=!1),O.set(k,{key:k,variant:I,message:L}),D.add(k);let B=d(k,{optional:!0});B==null&&(B={value:void 0,status:O.get(k)??To(k),touched:!1,required:!1}),(A=N.get(k))==null||A.forEach(V=>V(B))}),O.forEach((S,L)=>{M.has(L)||(O.delete(L),m(L))}),T},[]),y=f.useCallback((b,_)=>{if(i.current==null)return!0;const{state:$}=o.current,O=i.current.safeParse($);return E(O,b,_)},[E]),w=f.useCallback(async(b,_)=>{if(i.current==null)return!0;const{state:$}=o.current,O=await i.current.safeParseAsync($);return E(O,b,_)},[E]),j=f.useCallback((b,_,$={})=>{const O=Z._.get(o.current.state,b,{optional:!0}),{validateChildren:N=!0}=$,{state:D,touched:T}=o.current;T.add(b),b.length===0?o.current.state=_:Z._.set(D,b,_),h(b),(async()=>{var z;let M;try{M=y(b,N)}catch{M=await w(b,N)}(z=c.current)==null||z.call(c,{values:o.current.state,path:b,prev:O,valid:M})})()},[]),C=f.useCallback(b=>Z._.has(o.current.state,b),[]),v=f.useCallback((b,_)=>{o.current.statuses.set(b,_),o.current.touched.add(b),m(b)},[]),R=f.useCallback(()=>{const{statuses:b}=o.current;b.clear(),b.forEach((_,$)=>m($))},[]);return f.useEffect(()=>{if(!t)return;const{listeners:b}=o.current;o.current.state=e,b.forEach((_,$)=>{const O=d($,{optional:!0});O!=null&&_.forEach(N=>N(O))})},[t,e]),f.useMemo(()=>({bind:a,set:j,get:d,mode:s,validate:y,validateAsync:w,value:()=>o.current.state,has:C,remove:u,setStatus:v,clearStatuses:R,reset:p}),[a,j,d,y,w,C,u,v,R,p,s])},lp=e=>l.jsxRuntimeExports.jsx(Fr.Provider,{value:e,children:e.children}),cp=g.componentRenderProp(g.Text$1),je=({path:e,children:t=cp,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:o=!1,optional:i,onChange:c,className:a,...d})=>{const u=yt({path:e,optional:i??o,onChange:c}),p=St();if(u==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n==null&&(n=x._$1.capitalize(Z._.element(e,-1))),r=typeof r=="function"?r(u,p):r,!r)return null;const m=u.status.message,{onChange:h,value:E}=u,y={onChange:h,value:E};return u.variant!=null&&(y.variant=u.variant),l.jsxRuntimeExports.jsx(He.Item,{padHelpText:s,helpText:m,helpTextVariant:u.status.variant,label:n,required:u.required,className:x.CSS(a,x.CSS.BE("field",e.split(".").join("-")),x.CSS.M(u.status.variant)),...d,children:t(y)})},Lt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:o,path:i,fieldKey:c=t,...a})=>l.jsxRuntimeExports.jsx(je,{...n,...a,path:c?`${i}.${c}`:i,children:d=>l.jsxRuntimeExports.jsx(e,{...d,...s,...o})});return r.displayName=e.displayName,r},hl=Lt(g.Numeric),vs=hl({}),gl=Lt(g.Text$1),yl=gl({}),Sl=Lt(g.Switch$1),Zr=Sl({}),ap=Lt(gt),up=Lt(rn),dp=Lt(Me.DropdownButton),Hr=({key:e,open:t,onChange:n})=>{const s=g.useMemoPrimitiveArray(e);g.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(n),async()=>await r.close()},[t==null,s])},xp=({fetchInitialValue:e,...t})=>{const[n,s]=f.useState(void 0);return g.useAsyncEffect(async()=>{s(await e())},[e]),Hr({...t,onChange:s}),n},fp=Object.freeze(Object.defineProperty({__proto__:null,useListener:Hr,useState:xp},Symbol.toStringTag,{value:"Module"})),pp=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:o,applyObservable:i,...c})=>{const a=Ye(),d=g.useAggregator(),u=g.useMemoPrimitiveArray(e),p=ml({values:s,...c,sync:!1,onChange:E=>{a!=null&&(async()=>{try{await(o==null?void 0:o({...E,client:a}))}catch(y){d({variant:"error",message:`Failed to save ${t}`,description:y.message})}})()}});g.useAsyncEffect(async()=>{if(a!=null)try{const E=await n({client:a});p.set("",E)}catch(E){d({variant:"error",message:`Failed to retrieve ${t}`,description:E.message})}},[u,a==null?void 0:a.key]);const m=f.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[u,a==null?void 0:a.key]),h=f.useCallback(E=>i==null?void 0:i({changes:E,ctx:p}),[u,i]);return Hr({key:u,open:m,onChange:h}),p},mp=Object.freeze(Object.defineProperty({__proto__:null,Context:Fr,Field:je,Form:lp,NumericField:vs,SwitchField:Zr,TextField:yl,buildDropdownButtonSelectField:dp,buildNumericField:hl,buildSelectMultiField:up,buildSelectSingleField:ap,buildSwitchField:Sl,buildTextField:gl,fieldArrayUtils:pl,fieldBuilder:Lt,use:ml,useChildFieldValues:rp,useContext:St,useField:yt,useFieldArray:op,useFieldListener:sp,useFieldState:fl,useFieldValid:np,useFieldValue:tp,useSynced:pp},Symbol.toStringTag,{value:"Module"})),hp=[{key:"name",name:"Name"},{key:"location",name:"Location"}],gp=({searchOptions:e,...t})=>{const n=Ye();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),l.jsxRuntimeExports.jsx(gt,{columns:hp,searcher:s,entryRenderKey:"name",...t})},yp=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:gp},Symbol.toStringTag,{value:"Module"})),Xt="label",qr=[{key:"color",name:"Color",render:({entry:e})=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],ns=({items:e},t)=>{const n=g.filterByType(Xt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Sp=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>l.jsxRuntimeExports.jsx(wn,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),Ep=g.componentRenderProp(Sp),jp=({onChange:e,className:t,value:n,...s})=>{const r=Ye(),o=r!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:i,onDragEnd:c,...a}=g.useDragAndDrop({type:"Label.SelectMultiple",canDrop:f.useCallback(m=>ns(m,Z.A(n)),[n]),onDrop:f.useCallback(({items:m})=>{const h=g.filterByType(Xt,m);if(h.length===0)return[];const E=Z.n([...Z.A(n),...h.map(y=>y.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),h},[e,n])}),d=g.useDraggingState(),u=f.useCallback(({dropped:m})=>{e(Z.A(n).filter(h=>!m.some(E=>E.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=f.useCallback((m,h)=>i([{key:h,type:Xt}],u),[i,u]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(t,x.CSS.dropRegion(ns(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:qr,emptyContent:o,renderTag:Ep,addPlaceholder:"Label",...a,...s})},El=({value:e,onChange:t})=>{const n=Ye(),s=n!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=f.useId(),o=f.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),i=g.useDragAndDrop({type:"Label.SelectSingle",canDrop:f.useCallback(d=>ns(d,Z.o$1(e)),[e]),onDrop:f.useCallback(({items:d})=>{const u=g.filterByType(Xt,d);return u.length===0?[]:(t(u[0].key,{clickedIndex:null,clicked:null,entries:[]}),u)},[o,t])}),c=g.useDraggingState(),a=f.useCallback(()=>e!=null&&i.startDrag([{type:Xt,key:e}]),[i.startDrag,e]);return{emptyContent:s,dragging:c,...i,onDragStart:a,searcher:n==null?void 0:n.labels}},Rp=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:o,...i}=El({value:t,onChange:e});return l.jsxRuntimeExports.jsx(gt,{data:s,className:x.CSS(n,x.CSS.dropRegion(ns(o,Z.o$1(t)))),value:t,onChange:e,columns:qr,entryRenderKey:"name",...i,...r})},bp=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...o}=El({value:t,onChange:n});return l.jsxRuntimeExports.jsx(gt,{data:e,value:t,onChange:n,columns:qr,entryRenderKey:"name",...o,...s})},wp=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Xt,SelectButton:bp,SelectMultiple:jp,SelectSingle:Rp},Symbol.toStringTag,{value:"Module"})),jl=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:o,...i})=>{const c=f.useRef(null),a=f.useRef(n);g.useClickOutside({ref:c,exclude:u=>g.findParent(u.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const d=f.useCallback(u=>{var m;if(!a.current||u.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${x.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return g.use$1({triggers:[["Escape"]],callback:d,loose:!0}),l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","bg"),x.CSS.visible(n),s&&x.CSS.M("enabled-modal")),empty:!0,align:"center",children:l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","dialog"),t&&x.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...i,style:{zIndex:s?11:void 0,...o},children:l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("modal","content")),empty:!0,children:e})})})},Cp=({root:e,...t})=>kr.createPortal(l.jsxRuntimeExports.jsx(jl,{...t}),g.getRootElement(e)),vp=Object.freeze(Object.defineProperty({__proto__:null,Dialog:jl,Modal:Cp},Symbol.toStringTag,{value:"Module"})),_s=new Error("Tab not found"),_p=new Error("Invalid Mosaic"),ss=(e,t,n="center",s)=>{var p;if(e=lt(e),s===void 0)return ir(e,t);const r=lr(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const o=r.key*2,i=r.key*2+1,c=n==="top"||n==="left"?o:i;if(lr(e,c).key!==r.key)return ss(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return ss(e,t,"center",s);const[a,d,u]=Ap(n);if(r.direction=u,r[a]={key:0,tabs:[t],selected:t.tabKey},r[d]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw _p;return r.first.key=o,r.last.key=i,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},kp=(e,t,n)=>{var o;e=lt(e);const[s,r]=Nt(e,t);if(s==null||r==null)throw _s;return r.tabs=(o=r.tabs)==null?void 0:o.map(i=>i.tabKey===t?n(i):i),e},ir=(e,t)=>(e=lt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=ir(e.first,t):e.last!=null&&(e.last=ir(e.last,t)),e)),rs=e=>{e=lt(e);const t=[];if(e.tabs!=null&&(e.selected=be.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=rs(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=rs(e.last);e.last=n,t.push(...s)}return[e,t]},Yr=(e,t)=>{var r;e=lt(e);const[,n]=Nt(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(o=>o.tabKey!==t),n.selected=be.resetSelection(n.selected,n.tabs),e=Tp(e);const s=n.selected??os(e);return[e,s]},os=e=>e.selected!=null?e.selected:e.first!=null?os(e.first):e.last!=null?os(e.last):null,Rl=(e,t)=>{e=lt(e);const[n,s]=Nt(e,t);if(n==null||s==null)throw _s;return s.selected=t,e},bl=(e,t,n,s)=>{e=lt(e);const[r,o]=Nt(e,t);if(r==null||o==null)throw _s;const[i,c]=Yr(e,t);return[ss(i,r,n,s),c]},Cn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Cn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Cn(e.last,t);if(n!=null)return n}},wl=(e,t,n)=>{const s=is(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Pp=(e,t,n)=>{e=lt(e);const s=Cn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(u=>u.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const o=s.tabs[r];s.tabs=s.tabs.filter(u=>u.tabKey!==t);const i=s.key*2,a={key:s.key*2+1,tabs:[o],selected:o.tabKey},d={key:i,tabs:s.tabs,selected:s.selected};return d.selected=be.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=a,s.tabs=void 0,s.selected=void 0,e},Np=(e,t)=>{const n=Cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Cl=(e,t,n)=>{e=lt(e);const[,s]=Nt(e,t);if((s==null?void 0:s.tabs)==null)throw _s;return s.tabs=be.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Mp=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,lr=(e,t)=>{const n=is(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:lr(e,s)},Tp=e=>{let t=!0;for(;t;)[e,t]=cr(e);return e.first==null&&e.last==null&&(e.key=1),e},cr=e=>{if(e.first==null||e.last==null)return[e,!1];if(Lo(e.first))return[Ao(e.last,!0),!0];if(Lo(e.last))return[Ao(e.first,!1),!0];let[t,n]=[!1,!1];return[e.first,t]=cr(e.first),[e.last,n]=cr(e.last),[e,t||n]},Ao=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Lo=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Nt=(e,t)=>{if(e.tabs!=null){const i=e.tabs.find(c=>c.tabKey===t);if(i!=null)return[i,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=Nt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,o]=Nt(e.last,t);return[r,o]},is=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=is(e.first,t);return n??is(e.last,t)},Ap=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},lt=e=>Z._.copy(e),ls=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ls(e.first,t,n),e.last!=null&&ls(e.last,t,n),n),ar=(e,t)=>{t(e),e.first!=null&&ar(e.first,t),e.last!=null&&ar(e.last,t)};class vl{constructor(t={}){Ke(this,"parent");Ke(this,"stub");Ke(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Lp=({node:e})=>{const t=f.createRef(),n=f.useRef(e);return f.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),f.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),l.jsxRuntimeExports.jsx("div",{ref:t})},_l=({node:e,children:t})=>kr.createPortal(t,e.el),$p=Object.freeze(Object.defineProperty({__proto__:null,In:_l,Node:vl,Out:Lp},Symbol.toStringTag,{value:"Module"})),cs=f.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:o,last:i,key:c,size:a},emptyContent:d,...u}=n,p=f.useCallback(([E])=>t(c,E),[t]),{props:m}=Pr({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let h;return s!==void 0?h=l.jsxRuntimeExports.jsx(kl,{emptyContent:d,...n}):o!=null&&i!=null?h=l.jsxRuntimeExports.jsxs(Es,{id:`mosaic-${c}`,align:"stretch",className:x.CSS.BE("mosaic","resize"),...m,children:[l.jsxRuntimeExports.jsx(cs,{...u,root:o,onResize:t},o.key),l.jsxRuntimeExports.jsx(cs,{...u,root:i,onResize:t},i.key)]}):(h=null,console.warn("Mosaic tree is malformed")),c===1?l.jsxRuntimeExports.jsx(g.Provider$2,{children:h}):h});cs.displayName="Mosaic";const as="pluto-mosaic-tab-drop",Ur="pluto-mosaic-tab-create",Op=(e,t,n)=>{if(g.filterByType(g.FILE_TYPE,t).length>0&&n)return!0;const r=g.filterByType(as,t).map(c=>c.key),o=e.filter(c=>!r.includes(c.tabKey)).length>0;return g.filterByType(Ur,t).length>0||r.length>0&&(o||e.length===0)},kl=f.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:o,...i})=>{const{key:c,tabs:a}=e,[d,u]=f.useState(null),p=o!=null,m=f.useCallback(({items:b})=>Op(a,b,p),[a,p]),h=f.useCallback(({items:b,event:_})=>{if(_==null)return[];u(null);const $=g.filterByType(g.FILE_TYPE,b).length>0,O=a.length===0?"center":Oo($o(_));if($)return o==null||o(c,O,_),b;const N=g.filterByType(as,b);if(N.length>0){const T=N.map(({key:M})=>M)[0];t(c,T,O)}const D=g.filterByType(Ur,b);if(D.length>0){const T=D.map(({key:M})=>M);n==null||n(c,O,T)}return N},[t,a.length]),E=f.useCallback(({event:b})=>{if(b==null)return;const _=a.length===0?"center":Oo($o(b));u(_)},[a.length]),{startDrag:y,...w}=g.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:h,onDragOver:E}),j=m(g.useDraggingState()),C=f.useCallback(()=>u(null),[]),v=f.useCallback((b,{tabKey:_})=>{y([{key:_,type:as,elementID:b.currentTarget.id}])},[y]),R=f.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return l.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:x.CSS.BE("mosaic","leaf"),children:[l.jsxRuntimeExports.jsxs(be.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:C,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:v,onCreate:R,...i,...w,children:[e.selected!=null&&r(a.find(b=>b.tabKey===e.selected)),j&&l.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("mosaic","mask"),style:Dp[d]})]})});kl.displayName="MosaicTabLeaf";const Dp={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},$o=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},zp=e=>e,Bp=e=>1-e,Oo=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[zp(e),Bp(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},Ip=({root:e,onSelect:t,children:n})=>{const s=f.useRef(new Map),r=new Set,o=ls(e,i=>{var c;return(c=i.tabs)==null?void 0:c.map(a=>{let d=s.current.get(a.tabKey);return a==null?null:(d==null&&(d=new vl({style:"width: 100%; height: 100%; position: relative;"}),d.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,d)),r.add(a.tabKey),l.jsxRuntimeExports.jsx(_l,{node:d,children:n({...a,visible:a.tabKey===i.selected})},a.tabKey))})}).flat().filter(i=>i!=null);return s.current.forEach((i,c)=>!r.has(c)&&s.current.delete(c)),[s,o]},Vp=ne.z.object({key:ne.z.number(),tabs:ne.z.array(be.tabZ).optional(),selected:ne.z.string().optional(),direction:x.g.direction.optional(),size:ne.z.number().optional()}),ur=Vp.extend({first:ne.z.lazy(()=>ur).optional(),last:ne.z.lazy(()=>ur).optional()}),Fp=({allowRename:e=!1,initialTree:t})=>{const[n,s]=f.useState(t);return f.useEffect(()=>s(rs(t)[0]),[t]),{root:n,onDrop:(d,u,p)=>s(m=>bl(m,u,p,d)[0]),onClose:d=>s(u=>Yr(u,d)[0]),onSelect:d=>s(u=>Rl(u,d)),onResize:(d,u)=>s(p=>wl(p,d,u)),onRename:e?(d,u)=>s(p=>Cl(p,d,u)):void 0}},Zp=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ur,HAUL_DROP_TYPE:as,Mosaic:cs,autoSelectTabs:rs,canSplit:Np,findSelected:os,findTabNode:Cn,forEachNode:ar,insertTab:ss,isEmpty:Mp,mapNodes:ls,moveTab:bl,nodeZ:ur,removeTab:Yr,renameTab:Cl,resizeNode:wl,selectTab:Rl,split:Pp,updateTab:kp,use:Fp,usePortal:Ip},Symbol.toStringTag,{value:"Module"})),Hp=({location:e="left",size:t="9rem",className:n,style:s,...r})=>{const o=x.J.construct(e),i=x.J.direction(o),c=x.g.swap(i);return l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.B("navbar"),x.CSS.bordered(x.J.swap(o)),x.CSS.dir(c),x.CSS.loc(o),n),direction:c,style:{[x.g.dimension(i)]:t,...s},align:"center",empty:!0,...r})},Tn=e=>({bordered:t=!1,className:n,...s})=>l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(x.CSS.BE("navbar","content"),e==="absolute-center"?x.CSS.M(e):x.CSS.align(e),e!==""&&t&&x.CSS.bordered(e),n),align:"center",...s}),Pl=Tn("start");Pl.displayName="NavbarStart";const Nl=Tn("end");Nl.displayName="NavbarEnd";const Ml=Tn("center");Ml.displayName="NavbarCenter";const Tl=Tn("");Tl.displayName="NavbarContent";const Al=Tn("absolute-center");Al.displayName="NavbarAbsoluteCenter";const on=Hp;on.Start=Pl;on.Center=Ml;on.End=Nl;on.AbsoluteCenter=Al;on.Content=Tl;const Gr=({aetherKey:e})=>{const[,{region:t},n]=g.use$3({aetherKey:e,type:P.Eraser$1.TYPE,schema:P.eraserStateZ,initialState:{region:x.Eo.ZERO,enabled:!0}}),s=g.useSyncedRef(t),r=f.useCallback(i=>{x.Eo.equals(i,s.current)||n(c=>({...c,region:i}))},[n]);return{setEnabled:f.useCallback(i=>n(c=>({...c,enabled:i})),[n]),erase:r}},qp=g.wrap$1(P.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Gr({aetherKey:e}),s=g.useResize(n);return l.jsxRuntimeExports.jsx("div",{ref:s,className:x.CSS(x.CSS.inheritDims()),children:t})}),Yp=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qp,use:Gr},Symbol.toStringTag,{value:"Module"})),Up=({items:e,initialKey:t})=>{const[n,s]=f.useState(t),r=i=>s(i===n?void 0:i),o=e.find(i=>i.key===n);return{onSelect:r,activeItem:o}},Gp=g.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:s,location:r="left",collapseThreshold:o=.65,className:i,onResize:c,...a})=>{const d=x.J.direction(r),u=f.useCallback(()=>t!=null&&(s==null?void 0:s(t.key)),[s,t==null?void 0:t.key]),{erase:p,setEnabled:m}=Gr({aetherKey:e}),h=f.useCallback((j,C)=>{c==null||c(j,C),p(C)},[c,p]);if(f.useLayoutEffect(()=>{m(t!=null)},[t,m]),t==null)return null;const{content:E,key:y,...w}=t;return l.jsxRuntimeExports.jsx(Ti,{className:x.CSS(x.CSS.BE("navdrawer","content"),x.CSS.dir(d),i),collapseThreshold:o,onCollapse:u,location:r,onResize:h,...w,...a,children:t.content},y)}),Wp=Object.freeze(Object.defineProperty({__proto__:null,Bar:on,Drawer:Gp,useDrawer:Up},Symbol.toStringTag,{value:"Module"})),Kp=({variant:e,className:t,children:n,...s})=>l.jsxRuntimeExports.jsx(X.Space,{className:x.CSS(t,x.CSS.B("note"),x.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),Xp=Object.freeze(Object.defineProperty({__proto__:null,Note:Kp},Symbol.toStringTag,{value:"Module"})),Zs={Close:l.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),l.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:l.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:l.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),l.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Qp=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:o,onClose:i,...c})=>l.jsxRuntimeExports.jsxs(X.Space,{size:1.5,direction:"x",className:x.CSS(x.CSS.B("macos-controls"),!n&&x.CSS.BM("macos-controls","blurred"),t),...c,children:[l.jsxRuntimeExports.jsx(Hs,{onClick:i,className:x.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Zs.Close}),l.jsxRuntimeExports.jsx(Hs,{onClick:s,className:x.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Zs.Minimize}),l.jsxRuntimeExports.jsx(Hs,{onClick:o,className:x.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Zs.Maximize})]}),Hs=({className:e,disabled:t,color:n,...s})=>l.jsxRuntimeExports.jsx("button",{className:x.CSS(x.CSS.B("macos-control"),x.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),qs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:o,...i})=>l.jsxRuntimeExports.jsxs(X.Pack,{...i,children:[l.jsxRuntimeExports.jsx(Ys,{className:x.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:l.jsxRuntimeExports.jsx(g.Qt.Subtract,{})}),l.jsxRuntimeExports.jsx(Ys,{className:x.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:l.jsxRuntimeExports.jsx(g.Qt.Box,{})}),l.jsxRuntimeExports.jsx(Ys,{onClick:s,className:x.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:l.jsxRuntimeExports.jsx(g.Qt.Close,{})})]}),Ys=({disabled:e=!1,className:t,...n})=>e?null:l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ll=e=>Z.w.getOS(e),Jp={MacOS:Qp,Windows:qs,Linux:qs,Docker:qs},em="Windows",tm=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ll({force:e,default:em}),r=Jp[s];return t!=null&&t!==s?null:l.jsxRuntimeExports.jsx(r,{...n})},nm=Object.freeze(Object.defineProperty({__proto__:null,Controls:tm,use:Ll},Symbol.toStringTag,{value:"Module"})),sm=(e,t)=>{const n=s=>l.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},rm=Object.freeze(Object.defineProperty({__proto__:null,createComponent:sm},Symbol.toStringTag,{value:"Module"}));f.createContext({instrumentation:Z.B$1.NOOP});const om=g.wrap$1(P.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=g.useMemoDeepEqualProps(n),[{path:r},,o]=g.use$3({aetherKey:e,type:P.Provider$2.TYPE,schema:P.providerStateZ$1,initialState:s});return f.useEffect(()=>{o(s)},[s,o]),l.jsxRuntimeExports.jsx(g.Composite,{path:r,children:t})}),im="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",$l=g.wrap$1(P.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=g.use$3({aetherKey:t,type:P.BaseProvider.TYPE,schema:P.providerStateZ$2,initialState:{}});return l.jsxRuntimeExports.jsx(g.Composite,{path:n,children:e})}),lm=Object.freeze(Object.defineProperty({__proto__:null,Provider:$l},Symbol.toStringTag,{value:"Module"})),cm=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Ol=g.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...r})=>{const o=g.useMemoDeepEqualProps({source:t,sink:n}),[,{status:i},c]=g.use$3({aetherKey:e,type:P.Chip.TYPE,schema:P.chipStateZ,initialState:{triggered:!1,...o,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});f.useEffect(()=>{c(h=>({...h,...o}))},[o,c]);const a=f.useCallback(()=>c(h=>({...h,triggered:!h.triggered})),[c]),{message:d,chipColor:u,buttonStyle:p,disabled:m}=cm(i);return l.jsxRuntimeExports.jsx(g.Icon,{variant:"text",className:x.CSS(x.CSS.B("control-chip"),s),disabled:m,onClick:a,tooltip:l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:d}),style:p,...r,children:l.jsxRuntimeExports.jsx(g.Qt.Circle,{color:u})})}),Dl=f.createContext({needsControlOf:[]}),zl=()=>f.useContext(Dl),am=g.wrap$1(P.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const r=g.useMemoDeepEqualProps(s),[{path:o},{status:i,needsControlOf:c},a]=g.use$3({aetherKey:e,type:P.Controller$1.TYPE,schema:P.controllerStateZ,initialState:r});return f.useEffect(()=>{i!=null&&(n==null||n(i))},[i,n]),f.useEffect(()=>{a(d=>({...d,...r}))},[r,a]),f.useEffect(()=>()=>n==null?void 0:n("released"),[]),l.jsxRuntimeExports.jsxs(Dl.Provider,{value:{needsControlOf:c},children:[l.jsxRuntimeExports.jsx(g.Composite,{path:o,children:t}),";"]})}),Bl=g.wrap$1(P.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=g.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:r,status:o},i]=g.use$3({aetherKey:e,type:P.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:P.indicatorStateZ});f.useEffect(()=>{i(d=>({...d,...s}))},[s,i]);let c;return((a=o.data)==null?void 0:a.color)!=null?c=x.Color.z.parse(o.data.color):r!=null&&!r.isZero?c=r:c="var(--pluto-gray-l8)",l.jsxRuntimeExports.jsxs(g.Dialog$1,{location:{x:"center",y:"bottom"},children:[l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:o.message}),l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("indicator"),style:{backgroundColor:x.cssString(c),flexGrow:1}})]})}),um=g.wrap$1(P.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=zl(),[,{states:s},r]=g.use$3({aetherKey:e,type:P.Legend.TYPE,schema:P.legendStateZ,initialState:{states:[],needsControlOf:n}});f.useEffect(()=>{r(c=>({...c,needsControlOf:n}))},[n]);const i=Z.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(d=>d.subject.key===c);if(a==null)throw new Z.Ce("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return l.jsxRuntimeExports.jsx($r,{data:i,...t})}),Il=g.wrap$1(P.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=g.use$3({aetherKey:e,type:P.StateProvider.TYPE,schema:P.stateProviderStateZ,initialState:{}});return l.jsxRuntimeExports.jsx(g.Composite,{path:n,children:t})}),dm=Object.freeze(Object.defineProperty({__proto__:null,Chip:Ol,Controller:am,Indicator:Bl,Legend:um,StateProvider:Il,useContext:zl},Symbol.toStringTag,{value:"Module"})),Vl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:l.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},xm=Vl($l),fm=Vl(g.Provider$3),pm=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:o,triggers:i,alamos:c,haul:a,channelAlias:d,telem:u})=>l.jsxRuntimeExports.jsx(g.Provider$1,{...i,children:l.jsxRuntimeExports.jsx(g.Config,{...o,children:l.jsxRuntimeExports.jsx(g.Provider$2,{...a,children:l.jsxRuntimeExports.jsx(g.Provider$4,{url:s??im,enabled:n,children:l.jsxRuntimeExports.jsx(fm,{workerKey:"vis",children:l.jsxRuntimeExports.jsx(om,{...c,children:l.jsxRuntimeExports.jsx(g.Aggregator,{children:l.jsxRuntimeExports.jsx($i,{connParams:t,children:l.jsxRuntimeExports.jsx(zi,{...d,children:l.jsxRuntimeExports.jsx(xm,{...u,children:l.jsxRuntimeExports.jsx(g.Provider,{...r,children:l.jsxRuntimeExports.jsx(Il,{children:e})})})})})})})})})})})}),mm=Object.freeze(Object.defineProperty({__proto__:null,Provider:pm},Symbol.toStringTag,{value:"Module"})),hm=({value:e})=>l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("progress"),children:l.jsxRuntimeExports.jsx("div",{className:x.CSS.B("progress-bar"),style:{width:`${e}%`}})}),gm=Object.freeze(Object.defineProperty({__proto__:null,Progress:hm},Symbol.toStringTag,{value:"Module"})),vn="range",Wr=[{key:"name",name:"Name"}],us=({items:e},t)=>{const n=g.filterByType(vn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},ym=({onChange:e,className:t,value:n,...s})=>{const r=Ye(),o=r!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:i,onDragEnd:c,...a}=g.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:f.useCallback(m=>us(m,Z.A(n)),[n]),onDrop:f.useCallback(({items:m})=>{const h=g.filterByType(vn,m);if(h.length===0)return[];const E=Z.n([...Z.A(n),...h.map(y=>y.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),h},[e,n])}),d=g.useDraggingState(),u=f.useCallback(({dropped:m})=>{e(Z.A(n).filter(h=>!m.some(E=>E.key===h)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=f.useCallback((m,h)=>i([{key:h,type:vn}],u),[i,u]);return l.jsxRuntimeExports.jsx(rn,{className:x.CSS(t,x.CSS.dropRegion(us(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Wr,emptyContent:o,entryRenderKey:"name",...a,...s})},Fl=({value:e,onChange:t})=>{const n=Ye(),s=n!=null?void 0:l.jsxRuntimeExports.jsx(g.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=f.useId(),o=f.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:i,...c}=g.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:f.useCallback(u=>us(u,Z.o$1(e)),[e]),onDrop:f.useCallback(({items:u})=>{const p=g.filterByType(vn,u);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[o,t])}),a=g.useDraggingState(),d=f.useCallback(()=>e!=null&&i([{type:vn,key:e}]),[i,e]);return{emptyContent:s,dragging:a,...c,onDragStart:d,searcher:n==null?void 0:n.ranges}},Sm=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:o,...i}=Fl({value:t,onChange:e});return l.jsxRuntimeExports.jsx(gt,{data:s,className:x.CSS(n,x.CSS.dropRegion(us(o,Z.o$1(t)))),value:t,onChange:e,columns:Wr,entryRenderKey:"name",...i,...r})},Em=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...o}=Fl({value:t,onChange:n});return l.jsxRuntimeExports.jsx(gt,{data:e,value:t,onChange:n,columns:Wr,entryRenderKey:"name",...o,...s})},jm=[{key:"color",name:"Color",width:50,render:e=>l.jsxRuntimeExports.jsx(g.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Rm=e=>{const t=Ye();return l.jsxRuntimeExports.jsx(rn,{...e,searcher:t==null?void 0:t.labels,columns:jm,renderTag:n=>n.entry==null?l.jsxRuntimeExports.jsx(wn,{color:"gray",children:n.entryKey}):l.jsxRuntimeExports.jsx(wn,{color:n.entry.color,children:n.entry.name})})},bm=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const o=new Z.m(e.start),i=o.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),d=c.span(o)<Z.y.DAY?"time":"dateTime",u=o.span(c);return l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",size:"small",className:x.CSS(x.CSS.B("time-range-chip")),align:"center",...r,children:[o.isToday&&l.jsxRuntimeExports.jsx(g.Text,{level:t,shade:n,weight:450,children:"Today"}),l.jsxRuntimeExports.jsx(g.DateTime,{level:t,displayTZ:"local",format:i,shade:n,weight:450,children:o}),l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?l.jsxRuntimeExports.jsx(g.Text,{level:t,children:"Now"}):l.jsxRuntimeExports.jsx(g.DateTime,{level:t,displayTZ:"local",format:d,shade:n,weight:450,children:c}),!u.isZero&&s&&l.jsxRuntimeExports.jsxs(g.Text,{level:t,shade:n,weight:450,children:["(",o.span(c).truncate(Z.y.MILLISECOND).toString(),")"]})]})},wm=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Em,SelectLabels:Rm,SelectMultiple:ym,SelectSingle:Sm,TimeRangeChip:bm},Symbol.toStringTag,{value:"Module"})),Cm=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(o=>o.key===t);return l.jsxRuntimeExports.jsx(X.Space,{direction:"x",align:"center",className:x.CSS.B("steps"),...s,children:e.map((o,i)=>l.jsxRuntimeExports.jsxs(f.Fragment,{children:[l.jsxRuntimeExports.jsxs(g.Button,{onClick:()=>n(o.key),variant:"outlined",disabled:i>r,children:[i+1,". ",o.title]},o.key),i!==e.length-1&&l.jsxRuntimeExports.jsx(g.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},o.key))})},vm=Object.freeze(Object.defineProperty({__proto__:null,Steps:Cm},Symbol.toStringTag,{value:"Module"})),Do=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=En(e,...n);return x.q.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},zo=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:o})=>{if(!_m({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const i=x.g.construct(t),c=x.g.swap(i);let a=Pt(c,s[c]-e[c]);const d=x.Eo.loc(n,a);if(x.J.swap(t)===r){const u=x.Eo.loc(o,x.J.swap(a));Math.abs(d-u)<Ie&&(a=x.J.swap(a))}return{direction:c,length:d-e[c]+Mt(a,Ie)}},dr=ne.z.object({direction:x.g.direction,length:ne.z.number()}),En=(e,...t)=>{let n=e;for(const s of t)n=x.q.translate(n,s.direction,s.length);return n},Zl=(e,t,n,s)=>{try{let r=e;const o=[e,...t.map(h=>(r=x.q.translate(r,h.direction,h.length),r))];if(!s)return o;const i=t[0],c=Pt(i.direction,i.length),a=Bo(c),d=4*(2-n**.5);o[0]=x.q.translate(o[0],{[i.direction]:-1*a*d,[x.g.swap(i.direction)]:0});const u=t[t.length-1],p=Pt(u.direction,u.length),m=Bo(p);return o[o.length-1]=x.q.translate(o[o.length-1],{[u.direction]:m*d,[x.g.swap(u.direction)]:0}),o}catch{return[]}},Ie=10,Bo=e=>e==="top"||e==="left"?-1:1,Mt=(e,t)=>e==="top"||e==="left"?-t:t,Pt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",dt=e=>Pt(e.direction,e.length),_m=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=x.g.construct(n),r=t[s]-e[s];return Mt(n,r)<0},Dn=e=>({direction:x.g.construct(e),length:Mt(e,Ie)}),Io={top:Dn("top"),bottom:Dn("bottom"),left:Dn("left"),right:Dn("right")},km=4,Pm=.25,ks=e=>xr(Nm(xr(e))),Nm=e=>{const t=[...e],n=e.findIndex((s,r)=>{const o=Math.abs(s.length);if(o<km){if(o<Pm)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const i=t[r+2];if(i.direction!==s.direction)return!1;t[r+2]={...i,length:i.length+s.length}}else{const i=t[r-2];if(i.direction!==s.direction)return!1;t[r-2]={...i,length:i.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},xr=e=>{const t=[...e];return e.findIndex((s,r)=>{const o=t[r-1];if(r===0||s.direction!==o.direction)return!1;if(r===1){const i=r-1,c=r,a=dt(o),d=dt(s);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(o.length)===Ie)return!1;const u=Mt(a,Ie),p=t[i].length-u,m=t[c].length+p;return Math.abs(m)<Ie?!1:(t[i]={...t[i],length:u},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const i=r,c=r-1,a=dt(s),d=dt(o);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Ie)return!1;const u=Mt(a,Ie),p=t[i].length-u,m=t[c].length+p;return Math.abs(m)<Ie?!1:(t[i]={...t[i],length:u},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?xr(t):t},Yt=e=>ks(Mm(e)),Mm=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:o})=>{let i=o,c=r,a={...Io[o]},d=En(n,a);const u={...Io[r]};let p=En(s,u);const m=[a],h=zo({sourceStumpTip:d,sourceOrientation:o,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});h!=null&&(m.push(h),d=En(d,h),i=dt(h),a=h);const E=zo({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:d,targetOrientation:i,targetBox:e});E!=null&&(p=En(p,E),c=Pt(E.direction,E.length));const y=()=>{E!=null&&(E.length*=-1,m.push(E)),u.length*=-1,m.push(u)};if(x.J.swap(i)===r){const b=x.g.construct(i),_=(p[b]-d[b])/2;m.push({direction:b,length:_});const $=x.g.swap(b);return m.push({direction:$,length:p[$]-d[$]}),m.push({direction:b,length:_}),y(),m}const w=p[a.direction]-d[a.direction];let j=x.g.swap(a.direction);const C=d[j]-p[j];let v;Pt(a.direction,w)===i&&Pt(j,C)===c?v={direction:a.direction,length:w}:(v={direction:j,length:p[j]-d[j]},j=x.g.swap(j)),m.push(v);const R={direction:j,length:p[j]-d[j]};return m.push(R),y(),m},Tm=e=>ks(Am(e)),Am=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],o=x.g.swap(r.direction),i=dt(r);if(t===0){s.unshift({direction:o,length:n});const c=Mt(i,Ie);s.unshift({direction:r.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:o,length:-n});const c=Mt(i,Ie);s.push({direction:r.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},Lm=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},$m=(e,t,n=!1,...s)=>{const r=(o,i)=>!s.includes(i)&&t(o,i);return n?Lm(e,r):e.findIndex(r)},Om=({delta:e,segments:t})=>ks(Hl(e,t,!1)),Dm=({delta:e,segments:t})=>ks(Hl(e,t,!0)),Hl=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Fo("x",e,s,n)),e.y!==0&&(s=Fo("y",e,s,n)),s},Vo=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=dt(t),o=dt(s);return Math.abs(s.length)>Ie&&r===o},Fo=(e,t,n,s)=>{const r=x.g.swap(e),o=s?n.length-1:0,i=n[o];if(Vo(e,i,t))return n[o]={...i,length:i.length-t[e]},n;const c=s?0:n.length-1,d=$m(n,p=>p.direction===e,s,o);if(d===c){const p=n[c];return Vo(e,p,t)?(n[c]={...p,length:p.length-t[e]},n):(i.direction===e?n[o]={...i,length:i.length-t[e]}:n[c]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:i.direction===e?(n[o]={...i,length:i.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const u=n[d];return n[d]={...u,length:u.length-t[e]},n},zm=ne.z.object({position:x.q.xy,zoom:ne.z.number()}),ql=ne.z.object({color:x.crudeZ,segments:ne.z.array(dr)}),Bm=ql.extend({key:ne.z.string(),source:ne.z.string(),target:ne.z.string(),segments:ne.z.array(dr),color:x.crudeZ,id:ne.z.string(),data:ne.z.object({segments:ne.z.array(dr),color:x.crudeZ}).optional(),selected:ne.z.boolean(),sourceHandle:ne.z.string().nullable().optional(),targetHandle:ne.z.string().nullable().optional()}),Im=ne.z.object({key:ne.z.string(),position:x.q.xy,selected:ne.z.boolean().optional(),zIndex:ne.z.number().optional(),id:ne.z.string().optional(),type:ne.z.string().optional(),data:ne.z.unknown().optional(),width:ne.z.number().optional().nullable(),height:ne.z.number().optional().nullable()}),Kr=e=>e.map(t=>({...t,id:t.key,type:"custom",zIndex:t.zIndex,data:{}})),Xr=e=>e.map(({segments:t,color:n,...s})=>({...s,id:s.key,data:{segments:t,color:n}})),Yl=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),Ul=(e,t)=>e.map(n=>{var s,r;return n.data==null&&(n.data={segments:[],color:t}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((r=n.data)==null?void 0:r.color)??t,...n}}),Gl=e=>({...e.position,zoom:e.zoom}),Wl=e=>({position:x.q.construct(e),zoom:e.zoom}),Kl=(e,t)=>Yl(t(Kr(e))),Wn=(e,t,n)=>Ul(t(Xr(e)),n),Vm=(e,t="x")=>{if(e.length===0)return[];const n=x.J.construct(t),s=x.J.swap(n);return e.sort((r,o)=>x.Eo.loc(r.box,n)-x.Eo.loc(o.box,n)),e.forEach((r,o)=>{if(o===0)return;const c=e[o-1].handles.find(h=>h.orientation===s),a=r.handles.find(h=>h.orientation===n);if(c==null||a==null)return;const d=c.absolutePosition,u=a.absolutePosition,p=x.q.set(x.q.translation(u,d),t,0),m=x.q.translate(x.Eo.topLeft(r.box),p);r.box=x.Eo.construct(m,x.Eo.dims(r.box))}),e};function ze(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=ze(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var fr={exports:{}},Us={},zn={exports:{}},Gs={};/**
|
|
1
|
+
"use strict";var of=Object.defineProperty;var rf=(e,t,n)=>t in e?of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>rf(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Cek9Ww4S.cjs"),g=require("react"),y=require("./Toggle-CP9KtybX.cjs"),p=require("./css-Dh7n0EGs.cjs"),_n=require("./external-mtlL4Z3a.cjs"),H=require("./aggregator-C0Ab25_o.cjs"),te=require("./Pack-DijAGcm_.cjs"),lf=require("./external-CYsmC4uZ.cjs"),we=require("./external-CAIE4G3V.cjs"),cf=require("./external-DRHWURjA.cjs"),Ni=require("./Animated-Ck87AGOu.cjs"),$=require("./LinePlot--yLT9nkT.cjs"),ie=require("zod"),wo=require("./external-gz4sf3pG.cjs"),ke=require("./external-Dm2-owlq.cjs"),af=require("./Text-Cg0q7seY.cjs"),Ti=require("./external-eI1p10Vf.cjs");require("./Item-DuNQFmgk.cjs");const Co=require("react-dom"),Tt=require("./external-Cc9o20Al.cjs"),Li=require("./units-CR-P9eLW.cjs"),$e=require("./external-DsKRFJxV.cjs"),uf=require("./external-BbS4QDTb.cjs"),df=require("./external-CjmMj11F.cjs"),xf=require("./external-CsrLjLOh.cjs"),ff=require("./Video-BgDjKMJx.cjs"),Ai=({variant:e,...t})=>i.jsxRuntimeExports.jsx(y.Qt.Circle,{color:y.variantColors[e],style:{color:y.variantColors[e]},...t}),pf=({status:{key:e,time:t,count:n,message:s,description:o,variant:r},silence:l,actions:c,className:a,children:u,...d})=>i.jsxRuntimeExports.jsxs(te.Space,{className:p.CSS(p.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Ai,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(y.Text,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(y.DateTime,{className:p.CSS(p.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(y.Icon,{className:p.CSS(p.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(y.Qt.Close,{})})]}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"start",className:p.CSS(p.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(y.Text,{className:p.CSS(p.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(y.Text,{className:p.CSS(p.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",justify:"end",className:p.CSS(p.CSS.BE("notification","actions")),children:H.A(c).map(x=>i.jsxRuntimeExports.jsx(mf,{action:x},x.key))})]},t.toString()),mf=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(y.Button,{...t})}return e},hf=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:y.Aggregator,Circle:Ai,Notification:pf,Text:y.Text$2,VARIANTS:H.VARIANTS,specZ:H.specZ$1,useAggregator:y.useAggregator,useContext:y.useContext$2,useNotifications:y.useNotifications,variantZ:H.variantZ},Symbol.toStringTag,{value:"Module"})),gf=Object.freeze(Object.defineProperty({__proto__:null,Config:y.Config,Context:y.Context,Dialog:y.Dialog$1,chooseLocation:y.chooseLocation,formatTip:y.formatTip,useConfig:y.useConfig,wrap:y.wrap},Symbol.toStringTag,{value:"Module"})),In=e=>e.preventDefault(),ns=g.forwardRef(({location:e,style:t,size:n,className:s,children:o,onDragStart:r,sizeUnits:l="px",showHandle:c=!0,...a},u)=>{const d=p.J.construct(e),x=p.J.direction(d),f=p.g.dimension(x);return i.jsxRuntimeExports.jsxs("div",{className:p.CSS(p.CSS.B("resize"),p.CSS.loc(d),p.CSS.dir(x),s),style:{[f]:`${n}${l}`,...t},ref:u,...a,children:[o,c&&i.jsxRuntimeExports.jsx("div",{draggable:!0,className:p.CSS(p.CSS.BE("resize","handle"),p.CSS.bordered(p.J.swap(d))),onDragStart:r,onDrag:In,onDragEnd:In})]})});ns.displayName="Resize.Core";const vo=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const r=g.useRef(null),[l,c]=g.useState({sizeDistribution:yf(n,t),root:null}),a=g.useCallback((x,f,m)=>{if(r.current==null)return;const h=p.Eo.dim(p.Eo.construct(r.current),o);c(E=>As(E,h,x,s,f,m))},[s,c,o]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const u=g.useCallback((x,f)=>{x.preventDefault();const m=o==="x"?"clientX":"clientY",h=v=>a(f,v[m]),E=()=>{c(v=>({...v,root:null})),document.removeEventListener("mousemove",h)};c(v=>({...v,root:x[m]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",E,{once:!0})},[c,o,As]);return{setSize:g.useCallback((x,f)=>a(x,void 0,f),[As]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:u,ref:r}}},ss=g.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:s,className:o,...r},l)=>{const c=p.g.construct(e),a=g.Children.toArray(t);return n=Ef(n),i.jsxRuntimeExports.jsx(te.Space,{...r,ref:l,direction:c,className:p.CSS(p.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:a.map((u,d)=>i.jsxRuntimeExports.jsx(ns,{onDragStart:x=>s(x,d),location:p.g.location(c),size:n[d]*100,sizeUnits:"%",showHandle:d!==a.length-1,children:u},d))})});ss.displayName="Resize.Multiple";const yf=(e,t)=>{const n=e.reduce((o,r)=>o+r,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(s).fill(o/s)]}return e.map(()=>1/t)},Ls=.001,Ef=e=>e.every(t=>p.W.closeTo(t,1/e.length),Ls)?e.map((t,n)=>n%2===0?t+Ls:n===e.length-1?t:t-Ls):e,As=(e,t,n,s,o,r)=>{const l=$i(e,t,n,o,r),[c,a]=jf(e.sizeDistribution,n,l,s/t),u=a?o??null:e.root;return{...e,sizeDistribution:c,root:u}},$i=(e,t,n,s,o)=>{let r;if(o!=null)o>1&&(o/=t),r=o-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");r=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return r},jf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const r=e[o]+n,l=Sf(o,e,s,n),c=e[l]-n;return r<s||c<s?[e,!1]:[e.map((a,u)=>u===o?r:u===l?c:a),!0]},Sf=(e,t,n,s)=>(e===t.length-1?wf:Rf)(e,t,n,s),Rf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},wf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},os=({onMove:e,onStart:t,onEnd:n})=>g.useCallback(s=>{s.preventDefault();const o=p.q.construct(s),r=y.mouseKey(s.button);t==null||t(o,r,s);const l=a=>{if(a.buttons===0)return c(a);const u=p.q.construct(a);e==null||e(p.Eo.construct(o,u),r,a)};window.addEventListener("mousemove",l);const c=a=>{window.removeEventListener("mousemove",l);const u=p.q.construct(a);n==null||n(p.Eo.construct(o,u),r,a)};window.addEventListener("mouseup",c,{once:!0})},[e,t,n]),$s=2,Ii=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:o=1/0,initialSize:r=200,collapseThreshold:l=1/0,className:c,...a})=>{const[u,d]=g.useState(p.j(r,s,o)),x=g.useRef(null),f=p.J.construct(n),m=g.useCallback(S=>{if(x.current===null)return 0;const j=p.Eo.dim(S,p.J.direction(f),!0)*(1-2*Number(["bottom","right"].includes(f))),C=x.current+j,P=p.j(C,s,o);return(P-C)/s>l?$s:P},[f,s,o,l]),h=g.useRef(null),E=g.useCallback(S=>{const j=m(S);d(j),h.current!=null&&(t==null||t(j,p.Eo.construct(h.current)))},[t,m]),v=g.useCallback(()=>d(S=>(x.current=S,S)),[d]),w=g.useCallback(S=>m(S)===$s&&(e==null?void 0:e()),[e,m]);g.useEffect(()=>d(S=>{const j=p.j(S,s,o);return x.current=j,j}),[s,o]);const _=os({onMove:E,onStart:v,onEnd:w});return i.jsxRuntimeExports.jsx(ns,{ref:h,location:f,size:u,onDragStart:_,className:p.clsx(c,p.CSS.expanded(u!==$s)),...a})},Cf=Object.freeze(Object.defineProperty({__proto__:null,Core:ns,Multiple:ss,Single:Ii,calculateDiffPercentage:$i,useMultiple:vo},Symbol.toStringTag,{value:"Module"})),kn="y",mr=28,vf=32,bf=40,_f=.5,kf=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=vo({direction:kn,count:e.length,minSize:mr}),l=c=>{if(o.current==null)return;const a=p.Eo.dim(p.Eo.construct(o.current),kn);s[c]<bf/a?n(c,e[c].initialSize??_f):n(c,mr+1)};return i.jsxRuntimeExports.jsx(ss,{empty:!0,className:p.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(Nf,{...c,key:c.key,index:a,direction:kn,onExpand:l,parent:o,size:s[a]}))})},Pf=i.jsxRuntimeExports.jsx(y.Qt.Caret.Down,{"aria-label":"contract"}),Mf=i.jsxRuntimeExports.jsx(y.Qt.Caret.Right,{"aria-label":"expand"}),Nf=({index:e,name:t,content:n,actions:s,size:o,parent:r,onExpand:l})=>{let c=!0;if(r.current!=null){const u=p.Eo.dim(p.Eo.construct(r.current),kn);c=o*u>vf}const a=c?Pf:Mf;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(_n.Header,{level:"p",className:p.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx(_n.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx(_n.Actions,{children:s})]}),n]})},Tf=Object.freeze(Object.defineProperty({__proto__:null,Accordion:kf},Symbol.toStringTag,{value:"Module"})),Oi=(e,t,n)=>H.A(e).map(r=>r.split(t)).flat().map((r,l)=>[i.jsxRuntimeExports.jsx(y.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:p.CSS.shade(n)}},`${r}-${l}`),r]).flat(),Lf=({children:e,icon:t,shade:n=7,weight:s=450,size:o=.5,url:r,level:l="p",separator:c=".",className:a,hideFirst:u=!1,...d})=>{r!=null&&(e=r);const x=Oi(e,c,n);return u&&x.shift(),i.jsxRuntimeExports.jsxs(y.WithIcon,{className:p.CSS(a,p.CSS.B("breadcrumb")),level:l,shade:n,weight:s,size:o,...d,children:[we.resolve(t),...x]})},Af=({url:e,className:t,level:n="p",separator:s=".",shade:o=7})=>{const r=Oi(e,s,o);return i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(t,p.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:r.map((l,c)=>{if(y.isValidElement(l))return l;if(l==null)return null;const u=e.split(s).indexOf(l);let d=e.split(s).slice(0,u+1).join("/");return d=`/${d}`,i.jsxRuntimeExports.jsx(y.Link,{level:n,href:d,children:l.split("-").map(x=>p._$1.capitalize(x)).join(" ")},c)})})},$f=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Lf,URL:Af},Symbol.toStringTag,{value:"Module"})),bo=g.createContext($.ZERO_CONTEXT_VALUE),De=()=>g.useContext(bo).synnax,If=()=>g.useContext(bo).state,hr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Di="serverVersionMismatch",Of=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,zi=y.wrap$1($.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=y.useCombinedStateAndRef($.ZERO_CONTEXT_VALUE),[{path:l},,c]=y.use$3({aetherKey:e,type:$.Provider.TYPE,schema:$.Provider.stateZ,initialState:{props:t??null,state:null}}),a=y.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:hr[d.status],message:d.message??p._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return y.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return o($.ZERO_CONTEXT_VALUE);const d=new H.Lf({...t,connectivityPollFrequency:H.k.seconds(5)});o({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(o({synnax:d,state:x}),a({variant:hr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const f=x.nodeVersion==null||H.H.semVerOlder(x.nodeVersion,x.clientVersion),m=Of(f,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Di,oldServer:f,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(u),c({props:t,state:x}),()=>{d.close(),o($.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,u]),i.jsxRuntimeExports.jsx(bo.Provider,{value:s,children:i.jsxRuntimeExports.jsx(y.Composite,{path:l,children:n})})}),Df=Object.freeze(Object.defineProperty({__proto__:null,Provider:zi,SERVER_VERSION_MISMATCH:Di,use:De,useConnectionState:If},Symbol.toStringTag,{value:"Module"})),Lt=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Bi=()=>g.useContext(Lt),Vi=e=>{const{aliases:t}=g.useContext(Lt);return t[e]??null},rs=()=>{const{aliases:e}=g.useContext(Lt);return e},is=(e,t="")=>{const{getName:n}=g.useContext(Lt),[s,o]=g.useState(t);return y.useAsyncEffect(async()=>{const r=await n(e);r!=null&&o(r)},[e,n]),s??t},_o=()=>{const{activeRange:e}=g.useContext(Lt);return e??void 0},Fi=({activeRange:e,children:t})=>{const n=De(),[s,o]=g.useState({}),r=g.useCallback(a=>{o(u=>{const d={...u};return a.forEach(({variant:x,key:f,value:m})=>{const h=Number(f.split("---")[1]);x==="delete"?delete d[h]:d[m.channel]=m.alias}),d})},[o]),l=g.useCallback(async(a,u)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,u)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const u=s[a];return u??(await n.channels.retrieve(a)).name},[s,n]);return y.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const a=await n.ranges.retrieve(e),u=await a.listAliases();o(u);const d=await a.openAliasTracker(),x=d.onChange(r);return()=>{x(),d.close()}},[n,e]),i.jsxRuntimeExports.jsx(Lt.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},zf=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=Bi(),a=Vi(e),u=is(e);let d=i.jsxRuntimeExports.jsx(y.Qt.Rename,{});r?d=i.jsxRuntimeExports.jsx(y.Qt.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(y.Qt.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,f=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var E;a!=null&&((E=o.onChange)==null||E.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(y.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(y.Text$1,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(y.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(y.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(y.Qt.Sync,{})}),i.jsxRuntimeExports.jsx(y.Icon,{onClick:f,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var gr=180/Math.PI,Qs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hi(e,t,n,s,o,r){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*gr,skewX:Math.atan(a)*gr,scaleX:l,scaleY:c}}var yn;function Bf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qs:Hi(t.a,t.b,t.c,t.d,t.e,t.f)}function Vf(e){return e==null||(yn||(yn=document.createElementNS("http://www.w3.org/2000/svg","g")),yn.setAttribute("transform",e),!(e=yn.transform.baseVal.consolidate()))?Qs:(e=e.matrix,Hi(e.a,e.b,e.c,e.d,e.e,e.f))}function Zi(e,t,n,s){function o(u){return u.length?u.pop()+" ":""}function r(u,d,x,f,m,h){if(u!==x||d!==f){var E=m.push("translate(",null,t,null,n);h.push({i:E-4,x:$.interpolateNumber(u,x)},{i:E-2,x:$.interpolateNumber(d,f)})}else(x||f)&&m.push("translate("+x+t+f+n)}function l(u,d,x,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:x.push(o(x)+"rotate(",null,s)-2,x:$.interpolateNumber(u,d)})):d&&x.push(o(x)+"rotate("+d+s)}function c(u,d,x,f){u!==d?f.push({i:x.push(o(x)+"skewX(",null,s)-2,x:$.interpolateNumber(u,d)}):d&&x.push(o(x)+"skewX("+d+s)}function a(u,d,x,f,m,h){if(u!==x||d!==f){var E=m.push(o(m)+"scale(",null,",",null,")");h.push({i:E-4,x:$.interpolateNumber(u,x)},{i:E-2,x:$.interpolateNumber(d,f)})}else(x!==1||f!==1)&&m.push(o(m)+"scale("+x+","+f+")")}return function(u,d){var x=[],f=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,x,f),l(u.rotate,d.rotate,x,f),c(u.skewX,d.skewX,x,f),a(u.scaleX,u.scaleY,d.scaleX,d.scaleY,x,f),u=d=null,function(m){for(var h=-1,E=f.length,v;++h<E;)x[(v=f[h]).i]=v.x(m);return x.join("")}}}var Ff=Zi(Bf,"px, ","px)","deg)"),Hf=Zi(Vf,", ",")",")"),Zf=1e-12;function yr(e){return((e=Math.exp(e))+1/e)/2}function Yf(e){return((e=Math.exp(e))-1/e)/2}function qf(e){return((e=Math.exp(2*e))-1)/(e+1)}const Wf=function e(t,n,s){function o(r,l){var c=r[0],a=r[1],u=r[2],d=l[0],x=l[1],f=l[2],m=d-c,h=x-a,E=m*m+h*h,v,w;if(E<Zf)w=Math.log(f/u)/t,v=function(b){return[c+b*m,a+b*h,u*Math.exp(t*b*w)]};else{var _=Math.sqrt(E),S=(f*f-u*u+s*E)/(2*u*n*_),j=(f*f-u*u-s*E)/(2*f*n*_),C=Math.log(Math.sqrt(S*S+1)-S),P=Math.log(Math.sqrt(j*j+1)-j);w=(P-C)/t,v=function(b){var L=b*w,N=yr(C),A=u/(n*_)*(N*qf(t*L+C)-Yf(C));return[c+A*m,a+A*h,u*N/yr(t*L+C)]}}return v.duration=w*1e3*t/Math.SQRT2,v}return o.rho=function(r){var l=Math.max(.001,+r),c=l*l,a=c*c;return e(l,c,a)},o}(Math.SQRT2,2,4),Xf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:$.Canvas,axisStateZ:$.axisStateZ,newTickFactory:$.newTickFactory,tickFactoryProps:$.tickFactoryProps,tickType:$.tickType},Symbol.toStringTag,{value:"Module"})),Gf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:$.AcquireChannelControl,AuthoritySource:$.AuthoritySource,Chip:$.Chip,Controller:$.Controller$1,Indicator:$.Indicator,Legend:$.Legend,REGISTRY:$.REGISTRY$3,STATUSES:$.STATUSES,SetChannelValue:$.SetChannelValue,StateProvider:$.StateProvider,acquireChannelControl:$.acquireChannelControl,acquireChannelControlPropsZ:$.acquireChannelControlPropsZ,authoritySource:$.authoritySource,authoritySourceProps:$.authoritySourceProps,chipStateZ:$.chipStateZ,controllerStateZ:$.controllerStateZ,indicatorStateZ:$.indicatorStateZ,legendStateZ:$.legendStateZ,setChannelValue:$.setChannelValue,setChannelValuePropsZ:$.setChannelValuePropsZ,stateProviderStateZ:$.stateProviderStateZ,statusZ:$.statusZ,sugaredStateZ:$.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),Kf={region:p.Eo.ZERO,dpr:1,os:H.w.getOS()},Uf={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Qf=y.wrap$1($.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=y.use$3({aetherKey:n,type:$.Canvas$1.TYPE,schema:$.canvasStateZ,initialState:Kf}),u=g.useRef({...Uf}),d=g.useCallback(m=>{u.current.bootstrapped&&a(()=>({bootstrapped:!0,region:m,dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})}))},[a]),x=y.useResize(d,{debounce:t});g.useEffect(()=>{const m=()=>{window.devicePixelRatio!==c&&a(h=>({...h,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",m,{once:!0})},[c]),g.useEffect(()=>{window.addEventListener("focus",()=>a(m=>({...m}))),window.addEventListener("blur",()=>a(m=>({...m})))},[a]);const f=g.useCallback(m=>{if(x(m),m==null)return;m.className.includes("gl")?u.current.gl=m:m.className.includes("upper2d")?u.current.upper2d=m:u.current.lower2d=m;const{gl:h,lower2d:E,upper2d:v,bootstrapped:w}=u.current;if(h==null||E==null||v==null||w)return;u.current.bootstrapped=!0;const _=h.transferControlToOffscreen(),S=v.transferControlToOffscreen(),j=E.transferControlToOffscreen();a({glCanvas:_,upper2dCanvas:S,lower2dCanvas:j,bootstrap:!0,bootstrapped:!1,region:p.Eo.construct(h),dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})},[_,S,j])},[a]);return i.jsxRuntimeExports.jsxs("div",{className:p.CSS(p.CSS.B("canvas-container"),s),...o,children:[i.jsxRuntimeExports.jsx("canvas",{ref:f,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:f,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:f,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(y.Composite,{path:r,children:l&&e})]})}),ls=(e,t)=>y.useResize(g.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(p.k$2.XY.translate(p.q.scale(p.Eo.topLeft(o),-1)).box(n),s)},[e]),t),Jf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Qf,useRegion:ls},Symbol.toStringTag,{value:"Module"})),Yi=g.createContext(null),Xe=e=>{const t=g.useContext(Yi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},qi=e=>{const t=Xe("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},an=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Xe(t),{key:o}=e;return y.useEffectCompare(()=>{p.J.outer.parse(e.loc),n(e)},([c],[a])=>H._.equal(c,a),[e]),g.useEffect(()=>()=>s(o),[]),{gridArea:p.g.swap(p.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},Wi=y.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=p.q.ZERO,children:o,hold:r=!1,onHold:l,visible:c,...a})=>{const[u,d]=g.useState([]),x=y.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:f},{grid:m},h]=y.use$3({aetherKey:e,type:$.LinePlot.TYPE,schema:$.linePlotStateZ,initialState:{container:p.Eo.ZERO,viewport:p.Eo.DECIMAL,grid:{},...x}});g.useEffect(()=>h(O=>({...O,...x})),[x]);const E=g.useRef(new Map),v=g.useCallback(O=>(E.current.set(O,null),()=>E.current.delete(O)),[E]),w=g.useCallback(O=>{const{mode:T,box:z,stage:R}=O;(T==="pan"&&R!=="start"||T==="zoom"||T==="zoomReset"&&R==="start")&&h(I=>({...I,viewport:z})),E.current.forEach((I,k)=>k(O))},[h]),_=g.useCallback(O=>h(T=>({...T,container:O})),[h]),S=ls(_,{debounce:n}),j=g.useCallback(O=>h(T=>({...T,grid:{...T.grid,[O.key]:O}})),[h]),C=g.useCallback(O=>h(T=>{const{[O]:z,...R}=T.grid;return{...T,grid:R}}),[h]),P=g.useCallback(O=>{d(T=>[...T.filter(({key:z})=>z!==O.key),O])},[d,w]),b=g.useCallback(O=>d(T=>T.filter(({key:z})=>z!==O)),[P]),L=g.useMemo(()=>ep(m),[m]),N=g.useCallback(O=>{h(T=>({...T,hold:O})),l==null||l(O)},[h,l]),A=g.useMemo(()=>({lines:u,setGridEntry:j,removeGridEntry:C,setLine:P,removeLine:b,setViewport:w,addViewportHandler:v,setHold:N}),[u,j,C,P,b,w,v,N]);return i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("line-plot"),style:{...t,...L},ref:S,...a,children:i.jsxRuntimeExports.jsx(Yi.Provider,{value:A,children:i.jsxRuntimeExports.jsx(y.Composite,{path:f,children:o})})})}),ep=e=>{const t=p.CSS.newGridBuilder();return $.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),$.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),$.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),$.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},ko=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?$.XAxis.TYPE:$.YAxis.TYPE,s=`${e}-axis`;return y.wrap$1(n,({aetherKey:o,children:r,location:l=t,label:c="",labelLevel:a="small",labelDirection:u=e,onLabelChange:d,color:x,labelSize:f,showGrid:m,type:h,bounds:E,className:v,tickSpacing:w,autoBounds:_,autoBoundUpdateInterval:S,onAutoBoundsChange:j,style:C,...P})=>{const b=((c==null?void 0:c.length)??0)>0,L=y.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:E,label:c,labelDirection:u,tickSpacing:w,autoBounds:_,autoBoundUpdateInterval:S}),[{path:N},{size:A,labelSize:O,...T},z]=y.use$3({aetherKey:o,type:n,schema:$.coreAxisStateZ,initialState:L});g.useEffect(()=>z(D=>({...D,...L})),[L]),g.useEffect(()=>{const{lower:D,upper:M}=$.parseAutoBounds(T.autoBounds);T.bounds!=null&&(D&&(E==null?void 0:E.lower)!==T.bounds.lower||M&&(E==null?void 0:E.upper)!==T.bounds.upper)&&(j==null||j(T.bounds))},[T.autoBounds,T.bounds]);const R=an({loc:l,key:`${n}-${o}`,size:A+O,order:1},`${e.toUpperCase()}Axis`),I=y.useTypography(a).toString(),k=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let M=H.dimensions(c,I)[p.g.dimension(p.g.construct(u))];M>0&&(M+=9),z(B=>({...B,labelSize:M}))}else{let M=H.dimensions(c,I).height*1.3;M>0&&(M+=12);const B=k.current;$.withinSizeThreshold(B,M)||(k.current=M,z(V=>({...V,labelSize:M})))}},[c,u,I]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(v,p.CSS.B("axis"),p.CSS.B(s),p.CSS.loc(l)),style:{...C,...R},align:"center",justify:l!=="left"?"end":"start",direction:p.g.swap(e),...P,children:b&&i.jsxRuntimeExports.jsx(y.MaybeEditable,{className:p.CSS(p.CSS.BE("axis","label"),p.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(y.Composite,{path:N,children:r})]})})},Xi=ko("x"),Gi=ko("y"),Ki=p.q.xy.extend({root:p.J.corner,units:ie.z.object({x:ie.z.enum(["px","decimal"]),y:ie.z.enum(["px","decimal"])})}),tp=Ki.partial({root:!0,units:!0}),np=e=>{var n,s,o,r;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((r=e==null?void 0:e.units)==null?void 0:r.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},sp=(e,t)=>{var r,l,c,a,u,d;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=p.Eo.construct(t.current),o=p.Eo.construct(t.current.parentElement);return((r=e.units)==null?void 0:r.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+p.Eo.width(s))/p.Eo.width(o):n.x/=p.Eo.width(o),((a=e.units)==null?void 0:a.y)==="decimal"?((u=e.root)==null?void 0:u.y)==="bottom"&&(n.y=1-e.y):((d=e.root)==null?void 0:d.y)==="bottom"?n.y=1-(e.y+p.Eo.height(s))/p.Eo.height(o):n.y/=p.Eo.height(o),n},Ui=(e,t)=>{if(t.current==null)return null;const n=p.Eo.construct(t.current.parentElement),s=p.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...p.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*p.Eo.width(n)-p.Eo.width(s),o.root.x="right"):e.x<.2?o.x=e.x*p.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*p.Eo.height(n)-p.Eo.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*p.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...p.q.truncate(o,3)}},Er=p.Eo.reRoot(p.Eo.DECIMAL,p.J.TOP_LEFT),Po=g.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,...r})=>{const[l,c]=H.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:p.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),u=y.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...np(l)});const x=g.useCallback(m=>{var j;if(((j=d.current)==null?void 0:j.parentElement)==null)return a.current;const h=p.Eo.construct(d.current.parentElement),E=p.k$2.XY.scale(h).scale(Er),v=E.box(p.Eo.construct(d.current)),w=p.k$2.XY.clamp(p.Eo.construct(p.Eo.topLeft(Er),{width:1-p.Eo.width(v),height:1-p.Eo.height(v)})),_=p.q.translate(p.q.construct(a.current),p.Eo.signedDims(E.box(m))),S=w.pos(_);return Ui(S,d)},[]),f=os({onStart:g.useCallback(()=>{a.current=sp(a.current,d)},[]),onMove:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&c(h)},[]),onEnd:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&(a.current=h)},[])});return i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(e,p.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:f,draggable:o,ref:d,...r,onDrag:In,onDragEnd:In,empty:!0})});Po.displayName="Legend.Container";const Mo=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(te.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(wo.Swatch,{value:o,onChange:l=>t==null?void 0:t({key:s,color:l,label:r}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),i.jsxRuntimeExports.jsx(y.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),No=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(Po,{...o,draggable:!r,value:n,onChange:s,children:Mo(e,t,l)})},op=Object.freeze(Object.defineProperty({__proto__:null,Container:Po,Simple:No,calcStickyPos:Ui,completeStickyXYz:Ki,legendSwatches:Mo,stickyXYz:tp},Symbol.toStringTag,{value:"Module"})),Qi=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=Xe("Legend");return Xe("Legend"),i.jsxRuntimeExports.jsx(No,{data:o,onEntryChange:n,...s})},rp=({onLineChange:e})=>{const{lines:t}=Xe("Legend"),n=y.useUniqueKey(),s=an({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Mo(t,e)})},Ji=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(Qi,{...t}):i.jsxRuntimeExports.jsx(rp,{...t}),el=y.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=y.use$3({aetherKey:e,type:$.Line.TYPE,schema:$.stateZ,initialState:t}),s=y.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),ip=Object.freeze(Object.defineProperty({__proto__:null,Line:el},Symbol.toStringTag,{value:"Module"})),To=y.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=Xe("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(el,{aetherKey:e,color:t,label:n,...s})}),tl=({level:e="h2",...t})=>{const n=y.useUniqueKey(),s=y.useTypography(e),o=an({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(te.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(y.MaybeEditable,{...t,level:e})})},nl=y.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=y.use$3({aetherKey:e,type:$.Tooltip.TYPE,schema:$.tooltipStateZ,initialState:{position:null}}),n=g.useRef(null),s=g.useCallback(r=>{const l=document.querySelector(".pluto-canvas-container");if(l==null)return;const c=p.Eo.topLeft(l);t({position:p.q.translation(c,p.q.construct(r))})},[t]),o=g.useCallback(()=>t({position:null}),[t]);return g.useEffect(()=>{if(n.current===null)return;const r=n.current.parentElement;if(r!=null)return r.addEventListener("mousemove",s),r.addEventListener("mouseleave",o),()=>{r.removeEventListener("mousemove",s),r.removeEventListener("mouseleave",o)}},[s]),i.jsxRuntimeExports.jsx("span",{ref:n})}),lp=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:nl},Symbol.toStringTag,{value:"Module"})),cp={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Lo=g.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:o,...r},l)=>i.jsxRuntimeExports.jsxs("div",{ref:l,className:p.CSS(p.CSS.noSelect,p.CSS.BE("viewport-mask","container"),e),style:{cursor:cp[t],...o},...r,children:[i.jsxRuntimeExports.jsx("div",{style:{...p.Eo.css(n),display:p.Eo.areaIsZero(n)?"none":"block"},className:p.CSS.BE("viewport-mask","selection")}),s]}));Lo.displayName="ZoomPanMask";const ap=[{key:"start",icon:i.jsxRuntimeExports.jsx(y.Qt.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(y.Qt.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(y.Qt.TextAlign.Right,{})}],up=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ao=({children:e=up,...t})=>i.jsxRuntimeExports.jsx(ke.Button,{...t,allowMultiple:!1,data:ap,children:e}),dp=new Set([H.g.UUID,H.g.JSON]),xp=H.g.ALL.filter(e=>e!==H.g.UNKNOWN).map(e=>({key:e.toString(),name:dp.has(e)?e.toString().toUpperCase():p._$1.capitalize(e.toString())})),fp=[{key:"name",name:"Name"}],pp=e=>i.jsxRuntimeExports.jsx(ke.DropdownButton,{...e,data:xp,columns:fp,entryRenderKey:"name"}),mp=[{key:"x",icon:i.jsxRuntimeExports.jsx(y.Qt.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(y.Qt.Arrow.Up,{})}],hp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),gp=({children:e=hp,...t})=>i.jsxRuntimeExports.jsx(ke.Button,{...t,allowMultiple:!1,data:mp,children:e}),sl=e=>i.jsxRuntimeExports.jsx(y.Icon,{className:p.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(y.Qt.Close,{"aria-label":"clear"})}),rt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:o,emptyContent:r,inputProps:l,allowNone:c=!0,searcher:a,className:u,variant:d="button",hideColumnHeader:x=!1,disabled:f,omit:m,children:h,dropdownVariant:E="connected",placeholder:v=cs,inputPlaceholder:w=v,triggerTooltip:_,dropdownZIndex:S,filter:j,actions:C,...P})=>{const{visible:b,open:L,close:N,toggle:A}=y.use$2(),[O,T]=g.useState(null),z=a!=null;y.useAsyncEffect(async()=>{if(y.selectValueIsZero(t))return T(null);if((O==null?void 0:O.key)===t)return;let M=null;if(z)try{[M]=await a.retrieve([t])}finally{M??(M=null)}else o!=null&&(M=o.find(B=>B.key===t)??null);T(M)},[a,t,o]);const R=g.useCallback((M,B)=>{Array.isArray(M)||(T(M==null?null:B.entries[0]),N(),e(M,B))},[e,c]),I=g.useMemo(()=>z?y.Search:Tt.Filter,[z]),k=i.jsxRuntimeExports.jsx(I,{searcher:a,filter:j,children:({onChange:M})=>i.jsxRuntimeExports.jsx(yp,{autoFocus:E==="modal",variant:d,onChange:M,onFocus:L,selected:O,entryRenderKey:n,visible:b,allowNone:c,className:u,disabled:f,placeholder:w,children:C})}),D=i.jsxRuntimeExports.jsx(y.Button,{tooltip:_,variant:"outlined",onClick:A,disabled:f,children:O!=null?ol(n,O):v});return i.jsxRuntimeExports.jsx(ke.Core,{close:N,zIndex:S,open:L,data:o,omit:m,emptyContent:r,allowMultiple:!1,visible:b,value:t,hideColumnHeader:x,onChange:R,allowNone:c,columns:s,listItem:h,variant:E,trigger:E!=="modal"?k:D,extraDialogContent:E==="modal"?k:void 0,keepMounted:!1,...P})},cs="Select",ol=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),yp=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=cs,className:c,disabled:a,...u})=>{const{clear:d}=y.useSelectionUtils(),[x,f]=g.useState("");g.useEffect(()=>{if(!n){if(H.w$1(t==null?void 0:t.key))return f("");t!=null&&f(ol(e,t))}},[t,n,e]);const m=w=>{s(w),f(w)},h=()=>{x===""&&s(""),f(""),o==null||o()},E=w=>{n||(w.preventDefault(),o==null||o())},v=()=>{f(""),d==null||d()};return i.jsxRuntimeExports.jsx(y.Text$1,{className:p.CSS(p.CSS.BE("select","input"),c),value:x,onChange:m,onFocus:h,onKeyDown:y.matchCallback([["Enter"]],w=>{w.preventDefault(),!n&&(o==null||o())}),endContent:i.jsxRuntimeExports.jsx(Ni.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:E,placeholder:l,disabled:a,...u,children:r&&i.jsxRuntimeExports.jsx(sl,{onClick:v,disabled:a})})},Qt=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:r,onDragStart:l,...c})=>{const a=p.cssString(n);s==null&&n!=null&&(s=i.jsxRuntimeExports.jsx(y.Qt.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(y.Icon,{"aria-label":"close",size:"small",className:p.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(y.Qt.Close,{})});return i.jsxRuntimeExports.jsx(y.WithIcon,{startIcon:s,endIcon:u,className:p.CSS(r,p.CSS.B("tag"),o!=null&&p.CSS.BM("tag","closeable")),level:H.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Ep=Object.freeze(Object.defineProperty({__proto__:null,Tag:Qt},Symbol.toStringTag,{value:"Module"})),At=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=y.componentRenderProp(rl),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:f,replaceOnSingle:m,onTagDragEnd:h,style:E,addPlaceholder:v="Add",children:w,dropdownVariant:_="connected",actions:S,...j})=>{const{visible:C,open:P,close:b}=y.use$2(),[L,N]=g.useState([]),[A,O]=g.useState(!1),T=c!=null;y.useAsyncEffect(async()=>{O(!0),y.selectValueIsZero(t)&&N([]);const D=L.map(V=>V.key),M=H.A(t);if(H.F.unorderedPrimitiveArrays(D,M)===H.F.EQUAL)return;let B=[];if(T)try{B=await c.retrieve(M)}finally{O(!1)}else s!=null&&(B=s.filter(V=>M.includes(V.key)));N(B)},[c,T,t,s]);const z=g.useCallback((D,M)=>{D!=null&&(N(M.entries),e(H.A(D),M))},[e]),R=g.useMemo(()=>T?y.Search:Tt.Filter,[T]);let I,k;if(_==="connected")k=i.jsxRuntimeExports.jsx(R,{searcher:c,children:({onChange:D,value:M})=>i.jsxRuntimeExports.jsx(jp,{value:M,selectedKeys:t,className:n,onChange:D,loading:A,selected:L,onFocus:P,entryRenderKey:r,visible:C,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:E,children:S})});else{const D=H.A(t);k=i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[D.map(M=>{const B=L.find(V=>V.key===M);return a({key:M,entryKey:M,entryRenderKey:r,loading:A,entry:B,onClose:()=>{const V=D.filter(Z=>Z!==M);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>d==null?void 0:d(V,M),onDragEnd:V=>h==null?void 0:h(V,M)})}),D.length>0?i.jsxRuntimeExports.jsx(y.Icon,{onClick:P,children:i.jsxRuntimeExports.jsx(y.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(y.Button,{onClick:P,shade:7,startIcon:i.jsxRuntimeExports.jsx(y.Qt.Add,{}),variant:"text",children:v})]}),I=i.jsxRuntimeExports.jsx(R,{searcher:c,children:M=>i.jsxRuntimeExports.jsx(y.Text$1,{autoFocus:!0,placeholder:"Search",...M,children:S})})}return i.jsxRuntimeExports.jsx(ke.Core,{close:b,open:P,data:s,emptyContent:l,visible:C,value:t,onChange:z,allowNone:f,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:w,trigger:k,extraDialogContent:I,variant:_,...j})},jp=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=cs,onTagDragStart:u,onTagDragEnd:d,value:x,className:f,children:m,...h})=>{const{onSelect:E,clear:v}=y.useSelectionUtils(),w=g.useRef(null);g.useLayoutEffect(()=>{var C;r&&((C=w.current)==null||C.focus())},[r,n]);const _=()=>{r||s(""),o==null||o()},S=()=>{r||o==null||o()},j=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(y.Text$1,{ref:w,className:p.CSS(p.CSS.BE("select-multiple","input"),p.CSS.visible(r),f),onBlur:j,placeholder:a,value:x,onChange:s,onFocus:_,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:S,variant:"button",...h,children:[i.jsxRuntimeExports.jsx(te.Space,{direction:"x",className:p.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:H.A(e).map(C=>{const P=n.find(b=>b.key===C);return c({key:C,entryKey:C,entryRenderKey:l,loading:t,entry:P,onClose:()=>E==null?void 0:E(C),onDragStart:b=>u==null?void 0:u(b,C),onDragEnd:b=>d==null?void 0:d(b,C)})})}),m,i.jsxRuntimeExports.jsx(sl,{onClick:v})]})},rl=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...o})=>{let r=e;return n!=null&&(r=typeof t=="function"?t(n):n[t]),g.createElement(Qt,{size:"small",variant:"outlined",className:p.CSS(n==null&&!s&&p.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},H.Q(r))},Sp=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ke.BaseButton,Button:ke.Button,DEFAULT_PLACEHOLDER:cs,DataType:pp,Direction:gp,DropdownButton:ke.DropdownButton,Multiple:At,MultipleTag:rl,Single:rt,TextAlignment:Ao,defaultButton:ke.defaultButton},Symbol.toStringTag,{value:"Module"})),Pn=6,Rp=2,jr=5,wp=e=>p.Eo.width(e)<jr&&p.Eo.height(e)<jr,Cp=["zoom","pan","select","zoomReset"],Gt=[...Cp,"click"],vp=ie.z.enum(Gt),il=["zoom","select"],Mn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},ll={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},cl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},$o={zoom:Mn,pan:ll,select:cl,zoomReset:Mn,click:Mn},bp=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(r=>r!=="MouseLeft")).filter(o=>o.length>0)]))},_p=p.Eo.construct(0,0,1,1,p.J.TOP_LEFT),kp={width:30,height:50},al=({onChange:e,triggers:t,initial:n=_p,threshold:s=kp,ref:o})=>{const r=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(p.Eo.ZERO),[a,u]=g.useState(r),[d,x]=y.useStateRef(n),f=g.useRef(p.q.ZERO),m=g.useRef(null),h=p._.construct(s);g.useEffect(()=>x(()=>p.Eo.truncate(n,Pn)),[n]),g.useEffect(()=>u(r),[r]);const[E,v,w,_]=y.useMemoCompare(()=>{const L={...$o[r],...t},N=y.flattenConfig(L),A=bp(L);return[L,N,A,y.flattenConfig(A)]},y.compareModeConfigs,[t]),S=g.useCallback(({box:L,triggers:N,stage:A,cursor:O})=>{if(m.current==null)return;const T=y.determineMode(E,N),z=p.Eo.construct(m.current);if(T==null)return;if(T==="zoomReset")return c(p.Eo.ZERO),e==null||e({box:p.Eo.DECIMAL,mode:T,stage:A,cursor:O}),x(p.Eo.DECIMAL);const R=wp(L);if(A==="end"){if(R){T==="zoom"&&c(p.Eo.ZERO),e==null||e({box:d.current,mode:"click",stage:A,cursor:O});return}return x(k=>{if(T==="pan"){const M=Sr(L,k,z);return M===null||p.Eo.equals(M,k)?k:(e==null||e({box:M,mode:T,stage:A,cursor:O}),M)}const D=j(L,k,z);return D===null?k:(e==null||e({box:D,mode:T,stage:A,cursor:O}),T==="zoom"?(c(p.Eo.ZERO),D):p.Eo.truncate(k,Pn))})}if(il.includes(T))return R?void 0:c(p.k$2.XY.scale(z).clamp(z).translate({x:-p.Eo.left(z),y:-p.Eo.top(z)}).box(Rr(h,L,z)));if(c(k=>p.Eo.areaIsZero(k)?k:p.Eo.ZERO),p.q.distance(O,f.current)<Rp)return;f.current=O;const I=Sr(L,d.current,z);e==null||e({box:I,mode:T,stage:A,cursor:O})},[c,u,e,E,s.height,s.width,x,m]);g.useImperativeHandle(o,()=>({reset:()=>{c(p.Eo.ZERO),x(p.Eo.DECIMAL),e==null||e({box:p.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:p.q.ZERO})}}),[e]);const j=g.useCallback((L,N,A)=>p.Eo.truncate(Js(N,A).box(Rr(h,L,A)),Pn),[s]),C=y.useHeldRef({triggers:[["Control"]]}),P=y.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const L=N=>{if(m.current==null)return;let A=1;N.deltaY<0?A-=.035:A+=.035;const O=p.Eo.construct(m.current),T=p.q.construct(N);if(!p.Eo.contains(O,T)||N.target!==m.current)return;const R=Js(d.current,p.Eo.construct(m.current)).pos(p.q.construct(N));let k=p.k$2.XY.magnify({x:C.current.held?1:A,y:P.current.held?1:A}).box(d.current);k=p.Eo.translate(k,{x:C.current.held?0:R.x*(1-A),y:P.current.held?0:R.y*(1-A)}),x(k),e==null||e({stage:"end",box:k,cursor:p.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[x,e]),Ti.useDrag({bound:m,onDrag:S,triggers:v,loose:!0});const b=g.useCallback(({triggers:L,stage:N})=>{if(N==="end")return u(r);const A=y.determineMode(w,L);A!=null&&u(A)},[w,r,e]);return y.use$1({triggers:_,callback:b,region:m}),{maskBox:l,ref:m,mode:a}},Js=(e,t)=>p.k$2.XY.scale(t).clamp(t).scale(e),Sr=(e,t,n)=>{let s=p.Eo.signedDims(Js(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},p.Eo.truncate(p.k$2.XY.translate(p.q.construct(s)).box(t),Pn)},Rr=(e,t,n)=>p.Eo.height(t)<=e.height?p.Eo.construct(p.Eo.left(t),p.Eo.top(n),p.Eo.width(t),p.Eo.height(n)):p.Eo.width(t)<=e.width?p.Eo.construct(p.Eo.left(n),p.Eo.top(t),p.Eo.width(n),p.Eo.height(t)):t,Pp=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:p._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(af.Text,{trigger:t[0],level:"small"})]}),Mp={zoom:i.jsxRuntimeExports.jsx(y.Qt.Zoom,{}),pan:i.jsxRuntimeExports.jsx(y.Qt.Pan,{}),select:i.jsxRuntimeExports.jsx(y.Qt.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(y.Qt.Expand,{}),click:i.jsxRuntimeExports.jsx(y.Qt.Bolt,{})},Np=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&Gt.includes(o)).map(([o,r])=>({key:o,icon:Mp[o],tooltip:i.jsxRuntimeExports.jsx(Pp,{mode:o,triggers:r})})).sort((o,r)=>Gt.indexOf(o.key)-Gt.indexOf(r.key));return i.jsxRuntimeExports.jsx(ke.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(y.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},Tp=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:$o,MASK_MODES:il,MODES:Gt,Mask:Lo,PAN_DEFAULT_TRIGGERS:ll,SELECT_DEFAULT_TRIGGERS:cl,SelectMode:Np,ZOOM_DEFAULT_TRIGGERS:Mn,modeZ:vp,use:al},Symbol.toStringTag,{value:"Module"})),ul=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Io=g.forwardRef(({children:e,initial:t=p.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=Xe("Viewport");g.useLayoutEffect(()=>{r({box:t,mode:"zoom",cursor:p.q.ZERO,stage:"start"})},[r,t]);const l=g.useCallback(a=>{r(a),n==null||n(a)},[n,r]),c=al({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx(Lo,{className:p.CSS.BE("line-plot","viewport"),...c,children:e})});Io.displayName="Viewport";const Lp=Object.freeze(Object.defineProperty({__proto__:null,Floating:Qi,Legend:Ji,Line:To,LinePlot:Wi,Title:tl,Tooltip:lp,Viewport:Io,XAxis:Xi,YAxis:Gi,axisFactory:ko,selectViewportEl:ul,useContext:Xe,useGridEntry:an,useViewport:qi},Symbol.toStringTag,{value:"Module"})),Ap=y.wrap$1("Tooltip",({aetherKey:e,...t})=>(y.use$3({aetherKey:e,type:$.Annotation.TYPE,schema:$.annotationStateZ,initialState:t}),null)),dl=y.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=Xe("Range.Provider"),[,{hovered:r,count:l},c]=y.use$3({aetherKey:e,type:$.Provider$1.TYPE,schema:$.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=an({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=y.useContextMenu(),d=y.useSyncedRef(u.visible),x=g.useCallback(f=>{const m=E=>{c(v=>({...v,cursor:{x:E.clientX,y:E.clientY}}))},h=f.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(E=>({...E,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(y.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(te.Space,{style:{width:"100%",height:"100%"},onClick:()=>{r!=null&&(s({box:p.Eo.construct({x:r.viewport.lower,y:0},{x:r.viewport.upper,y:1}),mode:"zoom",cursor:p.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:x})})}),$p=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Ap,Provider:dl},Symbol.toStringTag,{value:"Module"})),xl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Ip=y.flattenConfig(xl),fl=y.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=y.use$3({aetherKey:e,type:$.Measure.TYPE,schema:$.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=y.useHeldRef({triggers:Ip,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=y.determineMode(xl,s.current.triggers,{loose:!0});if(["one","two"].includes(u))return t(d=>({...d,[u]:a}));t(u==="clear"?d=>({...d,one:null,two:null}):d=>({...d,one:d.one??a,two:d.one!==null?a:d.two}))}},[t,s]);qi(o);const r=g.useCallback(c=>t(a=>({...a,hover:p.q.construct(c)})),[t]),l=g.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return g.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",r),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",r),c.removeEventListener("mouseleave",l)}},[o]),i.jsxRuntimeExports.jsx("span",{ref:n})}),Op=Object.freeze(Object.defineProperty({__proto__:null,Measure:fl},Symbol.toStringTag,{value:"Module"})),Oo=y.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,units:r="",color:l,lineWidth:c,lineDash:a})=>{const[u,d]=H.usePurePassthrough({value:t,onChange:s,initial:""}),[,{position:x,pixelPosition:f},m]=y.use$3({aetherKey:e,type:$.Rule.TYPE,schema:$.ruleStateZ,initialState:{color:l,dragging:!1,position:n,lineWidth:c,lineDash:a}});g.useEffect(()=>{if(x==null)return;if(n==null)return o==null?void 0:o(x);const j=p.G.construct(x+.01,x-.01);n!=null&&!p.G.contains(j,n)&&(o==null||o(Math.trunc(x*100)/100))},[x]);const h=g.useRef(f);f!==h.current&&(h.current=f);const E=g.useRef(f);g.useEffect(()=>{m(j=>({...j,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const v=os({onStart:g.useCallback(()=>{m(j=>({...j,dragging:!0})),E.current=h.current},[]),onMove:j=>{m(C=>({...C,pixelPosition:(E.current??0)+p.Eo.signedHeight(j)}))},onEnd:g.useCallback(()=>{m(j=>({...j,dragging:!1})),E.current=f},[])}),w=g.useRef(null);if(x==null||f==null)return null;const _=ul(w==null?void 0:w.current),S=i.jsxRuntimeExports.jsxs("div",{ref:w,className:p.CSS.B("rule"),style:{top:`calc(${f}px - 0.5rem)`},children:[i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(y.Editable,{level:"p",value:u,onChange:d}),i.jsxRuntimeExports.jsx(y.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${x.toFixed(2)} ${r}`})]})]});return _==null?S:Co.createPortal(S,_)}),Dp=Object.freeze(Object.defineProperty({__proto__:null,Rule:Oo},Symbol.toStringTag,{value:"Module"})),pl=y.canDropOfType(He),zp=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,showLegend:r=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:u,onRuleChange:d,onAxisChannelDrop:x,onAxisChange:f,rules:m,enableTooltip:h=!0,enableMeasure:E=!1,initialViewport:v=p.Eo.DECIMAL,legendVariant:w,onViewportChange:_,viewportTriggers:S,annotationProvider:j,...C})=>{var A;const P=t.filter(({location:O})=>p.J.isY(O)),b=g.useRef(),L=y.usePrevious(e.length),N=y.usePrevious(C.hold);return(L===0&&e.length!==0||N===!0&&C.hold===!1)&&((A=b.current)==null||A.reset()),i.jsxRuntimeExports.jsxs(Wi,{...C,children:[P.map((O,T)=>{const z=e.filter(k=>k.axes.x===O.key),R=t.filter(({location:k})=>p.J.isX(k)),I=m==null?void 0:m.filter(k=>[...R.map(({key:D})=>D),O.key].includes(k.axis));return i.jsxRuntimeExports.jsx(Bp,{axis:O,index:T,lines:z,yAxes:R,rules:I,onAxisChannelDrop:x,onAxisChange:f,annotationProvider:j},O.key)}),r&&i.jsxRuntimeExports.jsx(Ji,{onLineChange:u,position:l,onPositionChange:c,variant:w}),n&&i.jsxRuntimeExports.jsx(tl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Io,{initial:v,onChange:_,triggers:S,ref:b,children:[h&&i.jsxRuntimeExports.jsx(nl,{}),E&&i.jsxRuntimeExports.jsx(fl,{})]})]})},Bp=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l,axis:{location:c,key:a,showGrid:u,...d},annotationProvider:x})=>{const f=y.useDrop({type:"Channel.LinePlot.XAxis",canDrop:pl,onDrop:g.useCallback(({items:E})=>{const v=y.filterByType(He,E);return r==null||r(a,v.map(({key:w})=>w)),v},[a,r])}),m=s==null?void 0:s.filter(E=>E.axis===a),h=y.useDraggingState();return i.jsxRuntimeExports.jsxs(Xi,{...d,...f,location:c,showGrid:u??n===0,className:p.CSS(p.CSS.dropRegion(y.canDropOfType(He)(h))),onAutoBoundsChange:E=>l==null?void 0:l({key:a,bounds:E}),children:[e.map((E,v)=>{const w=t.filter(S=>S.axes.y===E.key),_=s==null?void 0:s.filter(S=>S.axis===E.key);return i.jsxRuntimeExports.jsx(Fp,{axis:{...E,showGrid:u??(n===0&&v===0)},lines:w,rules:_,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l},E.key)}),m==null?void 0:m.map(E=>g.createElement(Oo,{aetherKey:E.key,...E,key:E.key,onLabelChange:v=>o==null?void 0:o({key:E.key,label:v}),onPositionChange:v=>o==null?void 0:o({key:E.key,position:v})})),i.jsxRuntimeExports.jsx(dl,{...x})]})},Vp=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Fp=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c}})=>{const a=y.useDrop({type:"Channel.LinePlot.YAxis",canDrop:pl,onDrop:g.useCallback(({items:d})=>{const x=y.filterByType(He,d);return s==null||s(r,x.map(({key:f})=>f)),x},[r,s])}),u=y.useDraggingState();return i.jsxRuntimeExports.jsxs(Gi,{...c,...a,location:l,className:p.CSS(p.CSS.dropRegion(y.canDropOfType(He)(u))),onAutoBoundsChange:d=>o==null?void 0:o({key:r,bounds:d}),children:[e.map(d=>i.jsxRuntimeExports.jsx(Hp,{line:d},Vp(d))),t==null?void 0:t.map(d=>g.createElement(Oo,{aetherKey:d.key,...d,key:d.key,onLabelChange:x=>n==null?void 0:n({key:d.key,label:x}),onPositionChange:x=>n==null?void 0:n({key:d.key,position:x})}))]})},Hp=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(Yp,{line:e}):i.jsxRuntimeExports.jsx(Zp,{line:e}),Zp=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...o}})=>{const r=Number(t.valueOf())*3,l=$.streamChannelData({timeSpan:t,channel:s,keepFor:r}),c=n!=null&&n!==0,a=$.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:r});return i.jsxRuntimeExports.jsx(To,{aetherKey:e,y:l,x:a,...o})},Yp=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const r=$.channelData({timeRange:e,channel:s}),l=n!=null&&n!==0,c=$.channelData({timeRange:e,channel:l?n:s,useIndexOfChannel:!l});return i.jsxRuntimeExports.jsx(To,{aetherKey:t,y:r,x:c,...o})},wr=[{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"}],On=({items:e},t)=>{const n=y.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},ml=["name","alias"],hl=e=>{const t=rs();return g.useMemo(()=>e.length===0?wr:wr.filter(n=>e.includes(n.key)),[e,t])},qp=({columns:e=ml,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=De(),c=rs(),a=hl(e),u=_o(),d=y.useMemoDeepEqualProps(o),x=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...d}),[l,u,d]),f=l!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...E}=y.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(j=>On(j,H.A(s)),[s]),onDrop:g.useCallback(({items:j})=>{const C=y.filterByType(He,j);if(C.length===0)return[];const P=H.n([...H.A(s),...C.map(b=>b.key)]);return t(P,{clickedIndex:null,clicked:null,entries:[]}),C},[t,s])}),v=y.useDraggingState(),w=g.useCallback(({dropped:j})=>{t(H.A(s).filter(C=>!j.some(P=>P.key===C)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),_=g.useCallback((j,C)=>m([{key:C,type:He}],w),[m,w]),S=g.useCallback(j=>c[j.key]??j.name,[c]);return i.jsxRuntimeExports.jsx(At,{className:p.CSS(n,p.CSS.dropRegion(On(v,H.A(s)))),value:s,onTagDragStart:_,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:f,entryRenderKey:S,...E,...r})},ot=({columns:e=ml,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=De(),a=rs(),u=hl(e),d=_o(),x=y.useMemoDeepEqualProps(r),f=g.useMemo(()=>{if(!(o!=null&&o.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x})},[c,d,o==null?void 0:o.length,x]),m=c!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),E=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:v,onDragEnd:w,..._}=y.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(P=>On(P,H.o$1(n)),[n]),onDrop:g.useCallback(({items:P})=>{const b=y.filterByType(He,P);return b.length===0?[]:(t(b[0].key,{clickedIndex:null,clicked:null,entries:[]}),b)},[E,t])}),S=y.useDraggingState(),j=g.useCallback(()=>n!=null&&v([{type:He,key:n}]),[v,n]),C=g.useCallback(P=>a[P.key]??P.name,[a]);return i.jsxRuntimeExports.jsx(rt,{data:o,className:p.CSS(s,p.CSS.dropRegion(On(S,H.o$1(n)))),value:n,onDragStart:j,onDragEnd:w,onChange:t,searcher:f,columns:u,emptyContent:m,entryRenderKey:C,..._,...l})},Wp=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:zf,AliasProvider:Fi,LinePlot:zp,SelectMultiple:qp,SelectSingle:ot,useActiveRange:_o,useAlias:Vi,useAliases:rs,useContext:Bi,useName:is},Symbol.toStringTag,{value:"Module"})),it=({path:e,optional:t=!1,onChange:n})=>{const s=lt(),{get:o,bind:r,set:l,setStatus:c}=s,[a,u]=g.useState(o(e,{optional:t}));g.useEffect(()=>(u(o(e,{optional:t})),r({path:e,onChange:u,listenToChildren:!1})),[e,n,r,o]);const d=g.useCallback(m=>{n==null||n(m,{...s,path:e}),l(e,m)},[e,l,n]),x=g.useCallback(m=>c(e,m),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let f;return s.mode==="preview"&&(f="preview"),{onChange:d,setStatus:x,variant:f,...a}},gl=(e,t=!1,n)=>{const{get:s,bind:o}=lt(n),[,r]=g.useState(0);return g.useEffect(()=>(r(l=>l+1),o({path:e,onChange:()=>r(l=>l+1)})),[e,o]),s(e,{optional:t})??null},Xp=(e,t=!1,n)=>{var l;const{get:s,bind:o}=lt(n),[,r]=g.useState(0);return g.useEffect(()=>(r(c=>c+1),o({path:e,onChange:()=>r(c=>c+1)})),[e,o]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},Gp=e=>{var t,n;return((n=(t=gl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},Kp=({path:e,ctx:t,onChange:n})=>{const s=lt(t);g.useEffect(()=>s.bind({path:e,onChange:o=>n(o,s),listenToChildren:!1}),[e,s])},Up=({path:e,optional:t=!1})=>{const{bind:n,get:s}=lt(),[o,r]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(r(s(e,{optional:t})),n({path:e,onChange:l=>r({...l,value:H.U(l.value)}),listenToChildren:!0})),[e,n,s]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},yl=(e,t)=>({add:(n,s)=>{const o=H.U(e.get(t).value);o.splice(s,0,...H.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,s)=>{const o=H.U(e.get(t).value);o.push(...H.A(n)),s!=null&&o.sort(s),e.set(t,o,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>!o.has(l)))},keepOnly:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>o.has(l)))},set:n=>e.set(t,H.executeSetter(n,e.get(t).value)),sort:n=>{const s=H.U(e.get(t).value);s.sort(n),e.set(t,s)}}),Qp=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=lt(n),{bind:o,get:r}=s,[l,c]=g.useState(r(e).value);return g.useEffect(()=>(c(r(e).value),o({path:e,onChange:a=>{c(H.U(a.value))},listenToChildren:t})),[e,o,r,c]),g.useMemo(()=>({value:l,...yl(s,e)}),[l,s,e])},Do=g.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),lt=e=>{const t=g.useContext(Do);return e??t},Cr=e=>({key:e,variant:"success",message:""}),Jp=e=>e.code===ie.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",El=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o})=>{const r=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=y.useSyncedRef(n),c=y.useSyncedRef(o),a=g.useCallback(({path:C,onChange:P,listenToChildren:b=!1})=>{var O;const{parentListeners:L,listeners:N}=r.current,A=b?L:N;return A.has(C)||A.set(C,new Set),(O=A.get(C))==null||O.add(P),()=>{var T;return(T=A.get(C))==null?void 0:T.delete(P)}},[]),u=g.useCallback((C,{optional:P}={optional:!1})=>{const{state:b,statuses:L,touched:N}=r.current,A=H._.get(b,C,{optional:P});if(A==null)return null;const O={value:A,status:L.get(C)??Cr(C),touched:N.has(C),required:!1};if(l.current==null)return O;const T=l.current,z=H.N.getFieldSchema(T,C,{optional:!0});return z==null||(O.required=!z.isOptional()),O},[]),d=g.useCallback(C=>{const{state:P,statuses:b,touched:L,listeners:N,parentListeners:A}=r.current;H._.remove(P,C),b.delete(C),L.delete(C),N.delete(C),A.delete(C)},[]),x=g.useCallback(C=>{const{statuses:P,touched:b}=r.current;r.current.state=C,m(""),P.clear(),b.clear()},[]),f=g.useCallback(C=>{var L;const{listeners:P}=r.current,b=u(C,{optional:!0});b!=null&&((L=P.get(C))==null||L.forEach(N=>N(b)))},[]),m=g.useCallback(C=>{const{listeners:P,parentListeners:b}=r.current,L=P.get(C);if(C==""&&([...P.keys()].forEach(O=>{var z;const T=u(O,{optional:!0});T!=null&&((z=P.get(O))==null||z.forEach(R=>{R(T)}))}),[...b.keys()].forEach(O=>{var z;const T=u(O,{optional:!0});T!=null&&((z=b.get(O))==null||z.forEach(R=>{R(T)}))})),L!=null){const N=u(C,{optional:!0});N!=null&&L.forEach(A=>{A(N)})}b.forEach((N,A)=>{if(H._.pathsMatch(C,A)){const T=u(A,{optional:!0});T!=null&&N.forEach(z=>{z(T)})}})},[]),h=g.useCallback((C,P="",b=!0)=>{const{statuses:L,listeners:N,touched:A}=r.current;if(C.success){const R=[...L.keys()];return L.clear(),R.forEach(I=>f(I)),!0}let O=!0;const T=new Set(C.error.issues.map(R=>R.path.join(".")));let z=(R,I)=>R===I;return b&&(z=(R,I)=>H._.pathsMatch(R,I)),C.error.issues.forEach(R=>{var B;const{message:I}=R,k=R.path.join(".");if(!z(k,P))return;const D=Jp(R);D!=="warning"&&(O=!1),L.set(k,{key:k,variant:D,message:I}),A.add(k);let M=u(k,{optional:!0});M??(M={value:void 0,status:L.get(k)??Cr(k),touched:!1,required:!1}),(B=N.get(k))==null||B.forEach(V=>V(M))}),L.forEach((R,I)=>{T.has(I)||(L.delete(I),f(I))}),O},[]),E=g.useCallback((C,P)=>{if(l.current==null)return!0;const{state:b}=r.current,L=l.current.safeParse(b);return h(L,C,P)},[h]),v=g.useCallback(async(C,P)=>{if(l.current==null)return!0;const{state:b}=r.current,L=await l.current.safeParseAsync(b);return h(L,C,P)},[h]),w=g.useCallback((C,P,b={})=>{const L=H._.get(r.current.state,C,{optional:!0}),{validateChildren:N=!0}=b,{state:A,touched:O}=r.current;O.add(C),C.length===0?r.current.state=P:H._.set(A,C,P),m(C),(async()=>{var z;let T;try{T=E(C,N)}catch{T=await v(C,N)}(z=c.current)==null||z.call(c,{values:r.current.state,path:C,prev:L,valid:T})})()},[]),_=g.useCallback(C=>H._.has(r.current.state,C),[]),S=g.useCallback((C,P)=>{r.current.statuses.set(C,P),r.current.touched.add(C),f(C)},[]),j=g.useCallback(()=>{const{statuses:C}=r.current;C.clear(),C.forEach((P,b)=>f(b))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:C}=r.current;r.current.state=e,C.forEach((P,b)=>{const L=u(b,{optional:!0});L!=null&&P.forEach(N=>N(L))})},[t,e]),g.useMemo(()=>({bind:a,set:w,get:u,mode:s,validate:E,validateAsync:v,value:()=>r.current.state,has:_,remove:d,setStatus:S,clearStatuses:j,reset:x}),[a,w,u,E,v,_,d,S,j,x,s])},em=e=>i.jsxRuntimeExports.jsx(Do.Provider,{value:e,children:e.children}),tm=y.componentRenderProp(y.Text$1),je=({path:e,children:t=tm,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:r=!1,optional:l,onChange:c,className:a,...u})=>{const d=it({path:e,optional:l??r,onChange:c}),x=lt();if(d==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=p._$1.capitalize(H._.element(e,-1))),o=typeof o=="function"?o(d,x):o,!o)return null;const f=d.status.message,{onChange:m,value:h}=d,E={onChange:m,value:h};return d.variant!=null&&(E.variant=d.variant),i.jsxRuntimeExports.jsx($e.Item,{padHelpText:s,helpText:f,helpTextVariant:d.status.variant,label:n,required:d.required,className:p.CSS(a,p.CSS.BE("field",e.split(".").join("-")),p.CSS.M(d.status.variant)),...u,children:t(E)})},Et=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(je,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},jl=Et(y.Numeric),as=jl({}),Sl=Et(y.Text$1),Rl=Sl({}),wl=Et(y.Switch$1),zo=wl({}),nm=Et(rt),sm=Et(At),om=Et(ke.DropdownButton),Bo=({key:e,open:t,onChange:n})=>{const s=y.useMemoPrimitiveArray(e);y.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},rm=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return y.useAsyncEffect(async()=>{s(await e())},[e]),Bo({...t,onChange:s}),n},im=Object.freeze(Object.defineProperty({__proto__:null,useListener:Bo,useState:rm},Symbol.toStringTag,{value:"Module"})),lm=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=De(),u=y.useAggregator(),d=y.useMemoPrimitiveArray(e),x=El({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(E){u({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});y.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});x.set("",h)}catch(h){u({variant:"error",message:`Failed to retrieve ${t}`,description:h.message})}},[d,a==null?void 0:a.key]);const f=g.useCallback(async()=>{if(a!=null)return await(o==null?void 0:o(a))},[d,a==null?void 0:a.key]),m=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:x}),[d,l]);return Bo({key:d,open:f,onChange:m}),x},cm=Object.freeze(Object.defineProperty({__proto__:null,Context:Do,Field:je,Form:em,NumericField:as,SwitchField:zo,TextField:Rl,buildDropdownButtonSelectField:om,buildNumericField:jl,buildSelectMultiField:sm,buildSelectSingleField:nm,buildSwitchField:wl,buildTextField:Sl,fieldArrayUtils:yl,fieldBuilder:Et,use:El,useChildFieldValues:Up,useContext:lt,useField:it,useFieldArray:Qp,useFieldListener:Kp,useFieldState:gl,useFieldValid:Gp,useFieldValue:Xp,useSynced:lm},Symbol.toStringTag,{value:"Module"})),am=[{key:"name",name:"Name"},{key:"location",name:"Location"}],um=({searchOptions:e,...t})=>{const n=De();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),i.jsxRuntimeExports.jsx(rt,{columns:am,searcher:s,entryRenderKey:"name",...t})},dm=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:um},Symbol.toStringTag,{value:"Module"})),vt="label",Vo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(y.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Dn=({items:e},t)=>{const n=y.filterByType(vt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},xm=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(Qt,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),fm=y.componentRenderProp(xm),pm=({onChange:e,className:t,value:n,...s})=>{const o=De(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=y.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(f=>Dn(f,H.A(n)),[n]),onDrop:g.useCallback(({items:f})=>{const m=y.filterByType(vt,f);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=y.useDraggingState(),d=g.useCallback(({dropped:f})=>{e(H.A(n).filter(m=>!f.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((f,m)=>l([{key:m,type:vt}],d),[l,d]);return i.jsxRuntimeExports.jsx(At,{className:p.CSS(t,p.CSS.dropRegion(Dn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:Vo,emptyContent:r,renderTag:fm,addPlaceholder:"Label",...a,...s})},Cl=({value:e,onChange:t})=>{const n=De(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),l=y.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Dn(u,H.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=y.filterByType(vt,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=y.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:vt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},mm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Cl({value:t,onChange:e});return i.jsxRuntimeExports.jsx(rt,{data:s,className:p.CSS(n,p.CSS.dropRegion(Dn(r,H.o$1(t)))),value:t,onChange:e,columns:Vo,entryRenderKey:"name",...l,...o})},hm=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Cl({value:t,onChange:n});return i.jsxRuntimeExports.jsx(rt,{data:e,value:t,onChange:n,columns:Vo,entryRenderKey:"name",...r,...s})},gm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:vt,SelectButton:hm,SelectMultiple:pm,SelectSingle:mm},Symbol.toStringTag,{value:"Module"})),vl=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);y.useClickOutside({ref:c,exclude:d=>y.findParent(d.target,f=>f.getAttribute("role")==="dialog")!=null,onClickOutside:o});const u=g.useCallback(d=>{var f;if(!a.current||d.stage!=="start")return;const x=(f=c.current)==null?void 0:f.querySelectorAll(`.${p.CSS.visible(!0)}`);x&&x.length>0||o()},[o]);return y.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(p.CSS.BE("modal","bg"),p.CSS.visible(n),s&&p.CSS.M("enabled-modal")),empty:!0,align:"center",children:i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(p.CSS.BE("modal","dialog"),t&&p.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...r},children:i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(p.CSS.BE("modal","content")),empty:!0,children:e})})})},ym=({root:e,...t})=>Co.createPortal(i.jsxRuntimeExports.jsx(vl,{...t}),y.getRootElement(e)),Em=Object.freeze(Object.defineProperty({__proto__:null,Dialog:vl,Modal:ym},Symbol.toStringTag,{value:"Module"})),us=new Error("Tab not found"),jm=new Error("Invalid Mosaic"),zn=(e,t,n="center",s)=>{var x;if(e=Ke(e),s===void 0)return eo(e,t);const o=to(e,s);if(n==="center")return(x=o.tabs)==null||x.push(t),o.selected=t.tabKey,e;const r=o.key*2,l=o.key*2+1,c=n==="top"||n==="left"?r:l;if(to(e,c).key!==o.key)return zn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return zn(e,t,"center",s);const[a,u,d]=bm(n);if(o.direction=d,o[a]={key:0,tabs:[t],selected:t.tabKey},o[u]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw jm;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Sm=(e,t,n)=>{var r;e=Ke(e);const[s,o]=ft(e,t);if(s==null||o==null)throw us;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},eo=(e,t)=>(e=Ke(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=eo(e.first,t):e.last!=null&&(e.last=eo(e.last,t)),e)),Bn=e=>{e=Ke(e);const t=[];if(e.tabs!=null&&(e.selected=we.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Bn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Bn(e.last);e.last=n,t.push(...s)}return[e,t]},Fo=(e,t)=>{var o;e=Ke(e);const[,n]=ft(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(r=>r.tabKey!==t),n.selected=we.resetSelection(n.selected,n.tabs),e=vm(e);const s=n.selected??Vn(e);return[e,s]},Vn=e=>e.selected!=null?e.selected:e.first!=null?Vn(e.first):e.last!=null?Vn(e.last):null,bl=(e,t)=>{e=Ke(e);const[n,s]=ft(e,t);if(n==null||s==null)throw us;return s.selected=t,e},_l=(e,t,n,s)=>{e=Ke(e);const[o,r]=ft(e,t);if(o==null||r==null)throw us;const[l,c]=Fo(e,t);return[zn(l,o,n,s),c]},Jt=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Jt(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Jt(e.last,t);if(n!=null)return n}},kl=(e,t,n)=>{const s=Fn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Rm=(e,t,n)=>{e=Ke(e);const s=Jt(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const o=s.tabs.findIndex(d=>d.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const r=s.tabs[o];s.tabs=s.tabs.filter(d=>d.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[r],selected:r.tabKey},u={key:l,tabs:s.tabs,selected:s.selected};return u.selected=we.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},wm=(e,t)=>{const n=Jt(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Pl=(e,t,n)=>{e=Ke(e);const[,s]=ft(e,t);if((s==null?void 0:s.tabs)==null)throw us;return s.tabs=we.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Cm=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,to=(e,t)=>{const n=Fn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:to(e,s)},vm=e=>{let t=!0;for(;t;)[e,t]=no(e);return e.first==null&&e.last==null&&(e.key=1),e},no=e=>{if(e.first==null||e.last==null)return[e,!1];if(br(e.first))return[vr(e.last,!0),!0];if(br(e.last))return[vr(e.first,!1),!0];let t,n;return[e.first,t]=no(e.first),[e.last,n]=no(e.last),[e,t||n]},vr=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),br=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),ft=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=ft(e.first,t);if(n!=null&&s!=null)return[n,s];const[o,r]=ft(e.last,t);return[o,r]},Fn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Fn(e.first,t);return n??Fn(e.last,t)},bm=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")}},Ke=e=>H._.copy(e),Hn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Hn(e.first,t,n),e.last!=null&&Hn(e.last,t,n),n),so=(e,t)=>{t(e),e.first!=null&&so(e.first,t),e.last!=null&&so(e.last,t)};class Ml{constructor(t={}){Fe(this,"parent");Fe(this,"stub");Fe(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const _m=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const o=s.parentNode;o!=null&&e.mount(o,s)},[e]),i.jsxRuntimeExports.jsx("div",{ref:t})},Nl=({node:e,children:t})=>Co.createPortal(t,e.el),km=Object.freeze(Object.defineProperty({__proto__:null,In:Nl,Node:Ml,Out:_m},Symbol.toStringTag,{value:"Module"})),Zn=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:o,first:r,last:l,key:c,size:a},emptyContent:u,...d}=n,x=g.useCallback(([h])=>t(c,h),[t]),{props:f}=vo({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Tl,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(ss,{id:`mosaic-${c}`,align:"stretch",className:p.CSS.BE("mosaic","resize"),...f,children:[i.jsxRuntimeExports.jsx(Zn,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(Zn,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(y.Provider$2,{children:m}):m});Zn.displayName="Mosaic";const Yn="pluto-mosaic-tab-drop",Ho="pluto-mosaic-tab-create",Pm=(e,t,n)=>{if(y.filterByType(y.FILE_TYPE,t).length>0&&n)return!0;const o=y.filterByType(Yn,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return y.filterByType(Ho,t).length>0||o.length>0&&(r||e.length===0)},Tl=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,onFileDrop:r,...l})=>{const{key:c,tabs:a}=e,[u,d]=g.useState(null),x=r!=null,f=g.useCallback(({items:C})=>Pm(a,C,x),[a,x]),m=g.useCallback(({items:C,event:P})=>{if(P==null)return[];d(null);const b=y.filterByType(y.FILE_TYPE,C).length>0,L=a.length===0?"center":kr(_r(P));if(b)return r==null||r(c,L,P),C;const N=y.filterByType(Yn,C);if(N.length>0){const O=N.map(({key:T})=>T)[0];t(c,O,L)}const A=y.filterByType(Ho,C);if(A.length>0){const O=A.map(({key:T})=>T);n==null||n(c,L,O)}return N},[t,a.length]),h=g.useCallback(({event:C})=>{if(C==null)return;const P=a.length===0?"center":kr(_r(C));d(P)},[a.length]),{startDrag:E,...v}=y.useDragAndDrop({type:"Mosaic",canDrop:f,onDrop:m,onDragOver:h}),w=f(y.useDraggingState()),_=g.useCallback(()=>d(null),[]),S=g.useCallback((C,{tabKey:P})=>{E([{key:P,type:Yn,elementID:C.currentTarget.id}])},[E]),j=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return i.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:p.CSS.BE("mosaic","leaf"),children:[i.jsxRuntimeExports.jsxs(we.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:_,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:S,onCreate:j,...l,...v,children:[e.selected!=null&&o(a.find(C=>C.tabKey===e.selected)),w&&i.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),u!=null&&i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("mosaic","mask"),style:Mm[u]})]})});Tl.displayName="MosaicTabLeaf";const Mm={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%"}},_r=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},Nm=e=>e,Tm=e=>1-e,kr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[Nm(e),Tm(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},Lm=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),o=new Set,r=Hn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let u=s.current.get(a.tabKey);return a==null?null:(u==null&&(u=new Ml({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),o.add(a.tabKey),i.jsxRuntimeExports.jsx(Nl,{node:u,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!o.has(c)&&s.current.delete(c)),[s,r]},Am=ie.z.object({key:ie.z.number(),tabs:ie.z.array(we.tabZ).optional(),selected:ie.z.string().optional(),direction:p.g.direction.optional(),size:ie.z.number().optional()}),oo=Am.extend({first:ie.z.lazy(()=>oo).optional(),last:ie.z.lazy(()=>oo).optional()}),$m=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Bn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(f=>_l(f,d,x,u)[0]),onClose:u=>s(d=>Fo(d,u)[0]),onSelect:u=>s(d=>bl(d,u)),onResize:(u,d)=>s(x=>kl(x,u,d)),onRename:e?(u,d)=>s(x=>Pl(x,u,d)):void 0}},Im=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ho,HAUL_DROP_TYPE:Yn,Mosaic:Zn,autoSelectTabs:Bn,canSplit:wm,findSelected:Vn,findTabNode:Jt,forEachNode:so,insertTab:zn,isEmpty:Cm,mapNodes:Hn,moveTab:_l,nodeZ:oo,removeTab:Fo,renameTab:Pl,resizeNode:kl,selectTab:bl,split:Rm,updateTab:Sm,use:$m,usePortal:Lm},Symbol.toStringTag,{value:"Module"})),Om=({location:e="left",size:t="9rem",className:n,style:s,...o})=>{const r=p.J.construct(e),l=p.J.direction(r),c=p.g.swap(l);return i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(p.CSS.B("navbar"),p.CSS.bordered(p.J.swap(r)),p.CSS.dir(c),p.CSS.loc(r),n),direction:c,style:{[p.g.dimension(l)]:t,...s},align:"center",empty:!0,...o})},un=e=>({bordered:t=!1,className:n,...s})=>i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(p.CSS.BE("navbar","content"),e==="absolute-center"?p.CSS.M(e):p.CSS.align(e),e!==""&&t&&p.CSS.bordered(e),n),align:"center",...s}),Ll=un("start");Ll.displayName="NavbarStart";const Al=un("end");Al.displayName="NavbarEnd";const $l=un("center");$l.displayName="NavbarCenter";const Il=un("");Il.displayName="NavbarContent";const Ol=un("absolute-center");Ol.displayName="NavbarAbsoluteCenter";const $t=Om;$t.Start=Ll;$t.Center=$l;$t.End=Al;$t.AbsoluteCenter=Ol;$t.Content=Il;const Zo=({aetherKey:e})=>{const[,{region:t},n]=y.use$3({aetherKey:e,type:$.Eraser$1.TYPE,schema:$.eraserStateZ,initialState:{region:p.Eo.ZERO,enabled:!0}}),s=y.useSyncedRef(t),o=g.useCallback(l=>{p.Eo.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:o}},Dm=y.wrap$1($.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Zo({aetherKey:e}),s=y.useResize(n);return i.jsxRuntimeExports.jsx("div",{ref:s,className:p.CSS(p.CSS.inheritDims()),children:t})}),zm=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Dm,use:Zo},Symbol.toStringTag,{value:"Module"})),Bm=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),o=l=>s(l===n?void 0:l),r=e.find(l=>l.key===n);return{onSelect:o,activeItem:r}},Vm=y.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:s,location:o="left",collapseThreshold:r=.65,className:l,onResize:c,...a})=>{const u=p.J.direction(o),d=g.useCallback(()=>t!=null&&(s==null?void 0:s(t.key)),[s,t==null?void 0:t.key]),{erase:x,setEnabled:f}=Zo({aetherKey:e}),m=g.useCallback((w,_)=>{c==null||c(w,_),x(_)},[c,x]);if(g.useLayoutEffect(()=>{f(t!=null)},[t,f]),t==null)return null;const{content:h,key:E,...v}=t;return i.jsxRuntimeExports.jsx(Ii,{className:p.CSS(p.CSS.BE("navdrawer","content"),p.CSS.dir(u),l),collapseThreshold:r,onCollapse:d,location:o,onResize:m,...v,...a,children:t.content},E)}),Fm=Object.freeze(Object.defineProperty({__proto__:null,Bar:$t,Drawer:Vm,useDrawer:Bm},Symbol.toStringTag,{value:"Module"})),Hm=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(te.Space,{className:p.CSS(t,p.CSS.B("note"),p.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),Zm=Object.freeze(Object.defineProperty({__proto__:null,Note:Hm},Symbol.toStringTag,{value:"Module"})),Is={Close:i.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:i.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:i.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.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"}),i.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"})]})},Ym=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(te.Space,{size:1.5,direction:"x",className:p.CSS(p.CSS.B("macos-controls"),!n&&p.CSS.BM("macos-controls","blurred"),t),...c,children:[i.jsxRuntimeExports.jsx(Os,{onClick:l,className:p.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Is.Close}),i.jsxRuntimeExports.jsx(Os,{onClick:s,className:p.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Is.Minimize}),i.jsxRuntimeExports.jsx(Os,{onClick:r,className:p.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Is.Maximize})]}),Os=({className:e,disabled:t,color:n,...s})=>i.jsxRuntimeExports.jsx("button",{className:p.CSS(p.CSS.B("macos-control"),p.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Ds=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(te.Pack,{...l,children:[i.jsxRuntimeExports.jsx(zs,{className:p.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(y.Qt.Subtract,{})}),i.jsxRuntimeExports.jsx(zs,{className:p.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(y.Qt.Box,{})}),i.jsxRuntimeExports.jsx(zs,{onClick:s,className:p.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(y.Qt.Close,{})})]}),zs=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(y.Icon,{className:p.CSS(p.CSS.B("windows-control"),t),tabIndex:-1,...n}),Dl=e=>H.w.getOS(e),qm={MacOS:Ym,Windows:Ds,Linux:Ds,Docker:Ds},Wm="Windows",Xm=({forceOS:e,visibleIfOS:t,...n})=>{const s=Dl({force:e,default:Wm}),o=qm[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},Gm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Xm,use:Dl},Symbol.toStringTag,{value:"Module"})),Km=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},Um=Object.freeze(Object.defineProperty({__proto__:null,createComponent:Km},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:H.B$1.NOOP});const Qm=y.wrap$1($.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=y.useMemoDeepEqualProps(n),[{path:o},,r]=y.use$3({aetherKey:e,type:$.Provider$2.TYPE,schema:$.providerStateZ$1,initialState:s});return g.useEffect(()=>{r(s)},[s,r]),i.jsxRuntimeExports.jsx(y.Composite,{path:o,children:t})}),Jm="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",zl=y.wrap$1($.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=y.use$3({aetherKey:t,type:$.BaseProvider.TYPE,schema:$.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(y.Composite,{path:n,children:e})}),eh=Object.freeze(Object.defineProperty({__proto__:null,Provider:zl},Symbol.toStringTag,{value:"Module"})),th=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===H.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Bl=y.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=y.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=y.use$3({aetherKey:e,type:$.Chip.TYPE,schema:$.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:H.m.now()}}});g.useEffect(()=>{c(m=>({...m,...r}))},[r,c]);const a=g.useCallback(()=>c(m=>({...m,triggered:!m.triggered})),[c]),{message:u,chipColor:d,buttonStyle:x,disabled:f}=th(l);return i.jsxRuntimeExports.jsx(y.Icon,{variant:"text",className:p.CSS(p.CSS.B("control-chip"),s),disabled:f,onClick:a,tooltip:i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(y.Qt.Circle,{color:d})})}),Vl=g.createContext({needsControlOf:[]}),Fl=()=>g.useContext(Vl),nh=y.wrap$1($.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=y.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=y.use$3({aetherKey:e,type:$.Controller$1.TYPE,schema:$.controllerStateZ,initialState:o});return g.useEffect(()=>{l!=null&&(n==null||n(l))},[l,n]),g.useEffect(()=>{a(u=>({...u,...o}))},[o,a]),g.useEffect(()=>()=>n==null?void 0:n("released"),[]),i.jsxRuntimeExports.jsxs(Vl.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(y.Composite,{path:r,children:t}),";"]})}),Hl=y.wrap$1($.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=y.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=y.use$3({aetherKey:e,type:$.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:H.m.now()}},schema:$.indicatorStateZ});g.useEffect(()=>{l(u=>({...u,...s}))},[s,l]);let c;return((a=r.data)==null?void 0:a.color)!=null?c=p.Color.z.parse(r.data.color):o!=null&&!o.isZero?c=o:c="var(--pluto-gray-l8)",i.jsxRuntimeExports.jsxs(y.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("indicator"),style:{backgroundColor:p.cssString(c),flexGrow:1}})]})}),sh=y.wrap$1($.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=Fl(),[,{states:s},o]=y.use$3({aetherKey:e,type:$.Legend.TYPE,schema:$.legendStateZ,initialState:{states:[],needsControlOf:n}});g.useEffect(()=>{o(c=>({...c,needsControlOf:n}))},[n]);const l=H.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(u=>u.subject.key===c);if(a==null)throw new H.Ce("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return i.jsxRuntimeExports.jsx(No,{data:l,...t})}),Zl=y.wrap$1($.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=y.use$3({aetherKey:e,type:$.StateProvider.TYPE,schema:$.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(y.Composite,{path:n,children:t})}),oh=Object.freeze(Object.defineProperty({__proto__:null,Chip:Bl,Controller:nh,Indicator:Hl,Legend:sh,StateProvider:Zl,useContext:Fl},Symbol.toStringTag,{value:"Module"})),Yl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},rh=Yl(zl),ih=Yl(y.Provider$3),lh=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:r,triggers:l,alamos:c,haul:a,channelAlias:u,telem:d})=>i.jsxRuntimeExports.jsx(y.Provider$1,{...l,children:i.jsxRuntimeExports.jsx(y.Config,{...r,children:i.jsxRuntimeExports.jsx(y.Provider$2,{...a,children:i.jsxRuntimeExports.jsx(y.Provider$4,{url:s??Jm,enabled:n,children:i.jsxRuntimeExports.jsx(ih,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(Qm,{...c,children:i.jsxRuntimeExports.jsx(y.Aggregator,{children:i.jsxRuntimeExports.jsx(zi,{connParams:t,children:i.jsxRuntimeExports.jsx(Fi,{...u,children:i.jsxRuntimeExports.jsx(rh,{...d,children:i.jsxRuntimeExports.jsx(y.Provider,{...o,children:i.jsxRuntimeExports.jsx(Zl,{children:e})})})})})})})})})})})}),ch=Object.freeze(Object.defineProperty({__proto__:null,Provider:lh},Symbol.toStringTag,{value:"Module"})),ah=({value:e})=>i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("progress"),children:i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("progress-bar"),style:{width:`${e}%`}})}),uh=Object.freeze(Object.defineProperty({__proto__:null,Progress:ah},Symbol.toStringTag,{value:"Module"})),en="range",Yo=[{key:"name",name:"Name"}],qn=({items:e},t)=>{const n=y.filterByType(en,e);return n.length>0&&!n.every(s=>t.includes(s.key))},dh=({onChange:e,className:t,value:n,...s})=>{const o=De(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=y.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(f=>qn(f,H.A(n)),[n]),onDrop:g.useCallback(({items:f})=>{const m=y.filterByType(en,f);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=y.useDraggingState(),d=g.useCallback(({dropped:f})=>{e(H.A(n).filter(m=>!f.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((f,m)=>l([{key:m,type:en}],d),[l,d]);return i.jsxRuntimeExports.jsx(At,{className:p.CSS(t,p.CSS.dropRegion(qn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Yo,emptyContent:r,entryRenderKey:"name",...a,...s})},ql=({value:e,onChange:t})=>{const n=De(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:l,...c}=y.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>qn(d,H.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=y.filterByType(en,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=y.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:en,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},xh=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=ql({value:t,onChange:e});return i.jsxRuntimeExports.jsx(rt,{data:s,className:p.CSS(n,p.CSS.dropRegion(qn(r,H.o$1(t)))),value:t,onChange:e,columns:Yo,entryRenderKey:"name",...l,...o})},fh=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=ql({value:t,onChange:n});return i.jsxRuntimeExports.jsx(rt,{data:e,value:t,onChange:n,columns:Yo,entryRenderKey:"name",...r,...s})},ph=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(y.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],mh=e=>{const t=De();return i.jsxRuntimeExports.jsx(At,{...e,searcher:t==null?void 0:t.labels,columns:ph,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(Qt,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(Qt,{color:n.entry.color,children:n.entry.name})})},hh=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...o})=>{const r=new H.m(e.start),l=r.isToday?"time":"dateTime",c=new H.m(e.end),a=c.equals(H.m.MAX),u=c.span(r)<H.y.DAY?"time":"dateTime",d=r.span(c);return i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",size:"small",className:p.CSS(p.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(y.Text,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(y.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(y.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(y.Text,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(y.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(y.Text,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(H.y.MILLISECOND).toString(),")"]})]})},gh=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:fh,SelectLabels:mh,SelectMultiple:dh,SelectSingle:xh,TimeRangeChip:hh},Symbol.toStringTag,{value:"Module"})),yh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",className:p.CSS.B("steps"),...s,children:e.map((r,l)=>i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsxs(y.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(y.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},Eh=Object.freeze(Object.defineProperty({__proto__:null,Steps:yh},Symbol.toStringTag,{value:"Module"})),Pr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=at(e,...n);return p.q.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Mr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!jh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=p.g.construct(t),c=p.g.swap(l);let a=dt(c,s[c]-e[c]);const u=p.Eo.loc(n,a);if(p.J.swap(t)===o){const d=p.Eo.loc(r,p.J.swap(a));Math.abs(u-d)<Ne&&(a=p.J.swap(a))}return{direction:c,length:u-e[c]+pt(a,Ne)}},ro=ie.z.object({direction:p.g.direction,length:ie.z.number()}),at=(e,...t)=>{let n=e;for(const s of t)n=p.q.translate(n,s.direction,s.length);return n},Wl=(e,t,n,s)=>{try{let o=e;const r=[e,...t.map(m=>(o=p.q.translate(o,m.direction,m.length),o))];if(!s)return r;const l=t[0],c=dt(l.direction,l.length),a=Nr(c),u=4*(2-n**.5);r[0]=p.q.translate(r[0],{[l.direction]:-1*a*u,[p.g.swap(l.direction)]:0});const d=t[t.length-1],x=dt(d.direction,d.length),f=Nr(x);return r[r.length-1]=p.q.translate(r[r.length-1],{[d.direction]:f*u,[p.g.swap(d.direction)]:0}),r}catch{return[]}},Ne=10,Nr=e=>e==="top"||e==="left"?-1:1,pt=(e,t)=>e==="top"||e==="left"?-t:t,dt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",tt=e=>dt(e.direction,e.length),jh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=p.g.construct(n),o=t[s]-e[s];return pt(n,o)<0},En=e=>({direction:p.g.construct(e),length:pt(e,Ne)}),Tr={top:En("top"),bottom:En("bottom"),left:En("left"),right:En("right")},Sh=4,Rh=.25,ds=e=>io(wh(io(e))),wh=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<Sh){if(o===0||o===e.length-1)return!1;if(r<Rh)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},io=e=>{const t=[...e];return e.findIndex((s,o)=>{const r=t[o-1];if(o===0||s.direction!==r.direction)return!1;if(o===1){const l=o-1,c=o,a=tt(r),u=tt(s);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(r.length)===Ne)return!1;const d=pt(a,Ne),x=t[l].length-d,f=t[c].length+x;return Math.abs(f)<Ne?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:f},!0)}if(o===e.length-1){const l=o,c=o-1,a=tt(s),u=tt(r);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===Ne)return!1;const d=pt(a,Ne),x=t[l].length-d,f=t[c].length+x;return Math.abs(f)<Ne?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:f},!0)}return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?io(t):t},St=e=>ds(Ch(e)),Ch=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Tr[r]},u=at(n,a);const d={...Tr[o]};let x=at(s,d);const f=Math.abs(u.x-x.x),m=Math.abs(u.y-x.y);f<2*Ne&&m<10&&(a.length-=f/2,d.length+=f/2,u=at(n,a),x=at(s,d));const h=[a],E=Mr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});E!=null&&(h.push(E),u=at(u,E),l=tt(E),a=E);const v=Mr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});v!=null&&(x=at(x,v),c=dt(v.direction,v.length));const w=()=>{v!=null&&(v.length*=-1,h.push(v)),d.length*=-1,h.push(d)};if(p.J.swap(l)===o){const b=p.g.construct(l),L=(x[b]-u[b])/2;h.push({direction:b,length:L});const N=p.g.swap(b);return h.push({direction:N,length:x[N]-u[N]}),h.push({direction:b,length:L}),w(),h}const _=x[a.direction]-u[a.direction];let S=p.g.swap(a.direction);const j=u[S]-x[S];let C;dt(a.direction,_)===l&&dt(S,j)===c?C={direction:a.direction,length:_}:(C={direction:S,length:x[S]-u[S]},S=p.g.swap(S)),h.push(C);const P={direction:S,length:x[S]-u[S]};return h.push(P),w(),h},vh=e=>ds(bh(e)),bh=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],r=p.g.swap(o.direction),l=tt(o);if(t===0){s.unshift({direction:r,length:n});const c=pt(l,Ne);s.unshift({direction:o.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:r,length:-n});const c=pt(l,Ne);s.push({direction:o.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},_h=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},kh=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?_h(e,o):e.findIndex(o)},Ph=({delta:e,segments:t})=>ds(Xl(e,t,!1)),Mh=({delta:e,segments:t})=>ds(Xl(e,t,!0)),Xl=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Ar("x",e,s,n)),e.y!==0&&(s=Ar("y",e,s,n)),s},Lr=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=tt(t),r=tt(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Ne)&&o===r},Ar=(e,t,n,s)=>{const o=p.g.swap(e),r=s?n.length-1:0,l=n[r];if(Lr(e,l,t)){const x=n[n.length-1];return x.direction===e&&Math.abs(l.length)<Ne?(n[n.length-1]={...x,length:x.length-t[e]},n):(n[r]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,u=kh(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return Lr(e,x,t)?(n[c]={...x,length:x.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>x.length?n[r]={...l,length:l.length-t[e]}:n[c]={...x,length:x.length-t[e]},n)}if(u===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[r]={...l,length:l.length-t[e]},n):[{direction:o,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const d=n[u];return n[u]={...d,length:d.length-t[e]},n},Nh=ie.z.object({position:p.q.xy,zoom:ie.z.number()}),Gl=ie.z.object({color:p.crudeZ,segments:ie.z.array(ro)}),Th=Gl.extend({key:ie.z.string(),source:ie.z.string(),target:ie.z.string(),segments:ie.z.array(ro),color:p.crudeZ,id:ie.z.string(),data:ie.z.object({segments:ie.z.array(ro),color:p.crudeZ}).optional(),selected:ie.z.boolean(),sourceHandle:ie.z.string().nullable().optional(),targetHandle:ie.z.string().nullable().optional()}),Lh=ie.z.object({key:ie.z.string(),position:p.q.xy,selected:ie.z.boolean().optional(),zIndex:ie.z.number().optional(),type:ie.z.string().optional(),data:ie.z.record(ie.z.unknown()).optional(),measured:ie.z.object({width:ie.z.number().optional(),height:ie.z.number().optional()}).optional()}),qo=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),Wo=e=>e.map(({segments:t,color:n,...s})=>({...s,id:s.key,data:{segments:t,color:n}})),Kl=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),Ul=(e,t)=>e.map(n=>{var s,o;return n.data??(n.data={segments:[],color:t}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((o=n.data)==null?void 0:o.color)??t,...n}}),Ql=e=>({...e.position,zoom:e.zoom}),Jl=e=>({position:p.q.construct(e),zoom:e.zoom}),ec=(e,t)=>Kl(t(qo(e))),Nn=(e,t,n)=>Ul(t(Wo(e)),n),Ah=(e,t="x")=>{if(e.length===0)return[];const n=p.J.construct(t),s=p.J.swap(n);return e.sort((o,r)=>p.Eo.loc(o.box,n)-p.Eo.loc(r.box,n)),e.forEach((o,r)=>{if(r===0)return;const c=e[r-1].handles.find(m=>m.orientation===s),a=o.handles.find(m=>m.orientation===n);if(c==null||a==null)return;const u=c.absolutePosition,d=a.absolutePosition,x=p.q.set(p.q.translation(d,u),t,0),f=p.q.translate(p.Eo.topLeft(o.box),x);o.box=p.Eo.construct(f,p.Eo.dims(o.box))}),e};function Se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Se(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var $h={value:()=>{}};function xs(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Tn(n)}function Tn(e){this._=e}function Ih(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Tn.prototype=xs.prototype={constructor:Tn,on:function(e,t){var n=this._,s=Ih(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=Oh(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(o=(e=s[r]).type)n[o]=$r(n[o],e.name,t);else if(t==null)for(o in n)n[o]=$r(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tn(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,r;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,r=s.length;o<r;++o)s[o].value.apply(t,n)}};function Oh(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function $r(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=$h,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var lo="http://www.w3.org/1999/xhtml";const Ir={svg:"http://www.w3.org/2000/svg",xhtml:lo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ir.hasOwnProperty(t)?{space:Ir[t],local:e}:e}function Dh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lo&&t.documentElement.namespaceURI===lo?t.createElement(e):t.createElementNS(n,e)}}function zh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tc(e){var t=fs(e);return(t.local?zh:Dh)(t)}function Bh(){}function Xo(e){return e==null?Bh:function(){return this.querySelector(e)}}function Vh(e){typeof e!="function"&&(e=Xo(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=new Array(l),a,u,d=0;d<l;++d)(a=r[d])&&(u=e.call(a,a.__data__,d,r))&&("__data__"in a&&(u.__data__=a.__data__),c[d]=u);return new Ae(s,this._parents)}function Fh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Hh(){return[]}function nc(e){return e==null?Hh:function(){return this.querySelectorAll(e)}}function Zh(e){return function(){return Fh(e.apply(this,arguments))}}function Yh(e){typeof e=="function"?e=Zh(e):e=nc(e);for(var t=this._groups,n=t.length,s=[],o=[],r=0;r<n;++r)for(var l=t[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&(s.push(e.call(a,a.__data__,u,l)),o.push(a));return new Ae(s,o)}function sc(e){return function(){return this.matches(e)}}function oc(e){return function(t){return t.matches(e)}}var qh=Array.prototype.find;function Wh(e){return function(){return qh.call(this.children,e)}}function Xh(){return this.firstElementChild}function Gh(e){return this.select(e==null?Xh:Wh(typeof e=="function"?e:oc(e)))}var Kh=Array.prototype.filter;function Uh(){return Array.from(this.children)}function Qh(e){return function(){return Kh.call(this.children,e)}}function Jh(e){return this.selectAll(e==null?Uh:Qh(typeof e=="function"?e:oc(e)))}function eg(e){typeof e!="function"&&(e=sc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ae(s,this._parents)}function rc(e){return new Array(e.length)}function tg(){return new Ae(this._enter||this._groups.map(rc),this._parents)}function Wn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wn.prototype={constructor:Wn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ng(e){return function(){return e}}function sg(e,t,n,s,o,r){for(var l=0,c,a=t.length,u=r.length;l<u;++l)(c=t[l])?(c.__data__=r[l],s[l]=c):n[l]=new Wn(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function og(e,t,n,s,o,r,l){var c,a,u=new Map,d=t.length,x=r.length,f=new Array(d),m;for(c=0;c<d;++c)(a=t[c])&&(f[c]=m=l.call(a,a.__data__,c,t)+"",u.has(m)?o[c]=a:u.set(m,a));for(c=0;c<x;++c)m=l.call(e,r[c],c,r)+"",(a=u.get(m))?(s[c]=a,a.__data__=r[c],u.delete(m)):n[c]=new Wn(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(f[c])===a&&(o[c]=a)}function rg(e){return e.__data__}function ig(e,t){if(!arguments.length)return Array.from(this,rg);var n=t?og:sg,s=this._parents,o=this._groups;typeof e!="function"&&(e=ng(e));for(var r=o.length,l=new Array(r),c=new Array(r),a=new Array(r),u=0;u<r;++u){var d=s[u],x=o[u],f=x.length,m=lg(e.call(d,d&&d.__data__,u,s)),h=m.length,E=c[u]=new Array(h),v=l[u]=new Array(h),w=a[u]=new Array(f);n(d,x,E,v,w,m,t);for(var _=0,S=0,j,C;_<h;++_)if(j=E[_]){for(_>=S&&(S=_+1);!(C=v[S])&&++S<h;);j._next=C||null}}return l=new Ae(l,s),l._enter=c,l._exit=a,l}function lg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cg(){return new Ae(this._exit||this._groups.map(rc),this._parents)}function ag(e,t,n){var s=this.enter(),o=this,r=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?r.remove():n(r),s&&o?s.merge(o).order():o}function ug(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,r=s.length,l=Math.min(o,r),c=new Array(o),a=0;a<l;++a)for(var u=n[a],d=s[a],x=u.length,f=c[a]=new Array(x),m,h=0;h<x;++h)(m=u[h]||d[h])&&(f[h]=m);for(;a<o;++a)c[a]=n[a];return new Ae(c,this._parents)}function dg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,r=s[o],l;--o>=0;)(l=s[o])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function xg(e){e||(e=fg);function t(x,f){return x&&f?e(x.__data__,f.__data__):!x-!f}for(var n=this._groups,s=n.length,o=new Array(s),r=0;r<s;++r){for(var l=n[r],c=l.length,a=o[r]=new Array(c),u,d=0;d<c;++d)(u=l[d])&&(a[d]=u);a.sort(t)}return new Ae(o,this._parents).order()}function fg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mg(){return Array.from(this)}function hg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length;o<r;++o){var l=s[o];if(l)return l}return null}function gg(){let e=0;for(const t of this)++e;return e}function yg(){return!this.node()}function Eg(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],r=0,l=o.length,c;r<l;++r)(c=o[r])&&e.call(c,c.__data__,r,o);return this}function jg(e){return function(){this.removeAttribute(e)}}function Sg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rg(e,t){return function(){this.setAttribute(e,t)}}function wg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Cg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bg(e,t){var n=fs(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?Sg:jg:typeof t=="function"?n.local?vg:Cg:n.local?wg:Rg)(n,t))}function ic(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _g(e){return function(){this.style.removeProperty(e)}}function kg(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Pg(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Mg(e,t,n){return arguments.length>1?this.each((t==null?_g:typeof t=="function"?Pg:kg)(e,t,n??"")):bt(this.node(),e)}function bt(e,t){return e.style.getPropertyValue(t)||ic(e).getComputedStyle(e,null).getPropertyValue(t)}function Ng(e){return function(){delete this[e]}}function Tg(e,t){return function(){this[e]=t}}function Lg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ag(e,t){return arguments.length>1?this.each((t==null?Ng:typeof t=="function"?Lg:Tg)(e,t)):this.node()[e]}function lc(e){return e.trim().split(/^|\s+/)}function Go(e){return e.classList||new cc(e)}function cc(e){this._node=e,this._names=lc(e.getAttribute("class")||"")}cc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ac(e,t){for(var n=Go(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function uc(e,t){for(var n=Go(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function $g(e){return function(){ac(this,e)}}function Ig(e){return function(){uc(this,e)}}function Og(e,t){return function(){(t.apply(this,arguments)?ac:uc)(this,e)}}function Dg(e,t){var n=lc(e+"");if(arguments.length<2){for(var s=Go(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Og:t?$g:Ig)(n,t))}function zg(){this.textContent=""}function Bg(e){return function(){this.textContent=e}}function Vg(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fg(e){return arguments.length?this.each(e==null?zg:(typeof e=="function"?Vg:Bg)(e)):this.node().textContent}function Hg(){this.innerHTML=""}function Zg(e){return function(){this.innerHTML=e}}function Yg(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function qg(e){return arguments.length?this.each(e==null?Hg:(typeof e=="function"?Yg:Zg)(e)):this.node().innerHTML}function Wg(){this.nextSibling&&this.parentNode.appendChild(this)}function Xg(){return this.each(Wg)}function Gg(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Kg(){return this.each(Gg)}function Ug(e){var t=typeof e=="function"?e:tc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Qg(){return null}function Jg(e,t){var n=typeof e=="function"?e:tc(e),s=t==null?Qg:typeof t=="function"?t:Xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function ey(){var e=this.parentNode;e&&e.removeChild(this)}function ty(){return this.each(ey)}function ny(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oy(e){return this.select(e?sy:ny)}function ry(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iy(e){return function(t){e.call(this,t,this.__data__)}}function ly(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function cy(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,r;n<o;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++s]=r;++s?t.length=s:delete this.__on}}}function ay(e,t,n){return function(){var s=this.__on,o,r=iy(t);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=n),o.value=t;return}}this.addEventListener(e.type,r,n),o={type:e.type,name:e.name,value:t,listener:r,options:n},s?s.push(o):this.__on=[o]}}function uy(e,t,n){var s=ly(e+""),o,r=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,u=c.length,d;a<u;++a)for(o=0,d=c[a];o<r;++o)if((l=s[o]).type===d.type&&l.name===d.name)return d.value}return}for(c=t?ay:cy,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function dc(e,t,n){var s=ic(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function dy(e,t){return function(){return dc(this,e,t)}}function xy(e,t){return function(){return dc(this,e,t.apply(this,arguments))}}function fy(e,t){return this.each((typeof t=="function"?xy:dy)(e,t))}function*py(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length,l;o<r;++o)(l=s[o])&&(yield l)}var xc=[null];function Ae(e,t){this._groups=e,this._parents=t}function dn(){return new Ae([[document.documentElement]],xc)}function my(){return this}Ae.prototype=dn.prototype={constructor:Ae,select:Vh,selectAll:Yh,selectChild:Gh,selectChildren:Jh,filter:eg,data:ig,enter:tg,exit:cg,join:ag,merge:ug,selection:my,order:dg,sort:xg,call:pg,nodes:mg,node:hg,size:gg,empty:yg,each:Eg,attr:bg,style:Mg,property:Ag,classed:Dg,text:Fg,html:qg,raise:Xg,lower:Kg,append:Ug,insert:Jg,remove:ty,clone:oy,datum:ry,on:uy,dispatch:fy,[Symbol.iterator]:py};function Le(e){return typeof e=="string"?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],xc)}function hy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ie(e,t){if(e=hy(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const gy={passive:!1},tn={capture:!0,passive:!1};function Bs(e){e.stopImmediatePropagation()}function Ct(e){e.preventDefault(),e.stopImmediatePropagation()}function fc(e){var t=e.document.documentElement,n=Le(e).on("dragstart.drag",Ct,tn);"onselectstart"in t?n.on("selectstart.drag",Ct,tn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function pc(e,t){var n=e.document.documentElement,s=Le(e).on("dragstart.drag",null);t&&(s.on("click.drag",Ct,tn),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const jn=e=>()=>e;function co(e,{sourceEvent:t,subject:n,target:s,identifier:o,active:r,x:l,y:c,dx:a,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}co.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yy(e){return!e.ctrlKey&&!e.button}function Ey(){return this.parentNode}function jy(e,t){return t??{x:e.x,y:e.y}}function Sy(){return navigator.maxTouchPoints||"ontouchstart"in this}function mc(){var e=yy,t=Ey,n=jy,s=Sy,o={},r=xs("start","drag","end"),l=0,c,a,u,d,x=0;function f(j){j.on("mousedown.drag",m).filter(s).on("touchstart.drag",v).on("touchmove.drag",w,gy).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,C){if(!(d||!e.call(this,j,C))){var P=S(this,t.call(this,j,C),j,C,"mouse");P&&(Le(j.view).on("mousemove.drag",h,tn).on("mouseup.drag",E,tn),fc(j.view),Bs(j),u=!1,c=j.clientX,a=j.clientY,P("start",j))}}function h(j){if(Ct(j),!u){var C=j.clientX-c,P=j.clientY-a;u=C*C+P*P>x}o.mouse("drag",j)}function E(j){Le(j.view).on("mousemove.drag mouseup.drag",null),pc(j.view,u),Ct(j),o.mouse("end",j)}function v(j,C){if(e.call(this,j,C)){var P=j.changedTouches,b=t.call(this,j,C),L=P.length,N,A;for(N=0;N<L;++N)(A=S(this,b,j,C,P[N].identifier,P[N]))&&(Bs(j),A("start",j,P[N]))}}function w(j){var C=j.changedTouches,P=C.length,b,L;for(b=0;b<P;++b)(L=o[C[b].identifier])&&(Ct(j),L("drag",j,C[b]))}function _(j){var C=j.changedTouches,P=C.length,b,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),b=0;b<P;++b)(L=o[C[b].identifier])&&(Bs(j),L("end",j,C[b]))}function S(j,C,P,b,L,N){var A=r.copy(),O=Ie(N||P,C),T,z,R;if((R=n.call(j,new co("beforestart",{sourceEvent:P,target:f,identifier:L,active:l,x:O[0],y:O[1],dx:0,dy:0,dispatch:A}),b))!=null)return T=R.x-O[0]||0,z=R.y-O[1]||0,function I(k,D,M){var B=O,V;switch(k){case"start":o[L]=I,V=l++;break;case"end":delete o[L],--l;case"drag":O=Ie(M||D,C),V=l;break}A.call(k,j,new co(k,{sourceEvent:D,subject:R,target:f,identifier:L,active:V,x:O[0]+T,y:O[1]+z,dx:O[0]-B[0],dy:O[1]-B[1],dispatch:A}),b)}}return f.filter=function(j){return arguments.length?(e=typeof j=="function"?j:jn(!!j),f):e},f.container=function(j){return arguments.length?(t=typeof j=="function"?j:jn(j),f):t},f.subject=function(j){return arguments.length?(n=typeof j=="function"?j:jn(j),f):n},f.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:jn(!!j),f):s},f.on=function(){var j=r.on.apply(r,arguments);return j===r?f:j},f.clickDistance=function(j){return arguments.length?(x=(j=+j)*j,f):Math.sqrt(x)},f}var _t=0,Wt=0,Zt=0,hc=1e3,Xn,Xt,Gn=0,mt=0,ps=0,nn=typeof performance=="object"&&performance.now?performance:Date,gc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ko(){return mt||(gc(Ry),mt=nn.now()+ps)}function Ry(){mt=0}function Kn(){this._call=this._time=this._next=null}Kn.prototype=yc.prototype={constructor:Kn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ko():+n)+(t==null?0:+t),!this._next&&Xt!==this&&(Xt?Xt._next=this:Xn=this,Xt=this),this._call=e,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};function yc(e,t,n){var s=new Kn;return s.restart(e,t,n),s}function wy(){Ko(),++_t;for(var e=Xn,t;e;)(t=mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_t}function Or(){mt=(Gn=nn.now())+ps,_t=Wt=0;try{wy()}finally{_t=0,vy(),mt=0}}function Cy(){var e=nn.now(),t=e-Gn;t>hc&&(ps-=t,Gn=e)}function vy(){for(var e,t=Xn,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Xn=n);Xt=e,ao(s)}function ao(e){if(!_t){Wt&&(Wt=clearTimeout(Wt));var t=e-mt;t>24?(e<1/0&&(Wt=setTimeout(Or,e-nn.now()-ps)),Zt&&(Zt=clearInterval(Zt))):(Zt||(Gn=nn.now(),Zt=setInterval(Cy,hc)),_t=1,gc(Or))}}function Dr(e,t,n){var s=new Kn;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var by=xs("start","end","cancel","interrupt"),_y=[],Ec=0,zr=1,uo=2,Ln=3,Br=4,xo=5,An=6;function ms(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ky(e,n,{name:t,index:s,group:o,on:by,tween:_y,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ec})}function Uo(e,t){var n=ze(e,t);if(n.state>Ec)throw new Error("too late; already scheduled");return n}function Ze(e,t){var n=ze(e,t);if(n.state>Ln)throw new Error("too late; already running");return n}function ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ky(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=yc(r,0,n.time);function r(u){n.state=zr,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var d,x,f,m;if(n.state!==zr)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===Ln)return Dr(l);m.state===Br?(m.state=An,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=An,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(Dr(function(){n.state===Ln&&(n.state=Br,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=uo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===uo){for(n.state=Ln,o=new Array(f=n.tween.length),d=0,x=-1;d<f;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++x]=m);o.length=x+1}}function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=xo,1),x=-1,f=o.length;++x<f;)o[x].call(e,d);n.state===xo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=An,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function $n(e,t){var n=e.__transition,s,o,r=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){r=!1;continue}o=s.state>uo&&s.state<xo,s.state=An,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function Py(e){return this.each(function(){$n(this,e)})}function My(e,t){var n,s;return function(){var o=Ze(this,e),r=o.tween;if(r!==n){s=n=r;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function Ny(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ze(this,e),l=r.tween;if(l!==s){o=(s=l).slice();for(var c={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=c;break}a===u&&o.push(c)}r.tween=o}}function Ty(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=ze(this.node(),n).tween,o=0,r=s.length,l;o<r;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?My:Ny)(n,e,t))}function Qo(e,t,n){var s=e._id;return e.each(function(){var o=Ze(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return ze(o,s).value[t]}}function jc(e,t){var n;return(typeof t=="number"?$.interpolateNumber:t instanceof $.color?$.interpolateRgb:(n=$.color(t))?(t=n,$.interpolateRgb):$.interpolateString)(e,t)}function Ly(e){return function(){this.removeAttribute(e)}}function Ay(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $y(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttribute(e);return l===o?null:l===s?r:r=t(s=l,n)}}function Iy(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?r:r=t(s=l,n)}}function Oy(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function Dy(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function zy(e,t){var n=fs(e),s=n==="transform"?Hf:jc;return this.attrTween(e,typeof t=="function"?(n.local?Dy:Oy)(n,s,Qo(this,"attr."+e,t)):t==null?(n.local?Ay:Ly)(n):(n.local?Iy:$y)(n,s,t))}function By(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Fy(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&Vy(e,r)),n}return o._value=t,o}function Hy(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&By(e,r)),n}return o._value=t,o}function Zy(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=fs(e);return this.tween(n,(s.local?Fy:Hy)(s,t))}function Yy(e,t){return function(){Uo(this,e).delay=+t.apply(this,arguments)}}function qy(e,t){return t=+t,function(){Uo(this,e).delay=t}}function Wy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yy:qy)(t,e)):ze(this.node(),t).delay}function Xy(e,t){return function(){Ze(this,e).duration=+t.apply(this,arguments)}}function Gy(e,t){return t=+t,function(){Ze(this,e).duration=t}}function Ky(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xy:Gy)(t,e)):ze(this.node(),t).duration}function Uy(e,t){if(typeof t!="function")throw new Error;return function(){Ze(this,e).ease=t}}function Qy(e){var t=this._id;return arguments.length?this.each(Uy(t,e)):ze(this.node(),t).ease}function Jy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ze(this,e).ease=n}}function eE(e){if(typeof e!="function")throw new Error;return this.each(Jy(this._id,e))}function tE(e){typeof e!="function"&&(e=sc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ge(s,this._parents,this._name,this._id)}function nE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,r=Math.min(s,o),l=new Array(s),c=0;c<r;++c)for(var a=t[c],u=n[c],d=a.length,x=l[c]=new Array(d),f,m=0;m<d;++m)(f=a[m]||u[m])&&(x[m]=f);for(;c<s;++c)l[c]=t[c];return new Ge(l,this._parents,this._name,this._id)}function sE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function oE(e,t,n){var s,o,r=sE(t)?Uo:Ze;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function rE(e,t){var n=this._id;return arguments.length<2?ze(this.node(),n).on.on(e):this.each(oE(n,e,t))}function iE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function lE(){return this.on("end.remove",iE(this._id))}function cE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xo(e));for(var s=this._groups,o=s.length,r=new Array(o),l=0;l<o;++l)for(var c=s[l],a=c.length,u=r[l]=new Array(a),d,x,f=0;f<a;++f)(d=c[f])&&(x=e.call(d,d.__data__,f,c))&&("__data__"in d&&(x.__data__=d.__data__),u[f]=x,ms(u[f],t,n,f,u,ze(d,n)));return new Ge(r,this._parents,t,n)}function aE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nc(e));for(var s=this._groups,o=s.length,r=[],l=[],c=0;c<o;++c)for(var a=s[c],u=a.length,d,x=0;x<u;++x)if(d=a[x]){for(var f=e.call(d,d.__data__,x,a),m,h=ze(d,n),E=0,v=f.length;E<v;++E)(m=f[E])&&ms(m,t,n,E,f,h);r.push(f),l.push(d)}return new Ge(r,l,t,n)}var uE=dn.prototype.constructor;function dE(){return new uE(this._groups,this._parents)}function xE(e,t){var n,s,o;return function(){var r=bt(this,e),l=(this.style.removeProperty(e),bt(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function Sc(e){return function(){this.style.removeProperty(e)}}function fE(e,t,n){var s,o=n+"",r;return function(){var l=bt(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function pE(e,t,n){var s,o,r;return function(){var l=bt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),bt(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function mE(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ze(this,e),u=a.on,d=a.value[r]==null?c||(c=Sc(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function hE(e,t,n){var s=(e+="")=="transform"?Ff:jc;return t==null?this.styleTween(e,xE(e,s)).on("end.style."+e,Sc(e)):typeof t=="function"?this.styleTween(e,pE(e,s,Qo(this,"style."+e,t))).each(mE(this._id,e)):this.styleTween(e,fE(e,s,t),n).on("end.style."+e,null)}function gE(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function yE(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&gE(e,l,n)),s}return r._value=t,r}function EE(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,yE(e,t,n??""))}function jE(e){return function(){this.textContent=e}}function SE(e){return function(){var t=e(this);this.textContent=t??""}}function RE(e){return this.tween("text",typeof e=="function"?SE(Qo(this,"text",e)):jE(e==null?"":e+""))}function wE(e){return function(t){this.textContent=e.call(this,t)}}function CE(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&wE(o)),t}return s._value=e,s}function vE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,CE(e))}function bE(){for(var e=this._name,t=this._id,n=Rc(),s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)if(a=l[u]){var d=ze(a,t);ms(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ge(s,this._parents,e,n)}function _E(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(r,l){var c={value:l},a={value:function(){--o===0&&r()}};n.each(function(){var u=Ze(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),u.on=t}),o===0&&r()})}var kE=0;function Ge(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Rc(){return++kE}var Ye=dn.prototype;Ge.prototype={constructor:Ge,select:cE,selectAll:aE,selectChild:Ye.selectChild,selectChildren:Ye.selectChildren,filter:tE,merge:nE,selection:dE,transition:bE,call:Ye.call,nodes:Ye.nodes,node:Ye.node,size:Ye.size,empty:Ye.empty,each:Ye.each,on:rE,attr:zy,attrTween:Zy,style:hE,styleTween:EE,text:RE,textTween:vE,remove:lE,tween:Ty,delay:Wy,duration:Ky,ease:Qy,easeVarying:eE,end:_E,[Symbol.iterator]:Ye[Symbol.iterator]};function PE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ME={time:null,delay:0,duration:250,ease:PE};function NE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function TE(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=Rc(),(n=ME).time=Ko(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&ms(a,e,t,u,l,n||NE(a,t));return new Ge(s,this._parents,e,t)}dn.prototype.interrupt=Py;dn.prototype.transition=TE;const Sn=e=>()=>e;function LE(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function qe(e,t,n){this.k=e,this.x=t,this.y=n}qe.prototype={constructor:qe,scale:function(e){return e===1?this:new qe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qe(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hs=new qe(1,0,0);wc.prototype=qe.prototype;function wc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hs;return e.__zoom}function Vs(e){e.stopImmediatePropagation()}function Yt(e){e.preventDefault(),e.stopImmediatePropagation()}function AE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $E(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Vr(){return this.__zoom||hs}function IE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function OE(){return navigator.maxTouchPoints||"ontouchstart"in this}function DE(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function Cc(){var e=AE,t=$E,n=DE,s=IE,o=OE,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Wf,u=xs("start","zoom","end"),d,x,f,m=500,h=150,E=0,v=10;function w(R){R.property("__zoom",Vr).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(R,I,k,D){var M=R.selection?R.selection():R;M.property("__zoom",Vr),R!==M?C(R,I,k,D):M.interrupt().each(function(){P(this,arguments).event(D).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(R,I,k,D){w.scaleTo(R,function(){var M=this.__zoom.k,B=typeof I=="function"?I.apply(this,arguments):I;return M*B},k,D)},w.scaleTo=function(R,I,k,D){w.transform(R,function(){var M=t.apply(this,arguments),B=this.__zoom,V=k==null?j(M):typeof k=="function"?k.apply(this,arguments):k,Z=B.invert(V),W=typeof I=="function"?I.apply(this,arguments):I;return n(S(_(B,W),V,Z),M,l)},k,D)},w.translateBy=function(R,I,k,D){w.transform(R,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),l)},null,D)},w.translateTo=function(R,I,k,D,M){w.transform(R,function(){var B=t.apply(this,arguments),V=this.__zoom,Z=D==null?j(B):typeof D=="function"?D.apply(this,arguments):D;return n(hs.translate(Z[0],Z[1]).scale(V.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof k=="function"?-k.apply(this,arguments):-k),B,l)},D,M)};function _(R,I){return I=Math.max(r[0],Math.min(r[1],I)),I===R.k?R:new qe(I,R.x,R.y)}function S(R,I,k){var D=I[0]-k[0]*R.k,M=I[1]-k[1]*R.k;return D===R.x&&M===R.y?R:new qe(R.k,D,M)}function j(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function C(R,I,k,D){R.on("start.zoom",function(){P(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(D).end()}).tween("zoom",function(){var M=this,B=arguments,V=P(M,B).event(D),Z=t.apply(M,B),W=k==null?j(Z):typeof k=="function"?k.apply(M,B):k,Q=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),G=M.__zoom,K=typeof I=="function"?I.apply(M,B):I,U=a(G.invert(W).concat(Q/G.k),K.invert(W).concat(Q/K.k));return function(ee){if(ee===1)ee=K;else{var X=U(ee),se=Q/X[2];ee=new qe(se,W[0]-X[0]*se,W[1]-X[1]*se)}V.zoom(null,ee)}})}function P(R,I,k){return!k&&R.__zooming||new b(R,I)}function b(R,I){this.that=R,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,I),this.taps=0}b.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,I){return this.mouse&&R!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var I=Le(this.that).datum();u.call(R,this.that,new LE(R,{sourceEvent:this.sourceEvent,target:w,type:R,transform:this.that.__zoom,dispatch:u}),I)}};function L(R,...I){if(!e.apply(this,arguments))return;var k=P(this,I).event(R),D=this.__zoom,M=Math.max(r[0],Math.min(r[1],D.k*Math.pow(2,s.apply(this,arguments)))),B=Ie(R);if(k.wheel)(k.mouse[0][0]!==B[0]||k.mouse[0][1]!==B[1])&&(k.mouse[1]=D.invert(k.mouse[0]=B)),clearTimeout(k.wheel);else{if(D.k===M)return;k.mouse=[B,D.invert(B)],$n(this),k.start()}Yt(R),k.wheel=setTimeout(V,h),k.zoom("mouse",n(S(_(D,M),k.mouse[0],k.mouse[1]),k.extent,l));function V(){k.wheel=null,k.end()}}function N(R,...I){if(f||!e.apply(this,arguments))return;var k=R.currentTarget,D=P(this,I,!0).event(R),M=Le(R.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Q,!0),B=Ie(R,k),V=R.clientX,Z=R.clientY;fc(R.view),Vs(R),D.mouse=[B,this.__zoom.invert(B)],$n(this),D.start();function W(G){if(Yt(G),!D.moved){var K=G.clientX-V,U=G.clientY-Z;D.moved=K*K+U*U>E}D.event(G).zoom("mouse",n(S(D.that.__zoom,D.mouse[0]=Ie(G,k),D.mouse[1]),D.extent,l))}function Q(G){M.on("mousemove.zoom mouseup.zoom",null),pc(G.view,D.moved),Yt(G),D.event(G).end()}}function A(R,...I){if(e.apply(this,arguments)){var k=this.__zoom,D=Ie(R.changedTouches?R.changedTouches[0]:R,this),M=k.invert(D),B=k.k*(R.shiftKey?.5:2),V=n(S(_(k,B),D,M),t.apply(this,I),l);Yt(R),c>0?Le(this).transition().duration(c).call(C,V,D,R):Le(this).call(w.transform,V,D,R)}}function O(R,...I){if(e.apply(this,arguments)){var k=R.touches,D=k.length,M=P(this,I,R.changedTouches.length===D).event(R),B,V,Z,W;for(Vs(R),V=0;V<D;++V)Z=k[V],W=Ie(Z,this),W=[W,this.__zoom.invert(W),Z.identifier],M.touch0?!M.touch1&&M.touch0[2]!==W[2]&&(M.touch1=W,M.taps=0):(M.touch0=W,B=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),B&&(M.taps<2&&(x=W[0],d=setTimeout(function(){d=null},m)),$n(this),M.start())}}function T(R,...I){if(this.__zooming){var k=P(this,I).event(R),D=R.changedTouches,M=D.length,B,V,Z,W;for(Yt(R),B=0;B<M;++B)V=D[B],Z=Ie(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=Z:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=Z);if(V=k.that.__zoom,k.touch1){var Q=k.touch0[0],G=k.touch0[1],K=k.touch1[0],U=k.touch1[1],ee=(ee=K[0]-Q[0])*ee+(ee=K[1]-Q[1])*ee,X=(X=U[0]-G[0])*X+(X=U[1]-G[1])*X;V=_(V,Math.sqrt(ee/X)),Z=[(Q[0]+K[0])/2,(Q[1]+K[1])/2],W=[(G[0]+U[0])/2,(G[1]+U[1])/2]}else if(k.touch0)Z=k.touch0[0],W=k.touch0[1];else return;k.zoom("touch",n(S(V,Z,W),k.extent,l))}}function z(R,...I){if(this.__zooming){var k=P(this,I).event(R),D=R.changedTouches,M=D.length,B,V;for(Vs(R),f&&clearTimeout(f),f=setTimeout(function(){f=null},m),B=0;B<M;++B)V=D[B],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=Ie(V,this),Math.hypot(x[0]-V[0],x[1]-V[1])<v)){var Z=Le(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return w.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:Sn(+R),w):s},w.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Sn(!!R),w):e},w.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Sn(!!R),w):o},w.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Sn([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),w):t},w.scaleExtent=function(R){return arguments.length?(r[0]=+R[0],r[1]=+R[1],w):[r[0],r[1]]},w.translateExtent=function(R){return arguments.length?(l[0][0]=+R[0][0],l[1][0]=+R[1][0],l[0][1]=+R[0][1],l[1][1]=+R[1][1],w):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},w.constrain=function(R){return arguments.length?(n=R,w):n},w.duration=function(R){return arguments.length?(c=+R,w):c},w.interpolate=function(R){return arguments.length?(a=R,w):a},w.on=function(){var R=u.on.apply(u,arguments);return R===u?w:R},w.clickDistance=function(R){return arguments.length?(E=(R=+R)*R,w):Math.sqrt(E)},w.tapDistance=function(R){return arguments.length?(v=+R,w):v},w}const Te={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},sn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vc=["Enter"," ","Escape"];var ht;(function(e){e.Strict="strict",e.Loose="loose"})(ht||(ht={}));var xt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(xt||(xt={}));var kt;(function(e){e.Partial="partial",e.Full="full"})(kt||(kt={}));const bc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var et;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(et||(et={}));var Un;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Un||(Un={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));const Fr={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top};function _c(e){return e===null?null:e?"valid":"invalid"}const kc=e=>"id"in e&&"source"in e&&"target"in e,zE=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Jo=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xn=(e,t=[0,0])=>{const{width:n,height:s}=Ue(e),o=e.origin??t,r=n*o[0],l=s*o[1];return{x:e.position.x-r,y:e.position.y-l}},BE=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,o)=>{const r=typeof o=="string";let l=!t.nodeLookup&&!r?o:void 0;t.nodeLookup&&(l=r?t.nodeLookup.get(o):Jo(o)?o:t.nodeLookup.get(o.id));const c=l?Qn(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return gs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ys(n)},fn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const o=Qn(s);n=gs(n,o)}}),ys(n)},Pc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...pn(t,[n,s,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:d,selectable:x=!0,hidden:f=!1}=u;if(l&&!x||f)continue;const m=d.width??u.width??u.initialWidth??null,h=d.height??u.height??u.initialHeight??null,E=on(c,Mt(u)),v=(m??0)*(h??0),w=r&&E>0;(!u.internals.handleBounds||w||E>=v||u.dragging)&&a.push(u)}return a},VE=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function fo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function po({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=fn(e),a=er(c,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??r,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Mc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:r}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=l.origin??s;let x=o;if(l.extent==="parent"&&!l.expandParent)if(!c)r==null||r("005",Te.error005());else{const m=c.measured.width,h=c.measured.height;m&&h&&(x=[[a,u],[a+m,u+h]])}else c&&Nt(l.extent)&&(x=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const f=Nt(x)?gt(t,x,l.measured):t;return{position:{x:f.x-a+l.measured.width*d[0],y:f.y-u+l.measured.height*d[1]},positionAbsolute:f}}async function FE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){const r=new Set(e.map(f=>f.id)),l=[];for(const f of n){if(f.deletable===!1)continue;const m=r.has(f.id),h=!m&&f.parentId&&l.find(E=>E.id===f.parentId);(m||h)&&l.push(f)}const c=new Set(t.map(f=>f.id)),a=s.filter(f=>f.deletable!==!1),d=VE(l,a);for(const f of a)c.has(f.id)&&!d.find(h=>h.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:l};const x=await o({nodes:l,edges:d});return typeof x=="boolean"?x?{edges:d,nodes:l}:{edges:[],nodes:[]}:x}const Pt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),gt=(e={x:0,y:0},t,n)=>({x:Pt(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Pt(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Nc(e,t,n){const{width:s,height:o}=Ue(n),{x:r,y:l}=n.internals.positionAbsolute;return gt(e,[[r,l],[r+s,l+o]],t)}const Hr=(e,t,n)=>e<t?Pt(Math.abs(e-t),1,t)/t:e>n?-Pt(Math.abs(e-n),1,t)/t:0,Tc=(e,t,n=15,s=40)=>{const o=Hr(e.x,s,t.width-s)*n,r=Hr(e.y,s,t.height-s)*n;return[o,r]},gs=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),mo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ys=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Mt=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Jo(e)?e.internals.positionAbsolute:xn(e,t);return{x:n,y:s,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},Qn=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Jo(e)?e.internals.positionAbsolute:xn(e,t);return{x:n,y:s,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},Lc=(e,t)=>ys(gs(mo(e),mo(t))),on=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Zr=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),Jn=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Es=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),pn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?Es(c,l):c},Ac=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),er=(e,t,n,s,o,r)=>{const l=t/(e.width*(1+r)),c=n/(e.height*(1+r)),a=Math.min(l,c),u=Pt(a,s,o),d=e.x+e.width/2,x=e.y+e.height/2,f=t/2-d*u,m=n/2-x*u;return{x:f,y:m,zoom:u}},es=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Nt(e){return e!==void 0&&e!=="parent"}function Ue(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function $c(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Ic(e,t={width:0,height:0},n,s,o){const r={...e},l=s.get(n);if(l){const c=l.origin||o;r.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],r.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return r}function Kt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=We(e),c=pn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?Es(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const js=e=>({width:e.offsetWidth,height:e.offsetHeight}),Oc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},HE=["INPUT","SELECT","TEXTAREA"];function ho(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return HE.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Dc=e=>"clientX"in e,We=(e,t)=>{var r,l;const n=Dc(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Yr=(e,t,n,s,o)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...js(l)}})};function zc({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:r,targetControlX:l,targetControlY:c}){const a=e*.125+o*.375+l*.375+n*.125,u=t*.125+r*.375+c*.375+s*.125,d=Math.abs(a-e),x=Math.abs(u-t);return[a,u,d,x]}function Rn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function qr({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case q.Left:return[t-Rn(t-s,r),n];case q.Right:return[t+Rn(s-t,r),n];case q.Top:return[t,n-Rn(n-o,r)];case q.Bottom:return[t,n+Rn(o-n,r)]}}function Bc({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top,curvature:l=.25}){const[c,a]=qr({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=qr({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,f,m,h]=zc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:a,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${a} ${u},${d} ${s},${o}`,x,f,m,h]}function Vc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,r=n<e?n+o:n-o,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[r,c,o,l]}function ZE({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1}){if(!o)return s;const r=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(r?l:0)}function YE({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=gs(Qn(e),Qn(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return on(l,ys(r))>0}const Fc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,qE=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Hc=(e,t)=>{if(!e.source||!e.target)return Jn("006",Te.error006()),t;let n;return kc(e)?n={...e}:n={...e,id:Fc(e)},qE(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},WE=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return Jn("006",Te.error006()),n;if(!n.find(a=>a.id===e.id))return Jn("007",Te.error007(o)),n;const c={...r,id:s.shouldReplaceId?Fc(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function Zc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=Vc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const Wr={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},XE=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Xr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function GE({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:s=q.Top,center:o,offset:r}){const l=Wr[t],c=Wr[s],a={x:e.x+l.x*r,y:e.y+l.y*r},u={x:n.x+c.x*r,y:n.y+c.y*r},d=XE({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",f=d[x];let m=[],h,E;const v={x:0,y:0},w={x:0,y:0},[_,S,j,C]=Vc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??_,E=o.y??S;const b=[{x:h,y:a.y},{x:h,y:u.y}],L=[{x:a.x,y:E},{x:u.x,y:E}];l[x]===f?m=x==="x"?b:L:m=x==="x"?L:b}else{const b=[{x:a.x,y:u.y}],L=[{x:u.x,y:a.y}];if(x==="x"?m=l.x===f?L:b:m=l.y===f?b:L,t===s){const z=Math.abs(e[x]-n[x]);if(z<=r){const R=Math.min(r-1,r-z);l[x]===f?v[x]=(a[x]>e[x]?-1:1)*R:w[x]=(u[x]>n[x]?-1:1)*R}}if(t!==s){const z=x==="x"?"y":"x",R=l[x]===c[z],I=a[z]>u[z],k=a[z]<u[z];(l[x]===1&&(!R&&I||R&&k)||l[x]!==1&&(!R&&k||R&&I))&&(m=x==="x"?b:L)}const N={x:a.x+v.x,y:a.y+v.y},A={x:u.x+w.x,y:u.y+w.y},O=Math.max(Math.abs(N.x-m[0].x),Math.abs(A.x-m[0].x)),T=Math.max(Math.abs(N.y-m[0].y),Math.abs(A.y-m[0].y));O>=T?(h=(N.x+A.x)/2,E=m[0].y):(h=m[0].x,E=(N.y+A.y)/2)}return[[e,{x:a.x+v.x,y:a.y+v.y},...m,{x:u.x+w.x,y:u.y+w.y},n],h,E,j,C]}function KE(e,t,n,s){const o=Math.min(Xr(e,t)/2,Xr(t,n)/2,s),{x:r,y:l}=t;if(e.x===r&&r===n.x||e.y===l&&l===n.y)return`L${r} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${r+o*u},${l}Q ${r},${l} ${r},${l+o*d}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${r},${l+o*a}Q ${r},${l} ${r+o*c},${l}`}function go({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[d,x,f,m,h]=GE({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((v,w,_)=>{let S="";return _>0&&_<d.length-1?S=KE(d[_-1],w,d[_+1],l):S=`${_===0?"M":"L"}${w.x} ${w.y}`,v+=S,v},""),x,f,m,h]}function Gr(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function UE(e){var x;const{sourceNode:t,targetNode:n}=e;if(!Gr(t)||!Gr(n))return null;const s=t.internals.handleBounds||Kr(t.handles),o=n.internals.handleBounds||Kr(n.handles),r=Ur((s==null?void 0:s.source)??[],e.sourceHandle),l=Ur(e.connectionMode===ht.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!r||!l)return(x=e.onError)==null||x.call(e,"008",Te.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(r==null?void 0:r.position)||q.Bottom,a=(l==null?void 0:l.position)||q.Top,u=rn(t,r,c),d=rn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function Kr(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function rn(e,t,n=q.Left,s=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,r=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??Ue(e);if(s)return{x:o+l/2,y:r+c/2};switch((t==null?void 0:t.position)??n){case q.Top:return{x:o+l/2,y:r};case q.Right:return{x:o+l,y:r+c/2};case q.Bottom:return{x:o+l/2,y:r+c};case q.Left:return{x:o,y:r+c/2}}}function Ur(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function yo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function QE(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const r=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=yo(a,t);r.has(u)||(l.push({id:u,color:a.color||n,...a}),r.add(u))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const tr={nodeOrigin:[0,0],nodeExtent:sn,elevateNodesOnSelect:!0,defaults:{}},JE={...tr,checkEquality:!0};function nr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function ej(e,t,n){const s=nr(tr,n);for(const o of e.values())if(o.parentId)sr(o,e,t,s);else{const r=xn(o,s.nodeOrigin),l=Nt(o.extent)?o.extent:s.nodeExtent,c=gt(r,l,Ue(o));o.internals.positionAbsolute=c}}function Eo(e,t,n,s){var c,a;const o=nr(JE,s),r=new Map(t),l=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=r.get(u.id);if(o.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const x=xn(u,o.nodeOrigin),f=Nt(u.extent)?u.extent:o.nodeExtent,m=gt(x,f,Ue(u));d={...o.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:m,handleBounds:u.measured?d==null?void 0:d.internals.handleBounds:void 0,z:Yc(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&sr(d,t,n,s)}}function tj(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function sr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=nr(tr,s),c=e.parentId,a=t.get(c);if(!a){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}tj(e,n);const u=o?1e3:0,{x:d,y:x,z:f}=nj(e,a,r,l,u),{positionAbsolute:m}=e.internals,h=d!==m.x||x!==m.y;(h||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x:d,y:x}:m,z:f})}function Yc(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function nj(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=Ue(e),a=xn(e,n),u=Nt(e.extent)?gt(a,e.extent,c):a;let d=gt({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Nc(d,c,t));const x=Yc(e,o),f=t.internals.z??0;return{x:d.x,y:d.y,z:f>x?f:x}}function or(e,t,n,s=[0,0]){var l;const o=[],r=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const u=((l=r.get(c.parentId))==null?void 0:l.expandedRect)??Mt(a),d=Lc(u,c.rect);r.set(c.parentId,{expandedRect:d,parent:a})}return r.size>0&&r.forEach(({expandedRect:c,parent:a},u)=>{var S;const d=a.internals.positionAbsolute,x=Ue(a),f=a.origin??s,m=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,h=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,E=Math.max(x.width,Math.round(c.width)),v=Math.max(x.height,Math.round(c.height)),w=(E-x.width)*f[0],_=(v-x.height)*f[1];(m>0||h>0||w||_)&&(o.push({id:u,type:"position",position:{x:a.position.x-m+w,y:a.position.y-h+_}}),(S=n.get(u))==null||S.forEach(j=>{e.some(C=>C.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+m,y:j.position.y+h}})})),(x.width<c.width||x.height<c.height||m||h)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:E+(m?f[0]*m-w:0),height:v+(h?f[1]*h-_:0)}})}),o}function sj(e,t,n,s,o,r){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),x=[];for(const f of e.values()){const m=t.get(f.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},c=!0;else{const h=js(f.nodeElement),E=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(E||!m.internals.handleBounds||f.force))){const w=f.nodeElement.getBoundingClientRect(),_=Nt(m.extent)?m.extent:r;let{positionAbsolute:S}=m.internals;m.parentId&&m.extent==="parent"?S=Nc(S,h,t.get(m.parentId)):_&&(S=gt(S,_,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:S,handleBounds:{source:Yr("source",f.nodeElement,w,d,m.id),target:Yr("target",f.nodeElement,w,d,m.id)}},m.parentId&&sr(m,t,n,{nodeOrigin:o}),c=!0,E&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:Mt(m,o)}))}}}if(x.length>0){const f=or(x,t,n,o);a.push(...f)}return{changes:a,updatedInternals:c}}async function oj({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,height:r}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,r]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function qc(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:r,sourceHandle:l=null,targetHandle:c=null}=s,a=`${o}-source-${l}`,u=`${r}-target-${c}`,d=e.get(a)||new Map,x=e.get(u)||new Map,f={edgeId:s.id,source:o,target:r,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,d.set(`${r}-${c}`,f)),e.set(u,x.set(`${o}-${l}`,f))}}function Wc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Wc(n,t):!1}function Qr(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function rj(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Wc(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(r);c&&o.set(r,{id:r,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Fs({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const o=[];for(const[u,d]of t){const x=(l=n.get(u))==null?void 0:l.internals.userNode;x&&o.push({...x,position:d.position,dragging:s})}if(!e)return[o[0],o];const r=(c=n.get(e))==null?void 0:c.internals.userNode;return[r?{...r,position:((a=t.get(e))==null?void 0:a.position)||r.position,dragging:s}:o[0],o]}function ij({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){let r={x:null,y:null},l=0,c=new Map,a=!1,u={x:0,y:0},d=null,x=!1,f=null,m=!1;function h({noDragClassName:v,handleSelector:w,domNode:_,isSelectable:S,nodeId:j,nodeClickDistance:C=0}){f=Le(_);function P({x:A,y:O},T){const{nodeLookup:z,nodeExtent:R,snapGrid:I,snapToGrid:k,nodeOrigin:D,onNodeDrag:M,onSelectionDrag:B,onError:V,updateNodePositions:Z}=t();r={x:A,y:O};let W=!1,Q={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const G=fn(c);Q=mo(G)}for(const[G,K]of c){if(!z.has(G))continue;let U={x:A-K.distance.x,y:O-K.distance.y};k&&(U=Es(U,I));let ee=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!K.extent){const{positionAbsolute:de}=K.internals,re=de.x-Q.x+R[0][0],F=de.x+K.measured.width-Q.x2+R[1][0],J=de.y-Q.y+R[0][1],oe=de.y+K.measured.height-Q.y2+R[1][1];ee=[[re,J],[F,oe]]}const{position:X,positionAbsolute:se}=Mc({nodeId:G,nextPosition:U,nodeLookup:z,nodeExtent:ee,nodeOrigin:D,onError:V});W=W||K.position.x!==X.x||K.position.y!==X.y,K.position=X,K.internals.positionAbsolute=se}if(W&&(Z(c,!0),T&&(s||M||!j&&B))){const[G,K]=Fs({nodeId:j,dragItems:c,nodeLookup:z});s==null||s(T,c,G,K),M==null||M(T,G,K),j||B==null||B(T,K)}}async function b(){if(!d)return;const{transform:A,panBy:O,autoPanSpeed:T}=t(),[z,R]=Tc(u,d,T);(z!==0||R!==0)&&(r.x=(r.x??0)-z/A[2],r.y=(r.y??0)-R/A[2],await O({x:z,y:R})&&P(r,null)),l=requestAnimationFrame(b)}function L(A){var W;const{nodeLookup:O,multiSelectionActive:T,nodesDraggable:z,transform:R,snapGrid:I,snapToGrid:k,selectNodesOnDrag:D,onNodeDragStart:M,onSelectionDragStart:B,unselectNodesAndEdges:V}=t();x=!0,(!D||!S)&&!T&&j&&((W=O.get(j))!=null&&W.selected||V()),S&&D&&j&&(e==null||e(j));const Z=Kt(A.sourceEvent,{transform:R,snapGrid:I,snapToGrid:k,containerBounds:d});if(r=Z,c=rj(O,z,Z,j),c.size>0&&(n||M||!j&&B)){const[Q,G]=Fs({nodeId:j,dragItems:c,nodeLookup:O});n==null||n(A.sourceEvent,c,Q,G),M==null||M(A.sourceEvent,Q,G),j||B==null||B(A.sourceEvent,G)}}const N=mc().clickDistance(C).on("start",A=>{const{domNode:O,nodeDragThreshold:T,transform:z,snapGrid:R,snapToGrid:I}=t();d=(O==null?void 0:O.getBoundingClientRect())||null,m=!1,T===0&&L(A),r=Kt(A.sourceEvent,{transform:z,snapGrid:R,snapToGrid:I,containerBounds:d}),u=We(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:O,transform:T,snapGrid:z,snapToGrid:R,nodeDragThreshold:I,nodeLookup:k}=t(),D=Kt(A.sourceEvent,{transform:T,snapGrid:z,snapToGrid:R,containerBounds:d});if((A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||j&&!k.has(j))&&(m=!0),!m){if(!a&&O&&x&&(a=!0,b()),!x){const M=D.xSnapped-(r.x??0),B=D.ySnapped-(r.y??0);Math.sqrt(M*M+B*B)>I&&L(A)}(r.x!==D.xSnapped||r.y!==D.ySnapped)&&c&&x&&(u=We(A.sourceEvent,d),P(D,A.sourceEvent))}}).on("end",A=>{if(!(!x||m)&&(a=!1,x=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:O,updateNodePositions:T,onNodeDragStop:z,onSelectionDragStop:R}=t();if(T(c,!1),o||z||!j&&R){const[I,k]=Fs({nodeId:j,dragItems:c,nodeLookup:O,dragging:!1});o==null||o(A.sourceEvent,c,I,k),z==null||z(A.sourceEvent,I,k),j||R==null||R(A.sourceEvent,k)}}}).filter(A=>{const O=A.target;return!A.button&&(!v||!Qr(O,`.${v}`,_))&&(!w||Qr(O,w,_))});f.call(N)}function E(){f==null||f.on(".drag",null)}return{update:h,destroy:E}}function lj(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())on(o,Mt(r))>0&&s.push(r);return s}const cj=250;function aj(e,t,n,s){var c,a;let o=[],r=1/0;const l=lj(e,n,t+cj);for(const u of l){const d=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const x of d){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:f,y:m}=rn(u,x,x.position,!0),h=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(m-e.y,2));h>t||(h<r?(o=[{...x,x:f,y:m}],r=h):h===r&&o.push({...x,x:f,y:m}))}}if(!o.length)return null;if(o.length>1){const u=s.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Xc(e,t,n,s,o,r=!1){var u,d,x;const l=s.get(e);if(!l)return null;const c=o==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((d=l.internals.handleBounds)==null?void 0:d.source)??[],...((x=l.internals.handleBounds)==null?void 0:x.target)??[]],a=(n?c==null?void 0:c.find(f=>f.id===n):c==null?void 0:c[0])??null;return a&&r?{...a,...rn(l,a,a.position,!0)}:a}function Gc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function uj(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Kc=()=>!0;function dj(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:r,isTarget:l,domNode:c,nodeLookup:a,lib:u,autoPanOnConnect:d,flowId:x,panBy:f,cancelConnection:m,onConnectStart:h,onConnect:E,onConnectEnd:v,isValidConnection:w=Kc,onReconnectEnd:_,updateConnection:S,getTransform:j,getFromHandle:C,autoPanSpeed:P}){const b=Oc(e.target);let L=0,N;const{x:A,y:O}=We(e),T=b==null?void 0:b.elementFromPoint(A,O),z=Gc(r,T),R=c==null?void 0:c.getBoundingClientRect();if(!R||!z)return;const I=Xc(o,z,s,a,t);if(!I)return;let k=We(e,R),D=!1,M=null,B=!1,V=null;function Z(){if(!d||!R)return;const[se,de]=Tc(k,R,P);f({x:se,y:de}),L=requestAnimationFrame(Z)}const W={...I,nodeId:o,type:z,position:I.position},Q=a.get(o),K={inProgress:!0,isValid:null,from:rn(Q,W,q.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:Q,to:k,toHandle:null,toPosition:Fr[W.position],toNode:null};S(K);let U=K;h==null||h(e,{nodeId:o,handleId:s,handleType:z});function ee(se){if(!C()||!W){X(se);return}const de=j();k=We(se,R),N=aj(pn(k,de,!1,[1,1]),n,a,W),D||(Z(),D=!0);const re=Uc(se,{handle:N,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:w,doc:b,lib:u,flowId:x,nodeLookup:a});V=re.handleDomNode,M=re.connection,B=uj(!!N,re.isValid);const F={...U,isValid:B,to:N&&B?Ac({x:N.x,y:N.y},de):k,toHandle:re.toHandle,toPosition:B&&re.toHandle?re.toHandle.position:Fr[W.position],toNode:re.toHandle?a.get(re.toHandle.nodeId):null};B&&N&&U.toHandle&&F.toHandle&&U.toHandle.type===F.toHandle.type&&U.toHandle.nodeId===F.toHandle.nodeId&&U.toHandle.id===F.toHandle.id&&U.to.x===F.to.x&&U.to.y===F.to.y||(S(F),U=F)}function X(se){(N||V)&&M&&B&&(E==null||E(M));const{inProgress:de,...re}=U,F={...re,toPosition:U.toHandle?U.toPosition:null};v==null||v(se,F),r&&(_==null||_(se,F)),m(),cancelAnimationFrame(L),D=!1,B=!1,M=null,V=null,b.removeEventListener("mousemove",ee),b.removeEventListener("mouseup",X),b.removeEventListener("touchmove",ee),b.removeEventListener("touchend",X)}b.addEventListener("mousemove",ee),b.addEventListener("mouseup",X),b.addEventListener("touchmove",ee),b.addEventListener("touchend",X)}function Uc(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=Kc,nodeLookup:d}){const x=r==="target",f=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:h}=We(e),E=l.elementFromPoint(m,h),v=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:f,w={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const _=Gc(void 0,v),S=v.getAttribute("data-nodeid"),j=v.getAttribute("data-handleid"),C=v.classList.contains("connectable"),P=v.classList.contains("connectableend");if(!S||!_)return w;const b={source:x?S:s,sourceHandle:x?j:o,target:x?s:S,targetHandle:x?o:j};w.connection=b;const N=C&&P&&(n===ht.Strict?x&&_==="source"||!x&&_==="target":S!==s||j!==o);w.isValid=N&&u(b),w.toHandle=Xc(S,_,j,d,n,!1)}return w}const jo={onPointerDown:dj,isValid:Uc};function xj({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=Le(e);function r({translateExtent:c,width:a,height:u,zoomStep:d=10,pannable:x=!0,zoomable:f=!0,inversePan:m=!1}){const h=S=>{const j=n();if(S.sourceEvent.type!=="wheel"||!t)return;const C=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*d,P=j[2]*Math.pow(2,C);t.scaleTo(P)};let E=[0,0];const v=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(E=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},w=S=>{const j=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const C=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],P=[C[0]-E[0],C[1]-E[1]];E=C;const b=s()*Math.max(j[2],Math.log(j[2]))*(m?-1:1),L={x:j[0]-P[0]*b,y:j[1]-P[1]*b},N=[[0,0],[a,u]];t.setViewportConstrained({x:L.x,y:L.y,zoom:j[2]},N,c)},_=Cc().on("start",v).on("zoom",x?w:null).on("zoom.wheel",f?h:null);o.call(_,{})}function l(){o.on("zoom",null)}return{update:r,destroy:l,pointer:Ie}}const fj=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ss=e=>({x:e.x,y:e.y,zoom:e.k}),Hs=({x:e,y:t,zoom:n})=>hs.translate(e,t).scale(n),Rt=(e,t)=>e.target.closest(`.${t}`),Qc=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Zs=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},Jc=e=>{const t=e.ctrlKey&&es()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pj({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(Rt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const v=Ie(d),w=Jc(d),_=x*Math.pow(2,w);s.scaleTo(n,_,v,d);return}const f=d.deltaMode===1?20:1;let m=o===xt.Vertical?0:d.deltaX*f,h=o===xt.Horizontal?0:d.deltaY*f;!es()&&d.shiftKey&&o!==xt.Vertical&&(m=d.deltaY*f,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const E=Ss(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,E)),e.isPanScrolling&&(a==null||a(d,E),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,E),e.isPanScrolling=!1},150))}}function mj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||Rt(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function hj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=Ss(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,o))}}function gj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&Qc(t,e.mouseButton??0)),(l=r.sourceEvent)!=null&&l.sync||s([r.transform.x,r.transform.y,r.transform.k]),o&&!((c=r.sourceEvent)!=null&&c.internal)&&(o==null||o(r.sourceEvent,Ss(r.transform)))}}function yj({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:r}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,r&&Qc(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&fj(e.prevViewport,l.transform))){const a=Ss(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function Ej({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:r,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:u}){return d=>{var h;const x=e||t,f=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(Rt(d,`${u}-flow__node`)||Rt(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||Rt(d,c)&&d.type==="wheel"||Rt(d,a)&&(d.type!=="wheel"||o&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((h=d.touches)==null?void 0:h.length)>1)return d.preventDefault(),!1;if(!x&&!o&&!f&&d.type==="wheel"||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&m}}function jj({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,viewport:r,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=e.getBoundingClientRect(),f=Cc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),m=Le(e).call(f);S({x:r.x,y:r.y,zoom:Pt(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),E=m.on("dblclick.zoom");f.wheelDelta(Jc);function v(T,z){return m?new Promise(R=>{f==null||f.transform(Zs(m,z==null?void 0:z.duration,()=>R(!0)),T)}):Promise.resolve(!1)}function w({noWheelClassName:T,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:I,panOnScroll:k,panOnDrag:D,panOnScrollMode:M,panOnScrollSpeed:B,preventScrolling:V,zoomOnPinch:Z,zoomOnScroll:W,zoomOnDoubleClick:Q,zoomActivationKeyPressed:G,lib:K,onTransformChange:U}){I&&!d.isZoomingOrPanning&&_();const X=k&&!G&&!I?pj({zoomPanValues:d,noWheelClassName:T,d3Selection:m,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:B,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):mj({noWheelClassName:T,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",X,{passive:!1}),!I){const de=hj({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});f.on("start",de);const re=gj({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!R,onPanZoom:l,onTransformChange:U});f.on("zoom",re);const F=yj({zoomPanValues:d,panOnDrag:D,panOnScroll:k,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:u});f.on("end",F)}const se=Ej({zoomActivationKeyPressed:G,panOnDrag:D,zoomOnScroll:W,panOnScroll:k,zoomOnDoubleClick:Q,zoomOnPinch:Z,userSelectionActive:I,noPanClassName:z,noWheelClassName:T,lib:K});f.filter(se),Q?m.on("dblclick.zoom",E):m.on("dblclick.zoom",null)}function _(){f.on("zoom",null)}async function S(T,z,R){const I=Hs(T),k=f==null?void 0:f.constrain()(I,z,R);return k&&await v(k),new Promise(D=>D(k))}async function j(T,z){const R=Hs(T);return await v(R,z),new Promise(I=>I(R))}function C(T){if(m){const z=Hs(T),R=m.property("__zoom");(R.k!==T.zoom||R.x!==T.x||R.y!==T.y)&&(f==null||f.transform(m,z,null,{sync:!0}))}}function P(){const T=m?wc(m.node()):{x:0,y:0,k:1};return{x:T.x,y:T.y,zoom:T.k}}function b(T,z){return m?new Promise(R=>{f==null||f.scaleTo(Zs(m,z==null?void 0:z.duration,()=>R(!0)),T)}):Promise.resolve(!1)}function L(T,z){return m?new Promise(R=>{f==null||f.scaleBy(Zs(m,z==null?void 0:z.duration,()=>R(!0)),T)}):Promise.resolve(!1)}function N(T){f==null||f.scaleExtent(T)}function A(T){f==null||f.translateExtent(T)}function O(T){const z=!Oe(T)||T<0?0:T;f==null||f.clickDistance(z)}return{update:w,destroy:_,setViewport:j,setViewportConstrained:S,getViewport:P,scaleTo:b,scaleBy:L,setScaleExtent:N,setTranslateExtent:A,syncViewport:C,setClickDistance:O}}var Ut;(function(e){e.Line="line",e.Handle="handle"})(Ut||(Ut={}));function Sj({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,affectsY:r}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(a[0]=a[0]*-1),c&&r&&(a[1]=a[1]*-1),a}function Rj(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function Qe(e,t){return Math.max(0,t-e)}function Je(e,t){return Math.max(0,e-t)}function wn(e,t,n){return Math.max(0,t-e,e-n)}function Jr(e,t){return e?!t:t}function wj(e,t,n,s,o,r,l,c){let{affectsX:a,affectsY:u}=t;const{isHorizontal:d,isVertical:x}=t,f=d&&x,{xSnapped:m,ySnapped:h}=n,{minWidth:E,maxWidth:v,minHeight:w,maxHeight:_}=s,{x:S,y:j,width:C,height:P,aspectRatio:b}=e;let L=Math.floor(d?m-e.pointerX:0),N=Math.floor(x?h-e.pointerY:0);const A=C+(a?-L:L),O=P+(u?-N:N),T=-r[0]*C,z=-r[1]*P;let R=wn(A,E,v),I=wn(O,w,_);if(l){let M=0,B=0;a&&L<0?M=Qe(S+L+T,l[0][0]):!a&&L>0&&(M=Je(S+A+T,l[1][0])),u&&N<0?B=Qe(j+N+z,l[0][1]):!u&&N>0&&(B=Je(j+O+z,l[1][1])),R=Math.max(R,M),I=Math.max(I,B)}if(c){let M=0,B=0;a&&L>0?M=Je(S+L,c[0][0]):!a&&L<0&&(M=Qe(S+A,c[1][0])),u&&N>0?B=Je(j+N,c[0][1]):!u&&N<0&&(B=Qe(j+O,c[1][1])),R=Math.max(R,M),I=Math.max(I,B)}if(o){if(d){const M=wn(A/b,w,_)*b;if(R=Math.max(R,M),l){let B=0;!a&&!u||a&&!u&&f?B=Je(j+z+A/b,l[1][1])*b:B=Qe(j+z+(a?L:-L)/b,l[0][1])*b,R=Math.max(R,B)}if(c){let B=0;!a&&!u||a&&!u&&f?B=Qe(j+A/b,c[1][1])*b:B=Je(j+(a?L:-L)/b,c[0][1])*b,R=Math.max(R,B)}}if(x){const M=wn(O*b,E,v)/b;if(I=Math.max(I,M),l){let B=0;!a&&!u||u&&!a&&f?B=Je(S+O*b+T,l[1][0])/b:B=Qe(S+(u?N:-N)*b+T,l[0][0])/b,I=Math.max(I,B)}if(c){let B=0;!a&&!u||u&&!a&&f?B=Qe(S+O*b,c[1][0])/b:B=Je(S+(u?N:-N)*b,c[0][0])/b,I=Math.max(I,B)}}}N=N+(N<0?I:-I),L=L+(L<0?R:-R),o&&(f?A>O*b?N=(Jr(a,u)?-L:L)/b:L=(Jr(a,u)?-N:N)*b:d?(N=L/b,u=a):(L=N*b,a=u));const k=a?S+L:S,D=u?j+N:j;return{width:C+(a?-L:L),height:P+(u?-N:N),x:r[0]*L*(a?-1:1)+k,y:r[1]*N*(u?-1:1)+D}}const ea={width:0,height:0,x:0,y:0},Cj={...ea,pointerX:0,pointerY:0,aspectRatio:1};function vj(e){return[[0,0],[e.measured.width,e.measured.height]]}function bj(e,t,n){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,l=e.measured.height??0,c=n[0]*r,a=n[1]*l;return[[s-c,o-a],[s+r-c,o+l-a]]}function _j({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const r=Le(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:d,onResizeStart:x,onResize:f,onResizeEnd:m,shouldResize:h}){let E={...ea},v={...Cj};const w=Rj(a);let _,S=null,j=[],C,P,b;const L=mc().on("start",N=>{const{nodeLookup:A,transform:O,snapGrid:T,snapToGrid:z,nodeOrigin:R,paneDomNode:I}=n();if(_=A.get(t),!_)return;S=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:D}=Kt(N.sourceEvent,{transform:O,snapGrid:T,snapToGrid:z,containerBounds:S});E={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},v={...E,pointerX:k,pointerY:D,aspectRatio:E.width/E.height},C=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(C=A.get(_.parentId),P=C&&_.extent==="parent"?vj(C):void 0),j=[],b=void 0;for(const[M,B]of A)if(B.parentId===t&&(j.push({id:M,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const V=bj(B,_,B.origin??R);b?b=[[Math.min(V[0][0],b[0][0]),Math.min(V[0][1],b[0][1])],[Math.max(V[1][0],b[1][0]),Math.max(V[1][1],b[1][1])]]:b=V}x==null||x(N,{...E})}).on("drag",N=>{const{transform:A,snapGrid:O,snapToGrid:T,nodeOrigin:z}=n(),R=Kt(N.sourceEvent,{transform:A,snapGrid:O,snapToGrid:T,containerBounds:S}),I=[];if(!_)return;const{x:k,y:D,width:M,height:B}=E,V={},Z=_.origin??z,{width:W,height:Q,x:G,y:K}=wj(v,w,R,u,d,Z,P,b),U=W!==M,ee=Q!==B,X=G!==k&&U,se=K!==D&ⅇif(!X&&!se&&!U&&!ee)return;if((X||se||Z[0]===1||Z[1]===1)&&(V.x=X?G:E.x,V.y=se?K:E.y,E.x=V.x,E.y=V.y,j.length>0)){const J=G-k,oe=K-D;for(const he of j)he.position={x:he.position.x-J+Z[0]*(W-M),y:he.position.y-oe+Z[1]*(Q-B)},I.push(he)}if((U||ee)&&(V.width=U?W:E.width,V.height=ee?Q:E.height,E.width=V.width,E.height=V.height),C&&_.expandParent){const J=Z[0]*(V.width??0);V.x&&V.x<J&&(E.x=J,v.x=v.x-(V.x-J));const oe=Z[1]*(V.height??0);V.y&&V.y<oe&&(E.y=oe,v.y=v.y-(V.y-oe))}const de=Sj({width:E.width,prevWidth:M,height:E.height,prevHeight:B,affectsX:w.affectsX,affectsY:w.affectsY}),re={...E,direction:de};(h==null?void 0:h(N,re))!==!1&&(f==null||f(N,re),s(V,I))}).on("end",N=>{m==null||m(N,{...E}),o==null||o()});r.call(L)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var So={exports:{}},Ys={},Cn={exports:{}},qs={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ei;function kj(){if(ei)return qs;ei=1;var e=g;function t(x,f){return x===f&&(x!==0||1/x===1/f)||x!==x&&f!==f}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,r=e.useLayoutEffect,l=e.useDebugValue;function c(x,f){var m=f(),h=s({inst:{value:m,getSnapshot:f}}),E=h[0].inst,v=h[1];return r(function(){E.value=m,E.getSnapshot=f,a(E)&&v({inst:E})},[x,m,f]),o(function(){return a(E)&&v({inst:E}),x(function(){a(E)&&v({inst:E})})},[x]),l(m),m}function a(x){var f=x.getSnapshot;x=x.value;try{var m=f();return!n(x,m)}catch{return!0}}function u(x,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return qs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,qs}var Ws={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-shim.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ti;function Pj(){return ti||(ti=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var j=arguments.length,C=new Array(j>1?j-1:0),P=1;P<j;P++)C[P-1]=arguments[P];s("error",S,C)}}function s(S,j,C){{var P=t.ReactDebugCurrentFrame,b=P.getStackAddendum();b!==""&&(j+="%s",C=C.concat([b]));var L=C.map(function(N){return String(N)});L.unshift("Warning: "+j),Function.prototype.apply.call(console[S],console,L)}}function o(S,j){return S===j&&(S!==0||1/S===1/j)||S!==S&&j!==j}var r=typeof Object.is=="function"?Object.is:o,l=e.useState,c=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue,d=!1,x=!1;function f(S,j,C){d||e.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var P=j();if(!x){var b=j();r(P,b)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),x=!0)}var L=l({inst:{value:P,getSnapshot:j}}),N=L[0].inst,A=L[1];return a(function(){N.value=P,N.getSnapshot=j,m(N)&&A({inst:N})},[S,P,j]),c(function(){m(N)&&A({inst:N});var O=function(){m(N)&&A({inst:N})};return S(O)},[S]),u(P),P}function m(S){var j=S.getSnapshot,C=S.value;try{var P=j();return!r(C,P)}catch{return!0}}function h(S,j,C){return j()}var E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!E,w=v?h:f,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Ws.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ws}var ni;function ta(){return ni||(ni=1,process.env.NODE_ENV==="production"?Cn.exports=kj():Cn.exports=Pj()),Cn.exports}/**
|
|
18
18
|
* @license React
|
|
19
19
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var si;function Mj(){if(si)return Ys;si=1;var e=g,t=ta();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Ys.useSyncExternalStoreWithSelector=function(u,d,x,f,m){var h=r(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=c(function(){function w(P){if(!_){if(_=!0,S=P,P=f(P),m!==void 0&&E.hasValue){var b=E.value;if(m(b,P))return j=b}return j=P}if(b=j,s(S,P))return b;var L=f(P);return m!==void 0&&m(b,L)?b:(S=P,j=L)}var _=!1,S,j,C=x===void 0?null:x;return[function(){return w(d())},C===null?void 0:function(){return w(C())}]},[d,x,f,m]);var v=o(u,h[0],h[1]);return l(function(){E.hasValue=!0,E.value=v},[v]),a(v),v},Ys}var Xs={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* use-sync-external-store-shim/with-selector.development.js
|
|
28
28
|
*
|
|
@@ -30,4 +30,10 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Uo;function qm(){return Uo||(Uo=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=f,t=Xl();function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;function d(u,p,m,h,E){var y=o(null),w;y.current===null?(w={hasValue:!1,value:null},y.current=w):w=y.current;var j=c(function(){var b=!1,_,$,O=function(M){if(!b){b=!0,_=M;var z=h(M);if(E!==void 0&&w.hasValue){var S=w.value;if(E(S,z))return $=S,S}return $=z,z}var L=_,k=$;if(s(L,M))return k;var I=h(M);return E!==void 0&&E(k,I)?k:(_=M,$=I,I)},N=m===void 0?null:m,D=function(){return O(p())},T=N===null?void 0:function(){return O(N())};return[D,T]},[p,m,h,E]),C=j[0],v=j[1],R=r(u,C,v);return i(function(){w.hasValue=!0,w.value=R},[R]),a(R),R}Ks.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ks}process.env.NODE_ENV==="production"?fr.exports=Hm():fr.exports=qm();var Ym=fr.exports;const Um=g.getDefaultExportFromCjs(Ym),Gm={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Go=e=>{let t;const n=new Set,s=(u,p)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const h=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(E=>E(t,h))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>d,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Gm?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,r,a);return a},Wm=e=>e?Go(e):Go,{useDebugValue:Km}=f,{useSyncExternalStoreWithSelector:Xm}=Um,Qm=e=>e;function Ql(e,t=Qm,n){const s=Xm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Km(s),s}const Wo=(e,t)=>{const n=Wm(e),s=(r,o=t)=>Ql(n,r,o);return Object.assign(s,n),s},Jm=(e,t)=>e?Wo(e,t):Wo;function Ne(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}var eh={value:()=>{}};function Ps(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Kn(n)}function Kn(e){this._=e}function th(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Kn.prototype=Ps.prototype={constructor:Kn,on:function(e,t){var n=this._,s=th(e+"",n),r,o=-1,i=s.length;if(arguments.length<2){for(;++o<i;)if((r=(e=s[o]).type)&&(r=nh(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(r=(e=s[o]).type)n[r]=Ko(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ko(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Kn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,o;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],s=0,r=o.length;s<r;++s)o[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,o=s.length;r<o;++r)s[r].value.apply(t,n)}};function nh(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Ko(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=eh,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var pr="http://www.w3.org/1999/xhtml";const Xo={svg:"http://www.w3.org/2000/svg",xhtml:pr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ns(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xo.hasOwnProperty(t)?{space:Xo[t],local:e}:e}function sh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===pr&&t.documentElement.namespaceURI===pr?t.createElement(e):t.createElementNS(n,e)}}function rh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jl(e){var t=Ns(e);return(t.local?rh:sh)(t)}function oh(){}function Qr(e){return e==null?oh:function(){return this.querySelector(e)}}function ih(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=new Array(i),a,d,u=0;u<i;++u)(a=o[u])&&(d=e.call(a,a.__data__,u,o))&&("__data__"in a&&(d.__data__=a.__data__),c[u]=d);return new Oe(s,this._parents)}function lh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ch(){return[]}function ec(e){return e==null?ch:function(){return this.querySelectorAll(e)}}function ah(e){return function(){return lh(e.apply(this,arguments))}}function uh(e){typeof e=="function"?e=ah(e):e=ec(e);for(var t=this._groups,n=t.length,s=[],r=[],o=0;o<n;++o)for(var i=t[o],c=i.length,a,d=0;d<c;++d)(a=i[d])&&(s.push(e.call(a,a.__data__,d,i)),r.push(a));return new Oe(s,r)}function tc(e){return function(){return this.matches(e)}}function nc(e){return function(t){return t.matches(e)}}var dh=Array.prototype.find;function xh(e){return function(){return dh.call(this.children,e)}}function fh(){return this.firstElementChild}function ph(e){return this.select(e==null?fh:xh(typeof e=="function"?e:nc(e)))}var mh=Array.prototype.filter;function hh(){return Array.from(this.children)}function gh(e){return function(){return mh.call(this.children,e)}}function yh(e){return this.selectAll(e==null?hh:gh(typeof e=="function"?e:nc(e)))}function Sh(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=[],a,d=0;d<i;++d)(a=o[d])&&e.call(a,a.__data__,d,o)&&c.push(a);return new Oe(s,this._parents)}function sc(e){return new Array(e.length)}function Eh(){return new Oe(this._enter||this._groups.map(sc),this._parents)}function ds(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ds.prototype={constructor:ds,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jh(e){return function(){return e}}function Rh(e,t,n,s,r,o){for(var i=0,c,a=t.length,d=o.length;i<d;++i)(c=t[i])?(c.__data__=o[i],s[i]=c):n[i]=new ds(e,o[i]);for(;i<a;++i)(c=t[i])&&(r[i]=c)}function bh(e,t,n,s,r,o,i){var c,a,d=new Map,u=t.length,p=o.length,m=new Array(u),h;for(c=0;c<u;++c)(a=t[c])&&(m[c]=h=i.call(a,a.__data__,c,t)+"",d.has(h)?r[c]=a:d.set(h,a));for(c=0;c<p;++c)h=i.call(e,o[c],c,o)+"",(a=d.get(h))?(s[c]=a,a.__data__=o[c],d.delete(h)):n[c]=new ds(e,o[c]);for(c=0;c<u;++c)(a=t[c])&&d.get(m[c])===a&&(r[c]=a)}function wh(e){return e.__data__}function Ch(e,t){if(!arguments.length)return Array.from(this,wh);var n=t?bh:Rh,s=this._parents,r=this._groups;typeof e!="function"&&(e=jh(e));for(var o=r.length,i=new Array(o),c=new Array(o),a=new Array(o),d=0;d<o;++d){var u=s[d],p=r[d],m=p.length,h=vh(e.call(u,u&&u.__data__,d,s)),E=h.length,y=c[d]=new Array(E),w=i[d]=new Array(E),j=a[d]=new Array(m);n(u,p,y,w,j,h,t);for(var C=0,v=0,R,b;C<E;++C)if(R=y[C]){for(C>=v&&(v=C+1);!(b=w[v])&&++v<E;);R._next=b||null}}return i=new Oe(i,s),i._enter=c,i._exit=a,i}function vh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _h(){return new Oe(this._exit||this._groups.map(sc),this._parents)}function kh(e,t,n){var s=this.enter(),r=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?o.remove():n(o),s&&r?s.merge(r).order():r}function Ph(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,o=s.length,i=Math.min(r,o),c=new Array(r),a=0;a<i;++a)for(var d=n[a],u=s[a],p=d.length,m=c[a]=new Array(p),h,E=0;E<p;++E)(h=d[E]||u[E])&&(m[E]=h);for(;a<r;++a)c[a]=n[a];return new Oe(c,this._parents)}function Nh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,o=s[r],i;--r>=0;)(i=s[r])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Mh(e){e||(e=Th);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),o=0;o<s;++o){for(var i=n[o],c=i.length,a=r[o]=new Array(c),d,u=0;u<c;++u)(d=i[u])&&(a[u]=d);a.sort(t)}return new Oe(r,this._parents).order()}function Th(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ah(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Lh(){return Array.from(this)}function $h(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,o=s.length;r<o;++r){var i=s[r];if(i)return i}return null}function Oh(){let e=0;for(const t of this)++e;return e}function Dh(){return!this.node()}function zh(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],o=0,i=r.length,c;o<i;++o)(c=r[o])&&e.call(c,c.__data__,o,r);return this}function Bh(e){return function(){this.removeAttribute(e)}}function Ih(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vh(e,t){return function(){this.setAttribute(e,t)}}function Fh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Hh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function qh(e,t){var n=Ns(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?Ih:Bh:typeof t=="function"?n.local?Hh:Zh:n.local?Fh:Vh)(n,t))}function rc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Yh(e){return function(){this.style.removeProperty(e)}}function Uh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Gh(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Wh(e,t,n){return arguments.length>1?this.each((t==null?Yh:typeof t=="function"?Gh:Uh)(e,t,n??"")):Qt(this.node(),e)}function Qt(e,t){return e.style.getPropertyValue(t)||rc(e).getComputedStyle(e,null).getPropertyValue(t)}function Kh(e){return function(){delete this[e]}}function Xh(e,t){return function(){this[e]=t}}function Qh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Jh(e,t){return arguments.length>1?this.each((t==null?Kh:typeof t=="function"?Qh:Xh)(e,t)):this.node()[e]}function oc(e){return e.trim().split(/^|\s+/)}function Jr(e){return e.classList||new ic(e)}function ic(e){this._node=e,this._names=oc(e.getAttribute("class")||"")}ic.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function lc(e,t){for(var n=Jr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function cc(e,t){for(var n=Jr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function eg(e){return function(){lc(this,e)}}function tg(e){return function(){cc(this,e)}}function ng(e,t){return function(){(t.apply(this,arguments)?lc:cc)(this,e)}}function sg(e,t){var n=oc(e+"");if(arguments.length<2){for(var s=Jr(this.node()),r=-1,o=n.length;++r<o;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?ng:t?eg:tg)(n,t))}function rg(){this.textContent=""}function og(e){return function(){this.textContent=e}}function ig(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lg(e){return arguments.length?this.each(e==null?rg:(typeof e=="function"?ig:og)(e)):this.node().textContent}function cg(){this.innerHTML=""}function ag(e){return function(){this.innerHTML=e}}function ug(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function dg(e){return arguments.length?this.each(e==null?cg:(typeof e=="function"?ug:ag)(e)):this.node().innerHTML}function xg(){this.nextSibling&&this.parentNode.appendChild(this)}function fg(){return this.each(xg)}function pg(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mg(){return this.each(pg)}function hg(e){var t=typeof e=="function"?e:Jl(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gg(){return null}function yg(e,t){var n=typeof e=="function"?e:Jl(e),s=t==null?gg:typeof t=="function"?t:Qr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Sg(){var e=this.parentNode;e&&e.removeChild(this)}function Eg(){return this.each(Sg)}function jg(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rg(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bg(e){return this.select(e?Rg:jg)}function wg(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Cg(e){return function(t){e.call(this,t,this.__data__)}}function vg(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function _g(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,o;n<r;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++s]=o;++s?t.length=s:delete this.__on}}}function kg(e,t,n){return function(){var s=this.__on,r,o=Cg(t);if(s){for(var i=0,c=s.length;i<c;++i)if((r=s[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=t;return}}this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},s?s.push(r):this.__on=[r]}}function Pg(e,t,n){var s=vg(e+""),r,o=s.length,i;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,d=c.length,u;a<d;++a)for(r=0,u=c[a];r<o;++r)if((i=s[r]).type===u.type&&i.name===u.name)return u.value}return}for(c=t?kg:_g,r=0;r<o;++r)this.each(c(s[r],t,n));return this}function ac(e,t,n){var s=rc(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Ng(e,t){return function(){return ac(this,e,t)}}function Mg(e,t){return function(){return ac(this,e,t.apply(this,arguments))}}function Tg(e,t){return this.each((typeof t=="function"?Mg:Ng)(e,t))}function*Ag(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,o=s.length,i;r<o;++r)(i=s[r])&&(yield i)}var uc=[null];function Oe(e,t){this._groups=e,this._parents=t}function An(){return new Oe([[document.documentElement]],uc)}function Lg(){return this}Oe.prototype=An.prototype={constructor:Oe,select:ih,selectAll:uh,selectChild:ph,selectChildren:yh,filter:Sh,data:Ch,enter:Eh,exit:_h,join:kh,merge:Ph,selection:Lg,order:Nh,sort:Mh,call:Ah,nodes:Lh,node:$h,size:Oh,empty:Dh,each:zh,attr:qh,style:Wh,property:Jh,classed:sg,text:lg,html:dg,raise:fg,lower:mg,append:hg,insert:yg,remove:Eg,clone:bg,datum:wg,on:Pg,dispatch:Tg,[Symbol.iterator]:Ag};function Ze(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],uc)}function $g(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xe(e,t){if(e=$g(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Og={passive:!1},_n={capture:!0,passive:!1};function Xs(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function dc(e){var t=e.document.documentElement,n=Ze(e).on("dragstart.drag",Gt,_n);"onselectstart"in t?n.on("selectstart.drag",Gt,_n):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xc(e,t){var n=e.document.documentElement,s=Ze(e).on("dragstart.drag",null);t&&(s.on("click.drag",Gt,_n),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Bn=e=>()=>e;function mr(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:o,x:i,y:c,dx:a,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}mr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Dg(e){return!e.ctrlKey&&!e.button}function zg(){return this.parentNode}function Bg(e,t){return t??{x:e.x,y:e.y}}function Ig(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vg(){var e=Dg,t=zg,n=Bg,s=Ig,r={},o=Ps("start","drag","end"),i=0,c,a,d,u,p=0;function m(R){R.on("mousedown.drag",h).filter(s).on("touchstart.drag",w).on("touchmove.drag",j,Og).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(R,b){if(!(u||!e.call(this,R,b))){var _=v(this,t.call(this,R,b),R,b,"mouse");_&&(Ze(R.view).on("mousemove.drag",E,_n).on("mouseup.drag",y,_n),dc(R.view),Xs(R),d=!1,c=R.clientX,a=R.clientY,_("start",R))}}function E(R){if(Gt(R),!d){var b=R.clientX-c,_=R.clientY-a;d=b*b+_*_>p}r.mouse("drag",R)}function y(R){Ze(R.view).on("mousemove.drag mouseup.drag",null),xc(R.view,d),Gt(R),r.mouse("end",R)}function w(R,b){if(e.call(this,R,b)){var _=R.changedTouches,$=t.call(this,R,b),O=_.length,N,D;for(N=0;N<O;++N)(D=v(this,$,R,b,_[N].identifier,_[N]))&&(Xs(R),D("start",R,_[N]))}}function j(R){var b=R.changedTouches,_=b.length,$,O;for($=0;$<_;++$)(O=r[b[$].identifier])&&(Gt(R),O("drag",R,b[$]))}function C(R){var b=R.changedTouches,_=b.length,$,O;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),$=0;$<_;++$)(O=r[b[$].identifier])&&(Xs(R),O("end",R,b[$]))}function v(R,b,_,$,O,N){var D=o.copy(),T=Xe(N||_,b),M,z,S;if((S=n.call(R,new mr("beforestart",{sourceEvent:_,target:m,identifier:O,active:i,x:T[0],y:T[1],dx:0,dy:0,dispatch:D}),$))!=null)return M=S.x-T[0]||0,z=S.y-T[1]||0,function L(k,I,B){var A=T,V;switch(k){case"start":r[O]=L,V=i++;break;case"end":delete r[O],--i;case"drag":T=Xe(B||I,b),V=i;break}D.call(k,R,new mr(k,{sourceEvent:I,subject:S,target:m,identifier:O,active:V,x:T[0]+M,y:T[1]+z,dx:T[0]-A[0],dy:T[1]-A[1],dispatch:D}),$)}}return m.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Bn(!!R),m):e},m.container=function(R){return arguments.length?(t=typeof R=="function"?R:Bn(R),m):t},m.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Bn(R),m):n},m.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Bn(!!R),m):s},m.on=function(){var R=o.on.apply(o,arguments);return R===o?m:R},m.clickDistance=function(R){return arguments.length?(p=(R=+R)*R,m):Math.sqrt(p)},m}var Jt=0,jn=0,fn=0,fc=1e3,xs,Rn,fs=0,Tt=0,Ms=0,kn=typeof performance=="object"&&performance.now?performance:Date,pc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eo(){return Tt||(pc(Fg),Tt=kn.now()+Ms)}function Fg(){Tt=0}function ps(){this._call=this._time=this._next=null}ps.prototype=mc.prototype={constructor:ps,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?eo():+n)+(t==null?0:+t),!this._next&&Rn!==this&&(Rn?Rn._next=this:xs=this,Rn=this),this._call=e,this._time=n,hr()},stop:function(){this._call&&(this._call=null,this._time=1/0,hr())}};function mc(e,t,n){var s=new ps;return s.restart(e,t,n),s}function Zg(){eo(),++Jt;for(var e=xs,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jt}function Qo(){Tt=(fs=kn.now())+Ms,Jt=jn=0;try{Zg()}finally{Jt=0,qg(),Tt=0}}function Hg(){var e=kn.now(),t=e-fs;t>fc&&(Ms-=t,fs=e)}function qg(){for(var e,t=xs,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xs=n);Rn=e,hr(s)}function hr(e){if(!Jt){jn&&(jn=clearTimeout(jn));var t=e-Tt;t>24?(e<1/0&&(jn=setTimeout(Qo,e-kn.now()-Ms)),fn&&(fn=clearInterval(fn))):(fn||(fs=kn.now(),fn=setInterval(Hg,fc)),Jt=1,pc(Qo))}}function Jo(e,t,n){var s=new ps;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var Yg=Ps("start","end","cancel","interrupt"),Ug=[],hc=0,ei=1,gr=2,Xn=3,ti=4,yr=5,Qn=6;function Ts(e,t,n,s,r,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Gg(e,n,{name:t,index:s,group:r,on:Yg,tween:Ug,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:hc})}function to(e,t){var n=Ue(e,t);if(n.state>hc)throw new Error("too late; already scheduled");return n}function Je(e,t){var n=Ue(e,t);if(n.state>Xn)throw new Error("too late; already running");return n}function Ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Gg(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=mc(o,0,n.time);function o(d){n.state=ei,n.timer.restart(i,n.delay,n.time),n.delay<=d&&i(d-n.delay)}function i(d){var u,p,m,h;if(n.state!==ei)return a();for(u in s)if(h=s[u],h.name===n.name){if(h.state===Xn)return Jo(i);h.state===ti?(h.state=Qn,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[u]):+u<t&&(h.state=Qn,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[u])}if(Jo(function(){n.state===Xn&&(n.state=ti,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=gr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gr){for(n.state=Xn,r=new Array(m=n.tween.length),u=0,p=-1;u<m;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function c(d){for(var u=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(a),n.state=yr,1),p=-1,m=r.length;++p<m;)r[p].call(e,u);n.state===yr&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Qn,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function Jn(e,t){var n=e.__transition,s,r,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((s=n[i]).name!==t){o=!1;continue}r=s.state>gr&&s.state<yr,s.state=Qn,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[i]}o&&delete e.__transition}}function Wg(e){return this.each(function(){Jn(this,e)})}function Kg(e,t){var n,s;return function(){var r=Je(this,e),o=r.tween;if(o!==n){s=n=o;for(var i=0,c=s.length;i<c;++i)if(s[i].name===t){s=s.slice(),s.splice(i,1);break}}r.tween=s}}function Xg(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var o=Je(this,e),i=o.tween;if(i!==s){r=(s=i).slice();for(var c={name:t,value:n},a=0,d=r.length;a<d;++a)if(r[a].name===t){r[a]=c;break}a===d&&r.push(c)}o.tween=r}}function Qg(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ue(this.node(),n).tween,r=0,o=s.length,i;r<o;++r)if((i=s[r]).name===e)return i.value;return null}return this.each((t==null?Kg:Xg)(n,e,t))}function no(e,t,n){var s=e._id;return e.each(function(){var r=Je(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Ue(r,s).value[t]}}function gc(e,t){var n;return(typeof t=="number"?P.interpolateNumber:t instanceof P.color?P.interpolateRgb:(n=P.color(t))?(t=n,P.interpolateRgb):P.interpolateString)(e,t)}function Jg(e){return function(){this.removeAttribute(e)}}function ey(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ty(e,t,n){var s,r=n+"",o;return function(){var i=this.getAttribute(e);return i===r?null:i===s?o:o=t(s=i,n)}}function ny(e,t,n){var s,r=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===r?null:i===s?o:o=t(s=i,n)}}function sy(e,t,n){var s,r,o;return function(){var i,c=n(this),a;return c==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=c+"",i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c)))}}function ry(e,t,n){var s,r,o;return function(){var i,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=c+"",i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c)))}}function oy(e,t){var n=Ns(e),s=n==="transform"?Wx:gc;return this.attrTween(e,typeof t=="function"?(n.local?ry:sy)(n,s,no(this,"attr."+e,t)):t==null?(n.local?ey:Jg)(n):(n.local?ny:ty)(n,s,t))}function iy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ly(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cy(e,t){var n,s;function r(){var o=t.apply(this,arguments);return o!==s&&(n=(s=o)&&ly(e,o)),n}return r._value=t,r}function ay(e,t){var n,s;function r(){var o=t.apply(this,arguments);return o!==s&&(n=(s=o)&&iy(e,o)),n}return r._value=t,r}function uy(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Ns(e);return this.tween(n,(s.local?cy:ay)(s,t))}function dy(e,t){return function(){to(this,e).delay=+t.apply(this,arguments)}}function xy(e,t){return t=+t,function(){to(this,e).delay=t}}function fy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dy:xy)(t,e)):Ue(this.node(),t).delay}function py(e,t){return function(){Je(this,e).duration=+t.apply(this,arguments)}}function my(e,t){return t=+t,function(){Je(this,e).duration=t}}function hy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?py:my)(t,e)):Ue(this.node(),t).duration}function gy(e,t){if(typeof t!="function")throw new Error;return function(){Je(this,e).ease=t}}function yy(e){var t=this._id;return arguments.length?this.each(gy(t,e)):Ue(this.node(),t).ease}function Sy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Je(this,e).ease=n}}function Ey(e){if(typeof e!="function")throw new Error;return this.each(Sy(this._id,e))}function jy(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var o=t[r],i=o.length,c=s[r]=[],a,d=0;d<i;++d)(a=o[d])&&e.call(a,a.__data__,d,o)&&c.push(a);return new it(s,this._parents,this._name,this._id)}function Ry(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,o=Math.min(s,r),i=new Array(s),c=0;c<o;++c)for(var a=t[c],d=n[c],u=a.length,p=i[c]=new Array(u),m,h=0;h<u;++h)(m=a[h]||d[h])&&(p[h]=m);for(;c<s;++c)i[c]=t[c];return new it(i,this._parents,this._name,this._id)}function by(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function wy(e,t,n){var s,r,o=by(t)?to:Je;return function(){var i=o(this,e),c=i.on;c!==s&&(r=(s=c).copy()).on(t,n),i.on=r}}function Cy(e,t){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(e):this.each(wy(n,e,t))}function vy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _y(){return this.on("end.remove",vy(this._id))}function ky(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qr(e));for(var s=this._groups,r=s.length,o=new Array(r),i=0;i<r;++i)for(var c=s[i],a=c.length,d=o[i]=new Array(a),u,p,m=0;m<a;++m)(u=c[m])&&(p=e.call(u,u.__data__,m,c))&&("__data__"in u&&(p.__data__=u.__data__),d[m]=p,Ts(d[m],t,n,m,d,Ue(u,n)));return new it(o,this._parents,t,n)}function Py(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ec(e));for(var s=this._groups,r=s.length,o=[],i=[],c=0;c<r;++c)for(var a=s[c],d=a.length,u,p=0;p<d;++p)if(u=a[p]){for(var m=e.call(u,u.__data__,p,a),h,E=Ue(u,n),y=0,w=m.length;y<w;++y)(h=m[y])&&Ts(h,t,n,y,m,E);o.push(m),i.push(u)}return new it(o,i,t,n)}var Ny=An.prototype.constructor;function My(){return new Ny(this._groups,this._parents)}function Ty(e,t){var n,s,r;return function(){var o=Qt(this,e),i=(this.style.removeProperty(e),Qt(this,e));return o===i?null:o===n&&i===s?r:r=t(n=o,s=i)}}function yc(e){return function(){this.style.removeProperty(e)}}function Ay(e,t,n){var s,r=n+"",o;return function(){var i=Qt(this,e);return i===r?null:i===s?o:o=t(s=i,n)}}function Ly(e,t,n){var s,r,o;return function(){var i=Qt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Qt(this,e))),i===a?null:i===s&&a===r?o:(r=a,o=t(s=i,c))}}function $y(e,t){var n,s,r,o="style."+t,i="end."+o,c;return function(){var a=Je(this,e),d=a.on,u=a.value[o]==null?c||(c=yc(t)):void 0;(d!==n||r!==u)&&(s=(n=d).copy()).on(i,r=u),a.on=s}}function Oy(e,t,n){var s=(e+="")=="transform"?Gx:gc;return t==null?this.styleTween(e,Ty(e,s)).on("end.style."+e,yc(e)):typeof t=="function"?this.styleTween(e,Ly(e,s,no(this,"style."+e,t))).each($y(this._id,e)):this.styleTween(e,Ay(e,s,t),n).on("end.style."+e,null)}function Dy(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function zy(e,t,n){var s,r;function o(){var i=t.apply(this,arguments);return i!==r&&(s=(r=i)&&Dy(e,i,n)),s}return o._value=t,o}function By(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,zy(e,t,n??""))}function Iy(e){return function(){this.textContent=e}}function Vy(e){return function(){var t=e(this);this.textContent=t??""}}function Fy(e){return this.tween("text",typeof e=="function"?Vy(no(this,"text",e)):Iy(e==null?"":e+""))}function Zy(e){return function(t){this.textContent=e.call(this,t)}}function Hy(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Zy(r)),t}return s._value=e,s}function qy(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Hy(e))}function Yy(){for(var e=this._name,t=this._id,n=Sc(),s=this._groups,r=s.length,o=0;o<r;++o)for(var i=s[o],c=i.length,a,d=0;d<c;++d)if(a=i[d]){var u=Ue(a,t);Ts(a,e,n,d,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new it(s,this._parents,e,n)}function Uy(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(o,i){var c={value:i},a={value:function(){--r===0&&o()}};n.each(function(){var d=Je(this,s),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),d.on=t}),r===0&&o()})}var Gy=0;function it(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Sc(){return++Gy}var nt=An.prototype;it.prototype={constructor:it,select:ky,selectAll:Py,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:jy,merge:Ry,selection:My,transition:Yy,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:Cy,attr:oy,attrTween:uy,style:Oy,styleTween:By,text:Fy,textTween:qy,remove:_y,tween:Qg,delay:fy,duration:hy,ease:yy,easeVarying:Ey,end:Uy,[Symbol.iterator]:nt[Symbol.iterator]};function Wy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ky={time:null,delay:0,duration:250,ease:Wy};function Xy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Qy(e){var t,n;e instanceof it?(t=e._id,e=e._name):(t=Sc(),(n=Ky).time=eo(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,o=0;o<r;++o)for(var i=s[o],c=i.length,a,d=0;d<c;++d)(a=i[d])&&Ts(a,e,t,d,i,n||Xy(a,t));return new it(s,this._parents,e,t)}An.prototype.interrupt=Wg;An.prototype.transition=Qy;const In=e=>()=>e;function Jy(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function st(e,t,n){this.k=e,this.x=t,this.y=n}st.prototype={constructor:st,scale:function(e){return e===1?this:new st(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new st(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ft=new st(1,0,0);st.prototype;function Qs(e){e.stopImmediatePropagation()}function pn(e){e.preventDefault(),e.stopImmediatePropagation()}function eS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tS(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ni(){return this.__zoom||ft}function nS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sS(){return navigator.maxTouchPoints||"ontouchstart"in this}function rS(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function oS(){var e=eS,t=tS,n=rS,s=nS,r=sS,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Jx,d=Ps("start","zoom","end"),u,p,m,h=500,E=150,y=0,w=10;function j(S){S.property("__zoom",ni).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",D).filter(r).on("touchstart.zoom",T).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(S,L,k,I){var B=S.selection?S.selection():S;B.property("__zoom",ni),S!==B?b(S,L,k,I):B.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},j.scaleBy=function(S,L,k,I){j.scaleTo(S,function(){var B=this.__zoom.k,A=typeof L=="function"?L.apply(this,arguments):L;return B*A},k,I)},j.scaleTo=function(S,L,k,I){j.transform(S,function(){var B=t.apply(this,arguments),A=this.__zoom,V=k==null?R(B):typeof k=="function"?k.apply(this,arguments):k,F=A.invert(V),H=typeof L=="function"?L.apply(this,arguments):L;return n(v(C(A,H),V,F),B,i)},k,I)},j.translateBy=function(S,L,k,I){j.transform(S,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,I)},j.translateTo=function(S,L,k,I,B){j.transform(S,function(){var A=t.apply(this,arguments),V=this.__zoom,F=I==null?R(A):typeof I=="function"?I.apply(this,arguments):I;return n(ft.translate(F[0],F[1]).scale(V.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof k=="function"?-k.apply(this,arguments):-k),A,i)},I,B)};function C(S,L){return L=Math.max(o[0],Math.min(o[1],L)),L===S.k?S:new st(L,S.x,S.y)}function v(S,L,k){var I=L[0]-k[0]*S.k,B=L[1]-k[1]*S.k;return I===S.x&&B===S.y?S:new st(S.k,I,B)}function R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function b(S,L,k,I){S.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var B=this,A=arguments,V=_(B,A).event(I),F=t.apply(B,A),H=k==null?R(F):typeof k=="function"?k.apply(B,A):k,G=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),U=B.__zoom,Q=typeof L=="function"?L.apply(B,A):L,ie=a(U.invert(H).concat(G/U.k),Q.invert(H).concat(G/Q.k));return function(le){if(le===1)le=Q;else{var de=ie(le),he=G/de[2];le=new st(he,H[0]-de[0]*he,H[1]-de[1]*he)}V.zoom(null,le)}})}function _(S,L,k){return!k&&S.__zooming||new $(S,L)}function $(S,L){this.that=S,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,L),this.taps=0}$.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,L){return this.mouse&&S!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var L=Ze(this.that).datum();d.call(S,this.that,new Jy(S,{sourceEvent:this.sourceEvent,target:j,type:S,transform:this.that.__zoom,dispatch:d}),L)}};function O(S,...L){if(!e.apply(this,arguments))return;var k=_(this,L).event(S),I=this.__zoom,B=Math.max(o[0],Math.min(o[1],I.k*Math.pow(2,s.apply(this,arguments)))),A=Xe(S);if(k.wheel)(k.mouse[0][0]!==A[0]||k.mouse[0][1]!==A[1])&&(k.mouse[1]=I.invert(k.mouse[0]=A)),clearTimeout(k.wheel);else{if(I.k===B)return;k.mouse=[A,I.invert(A)],Jn(this),k.start()}pn(S),k.wheel=setTimeout(V,E),k.zoom("mouse",n(v(C(I,B),k.mouse[0],k.mouse[1]),k.extent,i));function V(){k.wheel=null,k.end()}}function N(S,...L){if(m||!e.apply(this,arguments))return;var k=S.currentTarget,I=_(this,L,!0).event(S),B=Ze(S.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",G,!0),A=Xe(S,k),V=S.clientX,F=S.clientY;dc(S.view),Qs(S),I.mouse=[A,this.__zoom.invert(A)],Jn(this),I.start();function H(U){if(pn(U),!I.moved){var Q=U.clientX-V,ie=U.clientY-F;I.moved=Q*Q+ie*ie>y}I.event(U).zoom("mouse",n(v(I.that.__zoom,I.mouse[0]=Xe(U,k),I.mouse[1]),I.extent,i))}function G(U){B.on("mousemove.zoom mouseup.zoom",null),xc(U.view,I.moved),pn(U),I.event(U).end()}}function D(S,...L){if(e.apply(this,arguments)){var k=this.__zoom,I=Xe(S.changedTouches?S.changedTouches[0]:S,this),B=k.invert(I),A=k.k*(S.shiftKey?.5:2),V=n(v(C(k,A),I,B),t.apply(this,L),i);pn(S),c>0?Ze(this).transition().duration(c).call(b,V,I,S):Ze(this).call(j.transform,V,I,S)}}function T(S,...L){if(e.apply(this,arguments)){var k=S.touches,I=k.length,B=_(this,L,S.changedTouches.length===I).event(S),A,V,F,H;for(Qs(S),V=0;V<I;++V)F=k[V],H=Xe(F,this),H=[H,this.__zoom.invert(H),F.identifier],B.touch0?!B.touch1&&B.touch0[2]!==H[2]&&(B.touch1=H,B.taps=0):(B.touch0=H,A=!0,B.taps=1+!!u);u&&(u=clearTimeout(u)),A&&(B.taps<2&&(p=H[0],u=setTimeout(function(){u=null},h)),Jn(this),B.start())}}function M(S,...L){if(this.__zooming){var k=_(this,L).event(S),I=S.changedTouches,B=I.length,A,V,F,H;for(pn(S),A=0;A<B;++A)V=I[A],F=Xe(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=F:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=F);if(V=k.that.__zoom,k.touch1){var G=k.touch0[0],U=k.touch0[1],Q=k.touch1[0],ie=k.touch1[1],le=(le=Q[0]-G[0])*le+(le=Q[1]-G[1])*le,de=(de=ie[0]-U[0])*de+(de=ie[1]-U[1])*de;V=C(V,Math.sqrt(le/de)),F=[(G[0]+Q[0])/2,(G[1]+Q[1])/2],H=[(U[0]+ie[0])/2,(U[1]+ie[1])/2]}else if(k.touch0)F=k.touch0[0],H=k.touch0[1];else return;k.zoom("touch",n(v(V,F,H),k.extent,i))}}function z(S,...L){if(this.__zooming){var k=_(this,L).event(S),I=S.changedTouches,B=I.length,A,V;for(Qs(S),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),A=0;A<B;++A)V=I[A],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=Xe(V,this),Math.hypot(p[0]-V[0],p[1]-V[1])<w)){var F=Ze(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return j.wheelDelta=function(S){return arguments.length?(s=typeof S=="function"?S:In(+S),j):s},j.filter=function(S){return arguments.length?(e=typeof S=="function"?S:In(!!S),j):e},j.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:In(!!S),j):r},j.extent=function(S){return arguments.length?(t=typeof S=="function"?S:In([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),j):t},j.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],j):[o[0],o[1]]},j.translateExtent=function(S){return arguments.length?(i[0][0]=+S[0][0],i[1][0]=+S[1][0],i[0][1]=+S[0][1],i[1][1]=+S[1][1],j):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},j.constrain=function(S){return arguments.length?(n=S,j):n},j.duration=function(S){return arguments.length?(c=+S,j):c},j.interpolate=function(S){return arguments.length?(a=S,j):a},j.on=function(){var S=d.on.apply(d,arguments);return S===d?j:S},j.clickDistance=function(S){return arguments.length?(y=(S=+S)*S,j):Math.sqrt(y)},j.tapDistance=function(S){return arguments.length?(w=+S,j):w},j}const As=f.createContext(null),iS=As.Provider,De={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Ec=De.error001();function ye(e,t){const n=f.useContext(As);if(n===null)throw new Error(Ec);return Ql(n,e,t)}const we=()=>{const e=f.useContext(As);if(e===null)throw new Error(Ec);return f.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},lS=e=>e.userSelectionActive?"none":"all";function cS({position:e,children:t,className:n,style:s,...r}){const o=ye(lS),i=`${e}`.split("-");return f.createElement("div",{className:ze(["react-flow__panel",n,...i]),style:{...s,pointerEvents:o},...r},t)}function aS({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.createElement(cS,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},f.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const uS=({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:o={},labelBgPadding:i=[2,4],labelBgBorderRadius:c=2,children:a,className:d,...u})=>{const p=f.useRef(null),[m,h]=f.useState({x:0,y:0,width:0,height:0}),E=ze(["react-flow__edge-textwrapper",d]);return f.useEffect(()=>{if(p.current){const y=p.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),typeof n>"u"||!n?null:f.createElement("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:E,visibility:m.width?"visible":"hidden",...u},r&&f.createElement("rect",{width:m.width+2*i[0],x:-i[0],y:-i[1],height:m.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),f.createElement("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:p,style:s},n),a)};var dS=f.memo(uS);const so=e=>({width:e.offsetWidth,height:e.offsetHeight}),en=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ro=(e={x:0,y:0},t)=>({x:en(e.x,t[0][0],t[1][0]),y:en(e.y,t[0][1],t[1][1])}),si=(e,t,n)=>e<t?en(Math.abs(e-t),1,50)/50:e>n?-en(Math.abs(e-n),1,50)/50:0,jc=(e,t)=>{const n=si(e.x,35,t.width-35)*20,s=si(e.y,35,t.height-35)*20;return[n,s]},Rc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},xS=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),oo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),fS=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),ri=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Sr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},pS=e=>Ve(e.width)&&Ve(e.height)&&Ve(e.x)&&Ve(e.y),Ve=e=>!isNaN(e)&&isFinite(e),ge=Symbol.for("internals"),bc=["Enter"," ","Escape"],ms=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},mS=e=>"nativeEvent"in e;function Er(e){var r,o;const t=mS(e)?e.nativeEvent:e,n=((o=(r=t.composedPath)==null?void 0:r.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const wc=e=>"clientX"in e,pt=(e,t)=>{var o,i;const n=wc(e),s=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,r=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},hs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},$t=({id:e,path:t,labelX:n,labelY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h=20})=>f.createElement(f.Fragment,null,f.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:m}),h&&f.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),r&&Ve(n)&&Ve(s)?f.createElement(dS,{x:n,y:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d}):null);$t.displayName="BaseEdge";function mn(e,t,n){return n===void 0?n:s=>{const r=t().edges.find(o=>o.id===e);r&&n(s,{...r})}}function Cc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,o=n<e?n+r:n-r,i=Math.abs(s-t)/2,c=s<t?s+i:s-i;return[o,c,r,i]}function vc({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:o,targetControlX:i,targetControlY:c}){const a=e*.125+r*.375+i*.375+n*.125,d=t*.125+o*.375+c*.375+s*.125,u=Math.abs(a-e),p=Math.abs(d-t);return[a,d,u,p]}var ht;(function(e){e.Strict="strict",e.Loose="loose"})(ht||(ht={}));var kt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(kt||(kt={}));var tn;(function(e){e.Partial="partial",e.Full="full"})(tn||(tn={}));var ut;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ut||(ut={}));var gs;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gs||(gs={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));function oi({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Y.Left||e===Y.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function _c({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top}){const[i,c]=oi({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,d]=oi({pos:o,x1:s,y1:r,x2:e,y2:t}),[u,p,m,h]=vc({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:i,sourceControlY:c,targetControlX:a,targetControlY:d});return[`M${e},${t} C${i},${c} ${a},${d} ${s},${r}`,u,p,m,h]}const io=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,sourcePosition:r=Y.Bottom,targetPosition:o=Y.Top,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:y})=>{const[w,j,C]=_c({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:s,targetPosition:o});return f.createElement($t,{path:w,labelX:j,labelY:C,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:y})});io.displayName="SimpleBezierEdge";const ii={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},hS=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},li=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gS({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:s=Y.Top,center:r,offset:o}){const i=ii[t],c=ii[s],a={x:e.x+i.x*o,y:e.y+i.y*o},d={x:n.x+c.x*o,y:n.y+c.y*o},u=hS({source:a,sourcePosition:t,target:d}),p=u.x!==0?"x":"y",m=u[p];let h=[],E,y;const w={x:0,y:0},j={x:0,y:0},[C,v,R,b]=Cc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[p]*c[p]===-1){E=r.x??C,y=r.y??v;const $=[{x:E,y:a.y},{x:E,y:d.y}],O=[{x:a.x,y},{x:d.x,y}];i[p]===m?h=p==="x"?$:O:h=p==="x"?O:$}else{const $=[{x:a.x,y:d.y}],O=[{x:d.x,y:a.y}];if(p==="x"?h=i.x===m?O:$:h=i.y===m?$:O,t===s){const z=Math.abs(e[p]-n[p]);if(z<=o){const S=Math.min(o-1,o-z);i[p]===m?w[p]=(a[p]>e[p]?-1:1)*S:j[p]=(d[p]>n[p]?-1:1)*S}}if(t!==s){const z=p==="x"?"y":"x",S=i[p]===c[z],L=a[z]>d[z],k=a[z]<d[z];(i[p]===1&&(!S&&L||S&&k)||i[p]!==1&&(!S&&k||S&&L))&&(h=p==="x"?$:O)}const N={x:a.x+w.x,y:a.y+w.y},D={x:d.x+j.x,y:d.y+j.y},T=Math.max(Math.abs(N.x-h[0].x),Math.abs(D.x-h[0].x)),M=Math.max(Math.abs(N.y-h[0].y),Math.abs(D.y-h[0].y));T>=M?(E=(N.x+D.x)/2,y=h[0].y):(E=h[0].x,y=(N.y+D.y)/2)}return[[e,{x:a.x+w.x,y:a.y+w.y},...h,{x:d.x+j.x,y:d.y+j.y},n],E,y,R,b]}function yS(e,t,n,s){const r=Math.min(li(e,t)/2,li(t,n)/2,s),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const d=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+r*d},${i}Q ${o},${i} ${o},${i+r*u}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${i+r*a}Q ${o},${i} ${o+r*c},${i}`}function jr({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top,borderRadius:i=5,centerX:c,centerY:a,offset:d=20}){const[u,p,m,h,E]=gS({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:o,center:{x:c,y:a},offset:d});return[u.reduce((w,j,C)=>{let v="";return C>0&&C<u.length-1?v=yS(u[C-1],j,u[C+1],i):v=`${C===0?"M":"L"}${j.x} ${j.y}`,w+=v,w},""),p,m,h,E]}const Ls=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,sourcePosition:p=Y.Bottom,targetPosition:m=Y.Top,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:w})=>{const[j,C,v]=jr({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:s,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset});return f.createElement($t,{path:j,labelX:C,labelY:v,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:h,markerStart:E,interactionWidth:w})});Ls.displayName="SmoothStepEdge";const lo=f.memo(e=>{var t;return f.createElement(Ls,{...e,pathOptions:f.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});lo.displayName="StepEdge";function SS({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,o,i,c]=Cc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,o,i,c]}const co=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h})=>{const[E,y,w]=SS({sourceX:e,sourceY:t,targetX:n,targetY:s});return f.createElement($t,{path:E,labelX:y,labelY:w,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:d,style:u,markerEnd:p,markerStart:m,interactionWidth:h})});co.displayName="StraightEdge";function Vn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ci({pos:e,x1:t,y1:n,x2:s,y2:r,c:o}){switch(e){case Y.Left:return[t-Vn(t-s,o),n];case Y.Right:return[t+Vn(s-t,o),n];case Y.Top:return[t,n-Vn(n-r,o)];case Y.Bottom:return[t,n+Vn(r-n,o)]}}function kc({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:s,targetY:r,targetPosition:o=Y.Top,curvature:i=.25}){const[c,a]=ci({pos:n,x1:e,y1:t,x2:s,y2:r,c:i}),[d,u]=ci({pos:o,x1:s,y1:r,x2:e,y2:t,c:i}),[p,m,h,E]=vc({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:d,targetControlY:u});return[`M${e},${t} C${c},${a} ${d},${u} ${s},${r}`,p,m,h,E]}const ys=f.memo(({sourceX:e,sourceY:t,targetX:n,targetY:s,sourcePosition:r=Y.Bottom,targetPosition:o=Y.Top,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:w})=>{const[j,C,v]=kc({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:s,targetPosition:o,curvature:y==null?void 0:y.curvature});return f.createElement($t,{path:j,labelX:C,labelY:v,label:i,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:E,interactionWidth:w})});ys.displayName="BezierEdge";const ao=f.createContext(null),ES=ao.Provider;ao.Consumer;const jS=()=>f.useContext(ao),RS=e=>"id"in e&&"source"in e&&"target"in e,Pc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`reactflow__edge-${e}${t||""}-${n}${s||""}`,Rr=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,bS=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Nc=(e,t)=>{if(!e.source||!e.target)return ms("006",De.error006()),t;let n;return RS(e)?n={...e}:n={...e,id:Pc(e)},bS(n,t)?t:t.concat(n)},wS=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...o}=e;if(!t.source||!t.target)return ms("006",De.error006()),n;if(!n.find(a=>a.id===r))return ms("007",De.error007(r)),n;const c={...o,id:s.shouldReplaceId?Pc(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)},br=({x:e,y:t},[n,s,r],o,[i,c])=>{const a={x:(e-n)/r,y:(t-s)/r};return o?{x:i*Math.round(a.x/i),y:c*Math.round(a.y/c)}:a},Mc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),Wt=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],s=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-s};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-s}:r}},uo=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const{x:o,y:i}=Wt(r,t).positionAbsolute;return xS(s,oo({x:o,y:i,width:r.width||0,height:r.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fS(n)},Tc=(e,t,[n,s,r]=[0,0,1],o=!1,i=!1,c=[0,0])=>{const a={x:(t.x-n)/r,y:(t.y-s)/r,width:t.width/r,height:t.height/r},d=[];return e.forEach(u=>{const{width:p,height:m,selectable:h=!0,hidden:E=!1}=u;if(i&&!h||E)return!1;const{positionAbsolute:y}=Wt(u,c),w={x:y.x,y:y.y,width:p||0,height:m||0},j=Sr(a,w),C=typeof p>"u"||typeof m>"u"||p===null||m===null,v=o&&j>0,R=(p||0)*(m||0);(C||v||j>=R||u.dragging)&&d.push(u)}),d},Ac=(e,t)=>{const n=e.map(s=>s.id);return t.filter(s=>n.includes(s.source)||n.includes(s.target))},Lc=(e,t,n,s,r,o=.1)=>{const i=t/(e.width*(1+o)),c=n/(e.height*(1+o)),a=Math.min(i,c),d=en(a,s,r),u=e.x+e.width/2,p=e.y+e.height/2,m=t/2-u*d,h=n/2-p*d;return{x:m,y:h,zoom:d}},_t=(e,t=0)=>e.transition().duration(t);function ai(e,t,n,s){return(t[n]||[]).reduce((r,o)=>{var i,c;return`${e.id}-${o.id}-${n}`!==s&&r.push({id:o.id||null,type:n,nodeId:e.id,x:(((i=e.positionAbsolute)==null?void 0:i.x)??0)+o.x+o.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+o.y+o.height/2}),r},[])}function CS(e,t,n,s,r,o){const{x:i,y:c}=pt(e),d=t.elementsFromPoint(i,c).find(E=>E.classList.contains("react-flow__handle"));if(d){const E=d.getAttribute("data-nodeid");if(E){const y=xo(void 0,d),w=d.getAttribute("data-handleid"),j=o({nodeId:E,id:w,type:y});if(j){const C=r.find(v=>v.nodeId===E&&v.type===y&&v.id===w);return{handle:{id:w,type:y,nodeId:E,x:(C==null?void 0:C.x)||n.x,y:(C==null?void 0:C.y)||n.y},validHandleResult:j}}}}let u=[],p=1/0;if(r.forEach(E=>{const y=Math.sqrt((E.x-n.x)**2+(E.y-n.y)**2);if(y<=s){const w=o(E);y<=p&&(y<p?u=[{handle:E,validHandleResult:w}]:y===p&&u.push({handle:E,validHandleResult:w}),p=y)}}),!u.length)return{handle:null,validHandleResult:$c()};if(u.length===1)return u[0];const m=u.some(({validHandleResult:E})=>E.isValid),h=u.some(({handle:E})=>E.type==="target");return u.find(({handle:E,validHandleResult:y})=>h?E.type==="target":m?y.isValid:!0)||u[0]}const vS={source:null,target:null,sourceHandle:null,targetHandle:null},$c=()=>({handleDomNode:null,isValid:!1,connection:vS,endHandle:null});function Oc(e,t,n,s,r,o,i){const c=r==="target",a=i.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),d={...$c(),handleDomNode:a};if(a){const u=xo(void 0,a),p=a.getAttribute("data-nodeid"),m=a.getAttribute("data-handleid"),h=a.classList.contains("connectable"),E=a.classList.contains("connectableend"),y={source:c?p:n,sourceHandle:c?m:s,target:c?n:p,targetHandle:c?s:m};d.connection=y,h&&E&&(t===ht.Strict?c&&u==="source"||!c&&u==="target":p!==n||m!==s)&&(d.endHandle={nodeId:p,handleId:m,type:u},d.isValid=o(y))}return d}function _S({nodes:e,nodeId:t,handleId:n,handleType:s}){return e.reduce((r,o)=>{if(o[ge]){const{handleBounds:i}=o[ge];let c=[],a=[];i&&(c=ai(o,i,"source",`${t}-${n}-${s}`),a=ai(o,i,"target",`${t}-${n}-${s}`)),r.push(...c,...a)}return r},[])}function xo(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Js(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function kS(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Dc({event:e,handleId:t,nodeId:n,onConnect:s,isTarget:r,getState:o,setState:i,isValidConnection:c,edgeUpdaterType:a,onReconnectEnd:d}){const u=Rc(e.target),{connectionMode:p,domNode:m,autoPanOnConnect:h,connectionRadius:E,onConnectStart:y,panBy:w,getNodes:j,cancelConnection:C}=o();let v=0,R;const{x:b,y:_}=pt(e),$=u==null?void 0:u.elementFromPoint(b,_),O=xo(a,$),N=m==null?void 0:m.getBoundingClientRect();if(!N||!O)return;let D,T=pt(e,N),M=!1,z=null,S=!1,L=null;const k=_S({nodes:j(),nodeId:n,handleId:t,handleType:O}),I=()=>{if(!h)return;const[V,F]=jc(T,N);w({x:V,y:F}),v=requestAnimationFrame(I)};i({connectionPosition:T,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:O,connectionStartHandle:{nodeId:n,handleId:t,type:O},connectionEndHandle:null}),y==null||y(e,{nodeId:n,handleId:t,handleType:O});function B(V){const{transform:F}=o();T=pt(V,N);const{handle:H,validHandleResult:G}=CS(V,u,br(T,F,!1,[1,1]),E,k,U=>Oc(U,p,n,t,r?"target":"source",c,u));if(R=H,M||(I(),M=!0),L=G.handleDomNode,z=G.connection,S=G.isValid,i({connectionPosition:R&&S?Mc({x:R.x,y:R.y},F):T,connectionStatus:kS(!!R,S),connectionEndHandle:G.endHandle}),!R&&!S&&!L)return Js(D);z.source!==z.target&&L&&(Js(D),D=L,L.classList.add("connecting","react-flow__handle-connecting"),L.classList.toggle("valid",S),L.classList.toggle("react-flow__handle-valid",S))}function A(V){var F,H;(R||L)&&z&&S&&(s==null||s(z)),(H=(F=o()).onConnectEnd)==null||H.call(F,V),a&&(d==null||d(V)),Js(D),C(),cancelAnimationFrame(v),M=!1,S=!1,z=null,L=null,u.removeEventListener("mousemove",B),u.removeEventListener("mouseup",A),u.removeEventListener("touchmove",B),u.removeEventListener("touchend",A)}u.addEventListener("mousemove",B),u.addEventListener("mouseup",A),u.addEventListener("touchmove",B),u.addEventListener("touchend",A)}const ui=()=>!0,PS=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),NS=(e,t,n)=>s=>{const{connectionStartHandle:r,connectionEndHandle:o,connectionClickStartHandle:i}=s;return{connecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.handleId)===t&&(r==null?void 0:r.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n}},zc=f.forwardRef(({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:o=!0,id:i,onConnect:c,children:a,className:d,onMouseDown:u,onTouchStart:p,...m},h)=>{var N,D;const E=i||null,y=e==="target",w=we(),j=jS(),{connectOnClick:C,noPanClassName:v}=ye(PS,Ne),{connecting:R,clickConnecting:b}=ye(NS(j,E,e),Ne);j||(D=(N=w.getState()).onError)==null||D.call(N,"010",De.error010());const _=T=>{const{defaultEdgeOptions:M,onConnect:z,hasDefaultEdges:S}=w.getState(),L={...M,...T};if(S){const{edges:k,setEdges:I}=w.getState();I(Nc(L,k))}z==null||z(L),c==null||c(L)},$=T=>{if(!j)return;const M=wc(T);r&&(M&&T.button===0||!M)&&Dc({event:T,handleId:E,nodeId:j,onConnect:_,isTarget:y,getState:w.getState,setState:w.setState,isValidConnection:n||w.getState().isValidConnection||ui}),M?u==null||u(T):p==null||p(T)},O=T=>{const{onClickConnectStart:M,onClickConnectEnd:z,connectionClickStartHandle:S,connectionMode:L,isValidConnection:k}=w.getState();if(!j||!S&&!r)return;if(!S){M==null||M(T,{nodeId:j,handleId:E,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:j,type:e,handleId:E}});return}const I=Rc(T.target),B=n||k||ui,{connection:A,isValid:V}=Oc({nodeId:j,id:E,type:e},L,S.nodeId,S.handleId||null,S.type,B,I);V&&_(A),z==null||z(T),w.setState({connectionClickStartHandle:null})};return f.createElement("div",{"data-handleid":E,"data-nodeid":j,"data-handlepos":t,"data-id":`${j}-${E}-${e}`,className:ze(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",v,d,{source:!y,target:y,connectable:s,connectablestart:r,connectableend:o,connecting:b,connectionindicator:s&&(r&&!R||o&&R)}]),onMouseDown:$,onTouchStart:$,onClick:C?O:void 0,ref:h,...m},a)});zc.displayName="Handle";var Pn=f.memo(zc);const Bc=({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:s=Y.Bottom})=>f.createElement(f.Fragment,null,f.createElement(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.createElement(Pn,{type:"source",position:s,isConnectable:t}));Bc.displayName="DefaultNode";var wr=f.memo(Bc);const Ic=({data:e,isConnectable:t,sourcePosition:n=Y.Bottom})=>f.createElement(f.Fragment,null,e==null?void 0:e.label,f.createElement(Pn,{type:"source",position:n,isConnectable:t}));Ic.displayName="InputNode";var Vc=f.memo(Ic);const Fc=({data:e,isConnectable:t,targetPosition:n=Y.Top})=>f.createElement(f.Fragment,null,f.createElement(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Fc.displayName="OutputNode";var Zc=f.memo(Fc);const fo=()=>null;fo.displayName="GroupNode";const MS=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Fn=e=>e.id;function TS(e,t){return Ne(e.selectedNodes.map(Fn),t.selectedNodes.map(Fn))&&Ne(e.selectedEdges.map(Fn),t.selectedEdges.map(Fn))}const Hc=f.memo(({onSelectionChange:e})=>{const t=we(),{selectedNodes:n,selectedEdges:s}=ye(MS,TS);return f.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChange.forEach(o=>o(r))},[n,s,e]),null});Hc.displayName="SelectionListener";const AS=e=>!!e.onSelectionChange;function LS({onSelectionChange:e}){const t=ye(AS);return e||t?f.createElement(Hc,{onSelectionChange:e}):null}const $S=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ft(e,t){f.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function te(e,t,n){f.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const OS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:r,onConnectStart:o,onConnectEnd:i,onClickConnectStart:c,onClickConnectEnd:a,nodesDraggable:d,nodesConnectable:u,nodesFocusable:p,edgesFocusable:m,edgesUpdatable:h,elevateNodesOnSelect:E,minZoom:y,maxZoom:w,nodeExtent:j,onNodesChange:C,onEdgesChange:v,elementsSelectable:R,connectionMode:b,snapGrid:_,snapToGrid:$,translateExtent:O,connectOnClick:N,defaultEdgeOptions:D,fitView:T,fitViewOptions:M,onNodesDelete:z,onEdgesDelete:S,onNodeDrag:L,onNodeDragStart:k,onNodeDragStop:I,onSelectionDrag:B,onSelectionDragStart:A,onSelectionDragStop:V,noPanClassName:F,nodeOrigin:H,rfId:G,autoPanOnConnect:U,autoPanOnNodeDrag:Q,onError:ie,connectionRadius:le,isValidConnection:de,nodeDragThreshold:he})=>{const{setNodes:xe,setEdges:Le,setDefaultNodesAndEdges:W,setMinZoom:ce,setMaxZoom:fe,setTranslateExtent:pe,setNodeExtent:Be,reset:me}=ye($S,Ne),K=we();return f.useEffect(()=>{const $e=s==null?void 0:s.map(Et=>({...Et,...D}));return W(n,$e),()=>{me()}},[]),te("defaultEdgeOptions",D,K.setState),te("connectionMode",b,K.setState),te("onConnect",r,K.setState),te("onConnectStart",o,K.setState),te("onConnectEnd",i,K.setState),te("onClickConnectStart",c,K.setState),te("onClickConnectEnd",a,K.setState),te("nodesDraggable",d,K.setState),te("nodesConnectable",u,K.setState),te("nodesFocusable",p,K.setState),te("edgesFocusable",m,K.setState),te("edgesUpdatable",h,K.setState),te("elementsSelectable",R,K.setState),te("elevateNodesOnSelect",E,K.setState),te("snapToGrid",$,K.setState),te("snapGrid",_,K.setState),te("onNodesChange",C,K.setState),te("onEdgesChange",v,K.setState),te("connectOnClick",N,K.setState),te("fitViewOnInit",T,K.setState),te("fitViewOnInitOptions",M,K.setState),te("onNodesDelete",z,K.setState),te("onEdgesDelete",S,K.setState),te("onNodeDrag",L,K.setState),te("onNodeDragStart",k,K.setState),te("onNodeDragStop",I,K.setState),te("onSelectionDrag",B,K.setState),te("onSelectionDragStart",A,K.setState),te("onSelectionDragStop",V,K.setState),te("noPanClassName",F,K.setState),te("nodeOrigin",H,K.setState),te("rfId",G,K.setState),te("autoPanOnConnect",U,K.setState),te("autoPanOnNodeDrag",Q,K.setState),te("onError",ie,K.setState),te("connectionRadius",le,K.setState),te("isValidConnection",de,K.setState),te("nodeDragThreshold",he,K.setState),Ft(e,xe),Ft(t,Le),Ft(y,ce),Ft(w,fe),Ft(O,pe),Ft(j,Be),null},di={display:"none"},DS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},qc="react-flow__node-desc",Yc="react-flow__edge-desc",zS="react-flow__aria-live",BS=e=>e.ariaLiveMessage;function IS({rfId:e}){const t=ye(BS);return f.createElement("div",{id:`${zS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DS},t)}function VS({rfId:e,disableKeyboardA11y:t}){return f.createElement(f.Fragment,null,f.createElement("div",{id:`${qc}-${e}`,style:di},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),f.createElement("div",{id:`${Yc}-${e}`,style:di},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&f.createElement(IS,{rfId:e}))}var Nn=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,s]=f.useState(!1),r=f.useRef(!1),o=f.useRef(new Set([])),[i,c]=f.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),u=d.reduce((p,m)=>p.concat(...m),[]);return[d,u]}return[[],[]]},[e]);return f.useEffect(()=>{const a=typeof document<"u"?document:null,d=(t==null?void 0:t.target)||a;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Er(h))return!1;const y=fi(h.code,c);o.current.add(h[y]),xi(i,o.current,!1)&&(h.preventDefault(),s(!0))},p=h=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Er(h))return!1;const y=fi(h.code,c);xi(i,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(h[y]),h.key==="Meta"&&o.current.clear(),r.current=!1},m=()=>{o.current.clear(),s(!1)};return d==null||d.addEventListener("keydown",u),d==null||d.addEventListener("keyup",p),window.addEventListener("blur",m),()=>{d==null||d.removeEventListener("keydown",u),d==null||d.removeEventListener("keyup",p),window.removeEventListener("blur",m)}}},[e,s]),n};function xi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function fi(e,t){return t.includes(e)?"code":"key"}function Uc(e,t,n,s){var c,a;const r=e.parentNode||e.parentId;if(!r)return n;const o=t.get(r),i=Wt(o,s);return Uc(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((c=o[ge])==null?void 0:c.z)??0)>(n.z??0)?((a=o[ge])==null?void 0:a.z)??0:n.z??0},s)}function Gc(e,t,n){e.forEach(s=>{var o;const r=s.parentNode||s.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[s.id]){const{x:i,y:c,z:a}=Uc(s,e,{...s.position,z:((o=s[ge])==null?void 0:o.z)??0},t);s.positionAbsolute={x:i,y:c},s[ge].z=a,n!=null&&n[s.id]&&(s[ge].isParent=!0)}})}function er(e,t,n,s){const r=new Map,o={},i=s?1e3:0;return e.forEach(c=>{var h;const a=(Ve(c.zIndex)?c.zIndex:0)+(c.selected?i:0),d=t.get(c.id),u={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},p=c.parentNode||c.parentId;p&&(o[p]=!0);const m=(d==null?void 0:d.type)&&(d==null?void 0:d.type)!==c.type;Object.defineProperty(u,ge,{enumerable:!1,value:{handleBounds:m||(h=d==null?void 0:d[ge])==null?void 0:h.handleBounds,z:a}}),r.set(c.id,u)}),Gc(r,n,o),r}function Wc(e,t={}){const{getNodes:n,width:s,height:r,minZoom:o,maxZoom:i,d3Zoom:c,d3Selection:a,fitViewOnInitDone:d,fitViewOnInit:u,nodeOrigin:p}=e(),m=t.initial&&!d&&u;if(c&&a&&(m||!t.initial)){const E=n().filter(w=>{var C;const j=t.includeHiddenNodes?w.width&&w.height:!w.hidden;return(C=t.nodes)!=null&&C.length?j&&t.nodes.some(v=>v.id===w.id):j}),y=E.every(w=>w.width&&w.height);if(E.length>0&&y){const w=uo(E,p),{x:j,y:C,zoom:v}=Lc(w,s,r,t.minZoom??o,t.maxZoom??i,t.padding??.1),R=ft.translate(j,C).scale(v);return typeof t.duration=="number"&&t.duration>0?c.transform(_t(a,t.duration),R):c.transform(a,R),!0}}return!1}function FS(e,t){return e.forEach(n=>{const s=t.get(n.id);s&&t.set(s.id,{...s,[ge]:s[ge],selected:n.selected})}),new Map(t)}function ZS(e,t){return t.map(n=>{const s=e.find(r=>r.id===n.id);return s&&(n.selected=s.selected),n})}function Zn({changedNodes:e,changedEdges:t,get:n,set:s}){const{nodeInternals:r,edges:o,onNodesChange:i,onEdgesChange:c,hasDefaultNodes:a,hasDefaultEdges:d}=n();e!=null&&e.length&&(a&&s({nodeInternals:FS(e,r)}),i==null||i(e)),t!=null&&t.length&&(d&&s({edges:ZS(t,o)}),c==null||c(t))}const Zt=()=>{},HS={zoomIn:Zt,zoomOut:Zt,zoomTo:Zt,getZoom:()=>1,setViewport:Zt,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Zt,fitBounds:Zt,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},qS=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),YS=()=>{const e=we(),{d3Zoom:t,d3Selection:n}=ye(qS,Ne);return f.useMemo(()=>n&&t?{zoomIn:r=>t.scaleBy(_t(n,r==null?void 0:r.duration),1.2),zoomOut:r=>t.scaleBy(_t(n,r==null?void 0:r.duration),1/1.2),zoomTo:(r,o)=>t.scaleTo(_t(n,o==null?void 0:o.duration),r),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,c,a]=e.getState().transform,d=ft.translate(r.x??i,r.y??c).scale(r.zoom??a);t.transform(_t(n,o==null?void 0:o.duration),d)},getViewport:()=>{const[r,o,i]=e.getState().transform;return{x:r,y:o,zoom:i}},fitView:r=>Wc(e.getState,r),setCenter:(r,o,i)=>{const{width:c,height:a,maxZoom:d}=e.getState(),u=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:d,p=c/2-r*u,m=a/2-o*u,h=ft.translate(p,m).scale(u);t.transform(_t(n,i==null?void 0:i.duration),h)},fitBounds:(r,o)=>{const{width:i,height:c,minZoom:a,maxZoom:d}=e.getState(),{x:u,y:p,zoom:m}=Lc(r,i,c,a,d,(o==null?void 0:o.padding)??.1),h=ft.translate(u,p).scale(m);t.transform(_t(n,o==null?void 0:o.duration),h)},project:r=>{const{transform:o,snapToGrid:i,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),br(r,o,i,c)},screenToFlowPosition:r=>{const{transform:o,snapToGrid:i,snapGrid:c,domNode:a}=e.getState();if(!a)return r;const{x:d,y:u}=a.getBoundingClientRect(),p={x:r.x-d,y:r.y-u};return br(p,o,i,c)},flowToScreenPosition:r=>{const{transform:o,domNode:i}=e.getState();if(!i)return r;const{x:c,y:a}=i.getBoundingClientRect(),d=Mc(r,o);return{x:d.x+c,y:d.y+a}},viewportInitialized:!0}:HS,[t,n])};function rt(){const e=YS(),t=we(),n=f.useCallback(()=>t.getState().getNodes().map(y=>({...y})),[]),s=f.useCallback(y=>t.getState().nodeInternals.get(y),[]),r=f.useCallback(()=>{const{edges:y=[]}=t.getState();return y.map(w=>({...w}))},[]),o=f.useCallback(y=>{const{edges:w=[]}=t.getState();return w.find(j=>j.id===y)},[]),i=f.useCallback(y=>{const{getNodes:w,setNodes:j,hasDefaultNodes:C,onNodesChange:v}=t.getState(),R=w(),b=typeof y=="function"?y(R):y;if(C)j(b);else if(v){const _=b.length===0?R.map($=>({type:"remove",id:$.id})):b.map($=>({item:$,type:"reset"}));v(_)}},[]),c=f.useCallback(y=>{const{edges:w=[],setEdges:j,hasDefaultEdges:C,onEdgesChange:v}=t.getState(),R=typeof y=="function"?y(w):y;if(C)j(R);else if(v){const b=R.length===0?w.map(_=>({type:"remove",id:_.id})):R.map(_=>({item:_,type:"reset"}));v(b)}},[]),a=f.useCallback(y=>{const w=Array.isArray(y)?y:[y],{getNodes:j,setNodes:C,hasDefaultNodes:v,onNodesChange:R}=t.getState();if(v){const _=[...j(),...w];C(_)}else if(R){const b=w.map(_=>({item:_,type:"add"}));R(b)}},[]),d=f.useCallback(y=>{const w=Array.isArray(y)?y:[y],{edges:j=[],setEdges:C,hasDefaultEdges:v,onEdgesChange:R}=t.getState();if(v)C([...j,...w]);else if(R){const b=w.map(_=>({item:_,type:"add"}));R(b)}},[]),u=f.useCallback(()=>{const{getNodes:y,edges:w=[],transform:j}=t.getState(),[C,v,R]=j;return{nodes:y().map(b=>({...b})),edges:w.map(b=>({...b})),viewport:{x:C,y:v,zoom:R}}},[]),p=f.useCallback(({nodes:y,edges:w})=>{const{nodeInternals:j,getNodes:C,edges:v,hasDefaultNodes:R,hasDefaultEdges:b,onNodesDelete:_,onEdgesDelete:$,onNodesChange:O,onEdgesChange:N}=t.getState(),D=(y||[]).map(L=>L.id),T=(w||[]).map(L=>L.id),M=C().reduce((L,k)=>{const I=k.parentNode||k.parentId,B=!D.includes(k.id)&&I&&L.find(V=>V.id===I);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(D.includes(k.id)||B)&&L.push(k),L},[]),z=v.filter(L=>typeof L.deletable=="boolean"?L.deletable:!0),S=z.filter(L=>T.includes(L.id));if(M||S){const L=Ac(M,z),k=[...S,...L],I=k.reduce((B,A)=>(B.includes(A.id)||B.push(A.id),B),[]);if((b||R)&&(b&&t.setState({edges:v.filter(B=>!I.includes(B.id))}),R&&(M.forEach(B=>{j.delete(B.id)}),t.setState({nodeInternals:new Map(j)}))),I.length>0&&($==null||$(k),N&&N(I.map(B=>({id:B,type:"remove"})))),M.length>0&&(_==null||_(M),O)){const B=M.map(A=>({id:A.id,type:"remove"}));O(B)}}},[]),m=f.useCallback(y=>{const w=pS(y),j=w?null:t.getState().nodeInternals.get(y.id);return!w&&!j?[null,null,w]:[w?y:ri(j),j,w]},[]),h=f.useCallback((y,w=!0,j)=>{const[C,v,R]=m(y);return C?(j||t.getState().getNodes()).filter(b=>{if(!R&&(b.id===v.id||!b.positionAbsolute))return!1;const _=ri(b),$=Sr(_,C);return w&&$>0||$>=C.width*C.height}):[]},[]),E=f.useCallback((y,w,j=!0)=>{const[C]=m(y);if(!C)return!1;const v=Sr(C,w);return j&&v>0||v>=C.width*C.height},[]);return f.useMemo(()=>({...e,getNodes:n,getNode:s,getEdges:r,getEdge:o,setNodes:i,setEdges:c,addNodes:a,addEdges:d,toObject:u,deleteElements:p,getIntersectingNodes:h,isNodeIntersecting:E}),[e,n,s,r,o,i,c,a,d,u,p,h,E])}const US={actInsideInputWithModifier:!1};var GS=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=we(),{deleteElements:s}=rt(),r=Nn(e,US),o=Nn(t);f.useEffect(()=>{if(r){const{edges:i,getNodes:c}=n.getState(),a=c().filter(u=>u.selected),d=i.filter(u=>u.selected);s({nodes:a,edges:d}),n.setState({nodesSelectionActive:!1})}},[r]),f.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function WS(e){const t=we();f.useEffect(()=>{let n;const s=()=>{var o,i;if(!e.current)return;const r=so(e.current);(r.height===0||r.width===0)&&((i=(o=t.getState()).onError)==null||i.call(o,"004",De.error004())),t.setState({width:r.width||500,height:r.height||500})};return s(),window.addEventListener("resize",s),e.current&&(n=new ResizeObserver(()=>s()),n.observe(e.current)),()=>{window.removeEventListener("resize",s),n&&e.current&&n.unobserve(e.current)}},[])}const po={position:"absolute",width:"100%",height:"100%",top:0,left:0},KS=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Hn=e=>({x:e.x,y:e.y,zoom:e.k}),Ht=(e,t)=>e.target.closest(`.${t}`),pi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mi=e=>{const t=e.ctrlKey&&hs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},XS=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),QS=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:s,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:i=!1,panOnScrollSpeed:c=.5,panOnScrollMode:a=kt.Free,zoomOnDoubleClick:d=!0,elementsSelectable:u,panOnDrag:p=!0,defaultViewport:m,translateExtent:h,minZoom:E,maxZoom:y,zoomActivationKeyCode:w,preventScrolling:j=!0,children:C,noWheelClassName:v,noPanClassName:R})=>{const b=f.useRef(),_=we(),$=f.useRef(!1),O=f.useRef(!1),N=f.useRef(null),D=f.useRef({x:0,y:0,zoom:0}),{d3Zoom:T,d3Selection:M,d3ZoomHandler:z,userSelectionActive:S}=ye(XS,Ne),L=Nn(w),k=f.useRef(0),I=f.useRef(!1),B=f.useRef();return WS(N),f.useEffect(()=>{if(N.current){const A=N.current.getBoundingClientRect(),V=oS().scaleExtent([E,y]).translateExtent(h),F=Ze(N.current).call(V),H=ft.translate(m.x,m.y).scale(en(m.zoom,E,y)),G=[[0,0],[A.width,A.height]],U=V.constrain()(H,G,h);V.transform(F,U),V.wheelDelta(mi),_.setState({d3Zoom:V,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:N.current.closest(".react-flow")})}},[]),f.useEffect(()=>{M&&T&&(i&&!L&&!S?M.on("wheel.zoom",A=>{if(Ht(A,v))return!1;A.preventDefault(),A.stopImmediatePropagation();const V=M.property("__zoom").k||1;if(A.ctrlKey&&o){const de=Xe(A),he=mi(A),xe=V*Math.pow(2,he);T.scaleTo(M,xe,de,A);return}const F=A.deltaMode===1?20:1;let H=a===kt.Vertical?0:A.deltaX*F,G=a===kt.Horizontal?0:A.deltaY*F;!hs()&&A.shiftKey&&a!==kt.Vertical&&(H=A.deltaY*F,G=0),T.translateBy(M,-(H/V)*c,-(G/V)*c,{internal:!0});const U=Hn(M.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:ie,onViewportChangeEnd:le}=_.getState();clearTimeout(B.current),I.current||(I.current=!0,t==null||t(A,U),Q==null||Q(U)),I.current&&(e==null||e(A,U),ie==null||ie(U),B.current=setTimeout(()=>{n==null||n(A,U),le==null||le(U),I.current=!1},150))},{passive:!1}):typeof z<"u"&&M.on("wheel.zoom",function(A,V){if(!j&&A.type==="wheel"&&!A.ctrlKey||Ht(A,v))return null;A.preventDefault(),z.call(this,A,V)},{passive:!1}))},[S,i,a,M,T,z,L,o,j,v,t,e,n]),f.useEffect(()=>{T&&T.on("start",A=>{var H,G;if(!A.sourceEvent||A.sourceEvent.internal)return null;k.current=(H=A.sourceEvent)==null?void 0:H.button;const{onViewportChangeStart:V}=_.getState(),F=Hn(A.transform);$.current=!0,D.current=F,((G=A.sourceEvent)==null?void 0:G.type)==="mousedown"&&_.setState({paneDragging:!0}),V==null||V(F),t==null||t(A.sourceEvent,F)})},[T,t]),f.useEffect(()=>{T&&(S&&!$.current?T.on("zoom",null):S||T.on("zoom",A=>{var F;const{onViewportChange:V}=_.getState();if(_.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),O.current=!!(s&&pi(p,k.current??0)),(e||V)&&!((F=A.sourceEvent)!=null&&F.internal)){const H=Hn(A.transform);V==null||V(H),e==null||e(A.sourceEvent,H)}}))},[S,T,e,p,s]),f.useEffect(()=>{T&&T.on("end",A=>{if(!A.sourceEvent||A.sourceEvent.internal)return null;const{onViewportChangeEnd:V}=_.getState();if($.current=!1,_.setState({paneDragging:!1}),s&&pi(p,k.current??0)&&!O.current&&s(A.sourceEvent),O.current=!1,(n||V)&&KS(D.current,A.transform)){const F=Hn(A.transform);D.current=F,clearTimeout(b.current),b.current=setTimeout(()=>{V==null||V(F),n==null||n(A.sourceEvent,F)},i?150:0)}})},[T,i,p,n,s]),f.useEffect(()=>{T&&T.filter(A=>{const V=L||r,F=o&&A.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&A.button===1&&A.type==="mousedown"&&(Ht(A,"react-flow__node")||Ht(A,"react-flow__edge")))return!0;if(!p&&!V&&!i&&!d&&!o||S||!d&&A.type==="dblclick"||Ht(A,v)&&A.type==="wheel"||Ht(A,R)&&(A.type!=="wheel"||i&&A.type==="wheel"&&!L)||!o&&A.ctrlKey&&A.type==="wheel"||!V&&!i&&!F&&A.type==="wheel"||!p&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(p)&&!p.includes(A.button)&&A.type==="mousedown")return!1;const H=Array.isArray(p)&&p.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&H})},[S,T,r,o,i,d,p,u,L]),f.createElement("div",{className:"react-flow__renderer",ref:N,style:po},C)},JS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function eE(){const{userSelectionActive:e,userSelectionRect:t}=ye(JS,Ne);return e&&t?f.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function hi(e,t){const n=t.parentNode||t.parentId,s=e.find(r=>r.id===n);if(s){const r=t.position.x+t.width-s.width,o=t.position.y+t.height-s.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(s.style={...s.style},s.style.width=s.style.width??s.width,s.style.height=s.style.height??s.height,r>0&&(s.style.width+=r),o>0&&(s.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);s.position.x=s.position.x-i,s.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);s.position.y=s.position.y-i,s.style.height+=i,t.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function Kc(e,t){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const n=e.filter(s=>s.type==="add").map(s=>s.item);return t.reduce((s,r)=>{const o=e.filter(c=>c.id===r.id);if(o.length===0)return s.push(r),s;const i={...r};for(const c of o)if(c)switch(c.type){case"select":{i.selected=c.selected;break}case"position":{typeof c.position<"u"&&(i.position=c.position),typeof c.positionAbsolute<"u"&&(i.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(i.dragging=c.dragging),i.expandParent&&hi(s,i);break}case"dimensions":{typeof c.dimensions<"u"&&(i.width=c.dimensions.width,i.height=c.dimensions.height),typeof c.updateStyle<"u"&&(i.style={...i.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(i.resizing=c.resizing),i.expandParent&&hi(s,i);break}case"remove":return s}return s.push(i),s},n)}function Xc(e,t){return Kc(e,t)}function tE(e,t){return Kc(e,t)}const at=(e,t)=>({id:e,type:"select",selected:t});function Ut(e,t){return e.reduce((n,s)=>{const r=t.includes(s.id);return!s.selected&&r?(s.selected=!0,n.push(at(s.id,!0))):s.selected&&!r&&(s.selected=!1,n.push(at(s.id,!1))),n},[])}const tr=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Qc=f.memo(({isSelecting:e,selectionMode:t=tn.Full,panOnDrag:n,onSelectionStart:s,onSelectionEnd:r,onPaneClick:o,onPaneContextMenu:i,onPaneScroll:c,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:u,children:p})=>{const m=f.useRef(null),h=we(),E=f.useRef(0),y=f.useRef(0),w=f.useRef(),{userSelectionActive:j,elementsSelectable:C,dragging:v}=ye(nE,Ne),R=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,y.current=0},b=z=>{o==null||o(z),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},_=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}i==null||i(z)},$=c?z=>c(z):void 0,O=z=>{const{resetSelectedElements:S,domNode:L}=h.getState();if(w.current=L==null?void 0:L.getBoundingClientRect(),!C||!e||z.button!==0||z.target!==m.current||!w.current)return;const{x:k,y:I}=pt(z,w.current);S(),h.setState({userSelectionRect:{width:0,height:0,startX:k,startY:I,x:k,y:I}}),s==null||s(z)},N=z=>{const{userSelectionRect:S,nodeInternals:L,edges:k,transform:I,onNodesChange:B,onEdgesChange:A,nodeOrigin:V,getNodes:F}=h.getState();if(!e||!w.current||!S)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const H=pt(z,w.current),G=S.startX??0,U=S.startY??0,Q={...S,x:H.x<G?H.x:G,y:H.y<U?H.y:U,width:Math.abs(H.x-G),height:Math.abs(H.y-U)},ie=F(),le=Tc(L,Q,I,t===tn.Partial,!0,V),de=Ac(le,k).map(xe=>xe.id),he=le.map(xe=>xe.id);if(E.current!==he.length){E.current=he.length;const xe=Ut(ie,he);xe.length&&(B==null||B(xe))}if(y.current!==de.length){y.current=de.length;const xe=Ut(k,de);xe.length&&(A==null||A(xe))}h.setState({userSelectionRect:Q})},D=z=>{if(z.button!==0)return;const{userSelectionRect:S}=h.getState();!j&&S&&z.target===m.current&&(b==null||b(z)),h.setState({nodesSelectionActive:E.current>0}),R(),r==null||r(z)},T=z=>{j&&(h.setState({nodesSelectionActive:E.current>0}),r==null||r(z)),R()},M=C&&(e||j);return f.createElement("div",{className:ze(["react-flow__pane",{dragging:v,selection:e}]),onClick:M?void 0:tr(b,m),onContextMenu:tr(_,m),onWheel:tr($,m),onMouseEnter:M?void 0:a,onMouseDown:M?O:void 0,onMouseMove:M?N:d,onMouseUp:M?D:void 0,onMouseLeave:M?T:u,ref:m,style:po},p,f.createElement(eE,null))});Qc.displayName="Pane";function Jc(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const s=t.get(n);return s?s.selected?!0:Jc(s,t):!1}function gi(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n.current)return!1;s=s.parentElement}while(s);return!1}function sE(e,t,n,s){return Array.from(e.values()).filter(r=>(r.selected||r.id===s)&&(!r.parentNode||r.parentId||!Jc(r,e))&&(r.draggable||t&&typeof r.draggable>"u")).map(r=>{var o,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=r.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function rE(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ea(e,t,n,s,r=[0,0],o){const i=rE(e,e.extent||s);let c=i;const a=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(a&&e.width&&e.height){const p=n.get(a),{x:m,y:h}=Wt(p,r).positionAbsolute;c=p&&Ve(m)&&Ve(h)&&Ve(p.width)&&Ve(p.height)?[[m+e.width*r[0],h+e.height*r[1]],[m+p.width-e.width+e.width*r[0],h+p.height-e.height+e.height*r[1]]]:c}else o==null||o("005",De.error005()),c=i;else if(e.extent&&a&&e.extent!=="parent"){const p=n.get(a),{x:m,y:h}=Wt(p,r).positionAbsolute;c=[[e.extent[0][0]+m,e.extent[0][1]+h],[e.extent[1][0]+m,e.extent[1][1]+h]]}let d={x:0,y:0};if(a){const p=n.get(a);d=Wt(p,r).positionAbsolute}const u=c&&c!=="parent"?ro(t,c):t;return{position:{x:u.x-d.x,y:u.y-d.y},positionAbsolute:u}}function nr({nodeId:e,dragItems:t,nodeInternals:n}){const s=t.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[e?s.find(r=>r.id===e):s[0],s]}const yi=(e,t,n,s)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const o=Array.from(r),i=t.getBoundingClientRect(),c={x:i.width*s[0],y:i.height*s[1]};return o.map(a=>{const d=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(d.left-i.left-c.x)/n,y:(d.top-i.top-c.y)/n,...so(a)}})};function hn(e,t,n){return n===void 0?n:s=>{const r=t().nodeInternals.get(e);r&&n(s,{...r})}}function Cr({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:i,nodeInternals:c,onError:a}=t.getState(),d=c.get(e);if(!d){a==null||a("012",De.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&i)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var u;return(u=s==null?void 0:s.current)==null?void 0:u.blur()})):r([e])}function oE(){const e=we();return f.useCallback(({sourceEvent:n})=>{const{transform:s,snapGrid:r,snapToGrid:o}=e.getState(),i=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,a={x:(i-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:o?r[0]*Math.round(a.x/r[0]):a.x,ySnapped:o?r[1]*Math.round(a.y/r[1]):a.y,...a}},[])}function sr(e){return(t,n,s)=>e==null?void 0:e(t,s)}function ta({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:o,selectNodesOnDrag:i}){const c=we(),[a,d]=f.useState(!1),u=f.useRef([]),p=f.useRef({x:null,y:null}),m=f.useRef(0),h=f.useRef(null),E=f.useRef({x:0,y:0}),y=f.useRef(null),w=f.useRef(!1),j=f.useRef(!1),C=f.useRef(!1),v=oE();return f.useEffect(()=>{if(e!=null&&e.current){const R=Ze(e.current),b=({x:O,y:N})=>{const{nodeInternals:D,onNodeDrag:T,onSelectionDrag:M,updateNodePositions:z,nodeExtent:S,snapGrid:L,snapToGrid:k,nodeOrigin:I,onError:B}=c.getState();p.current={x:O,y:N};let A=!1,V={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&S){const H=uo(u.current,I);V=oo(H)}if(u.current=u.current.map(H=>{const G={x:O-H.distance.x,y:N-H.distance.y};k&&(G.x=L[0]*Math.round(G.x/L[0]),G.y=L[1]*Math.round(G.y/L[1]));const U=[[S[0][0],S[0][1]],[S[1][0],S[1][1]]];u.current.length>1&&S&&!H.extent&&(U[0][0]=H.positionAbsolute.x-V.x+S[0][0],U[1][0]=H.positionAbsolute.x+(H.width??0)-V.x2+S[1][0],U[0][1]=H.positionAbsolute.y-V.y+S[0][1],U[1][1]=H.positionAbsolute.y+(H.height??0)-V.y2+S[1][1]);const Q=ea(H,G,D,U,I,B);return A=A||H.position.x!==Q.position.x||H.position.y!==Q.position.y,H.position=Q.position,H.positionAbsolute=Q.positionAbsolute,H}),!A)return;z(u.current,!0,!0),d(!0);const F=r?T:sr(M);if(F&&y.current){const[H,G]=nr({nodeId:r,dragItems:u.current,nodeInternals:D});F(y.current,H,G)}},_=()=>{if(!h.current)return;const[O,N]=jc(E.current,h.current);if(O!==0||N!==0){const{transform:D,panBy:T}=c.getState();p.current.x=(p.current.x??0)-O/D[2],p.current.y=(p.current.y??0)-N/D[2],T({x:O,y:N})&&b(p.current)}m.current=requestAnimationFrame(_)},$=O=>{var I;const{nodeInternals:N,multiSelectionActive:D,nodesDraggable:T,unselectNodesAndEdges:M,onNodeDragStart:z,onSelectionDragStart:S}=c.getState();j.current=!0;const L=r?z:sr(S);(!i||!o)&&!D&&r&&((I=N.get(r))!=null&&I.selected||M()),r&&o&&i&&Cr({id:r,store:c,nodeRef:e});const k=v(O);if(p.current=k,u.current=sE(N,T,k,r),L&&u.current){const[B,A]=nr({nodeId:r,dragItems:u.current,nodeInternals:N});L(O.sourceEvent,B,A)}};if(t)R.on(".drag",null);else{const O=Vg().on("start",N=>{const{domNode:D,nodeDragThreshold:T}=c.getState();T===0&&$(N),C.current=!1;const M=v(N);p.current=M,h.current=(D==null?void 0:D.getBoundingClientRect())||null,E.current=pt(N.sourceEvent,h.current)}).on("drag",N=>{var z,S;const D=v(N),{autoPanOnNodeDrag:T,nodeDragThreshold:M}=c.getState();if(N.sourceEvent.type==="touchmove"&&N.sourceEvent.touches.length>1&&(C.current=!0),!C.current){if(!w.current&&j.current&&T&&(w.current=!0,_()),!j.current){const L=D.xSnapped-(((z=p==null?void 0:p.current)==null?void 0:z.x)??0),k=D.ySnapped-(((S=p==null?void 0:p.current)==null?void 0:S.y)??0);Math.sqrt(L*L+k*k)>M&&$(N)}(p.current.x!==D.xSnapped||p.current.y!==D.ySnapped)&&u.current&&j.current&&(y.current=N.sourceEvent,E.current=pt(N.sourceEvent,h.current),b(D))}}).on("end",N=>{if(!(!j.current||C.current)&&(d(!1),w.current=!1,j.current=!1,cancelAnimationFrame(m.current),u.current)){const{updateNodePositions:D,nodeInternals:T,onNodeDragStop:M,onSelectionDragStop:z}=c.getState(),S=r?M:sr(z);if(D(u.current,!1,!1),S){const[L,k]=nr({nodeId:r,dragItems:u.current,nodeInternals:T});S(N.sourceEvent,L,k)}}}).filter(N=>{const D=N.target;return!N.button&&(!n||!gi(D,`.${n}`,e))&&(!s||gi(D,s,e))});return R.call(O),()=>{R.on(".drag",null)}}}},[e,t,n,s,o,c,r,i,v]),a}function na(){const e=we();return f.useCallback(n=>{const{nodeInternals:s,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:c,snapGrid:a,onError:d,nodesDraggable:u}=e.getState(),p=i().filter(C=>C.selected&&(C.draggable||u&&typeof C.draggable>"u")),m=c?a[0]:5,h=c?a[1]:5,E=n.isShiftPressed?4:1,y=n.x*m*E,w=n.y*h*E,j=p.map(C=>{if(C.positionAbsolute){const v={x:C.positionAbsolute.x+y,y:C.positionAbsolute.y+w};c&&(v.x=a[0]*Math.round(v.x/a[0]),v.y=a[1]*Math.round(v.y/a[1]));const{positionAbsolute:R,position:b}=ea(C,v,s,r,void 0,d);C.position=b,C.positionAbsolute=R}return C});o(j,!0,!1)},[])}const Kt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var gn=e=>{const t=({id:n,type:s,data:r,xPos:o,yPos:i,xPosOrigin:c,yPosOrigin:a,selected:d,onClick:u,onMouseEnter:p,onMouseMove:m,onMouseLeave:h,onContextMenu:E,onDoubleClick:y,style:w,className:j,isDraggable:C,isSelectable:v,isConnectable:R,isFocusable:b,selectNodesOnDrag:_,sourcePosition:$,targetPosition:O,hidden:N,resizeObserver:D,dragHandle:T,zIndex:M,isParent:z,noDragClassName:S,noPanClassName:L,initialized:k,disableKeyboardA11y:I,ariaLabel:B,rfId:A,hasHandleBounds:V})=>{const F=we(),H=f.useRef(null),G=f.useRef(null),U=f.useRef($),Q=f.useRef(O),ie=f.useRef(s),le=v||C||u||p||m||h,de=na(),he=hn(n,F.getState,p),xe=hn(n,F.getState,m),Le=hn(n,F.getState,h),W=hn(n,F.getState,E),ce=hn(n,F.getState,y),fe=me=>{const{nodeDragThreshold:K}=F.getState();if(v&&(!_||!C||K>0)&&Cr({id:n,store:F,nodeRef:H}),u){const $e=F.getState().nodeInternals.get(n);$e&&u(me,{...$e})}},pe=me=>{if(!Er(me)&&!I)if(bc.includes(me.key)&&v){const K=me.key==="Escape";Cr({id:n,store:F,unselect:K,nodeRef:H})}else C&&d&&Object.prototype.hasOwnProperty.call(Kt,me.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${me.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~i}`}),de({x:Kt[me.key].x,y:Kt[me.key].y,isShiftPressed:me.shiftKey}))};f.useEffect(()=>()=>{G.current&&(D==null||D.unobserve(G.current),G.current=null)},[]),f.useEffect(()=>{if(H.current&&!N){const me=H.current;(!k||!V||G.current!==me)&&(G.current&&(D==null||D.unobserve(G.current)),D==null||D.observe(me),G.current=me)}},[N,k,V]),f.useEffect(()=>{const me=ie.current!==s,K=U.current!==$,$e=Q.current!==O;H.current&&(me||K||$e)&&(me&&(ie.current=s),K&&(U.current=$),$e&&(Q.current=O),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,s,$,O]);const Be=ta({nodeRef:H,disabled:N||!C,noDragClassName:S,handleSelector:T,nodeId:n,isSelectable:v,selectNodesOnDrag:_});return N?null:f.createElement("div",{className:ze(["react-flow__node",`react-flow__node-${s}`,{[L]:C},j,{selected:d,selectable:v,parent:z,dragging:Be}]),ref:H,style:{zIndex:M,transform:`translate(${c}px,${a}px)`,pointerEvents:le?"all":"none",visibility:k?"visible":"hidden",...w},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:he,onMouseMove:xe,onMouseLeave:Le,onContextMenu:W,onClick:fe,onDoubleClick:ce,onKeyDown:b?pe:void 0,tabIndex:b?0:void 0,role:b?"button":void 0,"aria-describedby":I?void 0:`${qc}-${A}`,"aria-label":B},f.createElement(ES,{value:n},f.createElement(e,{id:n,data:r,type:s,xPos:o,yPos:i,selected:d,isConnectable:R,sourcePosition:$,targetPosition:O,dragging:Be,dragHandle:T,zIndex:M})))};return t.displayName="NodeWrapper",f.memo(t)};const iE=e=>{const t=e.getNodes().filter(n=>n.selected);return{...uo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function lE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=we(),{width:r,height:o,x:i,y:c,transformString:a,userSelectionActive:d}=ye(iE,Ne),u=na(),p=f.useRef(null);if(f.useEffect(()=>{var E;n||(E=p.current)==null||E.focus({preventScroll:!0})},[n]),ta({nodeRef:p}),d||!r||!o)return null;const m=e?E=>{const y=s.getState().getNodes().filter(w=>w.selected);e(E,y)}:void 0,h=E=>{Object.prototype.hasOwnProperty.call(Kt,E.key)&&u({x:Kt[E.key].x,y:Kt[E.key].y,isShiftPressed:E.shiftKey})};return f.createElement("div",{className:ze(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a}},f.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:o,top:c,left:i}}))}var cE=f.memo(lE);const aE=e=>e.nodesSelectionActive,sa=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:i,deleteKeyCode:c,onMove:a,onMoveStart:d,onMoveEnd:u,selectionKeyCode:p,selectionOnDrag:m,selectionMode:h,onSelectionStart:E,onSelectionEnd:y,multiSelectionKeyCode:w,panActivationKeyCode:j,zoomActivationKeyCode:C,elementsSelectable:v,zoomOnScroll:R,zoomOnPinch:b,panOnScroll:_,panOnScrollSpeed:$,panOnScrollMode:O,zoomOnDoubleClick:N,panOnDrag:D,defaultViewport:T,translateExtent:M,minZoom:z,maxZoom:S,preventScrolling:L,onSelectionContextMenu:k,noWheelClassName:I,noPanClassName:B,disableKeyboardA11y:A})=>{const V=ye(aE),F=Nn(p),H=Nn(j),G=H||D,U=H||_,Q=F||m&&G!==!0;return GS({deleteKeyCode:c,multiSelectionKeyCode:w}),f.createElement(QS,{onMove:a,onMoveStart:d,onMoveEnd:u,onPaneContextMenu:o,elementsSelectable:v,zoomOnScroll:R,zoomOnPinch:b,panOnScroll:U,panOnScrollSpeed:$,panOnScrollMode:O,zoomOnDoubleClick:N,panOnDrag:!F&&G,defaultViewport:T,translateExtent:M,minZoom:z,maxZoom:S,zoomActivationKeyCode:C,preventScrolling:L,noWheelClassName:I,noPanClassName:B},f.createElement(Qc,{onSelectionStart:E,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:G,isSelecting:!!Q,selectionMode:h},e,V&&f.createElement(cE,{onSelectionContextMenu:k,noPanClassName:B,disableKeyboardA11y:A})))};sa.displayName="FlowRenderer";var uE=f.memo(sa);function dE(e){return ye(f.useCallback(n=>e?Tc(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function xE(e){const t={input:gn(e.input||Vc),default:gn(e.default||wr),output:gn(e.output||Zc),group:gn(e.group||fo)},n={},s=Object.keys(e).filter(r=>!["input","default","output","group"].includes(r)).reduce((r,o)=>(r[o]=gn(e[o]||wr),r),n);return{...t,...s}}const fE=({x:e,y:t,width:n,height:s,origin:r})=>!n||!s?{x:e,y:t}:r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-s*r[1]},pE=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ra=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,updateNodeDimensions:o,onError:i}=ye(pE,Ne),c=dE(e.onlyRenderVisibleElements),a=f.useRef(),d=f.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(p=>{const m=p.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(m)});return a.current=u,u},[]);return f.useEffect(()=>()=>{var u;(u=a==null?void 0:a.current)==null||u.disconnect()},[]),f.createElement("div",{className:"react-flow__nodes",style:po},c.map(u=>{var b,_,$;let p=u.type||"default";e.nodeTypes[p]||(i==null||i("003",De.error003(p)),p="default");const m=e.nodeTypes[p]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),E=!!(u.selectable||r&&typeof u.selectable>"u"),y=!!(u.connectable||n&&typeof u.connectable>"u"),w=!!(u.focusable||s&&typeof u.focusable>"u"),j=e.nodeExtent?ro(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,C=(j==null?void 0:j.x)??0,v=(j==null?void 0:j.y)??0,R=fE({x:C,y:v,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return f.createElement(m,{key:u.id,id:u.id,className:u.className,style:u.style,type:p,data:u.data,sourcePosition:u.sourcePosition||Y.Bottom,targetPosition:u.targetPosition||Y.Top,hidden:u.hidden,xPos:C,yPos:v,xPosOrigin:R.x,yPosOrigin:R.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:E,isConnectable:y,isFocusable:w,resizeObserver:d,dragHandle:u.dragHandle,zIndex:((b=u[ge])==null?void 0:b.z)??0,isParent:!!((_=u[ge])!=null&&_.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!(($=u[ge])!=null&&$.handleBounds)})}))};ra.displayName="NodeRenderer";var mE=f.memo(ra);const hE=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,gE=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Si="react-flow__edgeupdater",Ei=({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:o,onMouseOut:i,type:c})=>f.createElement("circle",{onMouseDown:r,onMouseEnter:o,onMouseOut:i,className:ze([Si,`${Si}-${c}`]),cx:hE(t,s,e),cy:gE(n,s,e),r:s,stroke:"transparent",fill:"transparent"}),yE=()=>!0;var qt=e=>{const t=({id:n,className:s,type:r,data:o,onClick:i,onEdgeDoubleClick:c,selected:a,animated:d,label:u,labelStyle:p,labelShowBg:m,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,style:w,source:j,target:C,sourceX:v,sourceY:R,targetX:b,targetY:_,sourcePosition:$,targetPosition:O,elementsSelectable:N,hidden:D,sourceHandleId:T,targetHandleId:M,onContextMenu:z,onMouseEnter:S,onMouseMove:L,onMouseLeave:k,reconnectRadius:I,onReconnect:B,onReconnectStart:A,onReconnectEnd:V,markerEnd:F,markerStart:H,rfId:G,ariaLabel:U,isFocusable:Q,isReconnectable:ie,pathOptions:le,interactionWidth:de,disableKeyboardA11y:he})=>{const xe=f.useRef(null),[Le,W]=f.useState(!1),[ce,fe]=f.useState(!1),pe=we(),Be=f.useMemo(()=>`url('#${Rr(H,G)}')`,[H,G]),me=f.useMemo(()=>`url('#${Rr(F,G)}')`,[F,G]);if(D)return null;const K=Pe=>{var We;const{edges:Fe,addSelectedEdges:bt,unselectNodesAndEdges:wt,multiSelectionActive:Ct}=pe.getState(),tt=Fe.find(dn=>dn.id===n);tt&&(N&&(pe.setState({nodesSelectionActive:!1}),tt.selected&&Ct?(wt({nodes:[],edges:[tt]}),(We=xe.current)==null||We.blur()):bt([n])),i&&i(Pe,tt))},$e=mn(n,pe.getState,c),Et=mn(n,pe.getState,z),an=mn(n,pe.getState,S),Dt=mn(n,pe.getState,L),zt=mn(n,pe.getState,k),et=(Pe,Fe)=>{if(Pe.button!==0)return;const{edges:bt,isValidConnection:wt}=pe.getState(),Ct=Fe?C:j,tt=(Fe?M:T)||null,We=Fe?"target":"source",dn=wt||yE,Ds=Fe,xn=bt.find(vt=>vt.id===n);fe(!0),A==null||A(Pe,xn,We);const zs=vt=>{fe(!1),V==null||V(vt,xn,We)};Dc({event:Pe,handleId:tt,nodeId:Ct,onConnect:vt=>B==null?void 0:B(xn,vt),isTarget:Ds,getState:pe.getState,setState:pe.setState,isValidConnection:dn,edgeUpdaterType:We,onReconnectEnd:zs})},Bt=Pe=>et(Pe,!0),jt=Pe=>et(Pe,!1),Rt=()=>W(!0),It=()=>W(!1),Vt=!N&&!i,un=Pe=>{var Fe;if(!he&&bc.includes(Pe.key)&&N){const{unselectNodesAndEdges:bt,addSelectedEdges:wt,edges:Ct}=pe.getState();Pe.key==="Escape"?((Fe=xe.current)==null||Fe.blur(),bt({edges:[Ct.find(We=>We.id===n)]})):wt([n])}};return f.createElement("g",{className:ze(["react-flow__edge",`react-flow__edge-${r}`,s,{selected:a,animated:d,inactive:Vt,updating:Le}]),onClick:K,onDoubleClick:$e,onContextMenu:Et,onMouseEnter:an,onMouseMove:Dt,onMouseLeave:zt,onKeyDown:Q?un:void 0,tabIndex:Q?0:void 0,role:Q?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":U===null?void 0:U||`Edge from ${j} to ${C}`,"aria-describedby":Q?`${Yc}-${G}`:void 0,ref:xe},!ce&&f.createElement(e,{id:n,source:j,target:C,selected:a,animated:d,label:u,labelStyle:p,labelShowBg:m,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,data:o,style:w,sourceX:v,sourceY:R,targetX:b,targetY:_,sourcePosition:$,targetPosition:O,sourceHandleId:T,targetHandleId:M,markerStart:Be,markerEnd:me,pathOptions:le,interactionWidth:de}),ie&&f.createElement(f.Fragment,null,(ie==="source"||ie===!0)&&f.createElement(Ei,{position:$,centerX:v,centerY:R,radius:I,onMouseDown:Bt,onMouseEnter:Rt,onMouseOut:It,type:"source"}),(ie==="target"||ie===!0)&&f.createElement(Ei,{position:O,centerX:b,centerY:_,radius:I,onMouseDown:jt,onMouseEnter:Rt,onMouseOut:It,type:"target"})))};return t.displayName="EdgeWrapper",f.memo(t)};function SE(e){const t={default:qt(e.default||ys),straight:qt(e.bezier||co),step:qt(e.step||lo),smoothstep:qt(e.step||Ls),simplebezier:qt(e.simplebezier||io)},n={},s=Object.keys(e).filter(r=>!["default","bezier"].includes(r)).reduce((r,o)=>(r[o]=qt(e[o]||ys),r),n);return{...t,...s}}function ji(e,t,n=null){const s=((n==null?void 0:n.x)||0)+t.x,r=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,i=(n==null?void 0:n.height)||t.height;switch(e){case Y.Top:return{x:s+o/2,y:r};case Y.Right:return{x:s+o,y:r+i/2};case Y.Bottom:return{x:s+o/2,y:r+i};case Y.Left:return{x:s,y:r+i/2}}}function Ri(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const EE=(e,t,n,s,r,o)=>{const i=ji(n,e,t),c=ji(o,s,r);return{sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}};function jE({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:s,targetWidth:r,targetHeight:o,width:i,height:c,transform:a}){const d={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+s,t.y+o)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=oo({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:i/a[2],height:c/a[2]}),p=Math.max(0,Math.min(u.x2,d.x2)-Math.max(u.x,d.x)),m=Math.max(0,Math.min(u.y2,d.y2)-Math.max(u.y,d.y));return Math.ceil(p*m)>0}function bi(e){var s,r,o,i,c;const t=((s=e==null?void 0:e[ge])==null?void 0:s.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((r=e==null?void 0:e.positionAbsolute)==null?void 0:r.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const RE=[{level:0,isMaxLevel:!0,edges:[]}];function bE(e,t,n=!1){let s=-1;const r=e.reduce((i,c)=>{var u,p;const a=Ve(c.zIndex);let d=a?c.zIndex:0;if(n){const m=t.get(c.target),h=t.get(c.source),E=c.selected||(m==null?void 0:m.selected)||(h==null?void 0:h.selected),y=Math.max(((u=h==null?void 0:h[ge])==null?void 0:u.z)||0,((p=m==null?void 0:m[ge])==null?void 0:p.z)||0,1e3);d=(a?c.zIndex:0)+(E?y:0)}return i[d]?i[d].push(c):i[d]=[c],s=d>s?d:s,i},{}),o=Object.entries(r).map(([i,c])=>{const a=+i;return{edges:c,level:a,isMaxLevel:a===s}});return o.length===0?RE:o}function wE(e,t,n){const s=ye(f.useCallback(r=>e?r.edges.filter(o=>{const i=t.get(o.source),c=t.get(o.target);return(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&jE({sourcePos:i.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:i.width,sourceHeight:i.height,targetWidth:c.width,targetHeight:c.height,width:r.width,height:r.height,transform:r.transform})}):r.edges,[e,t]));return bE(s,t,n)}const CE=({color:e="none",strokeWidth:t=1})=>f.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),vE=({color:e="none",strokeWidth:t=1})=>f.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),wi={[gs.Arrow]:CE,[gs.ArrowClosed]:vE};function _E(e){const t=we();return f.useMemo(()=>{var r,o;return Object.prototype.hasOwnProperty.call(wi,e)?wi[e]:((o=(r=t.getState()).onError)==null||o.call(r,"009",De.error009(e)),null)},[e])}const kE=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:c="auto-start-reverse"})=>{const a=_E(t);return a?f.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0"},f.createElement(a,{color:n,strokeWidth:i})):null},PE=({defaultColor:e,rfId:t})=>n=>{const s=[];return n.edges.reduce((r,o)=>([o.markerStart,o.markerEnd].forEach(i=>{if(i&&typeof i=="object"){const c=Rr(i,t);s.includes(c)||(r.push({id:c,color:i.color||e,...i}),s.push(c))}}),r),[]).sort((r,o)=>r.id.localeCompare(o.id))},oa=({defaultColor:e,rfId:t})=>{const n=ye(f.useCallback(PE({defaultColor:e,rfId:t}),[e,t]),(s,r)=>!(s.length!==r.length||s.some((o,i)=>o.id!==r[i].id)));return f.createElement("defs",null,n.map(s=>f.createElement(kE,{id:s.id,key:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient})))};oa.displayName="MarkerDefinitions";var NE=f.memo(oa);const ME=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),ia=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:s,edgeTypes:r,noPanClassName:o,onEdgeContextMenu:i,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:d,onEdgeClick:u,onEdgeDoubleClick:p,onReconnect:m,onReconnectStart:h,onReconnectEnd:E,reconnectRadius:y,children:w,disableKeyboardA11y:j})=>{const{edgesFocusable:C,edgesUpdatable:v,elementsSelectable:R,width:b,height:_,connectionMode:$,nodeInternals:O,onError:N}=ye(ME,Ne),D=wE(t,O,n);return b?f.createElement(f.Fragment,null,D.map(({level:T,edges:M,isMaxLevel:z})=>f.createElement("svg",{key:T,style:{zIndex:T},width:b,height:_,className:"react-flow__edges react-flow__container"},z&&f.createElement(NE,{defaultColor:e,rfId:s}),f.createElement("g",null,M.map(S=>{const[L,k,I]=bi(O.get(S.source)),[B,A,V]=bi(O.get(S.target));if(!I||!V)return null;let F=S.type||"default";r[F]||(N==null||N("011",De.error011(F)),F="default");const H=r[F]||r.default,G=$===ht.Strict?A.target:(A.target??[]).concat(A.source??[]),U=Ri(k.source,S.sourceHandle),Q=Ri(G,S.targetHandle),ie=(U==null?void 0:U.position)||Y.Bottom,le=(Q==null?void 0:Q.position)||Y.Top,de=!!(S.focusable||C&&typeof S.focusable>"u"),he=S.reconnectable||S.updatable,xe=typeof m<"u"&&(he||v&&typeof he>"u");if(!U||!Q)return N==null||N("008",De.error008(U,S)),null;const{sourceX:Le,sourceY:W,targetX:ce,targetY:fe}=EE(L,U,ie,B,Q,le);return f.createElement(H,{key:S.id,id:S.id,className:ze([S.className,o]),type:F,data:S.data,selected:!!S.selected,animated:!!S.animated,hidden:!!S.hidden,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,style:S.style,source:S.source,target:S.target,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerEnd:S.markerEnd,markerStart:S.markerStart,sourceX:Le,sourceY:W,targetX:ce,targetY:fe,sourcePosition:ie,targetPosition:le,elementsSelectable:R,onContextMenu:i,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,onClick:u,onEdgeDoubleClick:p,onReconnect:m,onReconnectStart:h,onReconnectEnd:E,reconnectRadius:y,rfId:s,ariaLabel:S.ariaLabel,isFocusable:de,isReconnectable:xe,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:j})})))),w):null};ia.displayName="EdgeRenderer";var TE=f.memo(ia);const AE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LE({children:e}){const t=ye(AE);return f.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function $E(e){const t=rt(),n=f.useRef(!1);f.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const OE={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top},la=({nodeId:e,handleType:t,style:n,type:s=ut.Bezier,CustomComponent:r,connectionStatus:o})=>{var _,$,O;const{fromNode:i,handleId:c,toX:a,toY:d,connectionMode:u}=ye(f.useCallback(N=>({fromNode:N.nodeInternals.get(e),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[e]),Ne),p=(_=i==null?void 0:i[ge])==null?void 0:_.handleBounds;let m=p==null?void 0:p[t];if(u===ht.Loose&&(m=m||(p==null?void 0:p[t==="source"?"target":"source"])),!i||!m)return null;const h=c?m.find(N=>N.id===c):m[0],E=h?h.x+h.width/2:(i.width??0)/2,y=h?h.y+h.height/2:i.height??0,w=((($=i.positionAbsolute)==null?void 0:$.x)??0)+E,j=(((O=i.positionAbsolute)==null?void 0:O.y)??0)+y,C=h==null?void 0:h.position,v=C?OE[C]:null;if(!C||!v)return null;if(r)return f.createElement(r,{connectionLineType:s,connectionLineStyle:n,fromNode:i,fromHandle:h,fromX:w,fromY:j,toX:a,toY:d,fromPosition:C,toPosition:v,connectionStatus:o});let R="";const b={sourceX:w,sourceY:j,sourcePosition:C,targetX:a,targetY:d,targetPosition:v};return s===ut.Bezier?[R]=kc(b):s===ut.Step?[R]=jr({...b,borderRadius:0}):s===ut.SmoothStep?[R]=jr(b):s===ut.SimpleBezier?[R]=_c(b):R=`M${w},${j} ${a},${d}`,f.createElement("path",{d:R,fill:"none",className:"react-flow__connection-path",style:n})};la.displayName="ConnectionLine";const DE=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function zE({containerStyle:e,style:t,type:n,component:s}){const{nodeId:r,handleType:o,nodesConnectable:i,width:c,height:a,connectionStatus:d}=ye(DE,Ne);return!(r&&o&&c&&i)?null:f.createElement("svg",{style:e,width:c,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container"},f.createElement("g",{className:ze(["react-flow__connection",d])},f.createElement(la,{nodeId:r,handleType:o,style:t,type:n,CustomComponent:s,connectionStatus:d})))}function Ci(e,t){const n=f.useRef(null),s=we();return f.useMemo(()=>{var o,i;if(process.env.NODE_ENV==="development"){const c=Object.keys(e);Ne(n.current,c)&&((i=(o=s.getState()).onError)==null||i.call(o,"002",De.error002())),n.current=c}return t(e)},[e])}const ca=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:s,onMoveEnd:r,onInit:o,onNodeClick:i,onEdgeClick:c,onNodeDoubleClick:a,onEdgeDoubleClick:d,onNodeMouseEnter:u,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:h,onSelectionContextMenu:E,onSelectionStart:y,onSelectionEnd:w,connectionLineType:j,connectionLineStyle:C,connectionLineComponent:v,connectionLineContainerStyle:R,selectionKeyCode:b,selectionOnDrag:_,selectionMode:$,multiSelectionKeyCode:O,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:M,elementsSelectable:z,selectNodesOnDrag:S,defaultViewport:L,translateExtent:k,minZoom:I,maxZoom:B,preventScrolling:A,defaultMarkerColor:V,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Q,zoomOnDoubleClick:ie,panOnDrag:le,onPaneClick:de,onPaneMouseEnter:he,onPaneMouseMove:xe,onPaneMouseLeave:Le,onPaneScroll:W,onPaneContextMenu:ce,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:Be,onEdgeMouseLeave:me,onReconnect:K,onReconnectStart:$e,onReconnectEnd:Et,reconnectRadius:an,noDragClassName:Dt,noWheelClassName:zt,noPanClassName:et,elevateEdgesOnSelect:Bt,disableKeyboardA11y:jt,nodeOrigin:Rt,nodeExtent:It,rfId:Vt})=>{const un=Ci(e,xE),Pe=Ci(t,SE);return $E(o),f.createElement(uE,{onPaneClick:de,onPaneMouseEnter:he,onPaneMouseMove:xe,onPaneMouseLeave:Le,onPaneContextMenu:ce,onPaneScroll:W,deleteKeyCode:T,selectionKeyCode:b,selectionOnDrag:_,selectionMode:$,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:O,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:z,onMove:n,onMoveStart:s,onMoveEnd:r,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:ie,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Q,panOnDrag:le,defaultViewport:L,translateExtent:k,minZoom:I,maxZoom:B,onSelectionContextMenu:E,preventScrolling:A,noDragClassName:Dt,noWheelClassName:zt,noPanClassName:et,disableKeyboardA11y:jt},f.createElement(LE,null,f.createElement(TE,{edgeTypes:Pe,onEdgeClick:c,onEdgeDoubleClick:d,onlyRenderVisibleElements:M,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:Be,onEdgeMouseLeave:me,onReconnect:K,onReconnectStart:$e,onReconnectEnd:Et,reconnectRadius:an,defaultMarkerColor:V,noPanClassName:et,elevateEdgesOnSelect:!!Bt,disableKeyboardA11y:jt,rfId:Vt},f.createElement(zE,{style:C,type:j,component:v,containerStyle:R})),f.createElement("div",{className:"react-flow__edgelabel-renderer"}),f.createElement(mE,{nodeTypes:un,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:u,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:h,selectNodesOnDrag:S,onlyRenderVisibleElements:M,noPanClassName:et,noDragClassName:Dt,disableKeyboardA11y:jt,nodeOrigin:Rt,nodeExtent:It,rfId:Vt})))};ca.displayName="GraphView";var BE=f.memo(ca);const vr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ct={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:vr,nodeExtent:vr,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ht.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:ms,isValidConnection:void 0},IE=()=>Jm((e,t)=>({...ct,setNodes:n=>{const{nodeInternals:s,nodeOrigin:r,elevateNodesOnSelect:o}=t();e({nodeInternals:er(n,s,r,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:s={}}=t();e({edges:n.map(r=>({...s,...r}))})},setDefaultNodesAndEdges:(n,s)=>{const r=typeof n<"u",o=typeof s<"u",i=r?er(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:o?s:[],hasDefaultNodes:r,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:s,nodeInternals:r,fitViewOnInit:o,fitViewOnInitDone:i,fitViewOnInitOptions:c,domNode:a,nodeOrigin:d}=t(),u=a==null?void 0:a.querySelector(".react-flow__viewport");if(!u)return;const p=window.getComputedStyle(u),{m22:m}=new window.DOMMatrixReadOnly(p.transform),h=n.reduce((y,w)=>{const j=r.get(w.id);if(j!=null&&j.hidden)r.set(j.id,{...j,[ge]:{...j[ge],handleBounds:void 0}});else if(j){const C=so(w.nodeElement);!!(C.width&&C.height&&(j.width!==C.width||j.height!==C.height||w.forceUpdate))&&(r.set(j.id,{...j,[ge]:{...j[ge],handleBounds:{source:yi(".source",w.nodeElement,m,d),target:yi(".target",w.nodeElement,m,d)}},...C}),y.push({id:j.id,type:"dimensions",dimensions:C}))}return y},[]);Gc(r,d);const E=i||o&&!i&&Wc(t,{initial:!0,...c});e({nodeInternals:new Map(r),fitViewOnInitDone:E}),(h==null?void 0:h.length)>0&&(s==null||s(h))},updateNodePositions:(n,s=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=n.map(c=>{const a={id:c.id,type:"position",dragging:r};return s&&(a.positionAbsolute=c.positionAbsolute,a.position=c.position),a});o(i)},triggerNodeChanges:n=>{const{onNodesChange:s,nodeInternals:r,hasDefaultNodes:o,nodeOrigin:i,getNodes:c,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(o){const d=Xc(n,c()),u=er(d,r,i,a);e({nodeInternals:u})}s==null||s(n)}},addSelectedNodes:n=>{const{multiSelectionActive:s,edges:r,getNodes:o}=t();let i,c=null;s?i=n.map(a=>at(a,!0)):(i=Ut(o(),n),c=Ut(r,[])),Zn({changedNodes:i,changedEdges:c,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:s,edges:r,getNodes:o}=t();let i,c=null;s?i=n.map(a=>at(a,!0)):(i=Ut(r,n),c=Ut(o(),[])),Zn({changedNodes:c,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:s}={})=>{const{edges:r,getNodes:o}=t(),i=n||o(),c=s||r,a=i.map(u=>(u.selected=!1,at(u.id,!1))),d=c.map(u=>at(u.id,!1));Zn({changedNodes:a,changedEdges:d,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:s,maxZoom:r}=t();s==null||s.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:s,minZoom:r}=t();s==null||s.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{var s;(s=t().d3Zoom)==null||s.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:s}=t(),o=s().filter(c=>c.selected).map(c=>at(c.id,!1)),i=n.filter(c=>c.selected).map(c=>at(c.id,!1));Zn({changedNodes:o,changedEdges:i,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:s}=t();s.forEach(r=>{r.positionAbsolute=ro(r.position,n)}),e({nodeExtent:n,nodeInternals:new Map(s)})},panBy:n=>{const{transform:s,width:r,height:o,d3Zoom:i,d3Selection:c,translateExtent:a}=t();if(!i||!c||!n.x&&!n.y)return!1;const d=ft.translate(s[0]+n.x,s[1]+n.y).scale(s[2]),u=[[0,0],[r,o]],p=i==null?void 0:i.constrain()(d,u,a);return i.transform(c,p),s[0]!==p.x||s[1]!==p.y||s[2]!==p.k},cancelConnection:()=>e({connectionNodeId:ct.connectionNodeId,connectionHandleId:ct.connectionHandleId,connectionHandleType:ct.connectionHandleType,connectionStatus:ct.connectionStatus,connectionStartHandle:ct.connectionStartHandle,connectionEndHandle:ct.connectionEndHandle}),reset:()=>e({...ct})}),Object.is),mo=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=IE()),f.createElement(iS,{value:t.current},e)};mo.displayName="ReactFlowProvider";const aa=({children:e})=>f.useContext(As)?f.createElement(f.Fragment,null,e):f.createElement(mo,null,e);aa.displayName="ReactFlowWrapper";const VE={input:Vc,default:wr,output:Zc,group:fo},FE={default:ys,straight:co,step:lo,smoothstep:Ls,simplebezier:io},ZE=[0,0],HE=[15,15],qE={x:0,y:0,zoom:1},YE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ua=f.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:o=VE,edgeTypes:i=FE,onNodeClick:c,onEdgeClick:a,onInit:d,onMove:u,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:v,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:_,onNodeDragStart:$,onNodeDrag:O,onNodeDragStop:N,onNodesDelete:D,onEdgesDelete:T,onSelectionChange:M,onSelectionDragStart:z,onSelectionDrag:S,onSelectionDragStop:L,onSelectionContextMenu:k,onSelectionStart:I,onSelectionEnd:B,connectionMode:A=ht.Strict,connectionLineType:V=ut.Bezier,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:G,deleteKeyCode:U="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:ie=!1,selectionMode:le=tn.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:he=hs()?"Meta":"Control",zoomActivationKeyCode:xe=hs()?"Meta":"Control",snapToGrid:Le=!1,snapGrid:W=HE,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:fe=!0,nodesDraggable:pe,nodesConnectable:Be,nodesFocusable:me,nodeOrigin:K=ZE,edgesFocusable:$e,edgesUpdatable:Et,elementsSelectable:an,defaultViewport:Dt=qE,minZoom:zt=.5,maxZoom:et=2,translateExtent:Bt=vr,preventScrolling:jt=!0,nodeExtent:Rt,defaultMarkerColor:It="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:un=!0,panOnScroll:Pe=!1,panOnScrollSpeed:Fe=.5,panOnScrollMode:bt=kt.Free,zoomOnDoubleClick:wt=!0,panOnDrag:Ct=!0,onPaneClick:tt,onPaneMouseEnter:We,onPaneMouseMove:dn,onPaneMouseLeave:Ds,onPaneScroll:xn,onPaneContextMenu:zs,children:So,onEdgeContextMenu:vt,onEdgeDoubleClick:Td,onEdgeMouseEnter:Ad,onEdgeMouseMove:Ld,onEdgeMouseLeave:$d,onEdgeUpdate:Od,onEdgeUpdateStart:Dd,onEdgeUpdateEnd:zd,onReconnect:Bd,onReconnectStart:Id,onReconnectEnd:Vd,reconnectRadius:Fd=10,edgeUpdaterRadius:Zd=10,onNodesChange:Hd,onEdgesChange:qd,noDragClassName:Yd="nodrag",noWheelClassName:Ud="nowheel",noPanClassName:Eo="nopan",fitView:Gd=!1,fitViewOptions:Wd,connectOnClick:Kd=!0,attributionPosition:Xd,proOptions:Qd,defaultEdgeOptions:Jd,elevateNodesOnSelect:ex=!0,elevateEdgesOnSelect:tx=!1,disableKeyboardA11y:jo=!1,autoPanOnConnect:nx=!0,autoPanOnNodeDrag:sx=!0,connectionRadius:rx=20,isValidConnection:ox,onError:ix,style:lx,id:Ro,nodeDragThreshold:cx,...ax},ux)=>{const Bs=Ro||"1";return f.createElement("div",{...ax,style:{...lx,...YE},ref:ux,className:ze(["react-flow",r]),"data-testid":"rf__wrapper",id:Ro},f.createElement(aa,null,f.createElement(BE,{onInit:d,onMove:u,onMoveStart:p,onMoveEnd:m,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:C,onNodeMouseMove:v,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:_,nodeTypes:o,edgeTypes:i,connectionLineType:V,connectionLineStyle:F,connectionLineComponent:H,connectionLineContainerStyle:G,selectionKeyCode:Q,selectionOnDrag:ie,selectionMode:le,deleteKeyCode:U,multiSelectionKeyCode:he,panActivationKeyCode:de,zoomActivationKeyCode:xe,onlyRenderVisibleElements:ce,selectNodesOnDrag:fe,defaultViewport:Dt,translateExtent:Bt,minZoom:zt,maxZoom:et,preventScrolling:jt,zoomOnScroll:Vt,zoomOnPinch:un,zoomOnDoubleClick:wt,panOnScroll:Pe,panOnScrollSpeed:Fe,panOnScrollMode:bt,panOnDrag:Ct,onPaneClick:tt,onPaneMouseEnter:We,onPaneMouseMove:dn,onPaneMouseLeave:Ds,onPaneScroll:xn,onPaneContextMenu:zs,onSelectionContextMenu:k,onSelectionStart:I,onSelectionEnd:B,onEdgeContextMenu:vt,onEdgeDoubleClick:Td,onEdgeMouseEnter:Ad,onEdgeMouseMove:Ld,onEdgeMouseLeave:$d,onReconnect:Bd??Od,onReconnectStart:Id??Dd,onReconnectEnd:Vd??zd,reconnectRadius:Fd??Zd,defaultMarkerColor:It,noDragClassName:Yd,noWheelClassName:Ud,noPanClassName:Eo,elevateEdgesOnSelect:tx,rfId:Bs,disableKeyboardA11y:jo,nodeOrigin:K,nodeExtent:Rt}),f.createElement(OS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:w,onClickConnectEnd:j,nodesDraggable:pe,nodesConnectable:Be,nodesFocusable:me,edgesFocusable:$e,edgesUpdatable:Et,elementsSelectable:an,elevateNodesOnSelect:ex,minZoom:zt,maxZoom:et,nodeExtent:Rt,onNodesChange:Hd,onEdgesChange:qd,snapToGrid:Le,snapGrid:W,connectionMode:A,translateExtent:Bt,connectOnClick:Kd,defaultEdgeOptions:Jd,fitView:Gd,fitViewOptions:Wd,onNodesDelete:D,onEdgesDelete:T,onNodeDragStart:$,onNodeDrag:O,onNodeDragStop:N,onSelectionDrag:S,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:Eo,nodeOrigin:K,rfId:Bs,autoPanOnConnect:nx,autoPanOnNodeDrag:sx,onError:ix,connectionRadius:rx,isValidConnection:ox,nodeDragThreshold:cx}),f.createElement(LS,{onSelectionChange:M}),So,f.createElement(aS,{proOptions:Qd,position:Xd}),f.createElement(VS,{rfId:Bs,disableKeyboardA11y:jo})))});ua.displayName="ReactFlow";function UE(){const e=we();return f.useCallback(t=>{const{domNode:n,updateNodeDimensions:s}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((i,c)=>{const a=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${c}"]`);return a&&i.push({id:c,nodeElement:a,forceUpdate:!0}),i},[]);requestAnimationFrame(()=>s(o))},[])}function GE({onStart:e,onChange:t,onEnd:n}){const s=we();f.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),f.useEffect(()=>{s.setState({onViewportChange:t})},[t]),f.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}var qe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(qe||(qe={}));function WE({color:e,dimensions:t,lineWidth:n}){return f.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function KE({color:e,radius:t}){return f.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const XE={[qe.Dots]:"#91919a",[qe.Lines]:"#eee",[qe.Cross]:"#e2e2e2"},QE={[qe.Dots]:1,[qe.Lines]:1,[qe.Cross]:6},JE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function da({id:e,variant:t=qe.Dots,gap:n=20,size:s,lineWidth:r=1,offset:o=2,color:i,style:c,className:a}){const d=f.useRef(null),{transform:u,patternId:p}=ye(JE,Ne),m=i||XE[t],h=s||QE[t],E=t===qe.Dots,y=t===qe.Cross,w=Array.isArray(n)?n:[n,n],j=[w[0]*u[2]||1,w[1]*u[2]||1],C=h*u[2],v=y?[C,C]:j,R=E?[C/o,C/o]:[v[0]/o,v[1]/o];return f.createElement("svg",{className:ze(["react-flow__background",a]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},f.createElement("pattern",{id:p+e,x:u[0]%j[0],y:u[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`},E?f.createElement(KE,{color:m,radius:C/o}):f.createElement(WE,{dimensions:v,color:m,lineWidth:r})),f.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}da.displayName="Background";var ej=f.memo(da);const ho=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ae=(e,t)=>{const n=ho(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return x.Eo.construct(s.position,x.q.scale(x.Eo.dims(x.Eo.construct(n)),1/e.getZoom()))},tj=(e,t)=>$s.fromFlow(e,t);class xa{constructor(t,n){Ke(this,"node_",null);Ke(this,"position");Ke(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return x.q.translate(x.Eo.topLeft(this.node.box),this.position)}}class $s{constructor(t,n,s){Ke(this,"key");Ke(this,"box");Ke(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Ae(n,t),r=ho(t),o=r.getElementsByClassName("react-flow__handle"),i=x.Eo.construct(r),c=Array.from(o).map(a=>{const d=x.Eo.center(x.Eo.construct(a)),u=x.q.translation(x.Eo.topLeft(i),d),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=x.J.construct(p[0]);return new xa(u,m)});return new $s(t,s,c)}}const nj=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:o,fromNode:i,connectionLineStyle:c,connectionStatus:a})=>{const d=document.querySelector(".react-flow__handle-connecting"),u=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);if(u!=null){const E=x.J.outer.safeParse(u[1]);E.success&&(o=E.data)}const p=Yt({sourcePos:x.q.construct(e,t),targetPos:x.q.construct(n,s),sourceOrientation:r,targetOrientation:o,sourceBox:Ae(rt(),(i==null?void 0:i.id)??""),targetBox:Ae(rt(),(i==null?void 0:i.id)??"")}),m=rt(),h=Zl(x.q.construct(e,t),p,m.getZoom(),!1);return l.jsxRuntimeExports.jsx($t,{path:fa(h),style:{...c,stroke:x.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},sj=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:o,style:i,segments:c=[],onSegmentsChange:a,color:d="var(--pluto-gray-l9)",selected:u=!1,...p})=>{const m=x.q.construct(p.sourceX,p.sourceY),h=f.useRef(m),E=x.q.equals(m,h.current),y=x.q.construct(p.targetX,p.targetY),w=f.useRef(y),j=x.q.equals(y,w.current),C=rt(),[v,R,b]=g.useCombinedStateAndRef(()=>c.length>0?c:Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),_=f.useRef(o),$=f.useRef(s),O=g.useDebouncedCallback(a,100,[a]);if(!E||!j){let M=v;const z=x.q.translation(h.current,m),S=x.q.translation(y,w.current);x.q.equals(z,x.q.scale(S,-1),.001)?(h.current=m,w.current=y):(E?j||(M=Dm({delta:S,segments:M}),_.current!==o&&(_.current=o,M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),Do({sourcePos:m,targetPos:y,next:M,prev:v})||(M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),w.current=y):(M=Om({delta:z,segments:M}),$.current!==s&&($.current=s,M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),Do({sourcePos:m,targetPos:y,next:M,prev:v})||(M=Yt({sourcePos:m,targetPos:y,sourceOrientation:s,targetOrientation:o,sourceBox:Ae(C,t),targetBox:Ae(C,n)})),h.current=m),O(M),R(M))}const N=f.useRef(null),D=js({onStart:f.useCallback((M,z,S)=>{N.current={index:Number(S.currentTarget.id.split("-")[1]),segments:[...b.current]}},[]),onMove:f.useCallback(M=>{if(N.current==null)return;const z=Tm({segments:N.current.segments,index:N.current.index,magnitude:x.Eo.dim(M,x.g.swap(N.current.segments[N.current.index].direction),!0)/C.getZoom()});R(z)},[]),onEnd:f.useCallback(()=>a(b.current),[a])}),T=Zl(m,v,C.getZoom(),!0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx($t,{path:fa(T),style:{...i,stroke:x.cssString(d)},...p}),u&&rj(T).map((M,z)=>{const S=v[z].direction,L=x.g.swap(S),k={[x.g.dimension(S)]:"18px",[x.g.dimension(L)]:"4px"},I={[S]:M[S]-9,[L]:M[L]-2};return l.jsxRuntimeExports.jsxs(f.Fragment,{children:[l.jsxRuntimeExports.jsx("rect",{className:x.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...k,...I,rx:"2px",ry:"2px"}),l.jsxRuntimeExports.jsx("foreignObject",{x:M.x-9,y:M.y-9,width:"18px",height:"18px",children:l.jsxRuntimeExports.jsx("div",{id:`handle-${z}`,className:x.CSS(x.CSS.BE("diagram-edge-handle","dragger"),x.CSS.dir(S)),draggable:!0,onDragStart:D})})]},z)})]})},fa=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const o=e[r%e.length],i=e[(r+1)%e.length],c=Math.min(6/Math.hypot(i.x-o.x,i.y-o.y),.5);r>0&&(t+=`Q${o.x},${o.y} ${o.x*(1-c)+i.x*c},${o.y*(1-c)+i.y*c}`),r===0?t+=`M${o.x},${o.y}`:r===0&&(t+=`M${o.x*(1-c)+i.x*c},${o.y*(1-c)+i.y*c}`),r===s-1?t+=`L${i.x},${i.y}`:r<s-1&&(t+=`L${o.x*c+i.x*(1-c)},${o.y*c+i.y*(1-c)}`)}return t},rj=e=>e.slice(1).map((t,n)=>{const s=e[n];return x.q.construct((t.x+s.x)/2,(t.y+s.y)/2)}),oj=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:x.q.ZERO,zoom:1}})=>{const[r,o]=f.useState(n),[i,c]=f.useState(e),[a,d]=f.useState(t),[u,p]=f.useState(s),[m,h]=f.useState(!1);return{viewport:u,onViewportChange:p,edges:a,nodes:i,onNodesChange:c,onEdgesChange:d,editable:r,onEditableChange:o,fitViewOnResize:m,setFitViewOnResize:h}},ij=e=>e.source!==e.target,lj={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},cj={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},pa={maxZoom:1,minZoom:.5},aj={hideAttribution:!0},ma=f.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Ln=()=>f.useContext(ma),ha=f.memo(({children:e})=>{const{registerNodeRenderer:t}=Ln();return f.useEffect(()=>t(e),[t,e]),null});ha.displayName="NodeRenderer";const uj=["Backspace","Delete"],dj=g.wrap$1(P.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:r,edges:o,onEditableChange:i,editable:c,viewport:a,triggers:d,onViewportChange:u,fitViewOnResize:p,setFitViewOnResize:m,visible:h,...E})=>{const y=g.useMemoDeepEqualProps({visible:h}),[{path:w},,j]=g.use$3({aetherKey:e,type:P.Diagram$1.TYPE,schema:P.diagramStateZ,initialState:{position:a.position,region:x.Eo.ZERO,zoom:a.zoom,...y}});f.useEffect(()=>j(W=>({...W,...y})),[y]);const C=g.use().colors.gray.l9.hex,v=g.useMemoCompare(()=>d??Br.zoom,g.compareModeConfigs,[d]),{fitView:R}=rt(),b=g.useDebouncedCallback(W=>R(W),50,[R]),_=ws(f.useCallback(W=>{p&&b({maxZoom:1}),j(ce=>({...ce,region:W}))},[j,b,p])),$=f.useRef(null),O=f.useCallback(W=>{const ce=$.current;ce!=null&&ce.x===W.x&&ce.y===W.y&&ce.zoom===W.zoom||($.current=W,!(isNaN(W.x)||isNaN(W.y)||isNaN(W.zoom))&&(j(fe=>({...fe,position:W,zoom:W.zoom})),u(Wl(W))))},[j,u]);GE({onStart:O,onChange:O,onEnd:O});const[N,D]=f.useState(()=>()=>null),T=f.useCallback(W=>D(()=>W),[]),M=f.useMemo(()=>({custom:({id:W,xPos:ce,yPos:fe,selected:pe})=>N({symbolKey:W,position:{x:ce,y:fe},selected:pe})}),[N]),z=f.useRef(o),S=f.useMemo(()=>(z.current=o,Xr(o)),[o]),L=f.useRef(r),k=f.useMemo(()=>(L.current=r,Kr(r)),[r]),I=f.useCallback(W=>n(Kl(L.current,ce=>Xc(W,ce))),[n]),B=f.useCallback(W=>s(Wn(z.current,ce=>tE(W,ce),C)),[s,C]),A=f.useCallback((W,ce)=>s(Wn(z.current,fe=>wS(W,ce,fe),C)),[]),V=f.useCallback(W=>{s(Wn(z.current,ce=>Nc(W,ce),C))},[s,C]),F=f.useCallback((W,ce)=>{const fe=[...z.current],pe=fe.findIndex(Be=>Be.key===W);pe!==-1&&(fe[pe]={...fe[pe],segments:ce},z.current=fe,s(fe))},[s]),H=c?lj:cj,G=g.useSyncedRef(F),U=f.useMemo(()=>({default:W=>l.jsxRuntimeExports.jsx(sj,{...W,segments:W.data.segments,color:W.data.color,onSegmentsChange:f.useCallback(ce=>G.current(W.id,ce),[W.id])},W.id)}),[]),Q=f.useRef(null);g.use$1({triggers:v.zoomReset,callback:f.useCallback(({stage:W,cursor:ce})=>{const fe=Q.current;fe==null||W!=="start"||!x.Eo.contains(fe,ce)||R()},[R])});const ie=g.purgeMouse(v.select)[0]??null,le=g.purgeMouse(v.pan)[0]??null,de=g.purgeMouse(v.zoom)[0]??null,he={selectionOnDrag:ie==null,panOnDrag:le==null,selectionKeyCode:ie,panActivationKeyCode:le,zoomActivationKeyCode:de},xe=g.useCombinedRefs(Q,_),Le=f.useMemo(()=>({visible:h,editable:c,onEditableChange:i,registerNodeRenderer:T,fitViewOnResize:p,setFitViewOnResize:m}),[c,h,i,T,p]);return l.jsxRuntimeExports.jsx(ma.Provider,{value:Le,children:l.jsxRuntimeExports.jsx(g.Composite,{path:w,children:h&&l.jsxRuntimeExports.jsx(ua,{...he,className:x.CSS(x.CSS.B("diagram"),x.CSS.editable(c)),nodes:k,edges:S,nodeTypes:M,edgeTypes:U,ref:xe,fitView:!0,onNodesChange:I,onEdgesChange:B,onConnect:V,onEdgeUpdate:A,defaultViewport:Gl(a),connectionLineComponent:nj,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:ij,connectionMode:ht.Loose,snapGrid:[3,3],fitViewOptions:pa,selectionMode:tn.Partial,proOptions:aj,deleteKeyCode:uj,...E,style:{[x.CSS.var("diagram-zoom")]:a.zoom,...E.style},...H,children:t})})})}),xj=()=>{const{editable:e}=Ln();return e?l.jsxRuntimeExports.jsx(ej,{}):null},fj=({children:e,...t})=>l.jsxRuntimeExports.jsx(X.Pack,{direction:"y",borderShade:4,className:x.CSS.BE("diagram","controls"),...t,children:e}),pj=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Ln();return l.jsxRuntimeExports.jsx(g.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:x.J.RIGHT_CENTER,tooltip:n?l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Disable edit mode"}):l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?l.jsxRuntimeExports.jsx(g.Qt.EditOff,{}):l.jsxRuntimeExports.jsx(g.Qt.Edit,{})})},mj=({onClick:e,...t})=>{const{fitView:n}=rt(),{fitViewOnResize:s,setFitViewOnResize:r}=Ln();return l.jsxRuntimeExports.jsx(g.ToggleIcon,{onClick:o=>{n(pa),e==null||e(o)},value:s,onChange:o=>r(o),rightClickToggle:!0,tooltip:l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:x.J.RIGHT_CENTER,variant:"outlined",...t,children:l.jsxRuntimeExports.jsx(g.Qt.Expand,{})})},hj=e=>l.jsxRuntimeExports.jsx(mo,{children:l.jsxRuntimeExports.jsx(dj,{...e})}),gj=Object.freeze(Object.defineProperty({__proto__:null,Background:xj,Controls:fj,Diagram:hj,FitViewControl:mj,HandleLayout:xa,NodeLayout:$s,NodeRenderer:ha,ToggleEditControl:pj,alignNodes:Vm,edgeConverter:Wn,edgeZ:Bm,nodeConverter:Kl,nodeZ:Im,rfEdgeDataZ:ql,selectNode:ho,selectNodeBox:Ae,selectNodeLayout:tj,translateEdgesBackward:Ul,translateEdgesForward:Xr,translateNodesBackward:Yl,translateNodesForward:Kr,translateViewportBackward:Wl,translateViewportForward:Gl,use:oj,useContext:Ln,viewportZ:zm},Symbol.toStringTag,{value:"Module"})),yj=g.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=l.jsxRuntimeExports.jsx(g.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:o,telem:i,...c})=>{const a=g.useMemoDeepEqualProps({font:t,color:o,telem:i,visible:s}),[,{scrolling:d,empty:u},p]=g.use$3({aetherKey:e,type:P.Log.TYPE,schema:P.logState,initialState:{empty:!0,region:x.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});f.useEffect(()=>{p(h=>({...h,...a}))},[a,p]);const m=ws(f.useCallback(h=>p(E=>({...E,region:h})),[p]));return l.jsxRuntimeExports.jsx("div",{ref:m,className:x.CSS(x.CSS.B("log"),n),onWheel:h=>{p(E=>({...E,wheelPos:E.wheelPos-h.deltaY,scrolling:E.scrolling?E.scrolling:h.deltaY<0}))},...c,children:u?r:l.jsxRuntimeExports.jsx(g.Icon,{className:x.CSS(x.CSS.BE("log","live"),d&&x.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",children:l.jsxRuntimeExports.jsx(g.Qt.Dynamic,{})})})}),Sj=Object.freeze(Object.defineProperty({__proto__:null,Log:yj},Symbol.toStringTag,{value:"Module"})),Ej=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:r}=e,o=i=>()=>s({...e,...i});return t?l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[l.jsxRuntimeExports.jsx(xt,{selected:r==="top",onClick:o({outer:"top"})}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[l.jsxRuntimeExports.jsx(xt,{selected:r==="left",onClick:o({outer:"left"})}),l.jsxRuntimeExports.jsx(vi,{showInner:n,value:e,onChange:s}),l.jsxRuntimeExports.jsx(xt,{selected:r==="right",onClick:o({outer:"right"})})]}),l.jsxRuntimeExports.jsx(xt,{selected:r==="bottom",onClick:o({outer:"bottom"})})]}):l.jsxRuntimeExports.jsx(vi,{className:x.CSS.B("orientation-control"),value:e,onChange:s})},vi=({value:e,onChange:t,className:n,showInner:s=!0,...r})=>{const{inner:o}=e,i=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),l.jsxRuntimeExports.jsxs(X.Space,{className:x.CSS(n,x.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,className:x.CSS(x.CSS.dir("y")),selected:o==="top",onClick:i({inner:"top"})}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"center",justify:"center",children:[l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,selected:o==="left",onClick:i({inner:"left"})}),l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,selected:o==="right",onClick:i({inner:"right"})})]}),l.jsxRuntimeExports.jsx(xt,{style:c,disabled:!s,className:x.CSS(x.CSS.dir("y")),selected:o==="bottom",onClick:i({inner:"bottom"})})]})},xt=({selected:e,className:t,...n})=>l.jsxRuntimeExports.jsx(g.Icon,{variant:"text",className:x.CSS(t,x.CSS.selected(e)),...n,children:l.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ge=({className:e,direction:t,...n})=>l.jsxRuntimeExports.jsx(X.Space,{direction:t,align:"stretch",className:x.CSS(x.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ln=({showOuter:e,showInner:t,...n})=>l.jsxRuntimeExports.jsx(je,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var o;return l.jsxRuntimeExports.jsx(Ej,{value:{inner:s.orientation??"top",outer:((o=s.label)==null?void 0:o.orientation)??"top"},showInner:t,showOuter:e,onChange:i=>r({...s,orientation:i.inner,label:{...s.label,orientation:i.outer}})})}}),$n=({path:e,omit:t=[]})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsx(je,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:n=>l.jsxRuntimeExports.jsx(g.Text$1,{selectOnFocus:!0,...n})}),l.jsxRuntimeExports.jsx(vs,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:e+".maxInlineSize",hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,visible:!t.includes("level"),path:e+".level",label:"Label Size",padHelpText:!1,children:n=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...n})}),l.jsxRuntimeExports.jsx(je,{visible:!t.includes("align"),path:e+".align",label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>l.jsxRuntimeExports.jsx(zr,{...n})})]}),At=e=>l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>l.jsxRuntimeExports.jsx(_r.Swatch,{value:t??x.ZERO.setAlpha(1).rgba255,onChange:o=>n(o.rgba255),...r,bordered:!0})}),jj=e=>l.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>l.jsxRuntimeExports.jsx(g.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),Te=({omit:e})=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{omit:e,path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",grow:!0,children:[l.jsxRuntimeExports.jsx(At,{path:"color",optional:!0}),l.jsxRuntimeExports.jsx(je,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>l.jsxRuntimeExports.jsx(g.Switch$1,{...t})}),l.jsxRuntimeExports.jsx(jj,{path:"scale"})]})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]}),Rj=({path:e})=>{var d,u;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=P.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=P.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p=p??0;const m=P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:p}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p=p??0;const m=P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:p}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=P.authoritySource({channel:p}),E=P.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:E,source:h},indicator:{statusSource:h}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"State Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:o.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Command Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:i.channel,onChange:a})}),l.jsxRuntimeExports.jsx(Zr,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},go=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Ce=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(Rj,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},yn={y:2,x:.25},Sn={lower:0,upper:2e3},ga=({includeBorderRadius:e=!1})=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(At,{path:"backgroundColor",label:"Background Color"}),l.jsxRuntimeExports.jsx(je,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"%",...n})}),l.jsxRuntimeExports.jsx(je,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"%",...n})}),e&&l.jsxRuntimeExports.jsx(je,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t,dragScale:yn,bounds:Sn,endContent:"px",...n})}),l.jsxRuntimeExports.jsx(je,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t??200,dragScale:yn,bounds:Sn,endContent:"px",...n})}),l.jsxRuntimeExports.jsx(je,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>l.jsxRuntimeExports.jsx(g.Numeric,{value:t??200,dragScale:yn,bounds:Sn,endContent:"px",...n})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showInner:!1})]}),ya=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],bj=({path:e})=>{var p;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((p=t.telem)==null?void 0:p.props),r=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),o=P.stringifyNumberProps.parse(s.segments.stringifier.props),i=P.rollingAverageProps.parse(s.segments.rollingAverage.props),c=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:m??0}),stringifier:P.stringifyNumber({precision:o.precision??2}),rollingAverage:P.rollingAverage({windowSize:i.windowSize??1})},outlet:"stringifier"});n({...t,telem:h})},a=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:r.channel}),stringifier:P.stringifyNumber({precision:m}),rollingAverage:P.rollingAverage({windowSize:i.windowSize})},outlet:"stringifier"});n({...t,telem:h})},d=m=>{const h=P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:P.stringifyNumber({precision:o.precision??2}),valueStream:P.streamChannelValue({channel:r.channel}),rollingAverage:P.rollingAverage({windowSize:m})},outlet:"stringifier"});n({...t,telem:h})},u=bs(r.channel);return f.useEffect(()=>{n({...t,tooltip:[u]})},[u]),l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"Input Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Precision",align:"start",children:l.jsxRuntimeExports.jsx(g.Numeric,{value:o.precision??2,bounds:{lower:0,upper:10},onChange:a})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Averaging Window",align:"start",children:l.jsxRuntimeExports.jsx(g.Numeric,{value:i.windowSize??1,bounds:{lower:1,upper:100},onChange:d})})]})},wj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return l.jsxRuntimeExports.jsx(bj,{path:""});default:return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,empty:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(je,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>l.jsxRuntimeExports.jsx(g.Text$1,{...s})}),l.jsxRuntimeExports.jsx(vs,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),l.jsxRuntimeExports.jsx(je,{path:"level",label:"Value Size",hideIfNull:!0,padHelpText:!1,children:s=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...s})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showInner:!1})]})}},[]),t=be.useStatic({tabs:ya,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Cj=({path:e})=>{var c;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((c=t.source)==null?void 0:c.props),r=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),o=a=>{a=a??0;const d=P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:a}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:d})},i=bs(r.channel);return f.useEffect(()=>n({...t}),[i]),l.jsxRuntimeExports.jsx(Ge,{direction:"x",align:"stretch",children:l.jsxRuntimeExports.jsx(He.Item,{label:"Input Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:o})})})},vj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return l.jsxRuntimeExports.jsx(Cj,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{})}},[]),t=be.useStatic({tabs:ya,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},_j=({path:e})=>{var i;const{value:t,onChange:n}=yt({path:e}),s=P.sinkPipelinePropsZ.parse((i=t.sink)==null?void 0:i.props),r=P.setChannelValuePropsZ.parse(s.segments.setter.props),o=c=>{c=c??0;const a=P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:c}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),d=P.authoritySource({channel:c}),u=P.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:u,source:d},showIndicator:!0,indicator:{statusSource:d}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"Output Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:r.channel,onChange:o})}),l.jsxRuntimeExports.jsx(vs,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),l.jsxRuntimeExports.jsx(Zr,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},kj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(_j,{path:""});default:return l.jsxRuntimeExports.jsx(Te,{omit:["align","maxInlineSize"]})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Pj=({path:e})=>{var d,u;const{value:t,onChange:n}=yt({path:e}),s=P.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=P.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=P.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=P.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p=p??0;const m=P.sourcePipeline("number",{connections:[],segments:{valueStream:P.streamChannelValue({channel:p})},outlet:"valueStream"});n({...t,source:m})},a=p=>{p=p??0;const m=P.sinkPipeline("number",{connections:[],segments:{setter:P.setChannelValue({channel:p})},inlet:"setter"}),h=P.authoritySource({channel:p}),E=P.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{...t.control,showChip:!0,chip:{sink:E,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[l.jsxRuntimeExports.jsx(He.Item,{label:"State Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:o.channel,onChange:c})}),l.jsxRuntimeExports.jsx(He.Item,{label:"Command Channel",grow:!0,children:l.jsxRuntimeExports.jsx(mt,{value:i.channel,onChange:a})})]})},Nj=()=>{const e=f.useCallback(({tabKey:n})=>{switch(n){case"control":return l.jsxRuntimeExports.jsx(Pj,{path:""});default:return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label"}),l.jsxRuntimeExports.jsx(yl,{path:"units",label:"Units",align:"start",padHelpText:!1}),l.jsxRuntimeExports.jsx(At,{path:"color"})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]})}},[]),t=be.useStatic({tabs:go,content:e});return l.jsxRuntimeExports.jsx(be.Tabs,{...t})},Mj=()=>{const e=yt({path:"autoFit",optional:!0});return l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",grow:!0,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsx(je,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>l.jsxRuntimeExports.jsx(g.Text$1,{selectOnFocus:!0,...t})}),l.jsxRuntimeExports.jsx(je,{path:"level",label:"Text Size",padHelpText:!1,children:t=>l.jsxRuntimeExports.jsx(Me.SelectLevel,{...t})}),l.jsxRuntimeExports.jsx(je,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>l.jsxRuntimeExports.jsx(zr,{...t})})]}),l.jsxRuntimeExports.jsxs(X.Space,{direction:"x",children:[l.jsxRuntimeExports.jsx(At,{path:"color"}),l.jsxRuntimeExports.jsx(je,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>l.jsxRuntimeExports.jsx(g.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:l.jsxRuntimeExports.jsx(g.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:l.jsxRuntimeExports.jsx(g.Qt.AutoFitWidth,{})})})})]})]}),l.jsxRuntimeExports.jsx(ln,{path:""})]})},Tj=()=>l.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:"y",grow:!0,children:[l.jsxRuntimeExports.jsx($n,{path:"label",omit:["maxInlineSize","align"]}),l.jsxRuntimeExports.jsx(At,{path:"color"})]}),l.jsxRuntimeExports.jsx(ln,{path:"",showOuter:!1})]}),J=e=>l.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),cn=e=>l.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ot=e=>l.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),ae=e=>l.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Aj={left:{left:Y.Left,right:Y.Right,top:Y.Top,bottom:Y.Bottom},right:{left:Y.Right,right:Y.Left,top:Y.Bottom,bottom:Y.Top},top:{left:Y.Bottom,right:Y.Top,top:Y.Left,bottom:Y.Right},bottom:{left:Y.Top,right:Y.Bottom,top:Y.Right,bottom:Y.Left}},Lj=(e,t)=>Aj[t][e],$j=(e,t=!1)=>{if(t)return e;switch(e){case Y.Left:return Y.Right;case Y.Right:return Y.Left;case Y.Top:return Y.Bottom;case Y.Bottom:return Y.Top;default:return Y.Top}},Oj=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},se=({children:e,orientation:t})=>{let n;try{n=UE()}catch{return l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{})}const s=f.useRef(null),r=f.useRef(!0);return f.useEffect(()=>{if(s.current==null)return;if(r.current){r.current=!1;return}const o=s.current.closest(".react-flow__node"),i=o==null?void 0:o.getAttribute("data-id");i!=null&&(n==null||n(i))},[t]),l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("span",{ref:s}),e]})},q=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:o,...i})=>{const c=Oj(o,s,t,n);return l.jsxRuntimeExports.jsx(Pn,{position:$j(Lj(e,t),!r),...i,type:"source",onClick:a=>a.stopPropagation(),className:(x.CSS.B("handle"),x.CSS.BE("handle",i.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},ke=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...o})=>l.jsxRuntimeExports.jsx("button",{className:x.CSS(x.CSS.B("symbol-primitive"),x.CSS.B("symbol-primitive-toggle"),s!=null&&x.CSS.loc(s),t&&x.CSS.M("enabled"),n&&x.CSS.M("triggered"),e),color:x.cssString(r),...o}),Re=({className:e,...t})=>l.jsxRuntimeExports.jsx("div",{className:x.CSS(x.CSS.B("symbol-primitive"),e),...t}),Dj=.8,ue=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:o={},scale:i=1,...c})=>{e=x.g.construct(t)==="y"?x._.swap(e):e;const d=x.cssString(r),u=g.use();return r!=null&&(o[x.CSS.var("symbol-color")]=new x.Color(r).rgbString,o[x.CSS.var("symbol-color-contrast")]=new x.Color(r).pickByContrast(u.colors.gray.l0,u.colors.gray.l10).rgbString),l.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:x._.svgViewBox(e),className:x.CSS(x.CSS.loc(t),s),fill:d,stroke:d,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:x._.scale(e,i*Dj).width,...o},children:l.jsxRuntimeExports.jsx("g",{children:n})})},Sa=({className:e,orientation:t,scale:n,color:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,orientation:t,className:x.CSS(x.CSS.B("four-way-valve"),e),children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:87},color:s,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Ea=({color:e,orientation:t="left",scale:n,...s})=>l.jsxRuntimeExports.jsxs(ke,{...s,className:x.CSS(x.CSS.B("three-way-valve")),orientation:t,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),l.jsxRuntimeExports.jsx(J,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),ja=({orientation:e="left",color:t,scale:n,...s})=>l.jsxRuntimeExports.jsxs(ke,{...s,children:[l.jsxRuntimeExports.jsxs(se,{orientation:e,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:l.jsxRuntimeExports.jsx(J,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Ra=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{className:x.CSS(x.CSS.B("solenoid-valve"),s&&x.CSS.M("normally-open"),e),...o,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(J,{className:x.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),l.jsxRuntimeExports.jsx(ae,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),l.jsxRuntimeExports.jsx(cn,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),ba=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("relief-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),wa=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("check-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Ca=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,orientation:n,className:x.CSS(x.CSS.B("angled-valve"),t),children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),l.jsxRuntimeExports.jsx(J,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),va=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)})]})]}),_a=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const o=x.cssString(t);return l.jsxRuntimeExports.jsxs(Re,{...r,className:x.CSS(x.CSS.B("symbol"),e),children:[l.jsxRuntimeExports.jsx(se,{orientation:n,children:l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:5,top:50,id:"1"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),l.jsxRuntimeExports.jsx(J,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:o}),l.jsxRuntimeExports.jsx(J,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ka=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("cap"),e),...r,children:[l.jsxRuntimeExports.jsx(se,{orientation:t,children:l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),l.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:l.jsxRuntimeExports.jsx(J,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Pa=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("manual-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),l.jsxRuntimeExports.jsx(J,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),Na=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("filter"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:l.jsxRuntimeExports.jsx(J,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),zj=e=>typeof e=="number"?{topLeft:x.q.construct(e),topRight:x.q.construct(e),bottomLeft:x.q.construct(e),bottomRight:x.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:x.q.construct(e.topLeft),topRight:x.q.construct(e.topRight),bottomLeft:x.q.construct(e.bottomLeft),bottomRight:x.q.construct(e.bottomRight)}:e,Bj=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Ij={width:40,height:80},Ma={x:50,y:10},Os=({className:e,dimensions:t=Ij,borderRadius:n=Ma,boxBorderRadius:s,color:r,backgroundColor:o,...i})=>{const c=zj(n),a=s==null,d=g.use();return l.jsxRuntimeExports.jsx(Re,{className:x.CSS(e,x.CSS.B("tank")),style:{...t,borderRadius:s??Bj(c),borderColor:x.cssString(r??d.colors.gray.l9),backgroundColor:o==null?void 0:x.cssString(o)},...i,children:l.jsxRuntimeExports.jsxs(se,{children:[l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},Ta=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(e,x.CSS.B("regulator")),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),l.jsxRuntimeExports.jsx(J,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),l.jsxRuntimeExports.jsx(ae,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Aa=({className:e,orientation:t="left",scale:n,color:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("orifice"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[l.jsxRuntimeExports.jsx(J,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),La=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("needle-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:x.cssString(n)}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),$a=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,className:x.CSS(x.CSS.B("angled-relief-valve"),e),...r,children:[l.jsxRuntimeExports.jsxs(se,{children:[l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),l.jsxRuntimeExports.jsx(J,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Oa=({className:e,color:t,dimensions:n,orientation:s,units:r="psi",unitsLevel:o="small",children:i,inlineSize:c=80,...a})=>{const d=x.cssString(t),u=g.use(),p=t==null?"var(--pluto-gray-l0)":x.cssString(new x.Color(t).pickByContrast(u.colors.gray.l0,u.colors.gray.l9)),m=2.5*((n==null?void 0:n.width)??0)/500;return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("value"),e),...a,style:{borderColor:d,height:n==null?void 0:n.height,width:"100%"},children:[l.jsxRuntimeExports.jsx("div",{className:x.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:i}),l.jsxRuntimeExports.jsxs(se,{orientation:s,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:"left",left:-2+m,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:"left",left:102-m,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),l.jsxRuntimeExports.jsx("div",{className:x.CSS(x.CSS.BE("value","units"),x.CSS.M(o)),style:{background:d},children:l.jsxRuntimeExports.jsx(g.Text,{level:o,color:p,children:r})})]})},Da=({enabled:e=!1,onClick:t,orientation:n="left"})=>l.jsxRuntimeExports.jsxs(Re,{orientation:n,children:[l.jsxRuntimeExports.jsx(g.Switch$1,{value:e,onClick:t,onChange:()=>{}}),l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:0,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),za=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:o,onClickDelay:i})=>l.jsxRuntimeExports.jsxs(Re,{orientation:t,children:[l.jsxRuntimeExports.jsx(g.Button,{onClick:e,color:s,size:r,level:o,onClickDelay:i,children:n}),l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:0,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:100,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:50,top:0,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Ba=({className:e,orientation:t="left",text:n="",width:s,color:r,level:o,autoFit:i,align:c="center"})=>{const a=g.use(),d=x.cssString(r??a.colors.gray.l0),u={borderColor:d,textAlign:c};return x.g.construct(t)==="y"?u.height=i?"fit-content":s:u.width=i?"fit-content":s,l.jsxRuntimeExports.jsx(Re,{style:u,orientation:t,className:x.CSS(x.CSS.B("text-box"),x.CSS.loc(t),e),children:l.jsxRuntimeExports.jsx(g.Text,{color:d,level:o,children:n})})},Ia=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:o,color:i,onChange:c,...a})=>{const[d,u]=f.useState(r);return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("setpoint"),t),orientation:e,...a,children:[l.jsxRuntimeExports.jsxs(se,{orientation:e,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:e,left:1,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:e,left:100,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:e,left:50,top:-2,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),l.jsxRuntimeExports.jsx(g.Numeric,{size:"small",value:d,onChange:u,showDragHandle:!1,selectOnFocus:!0,endContent:o,color:i,style:{[x.CSS.var("pack-border-shade")]:x.cssString(i)},borderWidth:2,children:l.jsxRuntimeExports.jsx(g.Button,{variant:"outlined",size:"small",onClick:()=>c(d),color:i,children:"Set"})})]})},Va=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("screw-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Fa=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("vacuum-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Za=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("cavity-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Ha=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("piston-pump"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"2",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"62",x2:"62",y2:"32",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(J,{d:"M 23 32, h 16, m 0 -8, v 16",className:x.CSS(x.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),qa=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{...r,className:x.CSS(x.CSS.B("static-mixer"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:98.4848,top:50,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(cn,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),l.jsxRuntimeExports.jsx(J,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Ya=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("rotary-mixer"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)}),l.jsxRuntimeExports.jsx(ae,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:x.CSS(x.CSS.M("detail"),t)})]})]}),Ua=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(Re,{...o,orientation:n,className:x.CSS(x.CSS.B("light"),s&&x.CSS.M("enabled"),e),children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),l.jsxRuntimeExports.jsx(ue,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:l.jsxRuntimeExports.jsx(Ot,{cx:"32",cy:"32",r:"30"})})]}),Ga=({className:e,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(e,x.CSS.B("regulator")),...r,children:[l.jsxRuntimeExports.jsxs(se,{orientation:t,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),l.jsxRuntimeExports.jsx(cn,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),l.jsxRuntimeExports.jsx(ae,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Wa=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Ka=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:51,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(J,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),l.jsxRuntimeExports.jsx(J,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Xa=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:t,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Qa=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),l.jsxRuntimeExports.jsx(ae,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"49",x2:"43",y2:"83",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:x.CSS(x.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Ja=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",orientation:n,left:50,top:2,id:"4"})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(ae,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(cn,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),eu=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...o})=>l.jsxRuntimeExports.jsxs(ke,{...o,className:x.CSS(x.CSS.B("agitator")),children:[l.jsxRuntimeExports.jsx(se,{children:l.jsxRuntimeExports.jsx(q,{location:"top",left:50,top:2,id:"4",orientation:n})}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[l.jsxRuntimeExports.jsx(ae,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),l.jsxRuntimeExports.jsx(J,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),tu=({color:e,className:t,orientation:n="left",scale:s,...r})=>l.jsxRuntimeExports.jsxs(ke,{...r,className:x.CSS(x.CSS.B("compressor"),t),orientation:n,children:[l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),l.jsxRuntimeExports.jsxs(ue,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[l.jsxRuntimeExports.jsx(Ot,{cx:"35",cy:"25",r:"23"}),l.jsxRuntimeExports.jsx(J,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),l.jsxRuntimeExports.jsx(ae,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),l.jsxRuntimeExports.jsx(ae,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),nu=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:o="p",...i})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const a=x.g.construct(n)==="y";return l.jsxRuntimeExports.jsxs(Re,{className:x.CSS(x.CSS.B("arrow"),x.CSS.loc(n),t),orientation:n,...i,children:[l.jsxRuntimeExports.jsx("div",{className:"wrapper",children:l.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:x.cssString(r)},children:l.jsxRuntimeExports.jsx("div",{className:"bg",children:l.jsxRuntimeExports.jsx(g.Text,{level:o,className:x.CSS.BE("symbol","label"),children:s})})})}),l.jsxRuntimeExports.jsxs(se,{orientation:n,children:[l.jsxRuntimeExports.jsx(q,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:a,id:"1"}),l.jsxRuntimeExports.jsx(q,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:a,id:"2"})]}),l.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:l.jsxRuntimeExports.jsx("defs",{children:l.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[l.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),l.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),l.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Vj=({aetherKey:e,sink:t})=>{const n=g.useMemoDeepEqualProps({sink:t}),[,,s]=g.use$3({aetherKey:e,type:P.Button.TYPE,schema:P.buttonStateZ,initialState:{trigger:0,sink:t}});return f.useEffect(()=>{s(o=>({...o,...n}))},[n]),{click:f.useCallback(()=>{s(o=>({...o,trigger:o.trigger+1}))},[s])}},Fj=({aetherKey:e,source:t})=>{const n=g.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=g.use$3({aetherKey:e,type:P.Light.TYPE,schema:P.lightStateZ,initialState:{enabled:!1,...n}});return f.useEffect(()=>r(o=>({...o,...n})),[n,r]),{enabled:s}},re=f.forwardRef(({label:e="",onChange:t,level:n="p",children:s,orientation:r="top",style:o,className:i,maxInlineSize:c=150,...a},d)=>l.jsxRuntimeExports.jsxs(X.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...o},size:2/3,direction:r,ref:d,className:x.CSS(x.CSS.B("symbol"),i),align:"center",justify:"center",...a,children:[e.length>0&&l.jsxRuntimeExports.jsx(g.Editable,{className:x.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:c},onChange:f.useCallback(u=>t({label:{label:u,level:n,orientation:r}}),[t,n]),level:n}),s]}));re.displayName="Labeled";const Zj=({aetherKey:e,source:t,sink:n})=>{const s=g.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},o]=g.use$3({aetherKey:e,type:P.Setpoint.TYPE,schema:P.setpointStateZ,initialState:{trigger:0,value:0,...s}});return f.useEffect(()=>{o(c=>({...c,...s}))},[s,o]),{set:f.useCallback(c=>o(a=>({...a,trigger:a.trigger+1,command:c})),[o]),value:r}},ve=({aetherKey:e,source:t,sink:n})=>{const s=g.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:o},i]=g.use$3({aetherKey:e,type:P.Toggle.TYPE,schema:P.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return f.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{toggle:f.useCallback(()=>i(a=>({...a,triggered:!a.triggered})),[i]),triggered:r,enabled:o}},Hj=P.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),su=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:o,level:i="small"})=>{const c=g.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:i,minWidth:o}),[,a,d]=g.use$3({aetherKey:e,type:P.Value.TYPE,schema:P.Value.z,initialState:c});return f.useEffect(()=>d(u=>({...u,...c})),[c]),{width:a.width??a.minWidth}},qj=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Hj,use:su},Symbol.toStringTag,{value:"Module"})),ru=e=>x.g.construct(e)==="x"?x.J.swap(e):e,Yj=e=>x.g.construct(e)==="y"?x.J.swap(e):e,Se=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:s="left",chip:r,children:o,show:i=!0,...c})=>l.jsxRuntimeExports.jsxs(X.Space,{direction:x.J.rotate90(s),align:"center",justify:"center",empty:!0,...c,children:[l.jsxRuntimeExports.jsxs(X.Space,{direction:x.g.construct(s),align:"center",className:x.CSS(x.CSS.B("control-state")),size:"small",children:[i&&e&&l.jsxRuntimeExports.jsx(Ol,{size:"small",...r}),i&&t&&l.jsxRuntimeExports.jsx(Bl,{...n})]}),o]}),ou=g.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:s,source:r,sink:o,orientation:i="left",...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:r,sink:o});return l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Se,{...s,orientation:ru(i),children:l.jsxRuntimeExports.jsx(Ea,{enabled:a,triggered:d,onClick:u,orientation:i,...c})})})}),iu=e=>l.jsxRuntimeExports.jsx(Ea,{...e}),lu=g.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:s,source:r,sink:o,orientation:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:t,source:r,sink:o});return l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...e,orientation:i,children:l.jsxRuntimeExports.jsx(ja,{enabled:a,triggered:d,onClick:u,orientation:i,...c})})})}),cu=e=>l.jsxRuntimeExports.jsx(ja,{...e}),au=g.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:s="left",normallyOpen:r,source:o,sink:i,control:c,...a})=>{const{enabled:d,triggered:u,toggle:p}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Se,{...c,orientation:Yj(s),children:l.jsxRuntimeExports.jsx(Ra,{enabled:d,triggered:u,onClick:p,orientation:s,normallyOpen:r,...a})})})}),uu=e=>l.jsxRuntimeExports.jsx(Ra,{...e}),du=g.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...t,orientation:r,children:l.jsxRuntimeExports.jsx(Sa,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),xu=e=>l.jsxRuntimeExports.jsx(Sa,{...e}),fu=g.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:s,orientation:r="left",source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:ru(r),children:l.jsxRuntimeExports.jsx(Ca,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),pu=e=>l.jsxRuntimeExports.jsx(Ca,{...e}),mu=g.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(va,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),hu=e=>l.jsxRuntimeExports.jsx(va,{...e}),gu=({backgroundColor:e,label:t,onChange:n,orientation:s,color:r,dimensions:o,borderRadius:i})=>l.jsxRuntimeExports.jsx(re,{...t,onChange:n,children:l.jsxRuntimeExports.jsx(Os,{onResize:c=>n({dimensions:c}),orientation:s,color:r,dimensions:o,borderRadius:i,backgroundColor:e})}),yu=e=>l.jsxRuntimeExports.jsx(Os,{...e,dimensions:{width:25,height:50}}),Su=({backgroundColor:e,borderRadius:t,label:n,onChange:s,orientation:r,color:o,dimensions:i})=>l.jsxRuntimeExports.jsx(re,{...n,onChange:s,children:l.jsxRuntimeExports.jsx(Os,{onResize:c=>s({dimensions:c}),orientation:r,color:o,dimensions:i,boxBorderRadius:t,backgroundColor:e})}),Eu=e=>l.jsxRuntimeExports.jsx(Os,{...e,dimensions:{width:25,height:50},borderRadius:0}),ju=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(ba,{...s})}),Ru=e=>l.jsxRuntimeExports.jsx(ba,{...e}),bu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Ta,{...s})}),wu=e=>l.jsxRuntimeExports.jsx(Ta,{...e}),Cu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Ga,{...s})}),vu=e=>l.jsxRuntimeExports.jsx(Ga,{...e}),_u=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(_a,{...s})}),ku=e=>l.jsxRuntimeExports.jsx(_a,{...e}),Pu=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(ka,{...s})}),Nu=e=>l.jsxRuntimeExports.jsx(ka,{...e}),Mu=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(Pa,{...s})}),Tu=e=>l.jsxRuntimeExports.jsx(Pa,{...e}),Au=g.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:s,units:r,source:o,sink:i,color:c,onChange:a})=>{const{value:d,set:u}=Zj({aetherKey:t,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...e,onChange:a,children:l.jsxRuntimeExports.jsx(Se,{...s,className:x.CSS.B("symbol"),orientation:n,children:l.jsxRuntimeExports.jsx(Ia,{value:d,onChange:u,units:r,color:c,orientation:n})})})}),Lu=e=>l.jsxRuntimeExports.jsx(Ia,{value:12,onChange:()=>{},units:"mV",...e,children:l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:"10.0"})}),$u=({label:e,aetherKey:t,onChange:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:n,children:l.jsxRuntimeExports.jsx(Na,{...s})}),Ou=e=>l.jsxRuntimeExports.jsx(Na,{...e}),Du=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(La,{...s})}),zu=e=>l.jsxRuntimeExports.jsx(La,{...e}),Bu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(wa,{...s})}),Iu=e=>l.jsxRuntimeExports.jsx(wa,{...e}),Vu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(Aa,{...s})}),Fu=e=>l.jsxRuntimeExports.jsx(Aa,{...e}),Zu=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx($a,{...s})}),Hu=e=>l.jsxRuntimeExports.jsx($a,{...e}),qu=g.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:s,className:r,textColor:o,color:i,telem:c,units:a,onChange:d,tooltip:u,inlineSize:p})=>{const m=g.useTypography(n),[h,E]=f.useState({outerBox:x.Eo.ZERO,labelDims:x._.ZERO}),y=rt(),w=(m.lineHeight+.5)*m.baseSize+2,j=g.useResize(f.useCallback(R=>{const b=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);if(b==null)return;const _=x._.scale(x.Eo.dims(x.Eo.construct(b)),1/(Uj*y.getZoom()));E({outerBox:R,labelDims:_})},[]),{}),C=Gj({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:w,position:s,...h}),{width:v}=su({aetherKey:e,color:o,level:n,box:C,telem:c,minWidth:p});return l.jsxRuntimeExports.jsxs(g.Dialog$1,{location:{y:"top"},hide:u==null||u.length===0,children:[l.jsxRuntimeExports.jsx(X.Space,{direction:"y",children:u==null?void 0:u.map((R,b)=>l.jsxRuntimeExports.jsx(g.Text,{level:"small",children:R},b))}),l.jsxRuntimeExports.jsx(re,{className:x.CSS(r,x.CSS.B("value-labeled")),ref:j,onChange:d,...t,children:l.jsxRuntimeExports.jsx(Oa,{color:i,dimensions:{height:w,width:v},inlineSize:p,units:a,unitsLevel:Z.downLevel(n)})})]})}),Uj=.9,Gj=({labelOrientation:e,outerBox:t,labelDims:n,valueBoxHeight:s,position:r,hasLabel:o})=>(x.g.construct(e)==="x"&&(r=x.q.translate(r,"y",Math.max((n.height-s)/2-1,1))),o&&e==="left"?r=x.q.translate(r,{x:n.width+6,y:0}):o&&e==="top"&&(r=x.q.translate(r,"y",n.height+6)),x.Eo.construct(r.x,r.y,x.Eo.width(t),s)),Yu=({color:e})=>l.jsxRuntimeExports.jsx(Oa,{color:e,dimensions:{width:60,height:25},units:"psi",children:l.jsxRuntimeExports.jsx(g.Text,{level:"p",children:"50.00"})}),Uu=g.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Da,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),Gu=e=>l.jsxRuntimeExports.jsx(Da,{...e}),Wu=g.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:s,control:r,...o})=>{const{click:i}=Vj({aetherKey:e,sink:s});return l.jsxRuntimeExports.jsx(Se,{...r,className:x.CSS.B("symbol"),orientation:n,children:l.jsxRuntimeExports.jsx(za,{...t,onClick:i,...o})})}),Ku=({label:e,...t})=>l.jsxRuntimeExports.jsx(za,{label:"Button",...t}),Xu=g.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Va,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),Qu=e=>l.jsxRuntimeExports.jsx(Va,{...e}),Ju=g.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Fa,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),ed=e=>l.jsxRuntimeExports.jsx(Fa,{...e}),td=g.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Za,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),nd=e=>l.jsxRuntimeExports.jsx(Za,{...e}),sd=g.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Ha,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),rd=e=>l.jsxRuntimeExports.jsx(Ha,{...e}),od=({label:e,onChange:t,aetherKey:n,...s})=>l.jsxRuntimeExports.jsx(re,{...e,onChange:t,children:l.jsxRuntimeExports.jsx(qa,{...s})}),id=e=>l.jsxRuntimeExports.jsx(qa,{...e}),ld=g.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:s,orientation:r,source:o,sink:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:o,sink:i});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Se,{...n,orientation:r,children:l.jsxRuntimeExports.jsx(Ya,{enabled:a,triggered:d,onClick:u,orientation:r,...c})})})}),cd=e=>l.jsxRuntimeExports.jsx(Ya,{...e}),ad=g.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:s,...r})=>{const{enabled:o}=Fj({aetherKey:e,source:n});return l.jsxRuntimeExports.jsx(re,{...t,onChange:s,children:l.jsxRuntimeExports.jsx(Ua,{enabled:o,...r})})}),ud=e=>l.jsxRuntimeExports.jsx(Ua,{...e}),dd=g.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Wa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),xd=e=>l.jsxRuntimeExports.jsx(Wa,{...e}),fd=g.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Ka,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),pd=e=>l.jsxRuntimeExports.jsx(Ka,{...e}),md=g.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Xa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),hd=e=>l.jsxRuntimeExports.jsx(Xa,{...e}),gd=g.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Qa,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),yd=e=>l.jsxRuntimeExports.jsx(Qa,{...e}),Sd=g.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(Ja,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),Ed=e=>l.jsxRuntimeExports.jsx(Ja,{...e}),jd=g.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(eu,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),Rd=e=>l.jsxRuntimeExports.jsx(eu,{...e}),bd=g.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:s,sink:r,onChange:o,control:i,...c})=>{const{enabled:a,triggered:d,toggle:u}=ve({aetherKey:e,source:s,sink:r});return l.jsxRuntimeExports.jsx(re,{...t,onChange:o,children:l.jsxRuntimeExports.jsx(Se,{orientation:n,...i,children:l.jsxRuntimeExports.jsx(tu,{enabled:a,orientation:n,triggered:d,onClick:u,...c})})})}),wd=e=>l.jsxRuntimeExports.jsx(tu,{...e}),Cd=e=>l.jsxRuntimeExports.jsx(Ba,{...e}),vd=({level:e="p",width:t=100,...n})=>l.jsxRuntimeExports.jsx(Ba,{className:x.CSS.B("symbol"),level:e,width:t,...n}),_d=({label:{label:e,level:t},aetherKey:n,position:s,...r})=>l.jsxRuntimeExports.jsx(nu,{label:e,level:t,...r,className:x.CSS.B("symbol")}),kd=({label:e,...t})=>l.jsxRuntimeExports.jsx(nu,{label:"Off Page",...t,orientation:"right"}),oe=4,Pd=2,Wj=["agitator","angledReliefValve","angledValve","offPageReference","box","burstDisc","button","cap","cavityPump","checkValve","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","light","manualValve","needleValve","orifice","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve"],Kj=ne.z.enum(Wj),Ee={orientation:"left",scale:1},Xj={...Ee,source:P.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:P.streamChannelValue({channel:0}),rollingAverage:P.rollingAverage({windowSize:1}),stringifier:P.stringifyNumber({precision:2})},outlet:"stringifier"})},Qj={...Ee,source:P.sourcePipeline("number",{connections:[],segments:{valueStream:P.streamChannelValue({channel:0})},outlet:"valueStream"})},Jj={...Ee,sink:P.sinkPipeline("number",{connections:[],segments:{setter:P.setChannelValue({channel:0})},inlet:"setter"})},Nd={...Ee,source:P.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:P.streamChannelValue({channel:0}),threshold:P.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Md={...Ee,control:{show:!0},sink:P.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:P.setChannelValue({channel:0}),setpoint:P.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},_e={...Nd,...Md},ee=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),e0={width:125,height:200},yo={dimensions:e0},t0=3,n0={name:"Three Way Valve",key:"threeWayValve",Form:Ce,Symbol:ou,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Three Way Valve"),..._e}),Preview:iu,zIndex:oe},s0={name:"Valve",key:"valve",Form:Ce,Symbol:lu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Valve"),..._e}),Preview:cu,zIndex:oe},r0={name:"Solenoid Valve",key:"solenoidValve",Form:Ce,Symbol:au,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:uu,zIndex:oe},o0={name:"Four Way Valve",key:"fourWayValve",Form:Ce,Symbol:du,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Four Way Valve"),..._e}),Preview:xu,zIndex:oe},i0={name:"Angled Valve",key:"angledValve",Form:Ce,Symbol:fu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Angled Valve"),..._e}),Preview:pu,zIndex:oe},l0={name:"Pump",key:"pump",Form:Ce,Symbol:mu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Pump"),..._e}),Preview:hu,zIndex:oe},c0={name:"Screw Pump",key:"screwPump",Form:Ce,Symbol:Xu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Screw Pump"),..._e}),Preview:Qu,zIndex:oe},a0={name:"Tank",key:"tank",Form:ga,Symbol:gu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...ee("Tank"),borderRadius:Ma,...yo,...Ee}),Preview:yu,zIndex:Pd},u0={name:"Box",key:"box",Form:()=>ga({includeBorderRadius:!0}),Symbol:Su,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...ee("Box"),borderRadius:t0,...yo,...Ee}),Preview:Eu,zIndex:Pd},d0={name:"Relief Valve",key:"reliefValve",Form:Te,Symbol:ju,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Relief Valve"),...Ee}),Preview:Ru,zIndex:oe},x0={name:"Regulator",key:"regulator",Form:Te,Symbol:bu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Regulator"),...Ee}),Preview:wu,zIndex:oe},f0={name:"Electric Regulator",key:"electricRegulator",Form:Te,Symbol:Cu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Electric Regulator"),...Ee}),Preview:vu,zIndex:oe},p0={name:"Burst Disc",key:"burstDisc",Form:Te,Symbol:_u,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Burst Disc"),...Ee}),Preview:ku,zIndex:oe},m0={name:"Cap",key:"cap",Form:Te,Symbol:Pu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cap"),...Ee}),Preview:Nu,zIndex:oe},h0={name:"Manual Valve",key:"manualValve",Form:Te,Symbol:Mu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Manual Valve"),...Ee}),Preview:Tu,zIndex:oe},g0={name:"Filter",key:"filter",Form:Te,Symbol:$u,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Filter"),...Ee}),Preview:Ou,zIndex:oe},y0={name:"Needle Valve",key:"needleValve",Form:Te,Symbol:Du,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Needle Valve"),...Ee}),Preview:zu,zIndex:oe},S0={name:"Check Valve",key:"checkValve",Form:Te,Symbol:Bu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Check Valve"),...Ee}),Preview:Iu,zIndex:oe},E0={name:"Orifice",key:"orifice",Form:Te,Symbol:Vu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Orifice"),...Ee}),Preview:Fu,zIndex:oe},j0={name:"Angled Relief Valve",key:"angledReliefValve",Form:Te,Symbol:Zu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Angled Relief Valve"),...Ee}),Preview:Hu,zIndex:oe},R0={name:"Value",key:"value",Form:wj,Symbol:qu,Preview:Yu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...ee("Value"),...Ee,telem:Xj.source}),zIndex:oe},b0={name:"Button",key:"button",Symbol:Wu,Form:kj,Preview:Ku,defaultProps:e=>({color:e.colors.primary.z.rgba255,...ee("Button"),...Md,onClickDelay:0,scale:null}),zIndex:oe},w0={name:"Switch",key:"switch",Symbol:Uu,Preview:Gu,Form:Ce,defaultProps:()=>({...ee("Switch"),..._e,scale:null}),zIndex:oe},C0={name:"Vacuum Pump",key:"vacuumPump",Symbol:Ju,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Vacuum Pump"),..._e}),Preview:ed,zIndex:oe},v0={name:"Cavity Pump",key:"cavityPump",Symbol:td,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cavity Pump"),..._e}),Preview:nd,zIndex:oe},_0={name:"Piston Pump",key:"pistonPump",Symbol:sd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Piston Pump"),..._e}),Preview:rd,zIndex:oe},k0={name:"Static Mixer",key:"staticMixer",Symbol:od,Form:Te,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Static Mixer"),...Ee}),Preview:id,zIndex:oe},P0={name:"Rotary Mixer",key:"rotaryMixer",Symbol:ld,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Rotary Mixer"),..._e}),Preview:cd,zIndex:oe},N0={name:"Light",key:"light",Symbol:ad,Form:vj,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Light"),...Nd}),Preview:ud,zIndex:oe},M0={name:"Setpoint",key:"setpoint",Symbol:Au,Form:Nj,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...ee("Setpoint"),...Qj,...Jj}),Preview:Lu,zIndex:oe},T0={name:"Agitator",key:"agitator",Symbol:dd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Agitator"),..._e}),Preview:xd,zIndex:oe},A0={name:"Propeller Agitator",key:"propellerAgitator",Symbol:fd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Propeller Agitator"),..._e}),Preview:pd,zIndex:oe},L0={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:md,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Flat Blade Agitator"),..._e}),Preview:hd,zIndex:oe},$0={name:"Paddle Agitator",key:"paddleAgitator",Symbol:gd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Paddle Agitator"),..._e}),Preview:yd,zIndex:oe},O0={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Sd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Cross Beam Agitator"),..._e}),Preview:Ed,zIndex:oe},D0={name:"Helical Agitator",key:"helicalAgitator",Symbol:jd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Helical Agitator"),..._e}),Preview:Rd,zIndex:oe},z0={name:"Compressor",key:"compressor",Symbol:bd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...ee("Compressor"),..._e}),Preview:wd,zIndex:oe},B0={name:"Text Box",key:"textBox",Symbol:Cd,Form:Mj,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...ee("Text Box"),...Ee,...yo,level:"p",text:"Text Box",width:75}),Preview:vd,zIndex:oe},I0={name:"Off Page Reference",key:"offPageReference",Form:Tj,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...ee("Off Page Reference")}),Preview:kd,zIndex:oe},V0={value:R0,button:b0,tank:a0,switch:w0,offPageReference:I0,light:N0,setpoint:M0,box:u0,textBox:B0,valve:s0,solenoidValve:r0,threeWayValve:n0,fourWayValve:o0,angledValve:i0,manualValve:h0,needleValve:y0,reliefValve:d0,angledReliefValve:j0,checkValve:S0,regulator:x0,electricRegulator:f0,pump:l0,pistonPump:_0,screwPump:c0,cavityPump:v0,vacuumPump:C0,staticMixer:k0,rotaryMixer:P0,burstDisc:p0,cap:m0,filter:g0,orifice:E0,agitator:T0,propellerAgitator:A0,flatBladeAgitator:L0,paddleAgitator:$0,crossBeamAgitator:O0,helicalAgitator:D0,compressor:z0},F0=Object.freeze(Object.defineProperty({__proto__:null,Agitator:dd,AgitatorPreview:xd,AngledReliefValve:Zu,AngledReliefValvePreview:Hu,AngledValve:fu,AngledValvePreview:pu,Box:Su,BoxPreview:Eu,BurstDisc:_u,BurstDiscPreview:ku,Button:Wu,ButtonPreview:Ku,Cap:Pu,CapPreview:Nu,CavityPump:td,CavityPumpPreview:nd,CheckValve:Bu,CheckValvePreview:Iu,Compressor:bd,CompressorPreview:wd,CrossBeamAgitator:Sd,CrossBeamAgitatorPreview:Ed,ElectricRegulator:Cu,ElectricRegulatorPreview:vu,Filter:$u,FilterPreview:Ou,FlatBladeAgitator:md,FlatBladeAgitatorPreview:hd,FourWayValve:du,FourWayValvePreview:xu,HelicalAgitator:jd,HelicalAgitatorPreview:Rd,Light:ad,LightPreview:ud,ManualValve:Mu,ManualValvePreview:Tu,NeedleValve:Du,NeedleValvePreview:zu,OffPageReference:_d,OffPageReferencePreview:kd,Orifice:Vu,OrificePreview:Fu,PaddleAgitator:gd,PaddleAgitatorPreview:yd,PistonPump:sd,PistonPumpPreview:rd,PropellerAgitator:fd,PropellerAgitatorPreview:pd,Pump:mu,PumpPreview:hu,Regulator:bu,RegulatorPreview:wu,ReliefValve:ju,ReliefValvePreview:Ru,RotaryMixer:ld,RotaryMixerPreview:cd,SYMBOLS:V0,ScrewPump:Xu,ScrewPumpPreview:Qu,Setpoint:Au,SetpointPreview:Lu,SolenoidValve:au,SolenoidValvePreview:uu,StaticMixer:od,StaticMixerPreview:id,Switch:Uu,SwitchPreview:Gu,Tank:gu,TankPreview:yu,TextBox:Cd,TextBoxPreview:vd,ThreeWayValve:ou,ThreeWayValvePreview:iu,VacuumPump:Ju,VacuumPumpPreview:ed,Value:qu,ValuePreview:Yu,Valve:lu,ValvePreview:cu,typeZ:Kj},Symbol.toStringTag,{value:"Module"}));exports.Aether=g.main;exports.Dialog=g.use$4;exports.Divider=g.Divider$1;exports.Dropdown=g.Dropdown;exports.Haul=g.Haul;exports.Worker=g.Context$1;exports.compareArrayDeps=g.compareArrayDeps;exports.componentRenderProp=g.componentRenderProp;exports.isRenderProp=g.isRenderProp;exports.useAsyncEffect=g.useAsyncEffect;exports.useClickOutside=g.useClickOutside;exports.useCombinedRefs=g.useCombinedRefs;exports.useCombinedStateAndRef=g.useCombinedStateAndRef;exports.useDebouncedCallback=g.useDebouncedCallback;exports.useEffectCompare=g.useEffectCompare;exports.useMemoCompare=g.useMemoCompare;exports.useMemoDeepEqualProps=g.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=g.useMemoPrimitiveArray;exports.usePrevious=g.usePrevious;exports.useResize=g.useResize;exports.useStateRef=g.useStateRef;exports.useSyncedRef=g.useSyncedRef;exports.useTransforms=g.useTransforms;exports.CSS=x.CSS;exports.newBEM=x.newBEM;exports.Header=qn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Ct;exports.Rate=Z.P;exports.Series=Z.V;exports.TimeRange=Z.E;exports.TimeSpan=Z.y;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=X.Generic;exports.Align=fx.external;exports.Icon=be.Icon;exports.Tabs=be.external;exports.Button=px.external;exports.Caret=_i.Animated$1;exports.telem=P.external;exports.Color=_r.external;exports.Text=Me.external;exports.Triggers=ki.external;exports.List=nn.external;exports.createFilterTransform=nn.createFilterTransform;exports.fuseFilter=nn.fuseFilter;exports.proxyMemo=nn.proxyMemo;exports.createHexOpacityVariants=Pi.createHexOpacityVariants;exports.unitProperty=Pi.unitProperty;exports.Input=He.external;exports.Menu=hx.external;exports.Theming=gx.external;exports.Tree=yx.external;exports.Video=Sx.Video;exports.Accordion=zx;exports.Breadcrumb=Vx;exports.Canvas=of;exports.Channel=ep;exports.Control=dm;exports.Device=yp;exports.Diagram=gj;exports.Eraser=Yp;exports.Form=mp;exports.Label=wp;exports.Legend=df;exports.Line=ff;exports.LinePlot=If;exports.Log=Sj;exports.Measure=Hf;exports.Modal=vp;exports.Mosaic=Zp;exports.Nav=Wp;exports.Note=Xp;exports.OS=nm;exports.Observe=fp;exports.Override=rm;exports.Pluto=mm;exports.Portal=$p;exports.Progress=gm;exports.Range=Ff;exports.Ranger=wm;exports.Resize=Nx;exports.Rule=qf;exports.Schematic=F0;exports.Select=kf;exports.Status=Rx;exports.Steps=vm;exports.Synnax=Hx;exports.Tag=vf;exports.Telem=lm;exports.Tooltip=bx;exports.Value=qj;exports.Viewport=Bf;exports.axis=ef;exports.control=tf;
|
|
33
|
+
*/var oi;function Nj(){return oi||(oi=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=ta();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;function u(d,x,f,m,h){var E=r(null),v;E.current===null?(v={hasValue:!1,value:null},E.current=v):v=E.current;var w=c(function(){var C=!1,P,b,L=function(T){if(!C){C=!0,P=T;var z=m(T);if(h!==void 0&&v.hasValue){var R=v.value;if(h(R,z))return b=R,R}return b=z,z}var I=P,k=b;if(s(I,T))return k;var D=m(T);return h!==void 0&&h(k,D)?k:(P=T,b=D,D)},N=f===void 0?null:f,A=function(){return L(x())},O=N===null?void 0:function(){return L(N())};return[A,O]},[x,f,m,h]),_=w[0],S=w[1],j=o(d,_,S);return l(function(){v.hasValue=!0,v.value=j},[j]),a(j),j}Xs.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Xs}process.env.NODE_ENV==="production"?So.exports=Mj():So.exports=Nj();var Tj=So.exports;const Lj=y.getDefaultExportFromCjs(Tj),Aj={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},ri=e=>{let t;const n=new Set,s=(d,x)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=x??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,m))}},o=()=>t,a={setState:s,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Aj?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,o,a);return a},$j=e=>e?ri(e):ri,{useDebugValue:Ij}=g,{useSyncExternalStoreWithSelector:Oj}=Lj,Dj=e=>e;function na(e,t=Dj,n){const s=Oj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ij(s),s}const ii=(e,t)=>{const n=$j(e),s=(o,r=t)=>na(n,o,r);return Object.assign(s,n),s},zj=(e,t)=>e?ii(e,t):ii;function ge(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Rs=g.createContext(null),Bj=Rs.Provider,sa=Te.error001();function xe(e,t){const n=g.useContext(Rs);if(n===null)throw new Error(sa);return na(n,e,t)}function me(){const e=g.useContext(Rs);if(e===null)throw new Error(sa);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const li={display:"none"},Vj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oa="react-flow__node-desc",ra="react-flow__edge-desc",Fj="react-flow__aria-live",Hj=e=>e.ariaLiveMessage;function Zj({rfId:e}){const t=xe(Hj);return i.jsxRuntimeExports.jsx("div",{id:`${Fj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Vj,children:t})}function Yj({rfId:e,disableKeyboardA11y:t}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs("div",{id:`${oa}-${e}`,style:li,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),i.jsxRuntimeExports.jsx("div",{id:`${ra}-${e}`,style:li,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&i.jsxRuntimeExports.jsx(Zj,{rfId:e})]})}const qj=e=>e.userSelectionActive?"none":"all";function rr({position:e="top-left",children:t,className:n,style:s,...o}){const r=xe(qj),l=`${e}`.split("-");return i.jsxRuntimeExports.jsx("div",{className:Se(["react-flow__panel",n,...l]),style:{...s,pointerEvents:r},...o,children:t})}function Wj({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:i.jsxRuntimeExports.jsx(rr,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:i.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Xj=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},vn=e=>e.id;function Gj(e,t){return ge(e.selectedNodes.map(vn),t.selectedNodes.map(vn))&&ge(e.selectedEdges.map(vn),t.selectedEdges.map(vn))}function Kj({onSelectionChange:e}){const t=me(),{selectedNodes:n,selectedEdges:s}=xe(Xj,Gj);return g.useEffect(()=>{const o={nodes:n,edges:s};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(r=>r(o))},[n,s,e]),null}const Uj=e=>!!e.onSelectionChangeHandlers;function Qj({onSelectionChange:e}){const t=xe(Uj);return e||t?i.jsxRuntimeExports.jsx(Kj,{onSelectionChange:e}):null}const ia=[0,0],Jj={x:0,y:0,zoom:1},eS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],ci=[...eS,"rfId"],tS=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),ai={translateExtent:sn,nodeOrigin:ia,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function nS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=xe(tS,ge),d=me();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{x.current=ai,c()}),[]);const x=g.useRef(ai);return g.useEffect(()=>{for(const f of ci){const m=e[f],h=x.current[f];m!==h&&(typeof e[f]>"u"||(f==="nodes"?t(m):f==="edges"?n(m):f==="minZoom"?s(m):f==="maxZoom"?o(m):f==="translateExtent"?r(m):f==="nodeExtent"?l(m):f==="paneClickDistance"?u(m):f==="fitView"?d.setState({fitViewOnInit:m}):f==="fitViewOptions"?d.setState({fitViewOnInitOptions:m}):d.setState({[f]:m})))}x.current=e},ci.map(f=>e[f])),null}function ui(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function sS(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const o=ui(),r=()=>n(o!=null&&o.matches?"dark":"light");return r(),o==null||o.addEventListener("change",r),()=>{o==null||o.removeEventListener("change",r)}},[e]),t!==null?t:(s=ui())!=null&&s.matches?"dark":"light"}const di=typeof document<"u"?document:null;function ln(e=null,t={target:di,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),o=g.useRef(!1),r=g.useRef(new Set([])),[l,c]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
34
|
+
`).replace(`
|
|
35
|
+
|
|
36
|
+
`,`
|
|
37
|
+
+`).split(`
|
|
38
|
+
`)),d=u.reduce((x,f)=>x.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||di;if(e!==null){const u=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&ho(f))return!1;const h=fi(f.code,c);r.current.add(f[h]),xi(l,r.current,!1)&&(f.preventDefault(),s(!0))},d=f=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&ho(f))return!1;const h=fi(f.code,c);xi(l,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(f[h]),f.key==="Meta"&&r.current.clear(),o.current=!1},x=()=>{r.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),n}function xi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function fi(e,t){return t.includes(e)?"code":"key"}const oS=()=>{const e=me();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,o,r],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??r},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:o,panZoom:r,domNode:l}=e.getState();if(!r||!l)return Promise.resolve(!1);const c=fo(n,t),{width:a,height:u}=js(l);return po({nodes:c,width:a,height:u,minZoom:s,maxZoom:o,panZoom:r},t)},setCenter:async(t,n,s)=>{const{width:o,height:r,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,u=o/2-t*a,d=r/2-n*a;return c?(await c.setViewport({x:u,y:d,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:o,minZoom:r,maxZoom:l,panZoom:c}=e.getState(),a=er(t,s,o,r,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:o,domNode:r}=e.getState();if(!r)return t;const{x:l,y:c}=r.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return pn(a,s,n.snapToGrid,o)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:r}=s.getBoundingClientRect(),l=Ac(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function la(e,t){const n=[],s=new Map,o=[];for(const r of e)if(r.type==="add"){o.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const l=s.get(r.id);l?l.push(r):s.set(r.id,[r])}for(const r of t){const l=s.get(r.id);if(!l){n.push(r);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...r};for(const a of l)rS(a,c);n.push(c)}return o.length&&o.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function rS(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ca(e,t){return la(e,t)}function aa(e,t){return la(e,t)}function ut(e,t){return{id:e,type:"select",selected:t}}function wt(e,t=new Set,n=!1){const s=[];for(const[o,r]of e){const l=t.has(o);!(r.selected===void 0&&!l)&&r.selected!==l&&(n&&(r.selected=l),s.push(ut(r.id,l)))}return s}function pi({items:e=[],lookup:t}){var o;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,l]of e.entries()){const c=t.get(l.id),a=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function mi(e){return{id:e.id,type:"remove"}}const hi=e=>zE(e),iS=e=>kc(e);function ua(e){return g.forwardRef(e)}const lS=typeof window<"u"?g.useLayoutEffect:g.useEffect;function gi(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>cS(()=>n(o=>o+BigInt(1))));return lS(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function cS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const da=g.createContext(null);function aS({children:e}){const t=me(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:d,onNodesChange:x,nodeLookup:f}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(pi({items:m,lookup:f}))},[]),s=gi(n),o=g.useCallback(c=>{const{edges:a=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:x,edgeLookup:f}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(pi({items:m,lookup:f}))},[]),r=gi(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(da.Provider,{value:l,children:e})}function uS(){const e=g.useContext(da);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const dS=e=>!!e.panZoom;function ct(){const e=oS(),t=me(),n=uS(),s=xe(dS),o=g.useMemo(()=>{const r=x=>t.getState().nodeLookup.get(x),l=x=>{n.nodeQueue.push(x)},c=x=>{n.edgeQueue.push(x)},a=x=>{var w,_;const{nodeLookup:f,nodeOrigin:m}=t.getState(),h=hi(x)?x:f.get(x.id),E=h.parentId?Ic(h.position,h.measured,h.parentId,f,m):h.position,v={id:h.id,position:E,width:((w=h.measured)==null?void 0:w.width)??h.width,height:((_=h.measured)==null?void 0:_.height)??h.height,data:h.data};return Mt(v)},u=(x,f,m={replace:!1})=>{l(h=>h.map(E=>{if(E.id===x){const v=typeof f=="function"?f(E):f;return m.replace&&hi(v)?v:{...E,...v}}return E}))},d=(x,f,m={replace:!1})=>{c(h=>h.map(E=>{if(E.id===x){const v=typeof f=="function"?f(E):f;return m.replace&&iS(v)?v:{...E,...v}}return E}))};return{getNodes:()=>t.getState().nodes.map(x=>({...x})),getNode:x=>{var f;return(f=r(x))==null?void 0:f.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:x=[]}=t.getState();return x.map(f=>({...f}))},getEdge:x=>t.getState().edgeLookup.get(x),setNodes:l,setEdges:c,addNodes:x=>{const f=Array.isArray(x)?x:[x];n.nodeQueue.push(m=>[...m,...f])},addEdges:x=>{const f=Array.isArray(x)?x:[x];n.edgeQueue.push(m=>[...m,...f])},toObject:()=>{const{nodes:x=[],edges:f=[],transform:m}=t.getState(),[h,E,v]=m;return{nodes:x.map(w=>({...w})),edges:f.map(w=>({...w})),viewport:{x:h,y:E,zoom:v}}},deleteElements:async({nodes:x=[],edges:f=[]})=>{const{nodes:m,edges:h,onNodesDelete:E,onEdgesDelete:v,triggerNodeChanges:w,triggerEdgeChanges:_,onDelete:S,onBeforeDelete:j}=t.getState(),{nodes:C,edges:P}=await FE({nodesToRemove:x,edgesToRemove:f,nodes:m,edges:h,onBeforeDelete:j}),b=P.length>0,L=C.length>0;if(b){const N=P.map(mi);v==null||v(P),_(N)}if(L){const N=C.map(mi);E==null||E(C),w(N)}return(L||b)&&(S==null||S({nodes:C,edges:P})),{deletedNodes:C,deletedEdges:P}},getIntersectingNodes:(x,f=!0,m)=>{const h=Zr(x),E=h?x:a(x),v=m!==void 0;return E?(m||t.getState().nodes).filter(w=>{const _=t.getState().nodeLookup.get(w.id);if(_&&!h&&(w.id===x.id||!_.internals.positionAbsolute))return!1;const S=Mt(v?w:_),j=on(S,E);return f&&j>0||j>=E.width*E.height}):[]},isNodeIntersecting:(x,f,m=!0)=>{const E=Zr(x)?x:a(x);if(!E)return!1;const v=on(E,f);return m&&v>0||v>=E.width*E.height},updateNode:u,updateNodeData:(x,f,m={replace:!1})=>{u(x,h=>{const E=typeof f=="function"?f(h):f;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},updateEdge:d,updateEdgeData:(x,f,m={replace:!1})=>{d(x,h=>{const E=typeof f=="function"?f(h):f;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},getNodesBounds:x=>{const{nodeLookup:f,nodeOrigin:m}=t.getState();return BE(x,{nodeLookup:f,nodeOrigin:m})},getHandleConnections:({type:x,id:f,nodeId:m})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${m}-${x}-${f??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const yi=e=>e.selected,xS={actInsideInputWithModifier:!1},fS=typeof window<"u"?window:void 0;function pS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=me(),{deleteElements:s}=ct(),o=ln(e,xS),r=ln(t,{target:fS});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(yi),edges:l.filter(yi)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function mS(e){const t=me();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=js(e.current);(s.height===0||s.width===0)&&((r=(o=t.getState()).onError)==null||r.call(o,"004",Te.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const ws={position:"absolute",width:"100%",height:"100%",top:0,left:0},hS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function gS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=xt.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:f,preventScrolling:m=!0,children:h,noWheelClassName:E,noPanClassName:v,onViewportChange:w,isControlledViewport:_,paneClickDistance:S}){const j=me(),C=g.useRef(null),{userSelectionActive:P,lib:b}=xe(hS,ge),L=ln(f),N=g.useRef();mS(C);const A=g.useCallback(O=>{w==null||w({x:O[0],y:O[1],zoom:O[2]}),_||j.setState({transform:O})},[w,_]);return g.useEffect(()=>{if(C.current){N.current=jj({domNode:C.current,minZoom:d,maxZoom:x,translateExtent:u,viewport:a,paneClickDistance:S,onDraggingChange:R=>j.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:k,onMoveStart:D}=j.getState();D==null||D(R,I),k==null||k(I)},onPanZoom:(R,I)=>{const{onViewportChange:k,onMove:D}=j.getState();D==null||D(R,I),k==null||k(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:k,onMoveEnd:D}=j.getState();D==null||D(R,I),k==null||k(I)}});const{x:O,y:T,zoom:z}=N.current.getViewport();return j.setState({panZoom:N.current,transform:[O,T,z],domNode:C.current.closest(".react-flow")}),()=>{var R;(R=N.current)==null||R.destroy()}}},[]),g.useEffect(()=>{var O;(O=N.current)==null||O.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:r,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:m,noPanClassName:v,userSelectionActive:P,noWheelClassName:E,lib:b,onTransformChange:A})},[e,t,n,s,o,r,l,c,L,m,v,P,E,b,A]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:C,style:ws,children:h})}const yS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ES(){const{userSelectionActive:e,userSelectionRect:t}=xe(yS,ge);return e&&t?i.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Gs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},jS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function SS({isSelecting:e,selectionKeyPressed:t,selectionMode:n=kt.Full,panOnDrag:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:x,onPaneMouseLeave:f,children:m}){const h=g.useRef(null),E=me(),v=g.useRef(0),w=g.useRef(0),_=g.useRef(),S=g.useRef(new Map),{userSelectionActive:j,elementsSelectable:C,dragging:P}=xe(jS,ge),b=C&&(e||j),L=g.useRef(!1),N=g.useRef(!1),A=()=>{E.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,w.current=0},O=M=>{if(L.current){L.current=!1;return}c==null||c(M),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},T=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}a==null||a(M)},z=u?M=>u(M):void 0,R=M=>{var G,K,U,ee;const{resetSelectedElements:B,domNode:V,edgeLookup:Z}=E.getState();if(_.current=V==null?void 0:V.getBoundingClientRect(),!C||!e||M.button!==0||M.target!==h.current||!_.current)return;(K=(G=M.target)==null?void 0:G.setPointerCapture)==null||K.call(G,M.pointerId),N.current=!0,L.current=!1,S.current=new Map;for(const[X,se]of Z)S.current.set(se.source,((U=S.current.get(se.source))==null?void 0:U.add(X))||new Set([X])),S.current.set(se.target,((ee=S.current.get(se.target))==null?void 0:ee.add(X))||new Set([X]));const{x:W,y:Q}=We(M.nativeEvent,_.current);B(),E.setState({userSelectionRect:{width:0,height:0,startX:W,startY:Q,x:W,y:Q}}),r==null||r(M)},I=M=>{const{userSelectionRect:B,edgeLookup:V,transform:Z,nodeLookup:W,triggerNodeChanges:Q,triggerEdgeChanges:G}=E.getState();if(!_.current||!B)return;L.current=!0;const{x:K,y:U}=We(M.nativeEvent,_.current),{startX:ee,startY:X}=B,se={startX:ee,startY:X,x:K<ee?K:ee,y:U<X?U:X,width:Math.abs(K-ee),height:Math.abs(U-X)},de=Pc(W,se,Z,n===kt.Partial,!0),re=new Set,F=new Set;for(const J of de){F.add(J.id);const oe=S.current.get(J.id);if(oe)for(const he of oe)re.add(he)}if(v.current!==F.size){v.current=F.size;const J=wt(W,F,!0);Q(J)}if(w.current!==re.size){w.current=re.size;const J=wt(V,re);G(J)}E.setState({userSelectionRect:se,userSelectionActive:!0,nodesSelectionActive:!1})},k=M=>{var V,Z;if(M.button!==0||!N.current)return;(Z=(V=M.target)==null?void 0:V.releasePointerCapture)==null||Z.call(V,M.pointerId);const{userSelectionRect:B}=E.getState();!j&&B&&M.target===h.current&&(O==null||O(M)),v.current>0&&E.setState({nodesSelectionActive:!0}),A(),l==null||l(M),(t||o)&&(L.current=!1),N.current=!1},D=s===!0||Array.isArray(s)&&s.includes(0);return i.jsxRuntimeExports.jsxs("div",{className:Se(["react-flow__pane",{draggable:D,dragging:P,selection:e}]),onClick:b?void 0:Gs(O,h),onContextMenu:Gs(T,h),onWheel:Gs(z,h),onPointerEnter:b?void 0:d,onPointerDown:b?R:x,onPointerMove:b?I:x,onPointerUp:b?k:void 0,onPointerLeave:f,ref:h,style:ws,children:[m,i.jsxRuntimeExports.jsx(ES,{})]})}function Ro({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),u=c.get(e);if(!u){a==null||a("012",Te.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function xa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=me(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=ij({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{Ro({id:x,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{var x,f;if(t)(x=d.current)==null||x.destroy();else if(e.current)return(f=d.current)==null||f.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:o,nodeClickDistance:l}),()=>{var m;(m=d.current)==null||m.destroy()}},[n,s,t,r,e,o]),a}const RS=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fa(){const e=me();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:r,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:u,nodeOrigin:d}=e.getState(),x=new Map,f=RS(l),m=o?r[0]:5,h=o?r[1]:5,E=n.direction.x*m*n.factor,v=n.direction.y*h*n.factor;for(const[,w]of u){if(!f(w))continue;let _={x:w.internals.positionAbsolute.x+E,y:w.internals.positionAbsolute.y+v};o&&(_=Es(_,r));const{position:S,positionAbsolute:j}=Mc({nodeId:w.id,nextPosition:_,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:c});w.position=S,w.internals.positionAbsolute=j,x.set(w.id,w)}a(x)},[])}const ir=g.createContext(null),wS=ir.Provider;ir.Consumer;const pa=()=>g.useContext(ir),CS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),vS=(e,t,n)=>s=>{const{connectionClickStartHandle:o,connectionMode:r,connection:l}=s,{fromHandle:c,toHandle:a,isValid:u}=l,d=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:r===ht.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:d&&u}};function bS({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:l,onConnect:c,children:a,className:u,onMouseDown:d,onTouchStart:x,...f},m){var R,I;const h=l||null,E=e==="target",v=me(),w=pa(),{connectOnClick:_,noPanClassName:S,rfId:j}=xe(CS,ge),{connectingFrom:C,connectingTo:P,clickConnecting:b,isPossibleEndHandle:L,connectionInProcess:N,valid:A}=xe(vS(w,h,e),ge);w||(I=(R=v.getState()).onError)==null||I.call(R,"010",Te.error010());const O=k=>{const{defaultEdgeOptions:D,onConnect:M,hasDefaultEdges:B}=v.getState(),V={...D,...k};if(B){const{edges:Z,setEdges:W}=v.getState();W(Hc(V,Z))}M==null||M(V),c==null||c(V)},T=k=>{if(!w)return;const D=Dc(k.nativeEvent);if(o&&(D&&k.button===0||!D)){const M=v.getState();jo.onPointerDown(k.nativeEvent,{autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:E,handleId:h,nodeId:w,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:O,isValidConnection:n||M.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed})}D?d==null||d(k):x==null||x(k)},z=k=>{const{onClickConnectStart:D,onClickConnectEnd:M,connectionClickStartHandle:B,connectionMode:V,isValidConnection:Z,lib:W,rfId:Q,nodeLookup:G,connection:K}=v.getState();if(!w||!B&&!o)return;if(!B){D==null||D(k.nativeEvent,{nodeId:w,handleId:h,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:w,type:e,id:h}});return}const U=Oc(k.target),ee=n||Z,{connection:X,isValid:se}=jo.isValid(k.nativeEvent,{handle:{nodeId:w,id:h,type:e},connectionMode:V,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ee,flowId:Q,doc:U,lib:W,nodeLookup:G});se&&X&&O(X);const de=structuredClone(K);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,M==null||M(k,de),v.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":w,"data-handlepos":t,"data-id":`${j}-${w}-${h}-${e}`,className:Se(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:r,clickconnecting:b,connectingfrom:C,connectingto:P,valid:A,connectionindicator:s&&(!N||L)&&(N?r:o)}]),onMouseDown:T,onTouchStart:T,onClick:_?z:void 0,ref:m,...f,children:a})}const cn=g.memo(ua(bS));function _S({data:e,isConnectable:t,sourcePosition:n=q.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,i.jsxRuntimeExports.jsx(cn,{type:"source",position:n,isConnectable:t})]})}function kS({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:s=q.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(cn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(cn,{type:"source",position:s,isConnectable:t})]})}function PS(){return null}function MS({data:e,isConnectable:t,targetPosition:n=q.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(cn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ts={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ei={input:_S,default:kS,output:MS,group:PS};function NS(e){var t,n,s,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const TS=e=>{const{width:t,height:n,x:s,y:o}=fn(e.nodeLookup,{filter:r=>!!r.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function LS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=me(),{width:o,height:r,transformString:l,userSelectionActive:c}=xe(TS,ge),a=fa(),u=g.useRef(null);if(g.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),xa({nodeRef:u}),c||!o||!r)return null;const d=e?f=>{const m=s.getState().nodes.filter(h=>h.selected);e(f,m)}:void 0,x=f=>{Object.prototype.hasOwnProperty.call(ts,f.key)&&a({direction:ts[f.key],factor:f.shiftKey?4:1})};return i.jsxRuntimeExports.jsx("div",{className:Se(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:i.jsxRuntimeExports.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:o,height:r}})})}const ji=typeof window<"u"?window:void 0,AS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ma({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:d,selectionMode:x,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:E,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:C,panOnScrollMode:P,zoomOnDoubleClick:b,panOnDrag:L,defaultViewport:N,translateExtent:A,minZoom:O,maxZoom:T,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:I,noPanClassName:k,disableKeyboardA11y:D,onViewportChange:M,isControlledViewport:B}){const{nodesSelectionActive:V,userSelectionActive:Z}=xe(AS),W=ln(u,{target:ji}),Q=ln(E,{target:ji}),G=Q||L,K=Q||j,U=d&&G!==!0,ee=W||Z||U;return pS({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(gS,{onPaneContextMenu:r,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:K,panOnScrollSpeed:C,panOnScrollMode:P,zoomOnDoubleClick:b,panOnDrag:!W&&G,defaultViewport:N,translateExtent:A,minZoom:O,maxZoom:T,zoomActivationKeyCode:v,preventScrolling:z,noWheelClassName:I,noPanClassName:k,onViewportChange:M,isControlledViewport:B,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(SS,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,panOnDrag:G,isSelecting:!!ee,selectionMode:x,selectionKeyPressed:W,selectionOnDrag:U,children:[e,V&&i.jsxRuntimeExports.jsx(LS,{onSelectionContextMenu:R,noPanClassName:k,disableKeyboardA11y:D})]})})}ma.displayName="FlowRenderer";const $S=g.memo(ma),IS=e=>t=>e?Pc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function OS(e){return xe(g.useCallback(IS(e),[e]),ge)}const DS=e=>e.updateNodeInternals;function zS(){const e=xe(DS),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const r=o.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:o.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function BS({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=me(),r=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||l.current!==r.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(r.current),l.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(r.current){const x=u.current!==t,f=c.current!==e.sourcePosition,m=a.current!==e.targetPosition;(x||f||m)&&(u.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function VS({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,onContextMenu:r,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:u,nodesFocusable:d,resizeObserver:x,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:h,rfId:E,nodeTypes:v,nodeExtent:w,nodeClickDistance:_,onError:S}){const{node:j,internals:C,isParent:P}=xe(X=>{const se=X.nodeLookup.get(e),de=X.parentLookup.has(e);return{node:se,internals:se.internals,isParent:de}},ge);let b=j.type||"default",L=(v==null?void 0:v[b])||Ei[b];L===void 0&&(S==null||S("003",Te.error003(b)),b="default",L=Ei.default);const N=!!(j.draggable||c&&typeof j.draggable>"u"),A=!!(j.selectable||a&&typeof j.selectable>"u"),O=!!(j.connectable||u&&typeof j.connectable>"u"),T=!!(j.focusable||d&&typeof j.focusable>"u"),z=me(),R=$c(j),I=BS({node:j,nodeType:b,hasDimensions:R,resizeObserver:x}),k=xa({nodeRef:I,disabled:j.hidden||!N,noDragClassName:f,handleSelector:j.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:_}),D=fa();if(j.hidden)return null;const M=Ue(j),B=NS(j),V=A||N||t||n||s||o,Z=n?X=>n(X,{...C.userNode}):void 0,W=s?X=>s(X,{...C.userNode}):void 0,Q=o?X=>o(X,{...C.userNode}):void 0,G=r?X=>r(X,{...C.userNode}):void 0,K=l?X=>l(X,{...C.userNode}):void 0,U=X=>{const{selectNodesOnDrag:se,nodeDragThreshold:de}=z.getState();A&&(!se||!N||de>0)&&Ro({id:e,store:z,nodeRef:I}),t&&t(X,{...C.userNode})},ee=X=>{if(!(ho(X.nativeEvent)||h))if(vc.includes(X.key)&&A){const se=X.key==="Escape";Ro({id:e,store:z,unselect:se,nodeRef:I})}else N&&j.selected&&Object.prototype.hasOwnProperty.call(ts,X.key)&&(z.setState({ariaLiveMessage:`Moved selected node ${X.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~C.positionAbsolute.x}, y: ${~~C.positionAbsolute.y}`}),D({direction:ts[X.key],factor:X.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:Se(["react-flow__node",`react-flow__node-${b}`,{[m]:N},j.className,{selected:j.selected,selectable:A,parent:P,draggable:N,dragging:k}]),ref:I,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:R?"visible":"hidden",...j.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:W,onMouseLeave:Q,onContextMenu:G,onClick:U,onDoubleClick:K,onKeyDown:T?ee:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":h?void 0:`${oa}-${E}`,"aria-label":j.ariaLabel,children:i.jsxRuntimeExports.jsx(wS,{value:e,children:i.jsxRuntimeExports.jsx(L,{id:e,data:j.data,type:b,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:j.selected,selectable:A,draggable:N,deletable:j.deletable??!0,isConnectable:O,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:k,dragHandle:j.dragHandle,zIndex:C.z,parentId:j.parentId,...M})})})}const FS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ha(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=xe(FS,ge),l=OS(e.onlyRenderVisibleElements),c=zS();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:ws,children:l.map(a=>i.jsxRuntimeExports.jsx(VS,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}ha.displayName="NodeRenderer";const HS=g.memo(ha);function ZS(e){return xe(g.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const r=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);r&&l&&YE({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),ge)}const YS=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),qS=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Si={[Un.Arrow]:YS,[Un.ArrowClosed]:qS};function WS(e){const t=me();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(Si,e)?Si[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Te.error009(e)),null)},[e])}const XS=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=WS(t);return a?i.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:c,refX:"0",refY:"0",children:i.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},ga=({defaultColor:e,rfId:t})=>{const n=xe(r=>r.edges),s=xe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>QE(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return o.length?i.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:i.jsxRuntimeExports.jsx("defs",{children:o.map(r=>i.jsxRuntimeExports.jsx(XS,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};ga.displayName="MarkerDefinitions";var GS=g.memo(ga);function ya({x:e,y:t,label:n,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:u,...d}){const[x,f]=g.useState({x:1,y:0,width:0,height:0}),m=Se(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const E=h.current.getBBox();f({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),typeof n>"u"||!n?null:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-x.width/2} ${t-x.height/2})`,className:m,visibility:x.width?"visible":"hidden",...d,children:[o&&i.jsxRuntimeExports.jsx("rect",{width:x.width+2*l[0],x:-l[0],y:-l[1],height:x.height+2*l[1],className:"react-flow__edge-textbg",style:r,rx:c,ry:c}),i.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}ya.displayName="EdgeText";const KS=g.memo(ya);function It({id:e,path:t,labelX:n,labelY:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u,style:d,markerEnd:x,markerStart:f,className:m,interactionWidth:h=20}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{id:e,style:d,d:t,fill:"none",className:Se(["react-flow__edge-path",m]),markerEnd:x,markerStart:f}),h&&i.jsxRuntimeExports.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&Oe(n)&&Oe(s)?i.jsxRuntimeExports.jsx(KS,{x:n,y:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ri({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===q.Left||e===q.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Ea({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top}){const[l,c]=Ri({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=Ri({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,f,m]=zc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${s},${o}`,d,x,f,m]}function ja(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=q.Bottom,targetPosition:c=q.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:w})=>{const[_,S,j]=Ea({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),C=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(It,{id:C,path:_,labelX:S,labelY:j,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:w})})}const US=ja({isInternal:!1}),Sa=ja({isInternal:!0});US.displayName="SimpleBezierEdge";Sa.displayName="SimpleBezierEdgeInternal";function Ra(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,sourcePosition:m=q.Bottom,targetPosition:h=q.Top,markerEnd:E,markerStart:v,pathOptions:w,interactionWidth:_})=>{const[S,j,C]=go({sourceX:n,sourceY:s,sourcePosition:m,targetX:o,targetY:r,targetPosition:h,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(It,{id:P,path:S,labelX:j,labelY:C,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:E,markerStart:v,interactionWidth:_})})}const wa=Ra({isInternal:!1}),Ca=Ra({isInternal:!0});wa.displayName="SmoothStepEdge";Ca.displayName="SmoothStepEdgeInternal";function va(e){return g.memo(({id:t,...n})=>{var o;const s=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(wa,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const QS=va({isInternal:!1}),ba=va({isInternal:!0});QS.displayName="StepEdge";ba.displayName="StepEdgeInternal";function _a(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:m,markerStart:h,interactionWidth:E})=>{const[v,w,_]=Zc({sourceX:n,sourceY:s,targetX:o,targetY:r}),S=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(It,{id:S,path:v,labelX:w,labelY:_,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:m,markerStart:h,interactionWidth:E})})}const JS=_a({isInternal:!1}),ka=_a({isInternal:!0});JS.displayName="StraightEdge";ka.displayName="StraightEdgeInternal";function Pa(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=q.Bottom,targetPosition:c=q.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,pathOptions:w,interactionWidth:_})=>{const[S,j,C]=Bc({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c,curvature:w==null?void 0:w.curvature}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(It,{id:P,path:S,labelX:j,labelY:C,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:_})})}const e0=Pa({isInternal:!1}),Ma=Pa({isInternal:!0});e0.displayName="BezierEdge";Ma.displayName="BezierEdgeInternal";const wi={default:Ma,straight:ka,step:ba,smoothstep:Ca,simplebezier:Sa},Ci={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},t0=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,n0=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,vi="react-flow__edgeupdater";function bi({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:r,onMouseOut:l,type:c}){return i.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:l,className:Se([vi,`${vi}-${c}`]),cx:t0(t,s,e),cy:n0(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function s0({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:r,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:u,onReconnectStart:d,onReconnectEnd:x,setReconnecting:f,setUpdateHover:m}){const h=me(),E=(j,C)=>{if(j.button!==0)return;const{autoPanOnConnect:P,domNode:b,isValidConnection:L,connectionMode:N,connectionRadius:A,lib:O,onConnectStart:T,onConnectEnd:z,cancelConnection:R,nodeLookup:I,rfId:k,panBy:D,updateConnection:M}=h.getState(),B=C.type==="target";f(!0),d==null||d(j,n,C.type);const V=(W,Q)=>{f(!1),x==null||x(W,n,C.type,Q)},Z=W=>u==null?void 0:u(n,W);jo.onPointerDown(j.nativeEvent,{autoPanOnConnect:P,connectionMode:N,connectionRadius:A,domNode:b,handleId:C.id,nodeId:C.nodeId,nodeLookup:I,isTarget:B,edgeUpdaterType:C.type,lib:O,flowId:k,cancelConnection:R,panBy:D,isValidConnection:L,onConnect:Z,onConnectStart:T,onConnectEnd:z,onReconnectEnd:V,updateConnection:M,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},v=j=>E(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=j=>E(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>m(!0),S=()=>m(!1);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&i.jsxRuntimeExports.jsx(bi,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:v,onMouseEnter:_,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(bi,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:w,onMouseEnter:_,onMouseOut:S,type:"target"})]})}function o0({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,onDoubleClick:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,reconnectRadius:d,onReconnect:x,onReconnectStart:f,onReconnectEnd:m,rfId:h,edgeTypes:E,noPanClassName:v,onError:w,disableKeyboardA11y:_}){let S=xe(F=>F.edgeLookup.get(e));const j=xe(F=>F.defaultEdgeOptions);S=j?{...j,...S}:S;let C=S.type||"default",P=(E==null?void 0:E[C])||wi[C];P===void 0&&(w==null||w("011",Te.error011(C)),C="default",P=wi.default);const b=!!(S.focusable||t&&typeof S.focusable>"u"),L=typeof x<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),N=!!(S.selectable||s&&typeof S.selectable>"u"),A=g.useRef(null),[O,T]=g.useState(!1),[z,R]=g.useState(!1),I=me(),{zIndex:k,sourceX:D,sourceY:M,targetX:B,targetY:V,sourcePosition:Z,targetPosition:W}=xe(g.useCallback(F=>{const J=F.nodeLookup.get(S.source),oe=F.nodeLookup.get(S.target);if(!J||!oe)return{zIndex:S.zIndex,...Ci};const he=UE({id:e,sourceNode:J,targetNode:oe,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:F.connectionMode,onError:w});return{zIndex:ZE({selected:S.selected,zIndex:S.zIndex,sourceNode:J,targetNode:oe,elevateOnSelect:F.elevateEdgesOnSelect}),...he||Ci}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),ge),Q=g.useMemo(()=>S.markerStart?`url('#${yo(S.markerStart,h)}')`:void 0,[S.markerStart,h]),G=g.useMemo(()=>S.markerEnd?`url('#${yo(S.markerEnd,h)}')`:void 0,[S.markerEnd,h]);if(S.hidden||D===null||M===null||B===null||V===null)return null;const K=F=>{var Ve;const{addSelectedEdges:J,unselectNodesAndEdges:oe,multiSelectionActive:he}=I.getState();N&&(I.setState({nodesSelectionActive:!1}),S.selected&&he?(oe({nodes:[],edges:[S]}),(Ve=A.current)==null||Ve.blur()):J([e])),o&&o(F,S)},U=r?F=>{r(F,{...S})}:void 0,ee=l?F=>{l(F,{...S})}:void 0,X=c?F=>{c(F,{...S})}:void 0,se=a?F=>{a(F,{...S})}:void 0,de=u?F=>{u(F,{...S})}:void 0,re=F=>{var J;if(!_&&vc.includes(F.key)&&N){const{unselectNodesAndEdges:oe,addSelectedEdges:he}=I.getState();F.key==="Escape"?((J=A.current)==null||J.blur(),oe({edges:[S]})):he([e])}};return i.jsxRuntimeExports.jsx("svg",{style:{zIndex:k},children:i.jsxRuntimeExports.jsxs("g",{className:Se(["react-flow__edge",`react-flow__edge-${C}`,S.className,v,{selected:S.selected,animated:S.animated,inactive:!N&&!o,updating:O,selectable:N}]),onClick:K,onDoubleClick:U,onContextMenu:ee,onMouseEnter:X,onMouseMove:se,onMouseLeave:de,onKeyDown:b?re:void 0,tabIndex:b?0:void 0,role:b?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":b?`${ra}-${h}`:void 0,ref:A,children:[!z&&i.jsxRuntimeExports.jsx(P,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:N,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:D,sourceY:M,targetX:B,targetY:V,sourcePosition:Z,targetPosition:W,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:Q,markerEnd:G,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),L&&i.jsxRuntimeExports.jsx(s0,{edge:S,isReconnectable:L,reconnectRadius:d,onReconnect:x,onReconnectStart:f,onReconnectEnd:m,sourceX:D,sourceY:M,targetX:B,targetY:V,sourcePosition:Z,targetPosition:W,setUpdateHover:T,setReconnecting:R})]})})}const r0=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Na({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,onReconnect:r,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:x,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:E}){const{edgesFocusable:v,edgesReconnectable:w,elementsSelectable:_,onError:S}=xe(r0,ge),j=ZS(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(GS,{defaultColor:e,rfId:n}),j.map(C=>i.jsxRuntimeExports.jsx(o0,{id:C,edgesFocusable:v,edgesReconnectable:w,elementsSelectable:_,noPanClassName:o,onReconnect:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,onClick:d,reconnectRadius:x,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:S,edgeTypes:s,disableKeyboardA11y:E},C))]})}Na.displayName="EdgeRenderer";const i0=g.memo(Na),l0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function c0({children:e}){const t=xe(l0);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function a0(e){const t=ct(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const u0=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function d0(e){const t=xe(u0),n=me();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function x0(e){return e.connection.inProgress?{...e.connection,to:pn(e.connection.to,e.transform)}:{...e.connection}}function f0(e){return x0}function p0(e){const t=f0();return xe(t,ge)}const m0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function h0({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=xe(m0,ge);return!(r&&o&&a)?null:i.jsxRuntimeExports.jsx("svg",{style:e,width:r,height:l,className:"react-flow__connectionline react-flow__container",children:i.jsxRuntimeExports.jsx("g",{className:Se(["react-flow__connection",_c(c)]),children:i.jsxRuntimeExports.jsx(Ta,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Ta=({style:e,type:t=et.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:r,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:d,toHandle:x,toPosition:f}=p0();if(!o)return;if(n)return i.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:_c(s),toNode:d,toHandle:x});let m="";const h={sourceX:r.x,sourceY:r.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case et.Bezier:[m]=Bc(h);break;case et.SimpleBezier:[m]=Ea(h);break;case et.Step:[m]=go({...h,borderRadius:0});break;case et.SmoothStep:[m]=go(h);break;default:[m]=Zc(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Ta.displayName="ConnectionLine";const g0={};function _i(e=g0){const t=g.useRef(e),n=me();g.useEffect(()=>{var s,o;if(process.env.NODE_ENV==="development"){const r=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of r)if(t.current[l]!==e[l]){(o=(s=n.getState()).onError)==null||o.call(s,"002",Te.error002());break}t.current=e}},[e])}function y0(){const e=me(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Te.error013("react"))),t.current=!0}},[])}function La({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:r,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:x,onSelectionStart:f,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:E,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:_,selectionOnDrag:S,selectionMode:j,multiSelectionKeyCode:C,panActivationKeyCode:P,zoomActivationKeyCode:b,deleteKeyCode:L,onlyRenderVisibleElements:N,elementsSelectable:A,defaultViewport:O,translateExtent:T,minZoom:z,maxZoom:R,preventScrolling:I,defaultMarkerColor:k,zoomOnScroll:D,zoomOnPinch:M,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:Z,zoomOnDoubleClick:W,panOnDrag:Q,onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:U,onPaneMouseLeave:ee,onPaneScroll:X,onPaneContextMenu:se,paneClickDistance:de,nodeClickDistance:re,onEdgeContextMenu:F,onEdgeMouseEnter:J,onEdgeMouseMove:oe,onEdgeMouseLeave:he,reconnectRadius:Ve,onReconnect:bs,onReconnectStart:_s,onReconnectEnd:ks,noDragClassName:zt,noWheelClassName:Ps,noPanClassName:Bt,disableKeyboardA11y:Vt,nodeExtent:Ms,rfId:Ft,viewport:Ht,onViewportChange:gn}){return _i(e),_i(t),y0(),a0(n),d0(Ht),i.jsxRuntimeExports.jsx($S,{onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:U,onPaneMouseLeave:ee,onPaneContextMenu:se,onPaneScroll:X,paneClickDistance:de,deleteKeyCode:L,selectionKeyCode:_,selectionOnDrag:S,selectionMode:j,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:C,panActivationKeyCode:P,zoomActivationKeyCode:b,elementsSelectable:A,zoomOnScroll:D,zoomOnPinch:M,zoomOnDoubleClick:W,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:Z,panOnDrag:Q,defaultViewport:O,translateExtent:T,minZoom:z,maxZoom:R,onSelectionContextMenu:x,preventScrolling:I,noDragClassName:zt,noWheelClassName:Ps,noPanClassName:Bt,disableKeyboardA11y:Vt,onViewportChange:gn,isControlledViewport:!!Ht,children:i.jsxRuntimeExports.jsxs(c0,{children:[i.jsxRuntimeExports.jsx(i0,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:bs,onReconnectStart:_s,onReconnectEnd:ks,onlyRenderVisibleElements:N,onEdgeContextMenu:F,onEdgeMouseEnter:J,onEdgeMouseMove:oe,onEdgeMouseLeave:he,reconnectRadius:Ve,defaultMarkerColor:k,noPanClassName:Bt,disableKeyboardA11y:Vt,rfId:Ft}),i.jsxRuntimeExports.jsx(h0,{style:E,type:h,component:v,containerStyle:w}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(HS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:re,onlyRenderVisibleElements:N,noPanClassName:Bt,noDragClassName:zt,disableKeyboardA11y:Vt,nodeExtent:Ms,rfId:Ft}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}La.displayName="GraphView";const E0=g.memo(La),ki=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const u=new Map,d=new Map,x=new Map,f=new Map,m=s??t??[],h=n??e??[],E=c??[0,0],v=a??sn;qc(x,f,m),Eo(h,u,d,{nodeOrigin:E,nodeExtent:v,elevateNodesOnSelect:!1});let w=[0,0,1];if(l&&o&&r){const _=fn(u,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:S,y:j,zoom:C}=er(_,o,r,.5,2,.1);w=[S,j,C]}return{rfId:"1",width:0,height:0,transform:w,nodes:h,nodeLookup:u,parentLookup:d,edges:m,edgeLookup:f,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:sn,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ht.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...bc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Jn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},j0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>zj((u,d)=>({...ki({nodes:e,edges:t,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:x=>{const{nodeLookup:f,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:E}=d();Eo(x,f,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:E,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:f,edgeLookup:m}=d();qc(f,m,x),u({edges:x})},setDefaultNodesAndEdges:(x,f)=>{if(x){const{setNodes:m}=d();m(x),u({hasDefaultNodes:!0})}if(f){const{setEdges:m}=d();m(f),u({hasDefaultEdges:!0})}},updateNodeInternals:(x,f={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:h,parentLookup:E,fitViewOnInit:v,fitViewDone:w,fitViewOnInitOptions:_,domNode:S,nodeOrigin:j,nodeExtent:C,debug:P,fitViewSync:b}=d(),{changes:L,updatedInternals:N}=sj(x,h,E,S,j,C);if(N){if(ej(h,E,{nodeOrigin:j,nodeExtent:C}),f.triggerFitView){let A=w;!w&&v&&(A=b({..._,nodes:_==null?void 0:_.nodes})),u({fitViewDone:A})}else u({});(L==null?void 0:L.length)>0&&(P&&console.log("React Flow: trigger node changes",L),m==null||m(L))}},updateNodePositions:(x,f=!1)=>{const m=[],h=[];for(const[E,v]of x){const w={id:E,type:"position",position:v.position,dragging:f};v!=null&&v.expandParent&&(v!=null&&v.parentId)&&w.position&&(m.push({id:E,parentId:v.parentId,rect:{...v.internals.positionAbsolute,width:v.measured.width,height:v.measured.height}}),w.position.x=Math.max(0,w.position.x),w.position.y=Math.max(0,w.position.y)),h.push(w)}if(m.length>0){const{nodeLookup:E,parentLookup:v,nodeOrigin:w}=d(),_=or(m,E,v,w);h.push(..._)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:f,setNodes:m,nodes:h,hasDefaultNodes:E,debug:v}=d();if(x!=null&&x.length){if(E){const w=ca(x,h);m(w)}v&&console.log("React Flow: trigger node changes",x),f==null||f(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:f,setEdges:m,edges:h,hasDefaultEdges:E,debug:v}=d();if(x!=null&&x.length){if(E){const w=aa(x,h);m(w)}v&&console.log("React Flow: trigger edge changes",x),f==null||f(x)}},addSelectedNodes:x=>{const{multiSelectionActive:f,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:v}=d();if(f){const w=x.map(_=>ut(_,!0));E(w);return}E(wt(h,new Set([...x]),!0)),v(wt(m))},addSelectedEdges:x=>{const{multiSelectionActive:f,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:v}=d();if(f){const w=x.map(_=>ut(_,!0));v(w);return}v(wt(m,new Set([...x]))),E(wt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:f}={})=>{const{edges:m,nodes:h,nodeLookup:E,triggerNodeChanges:v,triggerEdgeChanges:w}=d(),_=x||h,S=f||m,j=_.map(P=>{const b=E.get(P.id);return b&&(b.selected=!1),ut(P.id,!1)}),C=S.map(P=>ut(P.id,!1));v(j),w(C)},setMinZoom:x=>{const{panZoom:f,maxZoom:m}=d();f==null||f.setScaleExtent([x,m]),u({minZoom:x})},setMaxZoom:x=>{const{panZoom:f,minZoom:m}=d();f==null||f.setScaleExtent([m,x]),u({maxZoom:x})},setTranslateExtent:x=>{var f;(f=d().panZoom)==null||f.setTranslateExtent(x),u({translateExtent:x})},setPaneClickDistance:x=>{var f;(f=d().panZoom)==null||f.setClickDistance(x)},resetSelectedElements:()=>{const{edges:x,nodes:f,triggerNodeChanges:m,triggerEdgeChanges:h}=d(),E=f.reduce((w,_)=>_.selected?[...w,ut(_.id,!1)]:w,[]),v=x.reduce((w,_)=>_.selected?[...w,ut(_.id,!1)]:w,[]);m(E),h(v)},setNodeExtent:x=>{const{nodes:f,nodeLookup:m,parentLookup:h,nodeOrigin:E,elevateNodesOnSelect:v,nodeExtent:w}=d();x[0][0]===w[0][0]&&x[0][1]===w[0][1]&&x[1][0]===w[1][0]&&x[1][1]===w[1][1]||(Eo(f,m,h,{nodeOrigin:E,nodeExtent:x,elevateNodesOnSelect:v,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:f,width:m,height:h,panZoom:E,translateExtent:v}=d();return oj({delta:x,panZoom:E,transform:f,translateExtent:v,width:m,height:h})},fitView:x=>{const{panZoom:f,width:m,height:h,minZoom:E,maxZoom:v,nodeLookup:w}=d();if(!f)return Promise.resolve(!1);const _=fo(w,x);return po({nodes:_,width:m,height:h,panZoom:f,minZoom:E,maxZoom:v},x)},fitViewSync:x=>{const{panZoom:f,width:m,height:h,minZoom:E,maxZoom:v,nodeLookup:w}=d();if(!f)return!1;const _=fo(w,x);return po({nodes:_,width:m,height:h,panZoom:f,minZoom:E,maxZoom:v},x),_.size>0},cancelConnection:()=>{u({connection:{...bc}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...ki()})}),Object.is);function Aa({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>j0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(Bj,{value:d,children:i.jsxRuntimeExports.jsx(aS,{children:u})})}function S0({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(Rs)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx(Aa,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const R0={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function w0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,nodeTypes:r,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:u,onMove:d,onMoveStart:x,onMoveEnd:f,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:v,onClickConnectEnd:w,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:C,onNodeDoubleClick:P,onNodeDragStart:b,onNodeDrag:L,onNodeDragStop:N,onNodesDelete:A,onEdgesDelete:O,onDelete:T,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:I,onSelectionDragStop:k,onSelectionContextMenu:D,onSelectionStart:M,onSelectionEnd:B,onBeforeDelete:V,connectionMode:Z,connectionLineType:W=et.Bezier,connectionLineStyle:Q,connectionLineComponent:G,connectionLineContainerStyle:K,deleteKeyCode:U="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:X=!1,selectionMode:se=kt.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:re=es()?"Meta":"Control",zoomActivationKeyCode:F=es()?"Meta":"Control",snapToGrid:J,snapGrid:oe,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:Ve,nodesDraggable:bs,nodesConnectable:_s,nodesFocusable:ks,nodeOrigin:zt=ia,edgesFocusable:Ps,edgesReconnectable:Bt,elementsSelectable:Vt=!0,defaultViewport:Ms=Jj,minZoom:Ft=.5,maxZoom:Ht=2,translateExtent:gn=sn,preventScrolling:ox=!0,nodeExtent:Ns,defaultMarkerColor:rx="#b1b1b7",zoomOnScroll:ix=!0,zoomOnPinch:lx=!0,panOnScroll:cx=!1,panOnScrollSpeed:ax=.5,panOnScrollMode:ux=xt.Free,zoomOnDoubleClick:dx=!0,panOnDrag:xx=!0,onPaneClick:fx,onPaneMouseEnter:px,onPaneMouseMove:mx,onPaneMouseLeave:hx,onPaneScroll:gx,onPaneContextMenu:yx,paneClickDistance:ur=0,nodeClickDistance:Ex=0,children:jx,onReconnect:Sx,onReconnectStart:Rx,onReconnectEnd:wx,onEdgeContextMenu:Cx,onEdgeDoubleClick:vx,onEdgeMouseEnter:bx,onEdgeMouseMove:_x,onEdgeMouseLeave:kx,reconnectRadius:Px=10,onNodesChange:Mx,onEdgesChange:Nx,noDragClassName:Tx="nodrag",noWheelClassName:Lx="nowheel",noPanClassName:dr="nopan",fitView:xr,fitViewOptions:Ax,connectOnClick:$x,attributionPosition:Ix,proOptions:Ox,defaultEdgeOptions:Dx,elevateNodesOnSelect:zx,elevateEdgesOnSelect:Bx,disableKeyboardA11y:fr=!1,autoPanOnConnect:Vx,autoPanOnNodeDrag:Fx,autoPanSpeed:Hx,connectionRadius:Zx,isValidConnection:Yx,onError:qx,style:Wx,id:pr,nodeDragThreshold:Xx,viewport:Gx,onViewportChange:Kx,width:Ux,height:Qx,colorMode:Jx="light",debug:ef,...tf},nf){const Ts=pr||"1",sf=sS(Jx);return i.jsxRuntimeExports.jsx("div",{...tf,style:{...Wx,...R0},ref:nf,className:Se(["react-flow",o,sf]),"data-testid":"rf__wrapper",id:pr,children:i.jsxRuntimeExports.jsxs(S0,{nodes:e,edges:t,width:Ux,height:Qx,fitView:xr,nodeOrigin:zt,nodeExtent:Ns,children:[i.jsxRuntimeExports.jsx(E0,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:C,onNodeDoubleClick:P,nodeTypes:r,edgeTypes:l,connectionLineType:W,connectionLineStyle:Q,connectionLineComponent:G,connectionLineContainerStyle:K,selectionKeyCode:ee,selectionOnDrag:X,selectionMode:se,deleteKeyCode:U,multiSelectionKeyCode:re,panActivationKeyCode:de,zoomActivationKeyCode:F,onlyRenderVisibleElements:he,defaultViewport:Ms,translateExtent:gn,minZoom:Ft,maxZoom:Ht,preventScrolling:ox,zoomOnScroll:ix,zoomOnPinch:lx,zoomOnDoubleClick:dx,panOnScroll:cx,panOnScrollSpeed:ax,panOnScrollMode:ux,panOnDrag:xx,onPaneClick:fx,onPaneMouseEnter:px,onPaneMouseMove:mx,onPaneMouseLeave:hx,onPaneScroll:gx,onPaneContextMenu:yx,paneClickDistance:ur,nodeClickDistance:Ex,onSelectionContextMenu:D,onSelectionStart:M,onSelectionEnd:B,onReconnect:Sx,onReconnectStart:Rx,onReconnectEnd:wx,onEdgeContextMenu:Cx,onEdgeDoubleClick:vx,onEdgeMouseEnter:bx,onEdgeMouseMove:_x,onEdgeMouseLeave:kx,reconnectRadius:Px,defaultMarkerColor:rx,noDragClassName:Tx,noWheelClassName:Lx,noPanClassName:dr,rfId:Ts,disableKeyboardA11y:fr,nodeExtent:Ns,viewport:Gx,onViewportChange:Kx}),i.jsxRuntimeExports.jsx(nS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:v,onClickConnectEnd:w,nodesDraggable:bs,nodesConnectable:_s,nodesFocusable:ks,edgesFocusable:Ps,edgesReconnectable:Bt,elementsSelectable:Vt,elevateNodesOnSelect:zx,elevateEdgesOnSelect:Bx,minZoom:Ft,maxZoom:Ht,nodeExtent:Ns,onNodesChange:Mx,onEdgesChange:Nx,snapToGrid:J,snapGrid:oe,connectionMode:Z,translateExtent:gn,connectOnClick:$x,defaultEdgeOptions:Dx,fitView:xr,fitViewOptions:Ax,onNodesDelete:A,onEdgesDelete:O,onDelete:T,onNodeDragStart:b,onNodeDrag:L,onNodeDragStop:N,onSelectionDrag:I,onSelectionDragStart:R,onSelectionDragStop:k,onMove:d,onMoveStart:x,onMoveEnd:f,noPanClassName:dr,nodeOrigin:zt,rfId:Ts,autoPanOnConnect:Vx,autoPanOnNodeDrag:Fx,autoPanSpeed:Hx,onError:qx,connectionRadius:Zx,isValidConnection:Yx,selectNodesOnDrag:Ve,nodeDragThreshold:Xx,onBeforeDelete:V,paneClickDistance:ur,debug:ef}),i.jsxRuntimeExports.jsx(Qj,{onSelectionChange:z}),jx,i.jsxRuntimeExports.jsx(Wj,{proOptions:Ox,position:Ix}),i.jsxRuntimeExports.jsx(Yj,{rfId:Ts,disableKeyboardA11y:fr})]})})}var C0=ua(w0);function v0(){const e=me();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],r=new Map;o.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&r.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(r,{triggerFitView:!1}))},[])}function b0({onStart:e,onChange:t,onEnd:n}){const s=me();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function _0({dimensions:e,lineWidth:t,variant:n,className:s}){return i.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Se(["react-flow__background-pattern",n,s])})}function k0({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Se(["react-flow__background-pattern","dots",t])})}var st;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(st||(st={}));const P0={[st.Dots]:1,[st.Lines]:1,[st.Cross]:6},M0=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $a({id:e,variant:t=st.Dots,gap:n=20,size:s,lineWidth:o=1,offset:r=0,color:l,bgColor:c,style:a,className:u,patternClassName:d}){const x=g.useRef(null),{transform:f,patternId:m}=xe(M0,ge),h=s||P0[t],E=t===st.Dots,v=t===st.Cross,w=Array.isArray(n)?n:[n,n],_=[w[0]*f[2]||1,w[1]*f[2]||1],S=h*f[2],j=Array.isArray(r)?r:[r,r],C=v?[S,S]:_,P=[j[0]*f[2]||1+C[0]/2,j[1]*f[2]||1+C[1]/2],b=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:Se(["react-flow__background",u]),style:{...a,...ws,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:x,"data-testid":"rf__background",children:[i.jsxRuntimeExports.jsx("pattern",{id:b,x:f[0]%_[0],y:f[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:E?i.jsxRuntimeExports.jsx(k0,{radius:S/2,className:d}):i.jsxRuntimeExports.jsx(_0,{dimensions:C,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b})`})]})}$a.displayName="Background";const N0=g.memo($a);function T0(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function L0(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function A0(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function $0(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function I0(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function bn({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:Se(["react-flow__controls-button",t]),...n,children:e})}const O0=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Ia({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:u,children:d,position:x="bottom-left",orientation:f="vertical","aria-label":m="React Flow controls"}){const h=me(),{isInteractive:E,minZoomReached:v,maxZoomReached:w}=xe(O0,ge),{zoomIn:_,zoomOut:S,fitView:j}=ct(),C=()=>{_(),r==null||r()},P=()=>{S(),l==null||l()},b=()=>{j(o),c==null||c()},L=()=>{h.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),a==null||a(!E)},N=f==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(rr,{className:Se(["react-flow__controls",N,u]),position:x,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(bn,{onClick:C,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:w,children:i.jsxRuntimeExports.jsx(T0,{})}),i.jsxRuntimeExports.jsx(bn,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:i.jsxRuntimeExports.jsx(L0,{})})]}),n&&i.jsxRuntimeExports.jsx(bn,{className:"react-flow__controls-fitview",onClick:b,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(A0,{})}),s&&i.jsxRuntimeExports.jsx(bn,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?i.jsxRuntimeExports.jsx(I0,{}):i.jsxRuntimeExports.jsx($0,{})}),d]})}Ia.displayName="Controls";g.memo(Ia);function D0({id:e,x:t,y:n,width:s,height:o,style:r,color:l,strokeColor:c,strokeWidth:a,className:u,borderRadius:d,shapeRendering:x,selected:f,onClick:m}){const{background:h,backgroundColor:E}=r||{},v=l||h||E;return i.jsxRuntimeExports.jsx("rect",{className:Se(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:v,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?w=>m(w,e):void 0})}const z0=g.memo(D0),B0=e=>e.nodes.map(t=>t.id),Ks=e=>e instanceof Function?e:()=>e;function V0({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=z0,onClick:l}){const c=xe(B0,ge),a=Ks(t),u=Ks(e),d=Ks(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(f=>i.jsxRuntimeExports.jsx(H0,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},f))})}function F0({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:r,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:u,x:d,y:x,width:f,height:m}=xe(h=>{const E=h.nodeLookup.get(e),{x:v,y:w}=E.internals.positionAbsolute,{width:_,height:S}=Ue(E);return{node:E,x:v,y:w,width:_,height:S}},ge);return!u||u.hidden||!$c(u)?null:i.jsxRuntimeExports.jsx(c,{x:d,y:x,width:f,height:m,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:r,shapeRendering:l,onClick:a,id:u.id})}const H0=g.memo(F0);var Z0=g.memo(V0);const Y0=200,q0=150,W0=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Lc(fn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},X0="react-flow__minimap-desc";function Oa({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:u,maskStrokeColor:d,maskStrokeWidth:x,position:f="bottom-right",onClick:m,onNodeClick:h,pannable:E=!1,zoomable:v=!1,ariaLabel:w="React Flow mini map",inversePan:_,zoomStep:S=10,offsetScale:j=5}){const C=me(),P=g.useRef(null),{boundingRect:b,viewBB:L,rfId:N,panZoom:A,translateExtent:O,flowWidth:T,flowHeight:z}=xe(W0,ge),R=(e==null?void 0:e.width)??Y0,I=(e==null?void 0:e.height)??q0,k=b.width/R,D=b.height/I,M=Math.max(k,D),B=M*R,V=M*I,Z=j*M,W=b.x-(B-b.width)/2-Z,Q=b.y-(V-b.height)/2-Z,G=B+Z*2,K=V+Z*2,U=`${X0}-${N}`,ee=g.useRef(0),X=g.useRef();ee.current=M,g.useEffect(()=>{if(P.current&&A)return X.current=xj({domNode:P.current,panZoom:A,getTransform:()=>C.getState().transform,getViewScale:()=>ee.current}),()=>{var re;(re=X.current)==null||re.destroy()}},[A]),g.useEffect(()=>{var re;(re=X.current)==null||re.update({translateExtent:O,width:T,height:z,inversePan:_,pannable:E,zoomStep:S,zoomable:v})},[E,v,_,S,O,T,z]);const se=m?re=>{var oe;const[F,J]=((oe=X.current)==null?void 0:oe.pointer(re))||[0,0];m(re,{x:F,y:J})}:void 0,de=h?g.useCallback((re,F)=>{const J=C.getState().nodeLookup.get(F);h(re,J)},[]):void 0;return i.jsxRuntimeExports.jsx(rr,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*M:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="string"?l:void 0},className:Se(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:R,height:I,viewBox:`${W} ${Q} ${G} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":U,ref:P,onClick:se,children:[w&&i.jsxRuntimeExports.jsx("title",{id:U,children:w}),i.jsxRuntimeExports.jsx(Z0,{onClick:de,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),i.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-Z},${Q-Z}h${G+Z*2}v${K+Z*2}h${-G-Z*2}z
|
|
39
|
+
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Oa.displayName="MiniMap";g.memo(Oa);function G0({nodeId:e,position:t,variant:n=Ut.Handle,className:s,style:o={},children:r,color:l,minWidth:c=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:x=!1,shouldResize:f,onResizeStart:m,onResize:h,onResizeEnd:E}){const v=pa(),w=typeof e=="string"?e:v,_=me(),S=g.useRef(null),j=n===Ut.Line?"right":"bottom-right",C=t??j,P=g.useRef(null);g.useEffect(()=>{if(!(!S.current||!w))return P.current||(P.current=_j({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:A,transform:O,snapGrid:T,snapToGrid:z,nodeOrigin:R,domNode:I}=_.getState();return{nodeLookup:A,transform:O,snapGrid:T,snapToGrid:z,nodeOrigin:R,paneDomNode:I}},onChange:(A,O)=>{const{triggerNodeChanges:T,nodeLookup:z,parentLookup:R,nodeOrigin:I}=_.getState(),k=[],D={x:A.x,y:A.y},M=z.get(w);if(M&&M.expandParent&&M.parentId){const B=M.origin??I,V=A.width??M.measured.width,Z=A.height??M.measured.height,W={id:M.id,parentId:M.parentId,rect:{width:V,height:Z,...Ic({x:A.x??M.position.x,y:A.y??M.position.y},{width:V,height:Z},M.parentId,z,B)}},Q=or([W],z,R,I);k.push(...Q),D.x=A.x?Math.max(B[0]*V,A.x):void 0,D.y=A.y?Math.max(B[1]*Z,A.y):void 0}if(D.x!==void 0&&D.y!==void 0){const B={id:w,type:"position",position:{...D}};k.push(B)}if(A.width!==void 0&&A.height!==void 0){const B={id:w,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:A.width,height:A.height}};k.push(B)}for(const B of O){const V={...B,type:"position"};k.push(V)}T(k)},onEnd:()=>{const A={id:w,type:"dimensions",resizing:!1};_.getState().triggerNodeChanges([A])}})),P.current.update({controlPosition:C,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:E,shouldResize:f}),()=>{var A;(A=P.current)==null||A.destroy()}},[C,c,a,u,d,x,m,h,E,f]);const b=C.split("-"),L=n===Ut.Line?"borderColor":"backgroundColor",N=l?{...o,[L]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:Se(["react-flow__resize-control","nodrag",...b,n,s]),ref:S,style:N,children:r})}g.memo(G0);const lr=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Me=(e,t)=>{const n=lr(t),s=e.getNodes().find(o=>o.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return p.Eo.construct(s.position,p._.scale(p.Eo.dims(p.Eo.construct(n)),1/e.getZoom()))},K0=(e,t)=>Cs.fromFlow(e,t);class Da{constructor(t,n){Fe(this,"node_",null);Fe(this,"position");Fe(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return p.q.translate(p.Eo.topLeft(this.node.box),this.position)}}class Cs{constructor(t,n,s){Fe(this,"key");Fe(this,"box");Fe(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Me(n,t),o=lr(t),r=o.getElementsByClassName("react-flow__handle"),l=p.Eo.construct(o),c=Array.from(r).map(a=>{const u=p.Eo.center(p.Eo.construct(a)),d=p.q.translation(p.Eo.topLeft(l),u),x=a.className.match(/react-flow__handle-(\w+)/);if(x==null)throw new Error("[schematic] - cannot find handle orientation");const f=p.J.construct(x[0]);return new Da(d,f)});return new Cs(t,s,c)}}const U0=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,toPosition:r,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const u=document.querySelector(".react-flow__handle-connecting"),d=u==null?void 0:u.className.match(/react-flow__handle-(\w+)/);if(d!=null){const h=p.J.outer.safeParse(d[1]);h.success&&(r=h.data)}const x=ct(),f=St({sourcePos:p.q.construct(e,t),targetPos:p.q.construct(n,s),sourceOrientation:o,targetOrientation:r,sourceBox:Me(x,(l==null?void 0:l.id)??""),targetBox:Me(x,(l==null?void 0:l.id)??"")}),m=Wl(p.q.construct(e,t),f,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(It,{path:za(m),style:{...c,stroke:p.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Q0=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,targetPosition:r,style:l,segments:c=[],onSegmentsChange:a,color:u="var(--pluto-gray-l9)",selected:d=!1,...x})=>{const f=p.q.construct(x.sourceX,x.sourceY),m=g.useRef(f),h=p.q.equals(f,m.current),E=p.q.construct(x.targetX,x.targetY),v=g.useRef(E),w=p.q.equals(E,v.current),_=ct(),[S,j,C]=y.useCombinedStateAndRef(()=>c.length>0?c:St({sourcePos:f,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),P=g.useRef(r),b=g.useRef(s),L=y.useDebouncedCallback(a,100,[a]);if(!h||!w){let T=S;const z=p.q.translation(m.current,f),R=p.q.translation(E,v.current);p.q.equals(z,p.q.scale(R,-1),.001)?(m.current=f,v.current=E):(h?w||(T=Mh({delta:R,segments:T}),P.current!==r&&(P.current=r,T=St({sourcePos:f,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),Pr({sourcePos:f,targetPos:E,next:T,prev:S})||(T=St({sourcePos:f,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),v.current=E):(T=Ph({delta:z,segments:T}),b.current!==s&&(b.current=s,T=St({sourcePos:f,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),Pr({sourcePos:f,targetPos:E,next:T,prev:S})||(T=St({sourcePos:f,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),m.current=f),L(T),j(T))}const N=g.useRef(null),A=os({onStart:g.useCallback((T,z,R)=>{N.current={index:Number(R.currentTarget.id.split("-")[1]),segments:[...C.current]}},[]),onMove:g.useCallback(T=>{if(N.current==null)return;const z=vh({segments:N.current.segments,index:N.current.index,magnitude:p.Eo.dim(T,p.g.swap(N.current.segments[N.current.index].direction),!0)/_.getZoom()});j(z)},[]),onEnd:g.useCallback(()=>a(C.current),[a])}),O=Wl(f,S,_.getZoom(),!0);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(It,{path:za(O),style:{...l,stroke:p.cssString(u)},...x}),d&&J0(O).map((T,z)=>{const R=S[z].direction,I=p.g.swap(R),k={[p.g.dimension(R)]:"18px",[p.g.dimension(I)]:"4px"},D={[R]:T[R]-9,[I]:T[I]-2};return i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsx("rect",{className:p.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...k,...D,rx:"2px",ry:"2px"}),i.jsxRuntimeExports.jsx("foreignObject",{x:T.x-9,y:T.y-9,width:"18px",height:"18px",children:i.jsxRuntimeExports.jsx("div",{id:`handle-${z}`,className:p.CSS(p.CSS.BE("diagram-edge-handle","dragger"),p.CSS.dir(R)),draggable:!0,onDragStart:A})})]},z)})]})},za=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const r=e[o%e.length],l=e[(o+1)%e.length],c=Math.min(6/Math.hypot(l.x-r.x,l.y-r.y),.5);o>0&&(t+=`Q${r.x},${r.y} ${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===0?t+=`M${r.x},${r.y}`:o===0&&(t+=`M${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${r.x*c+l.x*(1-c)},${r.y*c+l.y*(1-c)}`)}return t},J0=e=>e.slice(1).map((t,n)=>{const s=e[n];return p.q.construct((t.x+s.x)/2,(t.y+s.y)/2)}),e1=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:p.q.ZERO,zoom:1}})=>{const[o,r]=g.useState(n),[l,c]=g.useState(e),[a,u]=g.useState(t),[d,x]=g.useState(s),[f,m]=g.useState(!1);return{viewport:d,onViewportChange:x,edges:a,nodes:l,onNodesChange:c,onEdgesChange:u,editable:o,onEditableChange:r,fitViewOnResize:f,setFitViewOnResize:m}},t1=()=>!0,n1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},s1={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesReconnectable:!1,nodesFocusable:!1,reconnectRadius:0},Ba={maxZoom:1,minZoom:.5},o1={hideAttribution:!0},Va=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),mn=()=>g.useContext(Va),Fa=g.memo(({children:e})=>{const{registerNodeRenderer:t}=mn();return g.useEffect(()=>t(e),[t,e]),null});Fa.displayName="NodeRenderer";const r1=["Backspace","Delete"],i1=y.wrap$1($.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:o,edges:r,onEditableChange:l,editable:c,viewport:a,triggers:u,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:f,visible:m,...h})=>{const E=y.useMemoDeepEqualProps({visible:m}),[{path:v},,w]=y.use$3({aetherKey:e,type:$.Diagram$1.TYPE,schema:$.diagramStateZ,initialState:{position:a.position,region:p.Eo.ZERO,zoom:a.zoom,...E}});g.useEffect(()=>w(F=>({...F,...E})),[E]);const _=y.use().colors.gray.l9.hex,S=y.useMemoCompare(()=>u??$o.zoom,y.compareModeConfigs,[u]),{fitView:j}=ct(),C=y.useDebouncedCallback(F=>j(F),50,[j]),P=ls(g.useCallback(F=>{x&&C({maxZoom:1}),w(J=>({...J,region:F}))},[w,C,x])),b=g.useRef(null),L=g.useCallback(F=>{const J=b.current;J!=null&&J.x===F.x&&J.y===F.y&&J.zoom===F.zoom||(b.current=F,!(isNaN(F.x)||isNaN(F.y)||isNaN(F.zoom))&&(w(oe=>({...oe,position:F,zoom:F.zoom})),d(Jl(F))))},[w,d]);b0({onStart:L,onChange:L,onEnd:L});const[N,A]=g.useState(()=>()=>null),O=g.useCallback(F=>A(()=>F),[]),T=g.useMemo(()=>({custom:({id:F,positionAbsoluteX:J,positionAbsoluteY:oe,selected:he=!1})=>N({symbolKey:F,position:{x:J,y:oe},selected:he})}),[N]),z=g.useRef(r),R=g.useMemo(()=>(z.current=r,Wo(r)),[r]),I=g.useRef(o),k=g.useMemo(()=>(I.current=o,qo(o)),[o]),D=g.useCallback(F=>n(ec(I.current,J=>ca(F,J))),[n]),M=g.useCallback(F=>s(Nn(z.current,J=>aa(F,J),_)),[s,_]),B=g.useCallback((F,J)=>s(Nn(z.current,oe=>WE(F,J,oe),_)),[]),V=g.useCallback(F=>{s(Nn(z.current,J=>Hc(F,J),_))},[s,_]),Z=g.useCallback((F,J)=>{const oe=[...z.current],he=oe.findIndex(Ve=>Ve.key===F);he!==-1&&(oe[he]={...oe[he],segments:J},z.current=oe,s(oe))},[s]),W=c?n1:s1,Q=y.useSyncedRef(Z),G=g.useMemo(()=>({default:F=>{var J,oe;return i.jsxRuntimeExports.jsx(Q0,{...F,segments:((J=F.data)==null?void 0:J.segments)??[],color:(oe=F.data)==null?void 0:oe.color,onSegmentsChange:g.useCallback(he=>Q.current(F.id,he),[F.id])},F.id)}}),[]),K=g.useRef(null);y.use$1({triggers:S.zoomReset,callback:g.useCallback(({stage:F,cursor:J})=>{const oe=K.current;oe==null||F!=="start"||!p.Eo.contains(oe,J)||j()},[j])});const U=y.purgeMouse(S.select)[0]??null,ee=y.purgeMouse(S.pan)[0]??null,X=y.purgeMouse(S.zoom)[0]??null,se={selectionOnDrag:U==null,panOnDrag:ee==null,selectionKeyCode:U,panActivationKeyCode:ee,zoomActivationKeyCode:X},de=y.useCombinedRefs(K,P),re=g.useMemo(()=>({visible:m,editable:c,onEditableChange:l,registerNodeRenderer:O,fitViewOnResize:x,setFitViewOnResize:f}),[c,m,l,O,x]);return i.jsxRuntimeExports.jsx(Va.Provider,{value:re,children:i.jsxRuntimeExports.jsx(y.Composite,{path:v,children:m&&i.jsxRuntimeExports.jsx(C0,{...se,className:p.CSS(p.CSS.B("diagram"),p.CSS.editable(c)),nodes:k,edges:R,nodeTypes:T,edgeTypes:G,ref:de,fitView:!0,onNodesChange:D,onEdgesChange:M,onConnect:V,onReconnect:B,defaultViewport:Ql(a),connectionLineComponent:U0,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:t1,connectionMode:ht.Loose,snapGrid:[3,3],fitViewOptions:Ba,selectionMode:kt.Partial,proOptions:o1,deleteKeyCode:r1,...h,style:{[p.CSS.var("diagram-zoom")]:a.zoom,...h.style},...W,children:t})})})}),l1=()=>{const{editable:e}=mn();return e?i.jsxRuntimeExports.jsx(N0,{}):null},c1=({children:e,...t})=>i.jsxRuntimeExports.jsx(te.Pack,{direction:"y",borderShade:4,className:p.CSS.BE("diagram","controls"),...t,children:e}),a1=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=mn();return i.jsxRuntimeExports.jsx(y.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:p.J.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(y.Qt.EditOff,{}):i.jsxRuntimeExports.jsx(y.Qt.Edit,{})})},u1=({onClick:e,...t})=>{const{fitView:n}=ct(),{fitViewOnResize:s,setFitViewOnResize:o}=mn();return i.jsxRuntimeExports.jsx(y.ToggleIcon,{onClick:r=>{n(Ba),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:p.J.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(y.Qt.Expand,{})})},d1=e=>i.jsxRuntimeExports.jsx(Aa,{children:i.jsxRuntimeExports.jsx(i1,{...e})}),x1=Object.freeze(Object.defineProperty({__proto__:null,Background:l1,Controls:c1,Diagram:d1,FitViewControl:u1,HandleLayout:Da,NodeLayout:Cs,NodeRenderer:Fa,ToggleEditControl:a1,alignNodes:Ah,edgeConverter:Nn,edgeZ:Th,nodeConverter:ec,nodeZ:Lh,rfEdgeDataZ:Gl,selectNode:lr,selectNodeBox:Me,selectNodeLayout:K0,translateEdgesBackward:Ul,translateEdgesForward:Wo,translateNodesBackward:Kl,translateNodesForward:qo,translateViewportBackward:Jl,translateViewportForward:Ql,use:e1,useContext:mn,viewportZ:Nh},Symbol.toStringTag,{value:"Module"})),f1=y.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(y.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=y.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=y.use$3({aetherKey:e,type:$.Log.TYPE,schema:$.logState,initialState:{empty:!0,region:p.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{x(m=>({...m,...a}))},[a,x]);const f=ls(g.useCallback(m=>x(h=>({...h,region:m})),[x]));return i.jsxRuntimeExports.jsx("div",{ref:f,className:p.CSS(p.CSS.B("log"),n),onWheel:m=>{x(h=>({...h,wheelPos:h.wheelPos-m.deltaY,scrolling:h.scrolling?h.scrolling:m.deltaY<0}))},...c,children:d?o:i.jsxRuntimeExports.jsx(y.Icon,{className:p.CSS(p.CSS.BE("log","live"),u&&p.CSS.M("active")),variant:"outlined",onClick:()=>x(m=>({...m,scrolling:!m.scrolling})),tooltip:u?"Resume Scrolling":"Pause Scrolling",children:i.jsxRuntimeExports.jsx(y.Qt.Dynamic,{})})})}),p1=Object.freeze(Object.defineProperty({__proto__:null,Log:f1},Symbol.toStringTag,{value:"Module"})),m1=[{key:"standard",label:"Standard"},{key:"scientific",label:"Scientific"},{key:"engineering",label:"Engineering"}],h1=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(y.Button,{variant:s?"filled":"outlined",onClick:n,children:t.label},e),g1=({children:e=h1,...t})=>i.jsxRuntimeExports.jsx(ke.Button,{...t,data:m1,children:e}),y1=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(te.Space,{className:p.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(nt,{selected:o==="top",onClick:r({outer:"top"})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(nt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(Pi,{showInner:n,value:e,onChange:s}),i.jsxRuntimeExports.jsx(nt,{selected:o==="right",onClick:r({outer:"right"})})]}),i.jsxRuntimeExports.jsx(nt,{selected:o==="bottom",onClick:r({outer:"bottom"})})]}):i.jsxRuntimeExports.jsx(Pi,{className:p.CSS.B("orientation-control"),value:e,onChange:s})},Pi=({value:e,onChange:t,className:n,showInner:s=!0,...o})=>{const{inner:r}=e,l=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),i.jsxRuntimeExports.jsxs(te.Space,{className:p.CSS(n,p.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[i.jsxRuntimeExports.jsx(nt,{style:c,disabled:!s,className:p.CSS(p.CSS.dir("y")),selected:r==="top",onClick:l({inner:"top"})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",children:[i.jsxRuntimeExports.jsx(nt,{style:c,disabled:!s,selected:r==="left",onClick:l({inner:"left"})}),i.jsxRuntimeExports.jsx(nt,{style:c,disabled:!s,selected:r==="right",onClick:l({inner:"right"})})]}),i.jsxRuntimeExports.jsx(nt,{style:c,disabled:!s,className:p.CSS(p.CSS.dir("y")),selected:r==="bottom",onClick:l({inner:"bottom"})})]})},nt=({selected:e,className:t,...n})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:"text",className:p.CSS(t,p.CSS.selected(e)),...n,children:i.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Be=({className:e,direction:t,...n})=>i.jsxRuntimeExports.jsx(te.Space,{direction:t,align:"stretch",className:p.CSS(p.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Ot=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(je,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(y1,{value:{inner:s.orientation??"top",outer:((r=s.label)==null?void 0:r.orientation)??"top"},showInner:t,showOuter:e,onChange:l=>o({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),hn=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(je,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(y.Text$1,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(as,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),i.jsxRuntimeExports.jsx(je,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(ke.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(je,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(Ao,{...n})})]}),yt=e=>i.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(wo.Swatch,{value:t??p.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),E1=e=>i.jsxRuntimeExports.jsx(je,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>i.jsxRuntimeExports.jsx(y.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),Pe=({omit:e})=>i.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(hn,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(yt,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(je,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(y.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(E1,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(Ot,{path:""})]}),j1=({path:e})=>{var u,d;const{value:t,onChange:n}=it({path:e}),s=$.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=$.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=$.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const f=$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:x}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:f})},a=x=>{x??(x=0);const f=$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:x}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=$.authoritySource({channel:x}),h=$.acquireChannelControl({channel:x,authority:255});n({...t,sink:f,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:m},indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Be,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:l.channel,onChange:a})}),i.jsxRuntimeExports.jsx(zo,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},cr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Ce=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(j1,{path:""});default:return i.jsxRuntimeExports.jsx(Pe,{})}},[]),t=we.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(we.Tabs,{...t})},qt={y:2,x:.25},Us={lower:0,upper:2e3},Mi={lower:0,upper:51},Ha=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(hn,{path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(yt,{path:"color"}),i.jsxRuntimeExports.jsx(yt,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(je,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:qt,bounds:Mi,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(je,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:qt,bounds:Mi,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(je,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:qt,bounds:Us,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(je,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t??200,dragScale:qt,bounds:Us,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(je,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t??200,dragScale:qt,bounds:Us,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(Ot,{path:"",showInner:!1})]}),Za=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],S1=({path:e})=>{var f;const{value:t,onChange:n}=it({path:e}),s=$.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),o=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=$.stringifyNumberProps.parse(s.segments.stringifier.props),l=$.rollingAverageProps.parse(s.segments.rollingAverage.props),c=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:m??0}),stringifier:$.stringifyNumber({precision:r.precision??2,notation:r.notation}),rollingAverage:$.rollingAverage({windowSize:l.windowSize??1})},outlet:"stringifier"});n({...t,telem:h})},a=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue(o),stringifier:$.stringifyNumber({...r,notation:m}),rollingAverage:$.rollingAverage(l)},outlet:"stringifier"});n({...t,telem:h})},u=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:o.channel}),stringifier:$.stringifyNumber({...r,precision:m}),rollingAverage:$.rollingAverage({windowSize:l.windowSize})},outlet:"stringifier"});n({...t,telem:h})},d=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:$.stringifyNumber({...r,precision:r.precision??2}),valueStream:$.streamChannelValue({channel:o.channel}),rollingAverage:$.rollingAverage({windowSize:m})},outlet:"stringifier"});n({...t,telem:h})},x=is(o.channel);return g.useEffect(()=>n({...t,tooltip:[x]}),[x]),i.jsxRuntimeExports.jsxs(Be,{direction:"y",align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:o.channel,onChange:c})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx(g1,{value:r.notation,onChange:a})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:r.precision??2,bounds:{lower:0,upper:10},onChange:u})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Averaging Window",align:"start",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:d})})]})]})},R1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(S1,{path:""});default:return i.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(hn,{path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(yt,{path:"color"}),i.jsxRuntimeExports.jsx(je,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(y.Text$1,{...s})}),i.jsxRuntimeExports.jsx(as,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(je,{path:"level",label:"Value Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(ke.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(Ot,{path:"",showInner:!1})]})}},[]),t=we.useStatic({tabs:Za,content:e});return i.jsxRuntimeExports.jsx(we.Tabs,{...t})},w1=({path:e})=>{var c;const{value:t,onChange:n}=it({path:e}),s=$.sourcePipelinePropsZ.parse((c=t.source)==null?void 0:c.props),o=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=a=>{a??(a=0);const u=$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:a}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:u})},l=is(o.channel);return g.useEffect(()=>n({...t}),[l]),i.jsxRuntimeExports.jsx(Be,{direction:"x",align:"stretch",children:i.jsxRuntimeExports.jsx($e.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:o.channel,onChange:r})})})},C1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(w1,{path:""});default:return i.jsxRuntimeExports.jsx(Pe,{})}},[]),t=we.useStatic({tabs:Za,content:e});return i.jsxRuntimeExports.jsx(we.Tabs,{...t})},v1=({path:e})=>{var l;const{value:t,onChange:n}=it({path:e}),s=$.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),o=$.setChannelValuePropsZ.parse(s.segments.setter.props),r=c=>{c??(c=0);const a=$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:c}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=$.authoritySource({channel:c}),d=$.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return i.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Output Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:o.channel,onChange:r})}),i.jsxRuntimeExports.jsx(as,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(zo,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},b1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(v1,{path:""});default:return i.jsxRuntimeExports.jsx(Pe,{omit:["align","maxInlineSize"]})}},[]),t=we.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(we.Tabs,{...t})},_1=({path:e})=>{var u,d;const{value:t,onChange:n}=it({path:e}),s=$.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=$.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=$.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const f=$.sourcePipeline("number",{connections:[],segments:{valueStream:$.streamChannelValue({channel:x})},outlet:"valueStream"});n({...t,source:f})},a=x=>{x??(x=0);const f=$.sinkPipeline("number",{connections:[],segments:{setter:$.setChannelValue({channel:x})},inlet:"setter"}),m=$.authoritySource({channel:x}),h=$.acquireChannelControl({channel:x,authority:255});n({...t,sink:f,control:{...t.control,showChip:!0,chip:{sink:h,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Be,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ot,{value:l.channel,onChange:a})})]})},k1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(_1,{path:""});default:return i.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(hn,{path:"label"}),i.jsxRuntimeExports.jsx(Rl,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(yt,{path:"color"})]}),i.jsxRuntimeExports.jsx(Ot,{path:""})]})}},[]),t=we.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(we.Tabs,{...t})},P1=()=>{const e=it({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(je,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(y.Text$1,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(je,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(ke.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(je,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(Ao,{...t})})]}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(yt,{path:"color"}),i.jsxRuntimeExports.jsx(je,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(y.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(y.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:i.jsxRuntimeExports.jsx(y.Qt.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(Ot,{path:""})]})},M1=()=>i.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(hn,{path:"label",omit:["maxInlineSize","align"]}),i.jsxRuntimeExports.jsx(yt,{path:"color"})]}),i.jsxRuntimeExports.jsx(Ot,{path:"",showOuter:!1})]}),ne=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Dt=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),jt=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),N1={left:{left:q.Left,right:q.Right,top:q.Top,bottom:q.Bottom},right:{left:q.Right,right:q.Left,top:q.Bottom,bottom:q.Top},top:{left:q.Bottom,right:q.Top,top:q.Left,bottom:q.Right},bottom:{left:q.Top,right:q.Bottom,top:q.Right,bottom:q.Left}},T1=(e,t)=>N1[t][e],L1=(e,t=!1)=>{if(t)return e;switch(e){case q.Left:return q.Right;case q.Right:return q.Left;case q.Top:return q.Bottom;case q.Bottom:return q.Top;default:return q.Top}},A1=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},ce=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=v0()}catch{return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}const o=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const l=o.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{ref:o}),e]})},Y=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:r,...l})=>{const c=A1(r,s,t,n);return i.jsxRuntimeExports.jsx(cn,{position:L1(T1(e,t),!o),...l,type:"source",onClick:a=>a.stopPropagation(),className:(p.CSS.B("handle"),p.CSS.BE("handle",l.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},_e=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...r})=>i.jsxRuntimeExports.jsx("button",{className:p.CSS(p.CSS.B("symbol-primitive"),p.CSS.B("symbol-primitive-toggle"),s!=null&&p.CSS.loc(s),t&&p.CSS.M("enabled"),n&&p.CSS.M("triggered"),e),color:p.cssString(o),...r}),Re=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:p.CSS(p.CSS.B("symbol-primitive"),e),...t}),$1=.8,pe=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:r={},scale:l=1,...c})=>{e=p.g.construct(t)==="y"?p._.swap(e):e;const u=p.cssString(o),d=y.use();return o!=null&&(r[p.CSS.var("symbol-color")]=new p.Color(o).rgbString,r[p.CSS.var("symbol-color-contrast")]=new p.Color(o).pickByContrast(d.colors.gray.l0,d.colors.gray.l10).rgbString),i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:p._.svgViewBox(e),className:p.CSS(p.CSS.loc(t),s),fill:u,stroke:u,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:p._.scale(e,l*$1).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},Ya=({className:e,orientation:t,scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,orientation:t,className:p.CSS(p.CSS.B("four-way-valve"),e),children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:87},color:s,scale:n,children:[i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),qa=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(_e,{...s,className:p.CSS(p.CSS.B("three-way-valve")),orientation:t,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),Wa=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(_e,{...s,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:e,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(pe,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:i.jsxRuntimeExports.jsx(ne,{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"})})]}),Xa=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(_e,{className:p.CSS(p.CSS.B("solenoid-valve"),s&&p.CSS.M("normally-open"),e),...r,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(ne,{className:p.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"}),i.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),i.jsxRuntimeExports.jsx(Dt,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Ga=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{orientation:t,className:p.CSS(p.CSS.B("relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Ka=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{orientation:t,className:p.CSS(p.CSS.B("check-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),Ua=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,orientation:n,className:p.CSS(p.CSS.B("angled-valve"),t),children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),Qa=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)})]})]}),Ja=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=p.cssString(t);return i.jsxRuntimeExports.jsxs(Re,{...o,className:p.CSS(p.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(ce,{orientation:n,children:i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:5,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{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:r}),i.jsxRuntimeExports.jsx(ne,{d:"M33 24H2",strokeLinecap:"round"})]})]})},eu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(ce,{orientation:t,children:i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(pe,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(ne,{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"})})]}),tu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("manual-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),i.jsxRuntimeExports.jsx(ne,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),nu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(pe,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:i.jsxRuntimeExports.jsx(ne,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),I1=e=>typeof e=="number"?{topLeft:p.q.construct(e),topRight:p.q.construct(e),bottomLeft:p.q.construct(e),bottomRight:p.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:p.q.construct(e.topLeft),topRight:p.q.construct(e.topRight),bottomLeft:p.q.construct(e.bottomLeft),bottomRight:p.q.construct(e.bottomRight)}:e,O1=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},D1={width:40,height:80},su={x:50,y:10},vs=({className:e,dimensions:t=D1,borderRadius:n=su,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=I1(n),a=s==null,u=y.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(Re,{className:p.CSS(e,p.CSS.B("tank")),style:{...t,borderRadius:s??O1(c),borderColor:p.cssString(o??u.colors.gray.l9),backgroundColor:r==null?void 0:p.cssString(r)},...l,children:i.jsxRuntimeExports.jsxs(ce,{refreshDeps:d,children:[i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},ou=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(e,p.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(ne,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),i.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),ru=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("orifice"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(ne,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),iu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("needle-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{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:p.cssString(n)}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),lu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{orientation:t,className:p.CSS(p.CSS.B("angled-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(ce,{children:[i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:79},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(ne,{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"})]})]}),cu=({className:e,color:t,dimensions:n,orientation:s,units:o="psi",unitsLevel:r="small",children:l,inlineSize:c=80,...a})=>{const u=p.cssString(t),d=y.use(),x=t==null?"var(--pluto-gray-l0)":p.cssString(new p.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9)),f=2.5*((n==null?void 0:n.width)??0)/500;return i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("value"),e),...a,style:{borderColor:u,height:n==null?void 0:n.height,width:"100%"},children:[i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),i.jsxRuntimeExports.jsxs(ce,{orientation:s,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:"left",left:-2+f,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:"left",left:102-f,top:50,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx("div",{className:p.CSS(p.CSS.BE("value","units"),p.CSS.M(r)),style:{background:u},children:i.jsxRuntimeExports.jsx(y.Text,{level:r,color:x,children:o})})]})},au=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(Re,{orientation:n,children:[i.jsxRuntimeExports.jsx(y.Switch$1,{value:e,onClick:t,onChange:()=>{}}),i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),uu=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(Re,{orientation:t,children:[i.jsxRuntimeExports.jsx(y.Button,{onClick:e,color:s,size:o,level:r,onClickDelay:l,children:n}),i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:t,left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),du=({className:e,orientation:t="left",text:n="",width:s,color:o,level:r,autoFit:l,align:c="center"})=>{const a=y.use(),u=p.cssString(o??a.colors.gray.l0),d={borderColor:u,textAlign:c};return p.g.construct(t)==="y"?d.height=l?"fit-content":s:d.width=l?"fit-content":s,i.jsxRuntimeExports.jsx(Re,{style:d,orientation:t,className:p.CSS(p.CSS.B("text-box"),p.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(y.Text,{color:u,level:r,children:n})})},xu=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:r,color:l,onChange:c,...a})=>{const[u,d]=g.useState(o);return i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("setpoint"),t),orientation:e,...a,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:e,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:e,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:e,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:e,left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx(y.Numeric,{size:"small",value:u,onChange:d,showDragHandle:!1,selectOnFocus:!0,endContent:r,color:l,style:{[p.CSS.var("pack-border-shade")]:p.cssString(l)},borderWidth:2,children:i.jsxRuntimeExports.jsx(y.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},fu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("screw-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(ne,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(ne,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)})]})]}),pu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("vacuum-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:p.CSS(p.CSS.M("detail"),t)})]})]}),mu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("cavity-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(ne,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:p.CSS(p.CSS.M("detail"),t)})]})]}),hu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("piston-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(ne,{d:"M 23 32, h 16, m 0 -8, v 16",className:p.CSS(p.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),gu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{...o,className:p.CSS(p.CSS.B("static-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:98.4848,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Dt,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(ne,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),yu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("rotary-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)})]})]}),Eu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Re,{...r,orientation:n,className:p.CSS(p.CSS.B("light"),s&&p.CSS.M("enabled"),e),children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),i.jsxRuntimeExports.jsx(pe,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:i.jsxRuntimeExports.jsx(jt,{cx:"32",cy:"32",r:"30"})})]}),ju=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(e,p.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:t,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(Dt,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Su=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Ru=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:t,left:51,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(ne,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),i.jsxRuntimeExports.jsx(ne,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),wu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:t,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(Dt,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Cu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(_e,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:n,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(Dt,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),i.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),vu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(_e,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"top",orientation:n,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(Dt,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),bu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(_e,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(ce,{children:i.jsxRuntimeExports.jsx(Y,{location:"top",left:50,top:2,id:"4",orientation:n})}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(ne,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),_u=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(_e,{...o,className:p.CSS(p.CSS.B("compressor"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),i.jsxRuntimeExports.jsxs(pe,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(jt,{cx:"35",cy:"25",r:"23"}),i.jsxRuntimeExports.jsx(ne,{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"}),i.jsxRuntimeExports.jsx(fe,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),i.jsxRuntimeExports.jsx(fe,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),ku=({id:e,className:t,orientation:n="right",label:s="text",color:o="black",level:r="p",...l})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const a=p.g.construct(n)==="y";return i.jsxRuntimeExports.jsxs(Re,{className:p.CSS(p.CSS.B("arrow"),p.CSS.loc(n),t),orientation:n,...l,children:[i.jsxRuntimeExports.jsx("div",{className:"wrapper",children:i.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:p.cssString(o)},children:i.jsxRuntimeExports.jsx("div",{className:"bg",children:i.jsxRuntimeExports.jsx(y.Text,{level:r,className:p.CSS.BE("symbol","label"),children:s})})})}),i.jsxRuntimeExports.jsxs(ce,{orientation:n,children:[i.jsxRuntimeExports.jsx(Y,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:a,id:"1"}),i.jsxRuntimeExports.jsx(Y,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:a,id:"2"})]}),i.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[i.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),i.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),i.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},z1=({aetherKey:e,sink:t})=>{const n=y.useMemoDeepEqualProps({sink:t}),[,,s]=y.use$3({aetherKey:e,type:$.Button.TYPE,schema:$.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(r=>({...r,...n}))},[n]),{click:g.useCallback(()=>{s(r=>({...r,trigger:r.trigger+1}))},[s])}},B1=({aetherKey:e,source:t})=>{const n=y.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=y.use$3({aetherKey:e,type:$.Light.TYPE,schema:$.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>o(r=>({...r,...n})),[n,o]),{enabled:s}},ae=g.forwardRef(({label:e="",onChange:t,level:n="p",children:s,orientation:o="top",style:r,className:l,maxInlineSize:c=150,...a},u)=>i.jsxRuntimeExports.jsxs(te.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...r},size:2/3,direction:o,ref:u,className:p.CSS(p.CSS.B("symbol"),l),align:"center",justify:"center",...a,children:[e.length>0&&i.jsxRuntimeExports.jsx(y.Editable,{className:p.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:c},onChange:g.useCallback(d=>t({label:{label:d,level:n,orientation:o}}),[t,n]),level:n}),s]}));ae.displayName="Labeled";const V1=({aetherKey:e,source:t,sink:n})=>{const s=y.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=y.use$3({aetherKey:e,type:$.Setpoint.TYPE,schema:$.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{r(c=>({...c,...s}))},[s,r]),{set:g.useCallback(c=>r(a=>({...a,trigger:a.trigger+1,command:c})),[r]),value:o}},ve=({aetherKey:e,source:t,sink:n})=>{const s=y.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=y.use$3({aetherKey:e,type:$.Toggle.TYPE,schema:$.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(a=>({...a,...s}))},[s,l]),{toggle:g.useCallback(()=>l(a=>({...a,triggered:!a.triggered})),[l]),triggered:o,enabled:r}},F1=$.Value.z.partial({color:!0}).extend({level:H.levelZ.optional()}),Pu=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",notation:c})=>{const a=y.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:c}),[,u,d]=y.use$3({aetherKey:e,type:$.Value.TYPE,schema:$.Value.z,initialState:a});return g.useEffect(()=>d(x=>({...x,...a})),[a]),{width:u.width??u.minWidth}},H1=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:F1,use:Pu},Symbol.toStringTag,{value:"Module"})),Mu=e=>p.g.construct(e)==="x"?p.J.swap(e):e,Z1=e=>p.g.construct(e)==="y"?p.J.swap(e):e,ye=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:s="left",chip:o,children:r,show:l=!0,...c})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:p.J.rotate90(s),align:"center",justify:"center",empty:!0,...c,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:p.g.construct(s),align:"center",className:p.CSS(p.CSS.B("control-state")),size:"small",children:[l&&e&&i.jsxRuntimeExports.jsx(Bl,{size:"small",...o}),l&&t&&i.jsxRuntimeExports.jsx(Hl,{...n})]}),r]}),Nu=y.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:s,source:o,sink:r,orientation:l="left",...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:o,sink:r});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(ye,{...s,orientation:Mu(l),children:i.jsxRuntimeExports.jsx(qa,{enabled:a,triggered:u,onClick:d,orientation:l,...c})})})}),Tu=e=>i.jsxRuntimeExports.jsx(qa,{...e}),Lu=y.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:s,source:o,sink:r,orientation:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:t,source:o,sink:r});return i.jsxRuntimeExports.jsx(ae,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...e,orientation:l,children:i.jsxRuntimeExports.jsx(Wa,{enabled:a,triggered:u,onClick:d,orientation:l,...c})})})}),Au=e=>i.jsxRuntimeExports.jsx(Wa,{...e}),$u=y.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:s="left",normallyOpen:o,source:r,sink:l,control:c,...a})=>{const{enabled:u,triggered:d,toggle:x}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(ye,{...c,orientation:Z1(s),children:i.jsxRuntimeExports.jsx(Xa,{enabled:u,triggered:d,onClick:x,orientation:s,normallyOpen:o,...a})})})}),Iu=e=>i.jsxRuntimeExports.jsx(Xa,{...e}),Ou=y.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...t,orientation:o,children:i.jsxRuntimeExports.jsx(Ya,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Du=e=>i.jsxRuntimeExports.jsx(Ya,{...e}),zu=y.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:s,orientation:o="left",source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:Mu(o),children:i.jsxRuntimeExports.jsx(Ua,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Bu=e=>i.jsxRuntimeExports.jsx(Ua,{...e}),Vu=y.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(Qa,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Fu=e=>i.jsxRuntimeExports.jsx(Qa,{...e}),Hu=({backgroundColor:e,label:t,onChange:n,orientation:s,color:o,dimensions:r,borderRadius:l})=>i.jsxRuntimeExports.jsx(ae,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(vs,{onResize:c=>n({dimensions:c}),orientation:s,color:o,dimensions:r,borderRadius:l,backgroundColor:e})}),Zu=e=>i.jsxRuntimeExports.jsx(vs,{...e,dimensions:{width:25,height:50}}),Yu=({backgroundColor:e,borderRadius:t,label:n,onChange:s,orientation:o,color:r,dimensions:l})=>i.jsxRuntimeExports.jsx(ae,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(vs,{onResize:c=>s({dimensions:c}),orientation:o,color:r,dimensions:l,boxBorderRadius:t,backgroundColor:e})}),qu=e=>i.jsxRuntimeExports.jsx(vs,{...e,dimensions:{width:25,height:50},borderRadius:0}),Wu=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Ga,{...s})}),Xu=e=>i.jsxRuntimeExports.jsx(Ga,{...e}),Gu=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(ou,{...s})}),Ku=e=>i.jsxRuntimeExports.jsx(ou,{...e}),Uu=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(ju,{...s})}),Qu=e=>i.jsxRuntimeExports.jsx(ju,{...e}),Ju=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Ja,{...s})}),ed=e=>i.jsxRuntimeExports.jsx(Ja,{...e}),td=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(eu,{...s})}),nd=e=>i.jsxRuntimeExports.jsx(eu,{...e}),sd=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(tu,{...s})}),od=e=>i.jsxRuntimeExports.jsx(tu,{...e}),rd=y.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:s,units:o,source:r,sink:l,color:c,onChange:a})=>{const{value:u,set:d}=V1({aetherKey:t,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...e,onChange:a,children:i.jsxRuntimeExports.jsx(ye,{...s,className:p.CSS.B("symbol"),orientation:n,children:i.jsxRuntimeExports.jsx(xu,{value:u,onChange:d,units:o,color:c,orientation:n})})})}),id=e=>i.jsxRuntimeExports.jsx(xu,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:"10.0"})}),ld=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(nu,{...s})}),cd=e=>i.jsxRuntimeExports.jsx(nu,{...e}),ad=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(iu,{...s})}),ud=e=>i.jsxRuntimeExports.jsx(iu,{...e}),dd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Ka,{...s})}),xd=e=>i.jsxRuntimeExports.jsx(Ka,{...e}),fd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(ru,{...s})}),pd=e=>i.jsxRuntimeExports.jsx(ru,{...e}),md=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(lu,{...s})}),hd=e=>i.jsxRuntimeExports.jsx(lu,{...e}),gd=y.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:s,className:o,textColor:r,color:l,telem:c,units:a,onChange:u,tooltip:d,inlineSize:x,notation:f})=>{const m=y.useTypography(n),[h,E]=g.useState({outerBox:p.Eo.ZERO,labelDims:p._.ZERO}),v=ct(),w=(m.lineHeight+.5)*m.baseSize+2,_=y.useResize(g.useCallback(C=>{const P=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);if(P==null)return;const b=p._.scale(p.Eo.dims(p.Eo.construct(P)),1/(Y1*v.getZoom()));E({outerBox:C,labelDims:b})},[]),{}),S=q1({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:w,position:s,...h}),{width:j}=Pu({aetherKey:e,color:r,level:n,box:S,telem:c,minWidth:x,notation:f});return i.jsxRuntimeExports.jsxs(y.Dialog$1,{location:{y:"top"},hide:d==null||d.length===0,children:[i.jsxRuntimeExports.jsx(te.Space,{direction:"y",children:d==null?void 0:d.map((C,P)=>i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:C},P))}),i.jsxRuntimeExports.jsx(ae,{className:p.CSS(o,p.CSS.B("value-labeled")),ref:_,onChange:u,...t,children:i.jsxRuntimeExports.jsx(cu,{color:l,dimensions:{height:w,width:j},inlineSize:x,units:a,unitsLevel:H.downLevel(n)})})]})}),Y1=.9,q1=({labelOrientation:e,outerBox:t,labelDims:n,valueBoxHeight:s,position:o,hasLabel:r})=>(p.g.construct(e)==="x"&&(o=p.q.translate(o,"y",Math.max((n.height-s)/2-1,1))),r&&e==="left"?o=p.q.translate(o,{x:n.width+6,y:0}):r&&e==="top"&&(o=p.q.translate(o,"y",n.height+6)),p.Eo.construct(o.x,o.y,p.Eo.width(t),s)),yd=({color:e})=>i.jsxRuntimeExports.jsx(cu,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:"50.00"})}),Ed=y.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(au,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),jd=e=>i.jsxRuntimeExports.jsx(au,{...e}),Sd=y.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:s,control:o,...r})=>{const{click:l}=z1({aetherKey:e,sink:s});return i.jsxRuntimeExports.jsx(ye,{...o,className:p.CSS.B("symbol"),orientation:n,children:i.jsxRuntimeExports.jsx(uu,{...t,onClick:l,...r})})}),Rd=({label:e,...t})=>i.jsxRuntimeExports.jsx(uu,{label:"Button",...t}),wd=y.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(fu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Cd=e=>i.jsxRuntimeExports.jsx(fu,{...e}),vd=y.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(pu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),bd=e=>i.jsxRuntimeExports.jsx(pu,{...e}),_d=y.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(mu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),kd=e=>i.jsxRuntimeExports.jsx(mu,{...e}),Pd=y.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(hu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Md=e=>i.jsxRuntimeExports.jsx(hu,{...e}),Nd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ae,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(gu,{...s})}),Td=e=>i.jsxRuntimeExports.jsx(gu,{...e}),Ld=y.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(ye,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(yu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Ad=e=>i.jsxRuntimeExports.jsx(yu,{...e}),$d=y.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:s,...o})=>{const{enabled:r}=B1({aetherKey:e,source:n});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Eu,{enabled:r,...o})})}),Id=e=>i.jsxRuntimeExports.jsx(Eu,{...e}),Od=y.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Su,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Dd=e=>i.jsxRuntimeExports.jsx(Su,{...e}),zd=y.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Ru,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Bd=e=>i.jsxRuntimeExports.jsx(Ru,{...e}),Vd=y.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(wu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Fd=e=>i.jsxRuntimeExports.jsx(wu,{...e}),Hd=y.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Cu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Zd=e=>i.jsxRuntimeExports.jsx(Cu,{...e}),Yd=y.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(vu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),qd=e=>i.jsxRuntimeExports.jsx(vu,{...e}),Wd=y.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(bu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Xd=e=>i.jsxRuntimeExports.jsx(bu,{...e}),Gd=y.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=ve({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ae,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(ye,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(_u,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),Kd=e=>i.jsxRuntimeExports.jsx(_u,{...e}),Ud=e=>i.jsxRuntimeExports.jsx(du,{...e}),Qd=({level:e="p",width:t=100,...n})=>i.jsxRuntimeExports.jsx(du,{className:p.CSS.B("symbol"),level:e,width:t,...n}),Jd=({label:{label:e,level:t},aetherKey:n,position:s,...o})=>i.jsxRuntimeExports.jsx(ku,{label:e,level:t,...o,className:p.CSS.B("symbol")}),ex=({label:e,...t})=>i.jsxRuntimeExports.jsx(ku,{label:"Off Page",...t,orientation:"right"}),ue=4,tx=2,W1=["agitator","angledReliefValve","angledValve","offPageReference","box","burstDisc","button","cap","cavityPump","checkValve","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","light","manualValve","needleValve","orifice","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve"],X1=ie.z.enum(W1),Ee={orientation:"left",scale:1},G1={...Ee,source:$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:0}),rollingAverage:$.rollingAverage({windowSize:1}),stringifier:$.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},K1={...Ee,source:$.sourcePipeline("number",{connections:[],segments:{valueStream:$.streamChannelValue({channel:0})},outlet:"valueStream"})},U1={...Ee,sink:$.sinkPipeline("number",{connections:[],segments:{setter:$.setChannelValue({channel:0})},inlet:"setter"})},nx={...Ee,source:$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:0}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},sx={...Ee,control:{show:!0},sink:$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:0}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},be={...nx,...sx},le=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),Q1={width:125,height:200},ar={dimensions:Q1},J1=3,eR={name:"Three Way Valve",key:"threeWayValve",Form:Ce,Symbol:Nu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Three Way Valve"),...be}),Preview:Tu,zIndex:ue},tR={name:"Valve",key:"valve",Form:Ce,Symbol:Lu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Valve"),...be}),Preview:Au,zIndex:ue},nR={name:"Solenoid Valve",key:"solenoidValve",Form:Ce,Symbol:$u,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Solenoid Valve"),normallyOpen:!1,...be}),Preview:Iu,zIndex:ue},sR={name:"Four Way Valve",key:"fourWayValve",Form:Ce,Symbol:Ou,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Four Way Valve"),...be}),Preview:Du,zIndex:ue},oR={name:"Angled Valve",key:"angledValve",Form:Ce,Symbol:zu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Angled Valve"),...be}),Preview:Bu,zIndex:ue},rR={name:"Pump",key:"pump",Form:Ce,Symbol:Vu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Pump"),...be}),Preview:Fu,zIndex:ue},iR={name:"Screw Pump",key:"screwPump",Form:Ce,Symbol:wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Screw Pump"),...be}),Preview:Cd,zIndex:ue},lR={name:"Tank",key:"tank",Form:Ha,Symbol:Hu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...le("Tank"),borderRadius:su,...ar,...Ee}),Preview:Zu,zIndex:tx},cR={name:"Box",key:"box",Form:()=>Ha({includeBorderRadius:!0}),Symbol:Yu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...le("Box"),borderRadius:J1,...ar,...Ee}),Preview:qu,zIndex:tx},aR={name:"Relief Valve",key:"reliefValve",Form:Pe,Symbol:Wu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Relief Valve"),...Ee}),Preview:Xu,zIndex:ue},uR={name:"Regulator",key:"regulator",Form:Pe,Symbol:Gu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Regulator"),...Ee}),Preview:Ku,zIndex:ue},dR={name:"Electric Regulator",key:"electricRegulator",Form:Pe,Symbol:Uu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Electric Regulator"),...Ee}),Preview:Qu,zIndex:ue},xR={name:"Burst Disc",key:"burstDisc",Form:Pe,Symbol:Ju,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Burst Disc"),...Ee}),Preview:ed,zIndex:ue},fR={name:"Cap",key:"cap",Form:Pe,Symbol:td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Cap"),...Ee}),Preview:nd,zIndex:ue},pR={name:"Manual Valve",key:"manualValve",Form:Pe,Symbol:sd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Manual Valve"),...Ee}),Preview:od,zIndex:ue},mR={name:"Filter",key:"filter",Form:Pe,Symbol:ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Filter"),...Ee}),Preview:cd,zIndex:ue},hR={name:"Needle Valve",key:"needleValve",Form:Pe,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Needle Valve"),...Ee}),Preview:ud,zIndex:ue},gR={name:"Check Valve",key:"checkValve",Form:Pe,Symbol:dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Check Valve"),...Ee}),Preview:xd,zIndex:ue},yR={name:"Orifice",key:"orifice",Form:Pe,Symbol:fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Orifice"),...Ee}),Preview:pd,zIndex:ue},ER={name:"Angled Relief Valve",key:"angledReliefValve",Form:Pe,Symbol:md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Angled Relief Valve"),...Ee}),Preview:hd,zIndex:ue},jR={name:"Value",key:"value",Form:R1,Symbol:gd,Preview:yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...le("Value"),...Ee,telem:G1.source}),zIndex:ue},SR={name:"Button",key:"button",Symbol:Sd,Form:b1,Preview:Rd,defaultProps:e=>({color:e.colors.primary.z.rgba255,...le("Button"),...sx,onClickDelay:0,scale:null}),zIndex:ue},RR={name:"Switch",key:"switch",Symbol:Ed,Preview:jd,Form:Ce,defaultProps:()=>({...le("Switch"),...be,scale:null}),zIndex:ue},wR={name:"Vacuum Pump",key:"vacuumPump",Symbol:vd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Vacuum Pump"),...be}),Preview:bd,zIndex:ue},CR={name:"Cavity Pump",key:"cavityPump",Symbol:_d,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Cavity Pump"),...be}),Preview:kd,zIndex:ue},vR={name:"Piston Pump",key:"pistonPump",Symbol:Pd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Piston Pump"),...be}),Preview:Md,zIndex:ue},bR={name:"Static Mixer",key:"staticMixer",Symbol:Nd,Form:Pe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Static Mixer"),...Ee}),Preview:Td,zIndex:ue},_R={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Ld,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Rotary Mixer"),...be}),Preview:Ad,zIndex:ue},kR={name:"Light",key:"light",Symbol:$d,Form:C1,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Light"),...nx}),Preview:Id,zIndex:ue},PR={name:"Setpoint",key:"setpoint",Symbol:rd,Form:k1,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...le("Setpoint"),...K1,...U1}),Preview:id,zIndex:ue},MR={name:"Agitator",key:"agitator",Symbol:Od,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Agitator"),...be}),Preview:Dd,zIndex:ue},NR={name:"Propeller Agitator",key:"propellerAgitator",Symbol:zd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Propeller Agitator"),...be}),Preview:Bd,zIndex:ue},TR={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Vd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Flat Blade Agitator"),...be}),Preview:Fd,zIndex:ue},LR={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Hd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Paddle Agitator"),...be}),Preview:Zd,zIndex:ue},AR={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Yd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Cross Beam Agitator"),...be}),Preview:qd,zIndex:ue},$R={name:"Helical Agitator",key:"helicalAgitator",Symbol:Wd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Helical Agitator"),...be}),Preview:Xd,zIndex:ue},IR={name:"Compressor",key:"compressor",Symbol:Gd,Form:Ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...le("Compressor"),...be}),Preview:Kd,zIndex:ue},OR={name:"Text Box",key:"textBox",Symbol:Ud,Form:P1,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...le("Text Box"),...Ee,...ar,level:"p",text:"Text Box",width:75}),Preview:Qd,zIndex:ue},DR={name:"Off Page Reference",key:"offPageReference",Form:M1,Symbol:Jd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...le("Off Page Reference")}),Preview:ex,zIndex:ue},zR={value:jR,button:SR,tank:lR,switch:RR,offPageReference:DR,light:kR,setpoint:PR,box:cR,textBox:OR,valve:tR,solenoidValve:nR,threeWayValve:eR,fourWayValve:sR,angledValve:oR,manualValve:pR,needleValve:hR,reliefValve:aR,angledReliefValve:ER,checkValve:gR,regulator:uR,electricRegulator:dR,pump:rR,pistonPump:vR,screwPump:iR,cavityPump:CR,vacuumPump:wR,staticMixer:bR,rotaryMixer:_R,burstDisc:xR,cap:fR,filter:mR,orifice:yR,agitator:MR,propellerAgitator:NR,flatBladeAgitator:TR,paddleAgitator:LR,crossBeamAgitator:AR,helicalAgitator:$R,compressor:IR},BR=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Od,AgitatorPreview:Dd,AngledReliefValve:md,AngledReliefValvePreview:hd,AngledValve:zu,AngledValvePreview:Bu,Box:Yu,BoxPreview:qu,BurstDisc:Ju,BurstDiscPreview:ed,Button:Sd,ButtonPreview:Rd,Cap:td,CapPreview:nd,CavityPump:_d,CavityPumpPreview:kd,CheckValve:dd,CheckValvePreview:xd,Compressor:Gd,CompressorPreview:Kd,CrossBeamAgitator:Yd,CrossBeamAgitatorPreview:qd,ElectricRegulator:Uu,ElectricRegulatorPreview:Qu,Filter:ld,FilterPreview:cd,FlatBladeAgitator:Vd,FlatBladeAgitatorPreview:Fd,FourWayValve:Ou,FourWayValvePreview:Du,HelicalAgitator:Wd,HelicalAgitatorPreview:Xd,Light:$d,LightPreview:Id,ManualValve:sd,ManualValvePreview:od,NeedleValve:ad,NeedleValvePreview:ud,OffPageReference:Jd,OffPageReferencePreview:ex,Orifice:fd,OrificePreview:pd,PaddleAgitator:Hd,PaddleAgitatorPreview:Zd,PistonPump:Pd,PistonPumpPreview:Md,PropellerAgitator:zd,PropellerAgitatorPreview:Bd,Pump:Vu,PumpPreview:Fu,Regulator:Gu,RegulatorPreview:Ku,ReliefValve:Wu,ReliefValvePreview:Xu,RotaryMixer:Ld,RotaryMixerPreview:Ad,SYMBOLS:zR,ScrewPump:wd,ScrewPumpPreview:Cd,Setpoint:rd,SetpointPreview:id,SolenoidValve:$u,SolenoidValvePreview:Iu,StaticMixer:Nd,StaticMixerPreview:Td,Switch:Ed,SwitchPreview:jd,Tank:Hu,TankPreview:Zu,TextBox:Ud,TextBoxPreview:Qd,ThreeWayValve:Nu,ThreeWayValvePreview:Tu,VacuumPump:vd,VacuumPumpPreview:bd,Value:gd,ValuePreview:yd,Valve:Lu,ValvePreview:Au,typeZ:X1},Symbol.toStringTag,{value:"Module"}));exports.Aether=y.main;exports.Dialog=y.use$4;exports.Divider=y.Divider$1;exports.Dropdown=y.Dropdown;exports.Haul=y.Haul;exports.Worker=y.Context$1;exports.compareArrayDeps=y.compareArrayDeps;exports.componentRenderProp=y.componentRenderProp;exports.isRenderProp=y.isRenderProp;exports.useAsyncEffect=y.useAsyncEffect;exports.useClickOutside=y.useClickOutside;exports.useCombinedRefs=y.useCombinedRefs;exports.useCombinedStateAndRef=y.useCombinedStateAndRef;exports.useDebouncedCallback=y.useDebouncedCallback;exports.useEffectCompare=y.useEffectCompare;exports.useMemoCompare=y.useMemoCompare;exports.useMemoDeepEqualProps=y.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=y.useMemoPrimitiveArray;exports.usePrevious=y.usePrevious;exports.useResize=y.useResize;exports.useStateRef=y.useStateRef;exports.useSyncedRef=y.useSyncedRef;exports.useTransforms=y.useTransforms;exports.CSS=p.CSS;exports.newBEM=p.newBEM;exports.Header=_n.external;exports.DataType=H.g;exports.Density=H.b;exports.MultiSeries=H.Ct;exports.Rate=H.P;exports.Series=H.V;exports.TimeRange=H.E;exports.TimeSpan=H.y;exports.TimeStamp=H.m;exports.state=H.state;exports.Generic=te.Generic;exports.Align=lf.external;exports.Icon=we.Icon;exports.Tabs=we.external;exports.Button=cf.external;exports.Caret=Ni.Animated$1;exports.telem=$.external;exports.Color=wo.external;exports.Text=ke.external;exports.Triggers=Ti.external;exports.List=Tt.external;exports.createFilterTransform=Tt.createFilterTransform;exports.fuseFilter=Tt.fuseFilter;exports.proxyMemo=Tt.proxyMemo;exports.createHexOpacityVariants=Li.createHexOpacityVariants;exports.unitProperty=Li.unitProperty;exports.Input=$e.external;exports.Menu=uf.external;exports.Theming=df.external;exports.Tree=xf.external;exports.Video=ff.Video;exports.Accordion=Tf;exports.Breadcrumb=$f;exports.Canvas=Jf;exports.Channel=Wp;exports.Control=oh;exports.Device=dm;exports.Diagram=x1;exports.Eraser=zm;exports.Form=cm;exports.Label=gm;exports.Legend=op;exports.Line=ip;exports.LinePlot=Lp;exports.Log=p1;exports.Measure=Op;exports.Modal=Em;exports.Mosaic=Im;exports.Nav=Fm;exports.Note=Zm;exports.OS=Gm;exports.Observe=im;exports.Override=Um;exports.Pluto=ch;exports.Portal=km;exports.Progress=uh;exports.Range=$p;exports.Ranger=gh;exports.Resize=Cf;exports.Rule=Dp;exports.Schematic=BR;exports.Select=Sp;exports.Status=hf;exports.Steps=Eh;exports.Synnax=Df;exports.Tag=Ep;exports.Telem=eh;exports.Tooltip=gf;exports.Value=H1;exports.Viewport=Tp;exports.axis=Xf;exports.control=Gf;
|