@synnaxlabs/pluto 0.33.1 → 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.
Files changed (225) hide show
  1. package/dist/{Animated-CmYpn592.cjs → Animated-Ck87AGOu.cjs} +1 -1
  2. package/dist/{Animated-BJ0Om9zo.js → Animated-CnvOerW9.js} +2 -2
  3. package/dist/{Item-JN1-gBEw.js → Item--wCat2DH.js} +5 -5
  4. package/dist/{Item-CPt4Umh0.cjs → Item-DuNQFmgk.cjs} +1 -1
  5. package/dist/{Keyboard-BwzZPKjx.cjs → Keyboard-DPs95Etp.cjs} +1 -1
  6. package/dist/{Keyboard-CBvQle7r.js → Keyboard-Dh_Fhwg4.js} +2 -2
  7. package/dist/LinePlot--yLT9nkT.cjs +34 -0
  8. package/dist/LinePlot-6KHKqa-2.js +6269 -0
  9. package/dist/Link-BHtl4aby.cjs +1 -0
  10. package/dist/{Link-my2OWRXu.js → Link-CDG2-g6A.js} +2 -2
  11. package/dist/{List-B1BAwLaq.js → List-BjimX8fM.js} +5 -5
  12. package/dist/List-C8vXIE2j.cjs +1 -0
  13. package/dist/{Pack-CxtceW7N.js → Pack-D6eMgf33.js} +9 -9
  14. package/dist/{Pack-uflj5a28.cjs → Pack-DijAGcm_.cjs} +1 -1
  15. package/dist/{Text-BvzGtwCB.cjs → Text-Cg0q7seY.cjs} +1 -1
  16. package/dist/{Text-SLn1Qwzw.js → Text-CzgVM_22.js} +5 -5
  17. package/dist/Toggle-CP9KtybX.cjs +143 -0
  18. package/dist/{Toggle-CqrGlCW8.js → Toggle-Cdu7WaiC.js} +7782 -7769
  19. package/dist/{Video-DKosAU7v.cjs → Video-BgDjKMJx.cjs} +1 -1
  20. package/dist/{Video-o34bcpwh.js → Video-DYSz9XOF.js} +1 -1
  21. package/dist/aggregator-C0Ab25_o.cjs +67 -0
  22. package/dist/{aggregator-B36SA-20.js → aggregator-DzdAnRwI.js} +1427 -1397
  23. package/dist/align.cjs +1 -1
  24. package/dist/align.js +1 -1
  25. package/dist/button.cjs +1 -1
  26. package/dist/button.js +1 -1
  27. package/dist/color.cjs +1 -1
  28. package/dist/color.js +1 -1
  29. package/dist/{css-C8qHWSpT.js → css-B4FcyECk.js} +48 -21
  30. package/dist/css-Dh7n0EGs.cjs +1 -0
  31. package/dist/css.cjs +1 -1
  32. package/dist/css.js +2 -2
  33. package/dist/dropdown.cjs +1 -1
  34. package/dist/dropdown.js +1 -1
  35. package/dist/ether.cjs +1 -1
  36. package/dist/ether.js +5 -5
  37. package/dist/{external-B0o5Z8wI.js → external-B72rRj4o.js} +5 -5
  38. package/dist/{external-BTFW7AEo.js → external-BOIjtEGO.js} +2 -2
  39. package/dist/{external-Crturtt-.cjs → external-BbS4QDTb.cjs} +1 -1
  40. package/dist/{external-BLnPpmeS.cjs → external-CAIE4G3V.cjs} +1 -1
  41. package/dist/{external-CPTY4-IY.cjs → external-CYsmC4uZ.cjs} +1 -1
  42. package/dist/{external-B5jyXhgU.cjs → external-Cc9o20Al.cjs} +1 -1
  43. package/dist/{external-CLKqHc4s.cjs → external-CjmMj11F.cjs} +1 -1
  44. package/dist/{external-euVgbl49.js → external-CoQwrjWl.js} +15 -15
  45. package/dist/external-CsqyDUsJ.js +96 -0
  46. package/dist/external-CsrLjLOh.cjs +1 -0
  47. package/dist/{external-DYwzKoQ6.js → external-D9Q5Xjko.js} +2 -2
  48. package/dist/{external-D6YTf7Kx.cjs → external-DRHWURjA.cjs} +1 -1
  49. package/dist/{external-DVhxMa2A.js → external-DcMAC_pY.js} +13 -10
  50. package/dist/external-Dm2-owlq.cjs +1 -0
  51. package/dist/{external-Cb_NFNiX.cjs → external-DsKRFJxV.cjs} +1 -1
  52. package/dist/{external-BKx-fjB8.js → external-DvRQ7lJU.js} +2 -2
  53. package/dist/{external-DqwISR2q.js → external-FVIwMFDr.js} +5 -5
  54. package/dist/external-Yf8Lv9AU.js +248 -0
  55. package/dist/{external-BvoBhRW8.cjs → external-eI1p10Vf.cjs} +1 -1
  56. package/dist/external-gz4sf3pG.cjs +1 -0
  57. package/dist/{external-GxvuofB_.js → external-k3Jbrj0m.js} +11 -11
  58. package/dist/{external-Cewuz6Gm.js → external-lgZ2Gmbx.js} +4 -4
  59. package/dist/{external-Cc1Bqjmm.js → external-mE-a2ecU.js} +1 -1
  60. package/dist/{external-C-xh9EwI.cjs → external-mtlL4Z3a.cjs} +1 -1
  61. package/dist/header.cjs +1 -1
  62. package/dist/header.js +1 -1
  63. package/dist/index.cjs +39 -1
  64. package/dist/index.js +11752 -5556
  65. package/dist/input.cjs +1 -1
  66. package/dist/input.js +1 -1
  67. package/dist/list.cjs +1 -1
  68. package/dist/list.js +1 -1
  69. package/dist/menu.cjs +1 -1
  70. package/dist/menu.js +1 -1
  71. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  72. package/dist/src/aether/main.d.ts.map +1 -1
  73. package/dist/src/align/Space.d.ts.map +1 -1
  74. package/dist/src/button/Button.d.ts.map +1 -1
  75. package/dist/src/caret/Animated.d.ts.map +1 -1
  76. package/dist/src/channel/AliasProvider.d.ts.map +1 -1
  77. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  78. package/dist/src/color/Swatch/Swatch.d.ts +2 -1
  79. package/dist/src/color/Swatch/Swatch.d.ts.map +1 -1
  80. package/dist/src/color/core/color.d.ts.map +1 -1
  81. package/dist/src/divider/Divider.d.ts.map +1 -1
  82. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  83. package/dist/src/form/Field.d.ts.map +1 -1
  84. package/dist/src/form/Form.d.ts.map +1 -1
  85. package/dist/src/form/synced.d.ts.map +1 -1
  86. package/dist/src/hardware/device/Select.d.ts.map +1 -1
  87. package/dist/src/haul/Haul.d.ts.map +1 -1
  88. package/dist/src/hooks/useClickOutside.d.ts.map +1 -1
  89. package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
  90. package/dist/src/icon/Icon.d.ts.map +1 -1
  91. package/dist/src/input/Item.d.ts.map +1 -1
  92. package/dist/src/input/Label.d.ts.map +1 -1
  93. package/dist/src/input/Numeric.d.ts.map +1 -1
  94. package/dist/src/input/Text.d.ts.map +1 -1
  95. package/dist/src/input/types.d.ts.map +1 -1
  96. package/dist/src/label/Select.d.ts.map +1 -1
  97. package/dist/src/list/Item.d.ts.map +1 -1
  98. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  99. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  100. package/dist/src/menu/Item.d.ts.map +1 -1
  101. package/dist/src/modal/Modal.d.ts.map +1 -1
  102. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  103. package/dist/src/notation/SelectNotation.d.ts +12 -0
  104. package/dist/src/notation/SelectNotation.d.ts.map +1 -0
  105. package/dist/src/notation/notation.d.ts +33 -0
  106. package/dist/src/notation/notation.d.ts.map +1 -0
  107. package/dist/src/notation/notation.spec.d.ts +2 -0
  108. package/dist/src/notation/notation.spec.d.ts.map +1 -0
  109. package/dist/src/note/Note.d.ts.map +1 -1
  110. package/dist/src/observe/use.d.ts.map +1 -1
  111. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  112. package/dist/src/progress/Progress.d.ts.map +1 -1
  113. package/dist/src/ranger/Select.d.ts.map +1 -1
  114. package/dist/src/select/Alignment.d.ts.map +1 -1
  115. package/dist/src/select/List.d.ts.map +1 -1
  116. package/dist/src/select/Multiple.d.ts.map +1 -1
  117. package/dist/src/select/Single.d.ts.map +1 -1
  118. package/dist/src/status/Circle.d.ts.map +1 -1
  119. package/dist/src/status/Notification.d.ts.map +1 -1
  120. package/dist/src/synnax/Provider.d.ts.map +1 -1
  121. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  122. package/dist/src/tabs/Selector.d.ts.map +1 -1
  123. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  124. package/dist/src/tabs/types.d.ts.map +1 -1
  125. package/dist/src/tag/Tag.d.ts.map +1 -1
  126. package/dist/src/telem/Pipeline.d.ts.map +1 -1
  127. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  128. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  129. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  130. package/dist/src/telem/aether/transformers.d.ts +9 -0
  131. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  132. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  133. package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
  134. package/dist/src/telem/client/reader.d.ts.map +1 -1
  135. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  136. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  137. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  138. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  139. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  140. package/dist/src/text/DateTime.d.ts.map +1 -1
  141. package/dist/src/text/Editable.d.ts.map +1 -1
  142. package/dist/src/text/SelectLevel.d.ts.map +1 -1
  143. package/dist/src/text/core/types.d.ts +2 -0
  144. package/dist/src/text/core/types.d.ts.map +1 -1
  145. package/dist/src/text/dimensions.d.ts.map +1 -1
  146. package/dist/src/theming/core/fontString.d.ts +7 -1
  147. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  148. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  149. package/dist/src/tree/Tree.d.ts.map +1 -1
  150. package/dist/src/tree/core.d.ts.map +1 -1
  151. package/dist/src/triggers/Provider.d.ts.map +1 -1
  152. package/dist/src/triggers/hooks.d.ts.map +1 -1
  153. package/dist/src/util/zod.d.ts.map +1 -1
  154. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  155. package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
  156. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  157. package/dist/src/vis/diagram/Diagram.d.ts +1 -0
  158. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  159. package/dist/src/vis/diagram/aether/Diagram.d.ts +0 -2
  160. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  161. package/dist/src/vis/diagram/aether/types.d.ts +23 -14
  162. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
  163. package/dist/src/vis/diagram/edge/Edge.d.ts +1 -1
  164. package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
  165. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  166. package/dist/src/vis/diagram/util.d.ts +1 -1
  167. package/dist/src/vis/diagram/util.d.ts.map +1 -1
  168. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  169. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  170. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  171. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  172. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  173. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  174. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  175. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  176. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  177. package/dist/src/vis/lineplot/range/aether/external.d.ts.map +1 -1
  178. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  179. package/dist/src/vis/log/Log.d.ts.map +1 -1
  180. package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
  181. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  182. package/dist/src/vis/render/loop.d.ts +7 -4
  183. package/dist/src/vis/render/loop.d.ts.map +1 -1
  184. package/dist/src/vis/render/performance.d.ts.map +1 -1
  185. package/dist/src/vis/render/util.d.ts.map +1 -1
  186. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  187. package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
  188. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  189. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  190. package/dist/src/vis/schematic/primitives/Primitives.d.ts +2 -1
  191. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  192. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  193. package/dist/src/vis/value/aether/value.d.ts +20 -9
  194. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  195. package/dist/src/vis/value/use.d.ts +5 -1
  196. package/dist/src/vis/value/use.d.ts.map +1 -1
  197. package/dist/src/worker/Context.d.ts.map +1 -1
  198. package/dist/style.css +1 -1
  199. package/dist/tabs.cjs +1 -1
  200. package/dist/tabs.js +1 -1
  201. package/dist/text.cjs +1 -1
  202. package/dist/text.js +2 -2
  203. package/dist/theming.cjs +1 -1
  204. package/dist/theming.js +2 -2
  205. package/dist/tree.cjs +1 -1
  206. package/dist/tree.js +1 -1
  207. package/dist/triggers.cjs +1 -1
  208. package/dist/triggers.js +1 -1
  209. package/dist/{units-DbfWaeE2.cjs → units-CR-P9eLW.cjs} +1 -1
  210. package/dist/{units-CmWU_YzJ.js → units-rb5QAWjs.js} +1 -1
  211. package/dist/video.cjs +1 -1
  212. package/dist/video.js +1 -1
  213. package/package.json +19 -19
  214. package/dist/LinePlot-CgkhTRJT.js +0 -11256
  215. package/dist/LinePlot-oIHuM9Jz.cjs +0 -66
  216. package/dist/Link-mthAKDPf.cjs +0 -1
  217. package/dist/List-C3bjnukf.cjs +0 -1
  218. package/dist/Toggle-GvJ5CkHq.cjs +0 -143
  219. package/dist/aggregator-CU9VgdUJ.cjs +0 -67
  220. package/dist/css-4MXuPP5v.cjs +0 -1
  221. package/dist/external-B7W7NBGN.cjs +0 -1
  222. package/dist/external-BBGGwc9H.cjs +0 -1
  223. package/dist/external-BQMz5fJB.cjs +0 -1
  224. package/dist/external-BT_oycNI.js +0 -259
  225. package/dist/external-f7xyI5mJ.js +0 -94
package/dist/index.cjs CHANGED
@@ -1 +1,39 @@
1
- "use strict";var pl=Object.defineProperty;var ml=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var he=(e,t,n)=>ml(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Cek9Ww4S.cjs"),d=require("react"),c=require("./Toggle-GvJ5CkHq.cjs"),l=require("./css-4MXuPP5v.cjs"),Ke=require("./external-C-xh9EwI.cjs"),C=require("./aggregator-CU9VgdUJ.cjs"),D=require("./Pack-uflj5a28.cjs"),jl=require("./external-CPTY4-IY.cjs"),ne=require("./external-BLnPpmeS.cjs"),gl=require("./external-D6YTf7Kx.cjs"),Cs=require("./Animated-CmYpn592.cjs"),j=require("./LinePlot-oIHuM9Jz.cjs"),pe=require("zod"),Bt=require("./external-BQMz5fJB.cjs"),de=require("./external-B7W7NBGN.cjs"),fl=require("./Text-BvzGtwCB.cjs"),bs=require("./external-BvoBhRW8.cjs");require("./Item-CPt4Umh0.cjs");const At=require("react-dom"),$e=require("./external-B5jyXhgU.cjs"),vs=require("./units-DbfWaeE2.cjs"),me=require("./external-Cb_NFNiX.cjs"),hl=require("./external-Crturtt-.cjs"),El=require("./external-CLKqHc4s.cjs"),Sl=require("./external-BBGGwc9H.cjs"),Rl=require("./Video-DKosAU7v.cjs"),ws=({variant:e,...t})=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{color:c.variantColors[e],style:{color:c.variantColors[e]},...t}),yl=({status:{key:e,time:t,count:n,message:r,description:o,variant:i},silence:a,actions:u,className:x,children:m,...p})=>s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS(l.CSS.B("notification"),x),direction:"y",empty:!0,...p,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",size:"small",children:[s.jsxRuntimeExports.jsx(ws,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),s.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${n}`}),s.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>a(e),children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})})]}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[m??s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:r}),o!=null&&s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),u!=null&&s.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:C.A(u).map(g=>s.jsxRuntimeExports.jsx(Cl,{action:g},g.key))})]},t.toString()),Cl=({action:e})=>{if(!d.isValidElement(e)){const t=e;return s.jsxRuntimeExports.jsx(c.Button,{...t})}return e},bl=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:ws,Notification:yl,Text:c.Text$2,VARIANTS:C.VARIANTS,specZ:C.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:C.variantZ},Symbol.toStringTag,{value:"Module"})),vl=Object.freeze(Object.defineProperty({__proto__:null,Config:c.Config,Context:c.Context,Dialog:c.Dialog$1,chooseLocation:c.chooseLocation,formatTip:c.formatTip,useConfig:c.useConfig,wrap:c.wrap},Symbol.toStringTag,{value:"Module"})),et=e=>e.preventDefault(),xt=d.forwardRef(({location:e,style:t,size:n,className:r,children:o,onDragStart:i,sizeUnits:a="px",showHandle:u=!0,...x},m)=>{const p=l.J.construct(e),g=l.J.direction(p),h=l.g.dimension(g);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(p),l.CSS.dir(g),r),style:{[h]:`${n}${a}`,...t},ref:m,...x,children:[o,u&&s.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(p))),onDragStart:i,onDrag:et,onDragEnd:et})]})});xt.displayName="Resize.Core";const Ot=({onResize:e,count:t,initialSizes:n=[],minSize:r=100,direction:o="x"})=>{const i=d.useRef(null),[a,u]=d.useState({sizeDistribution:wl(n,t),root:null}),x=d.useCallback((g,h,f)=>{if(i.current==null)return;const E=l.Eo.dim(l.Eo.construct(i.current),o);u(R=>Ct(R,E,g,r,h,f))},[r,u,o]);d.useEffect(()=>e==null?void 0:e(a.sizeDistribution),[a.sizeDistribution,e]);const m=d.useCallback((g,h)=>{g.preventDefault();const f=o==="x"?"clientX":"clientY",E=k=>x(h,k[f]),R=()=>{u(k=>({...k,root:null})),document.removeEventListener("mousemove",E)};u(k=>({...k,root:g[f]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",R,{once:!0})},[u,o,Ct]);return{setSize:d.useCallback((g,h)=>x(g,void 0,h),[Ct]),props:{direction:o,sizeDistribution:a.sizeDistribution,onDragHandle:m,ref:i}}},dt=d.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:r,className:o,...i},a)=>{const u=l.g.construct(e),x=d.Children.toArray(t);return n=Pl(n),s.jsxRuntimeExports.jsx(D.Space,{...i,ref:a,direction:u,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:x.map((m,p)=>s.jsxRuntimeExports.jsx(xt,{onDragStart:g=>r(g,p),location:l.g.location(u),size:n[p]*100,sizeUnits:"%",showHandle:p!==x.length-1,children:m},p))})});dt.displayName="Resize.Multiple";const wl=(e,t)=>{const n=e.reduce((o,i)=>o+i,0),r=t-e.length;if(r<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(r).fill(o/r)]}return e.map(()=>1/t)},yt=.001,Pl=e=>e.every(t=>l.W.closeTo(t,1/e.length),yt)?e.map((t,n)=>n%2===0?t+yt:n===e.length-1?t:t-yt):e,Ct=(e,t,n,r,o,i)=>{const a=Ps(e,t,n,o,i),[u,x]=kl(e.sizeDistribution,n,a,r/t),m=x?o??null:e.root;return{...e,sizeDistribution:u,root:m}},Ps=(e,t,n,r,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[n];else if(r!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(r-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},kl=(e,t,n,r)=>{let o=t;for(;o>0&&e[o]+n<=r;)o--;const i=e[o]+n,a=Ll(o,e,r,n),u=e[a]-n;return i<r||u<r?[e,!1]:[e.map((x,m)=>m===o?i:m===a?u:x),!0]},Ll=(e,t,n,r)=>(e===t.length-1?Ml:Tl)(e,t,n,r),Tl=(e,t,n,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=n;)o++;return o},Ml=(e,t,n,r)=>{let o=e-1;for(;o>0&&t[o]-r<=n;)o--;return o},pt=({onMove:e,onStart:t,onEnd:n})=>d.useCallback(r=>{r.preventDefault();const o=l.q.construct(r),i=c.mouseKey(r.button);t==null||t(o,i,r);const a=x=>{if(x.buttons===0)return u(x);const m=l.q.construct(x);e==null||e(l.Eo.construct(o,m),i,x)};window.addEventListener("mousemove",a);const u=x=>{window.removeEventListener("mousemove",a);const m=l.q.construct(x);n==null||n(l.Eo.construct(o,m),i,x)};window.addEventListener("mouseup",u,{once:!0})},[e,t,n]),bt=2,ks=({onCollapse:e,onResize:t,location:n="left",minSize:r=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:a=1/0,className:u,...x})=>{const[m,p]=d.useState(l.j(i,r,o)),g=d.useRef(null),h=l.J.construct(n),f=d.useCallback($=>{if(g.current===null)return 0;const P=l.Eo.dim($,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),S=g.current+P,v=l.j(S,r,o);return(v-S)/r>a?bt:v},[h,r,o,a]),E=d.useRef(null),R=d.useCallback($=>{const P=f($);p(P),E.current!=null&&(t==null||t(P,l.Eo.construct(E.current)))},[t,f]),k=d.useCallback(()=>p($=>(g.current=$,$)),[p]),T=d.useCallback($=>f($)===bt&&(e==null?void 0:e()),[e,f]);d.useEffect(()=>p($=>{const P=l.j($,r,o);return g.current=P,P}),[r,o]);const M=pt({onMove:R,onStart:k,onEnd:T});return s.jsxRuntimeExports.jsx(xt,{ref:E,location:h,size:m,onDragStart:M,className:l.clsx(u,l.CSS.expanded(m!==bt)),...x})},$l=Object.freeze(Object.defineProperty({__proto__:null,Core:xt,Multiple:dt,Single:ks,calculateDiffPercentage:Ps,useMultiple:Ot},Symbol.toStringTag,{value:"Module"})),Qe="y",us=28,Nl=32,_l=40,Bl=.5,Al=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:r,ref:o,...i}}=Ot({direction:Qe,count:e.length,minSize:us}),a=u=>{if(o.current==null)return;const x=l.Eo.dim(l.Eo.construct(o.current),Qe);r[u]<_l/x?n(u,e[u].initialSize??Bl):n(u,us+1)};return s.jsxRuntimeExports.jsx(dt,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:r,ref:o,...t,...i,children:e.map((u,x)=>d.createElement(Dl,{...u,key:u.key,index:x,direction:Qe,onExpand:a,parent:o,size:r[x]}))})},Ol=s.jsxRuntimeExports.jsx(c.Qt.Caret.Down,{"aria-label":"contract"}),zl=s.jsxRuntimeExports.jsx(c.Qt.Caret.Right,{"aria-label":"expand"}),Dl=({index:e,name:t,content:n,actions:r,size:o,parent:i,onExpand:a})=>{let u=!0;if(i.current!=null){const m=l.Eo.dim(l.Eo.construct(i.current),Qe);u=o*m>Nl}const x=u?Ol:zl;return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(Ke.Header,{level:"p",className:l.CSS.expanded(u),empty:!0,children:[s.jsxRuntimeExports.jsx(Ke.ButtonTitle,{startIcon:x,onClick:()=>a(e),children:t}),r!=null&&s.jsxRuntimeExports.jsx(Ke.Actions,{children:r})]}),n]})},Vl=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Al},Symbol.toStringTag,{value:"Module"})),Ls=(e,t,n)=>C.A(e).map(i=>i.split(t)).flat().map((i,a)=>[s.jsxRuntimeExports.jsx(c.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:l.CSS.shade(n)}},`${i}-${a}`),i]).flat(),Il=({children:e,icon:t,shade:n=7,weight:r=450,size:o=.5,url:i,level:a="p",separator:u=".",className:x,hideFirst:m=!1,...p})=>{i!=null&&(e=i);const g=Ls(e,u,n);return m&&g.shift(),s.jsxRuntimeExports.jsxs(c.WithIcon,{className:l.CSS(x,l.CSS.B("breadcrumb")),level:a,shade:n,weight:r,size:o,...p,children:[ne.resolve(t),...g]})},Zl=({url:e,className:t,level:n="p",separator:r=".",shade:o=7})=>{const i=Ls(e,r,o);return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:i.map((a,u)=>{if(c.isValidElement(a))return a;if(a==null)return null;const m=e.split(r).indexOf(a);let p=e.split(r).slice(0,m+1).join("/");return p="/"+p,s.jsxRuntimeExports.jsx(c.Link,{level:n,href:p,children:a.split("-").map(g=>l._.capitalize(g)).join(" ")},u)})})},Fl=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Il,URL:Zl},Symbol.toStringTag,{value:"Module"})),zt=d.createContext(j.ZERO_CONTEXT_VALUE),ge=()=>d.useContext(zt).synnax,ql=()=>d.useContext(zt).state,xs={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Ts="serverVersionMismatch",Hl=(e,t,n)=>`Cluster version ${n!=null?n+" ":""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Ms=c.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[r,o,i]=c.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:a},,u]=c.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),x=c.useAggregator(),m=d.useCallback(p=>{i.current.state.status!==p.status&&x({variant:xs[p.status],message:p.message??l._.capitalize(p.status)}),o(g=>({...g,state:p}))},[x]);return c.useAsyncEffect(async()=>{if(r.synnax!=null&&r.synnax.close(),t==null)return o(j.ZERO_CONTEXT_VALUE);const p=new C.Lf({...t,connectivityPollFrequency:C.k.seconds(5)});o({synnax:p,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:p.clientVersion}});const g=await p.connectivity.check();if(o({synnax:p,state:g}),x({variant:xs[g.status],message:g.message??g.status.toUpperCase()}),g.status==="connected"&&!g.clientServerCompatible){const h=g.nodeVersion==null||C.H.semVerOlder(g.nodeVersion,g.clientVersion),f=Hl(h,g.clientVersion,g.nodeVersion);x({variant:"warning",message:"Incompatible cluster version",description:f,data:{type:Ts,oldServer:h,nodeVersion:g.nodeVersion,clientVersion:g.clientVersion}})}return p.connectivity.onChange(m),u({props:t,state:g}),()=>{p.close(),o(j.ZERO_CONTEXT_VALUE),u({props:null,state:null})}},[t,m]),s.jsxRuntimeExports.jsx(zt.Provider,{value:r,children:s.jsxRuntimeExports.jsx(c.Composite,{path:a,children:n})})}),Yl=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ms,SERVER_VERSION_MISMATCH:Ts,use:ge,useConnectionState:ql},Symbol.toStringTag,{value:"Module"})),Ne=d.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),$s=()=>d.useContext(Ne),Ns=e=>{const{aliases:t}=d.useContext(Ne);return t[e]??null},mt=()=>{const{aliases:e}=d.useContext(Ne);return e},jt=(e,t="")=>{const{getName:n}=d.useContext(Ne),[r,o]=d.useState(t);return c.useAsyncEffect(async()=>{const i=await n(e);i!=null&&o(i)},[e,n]),r??t},Dt=()=>{const{activeRange:e}=d.useContext(Ne);return e??void 0},_s=({activeRange:e,children:t})=>{const n=ge(),[r,o]=d.useState({}),i=d.useCallback(x=>{o(m=>{const p={...m};return x.forEach(({variant:g,key:h,value:f})=>{const E=Number(h.split("---")[1]);g==="delete"?delete p[E]:p[f.channel]=f.alias}),p})},[o]),a=d.useCallback(async(x,m)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(x,m)},[n,e]),u=d.useCallback(async x=>{if(n==null||x===0)return;const m=r[x];return m??(await n.channels.retrieve(x)).name},[r,n]);return c.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const x=await n.ranges.retrieve(e),m=await x.listAliases();o(m);const p=await x.openAliasTracker(),g=p.onChange(i);return()=>{g(),p.close()}},[n,e]),s.jsxRuntimeExports.jsx(Ne.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?a:null,getName:u},children:t})},Ul=({channelKey:e,value:t,shadow:n,className:r,...o})=>{const[i,a]=d.useState(!1),{setAlias:u}=$s(),x=Ns(e),m=jt(e);let p=s.jsxRuntimeExports.jsx(c.Qt.Rename,{});i?p=s.jsxRuntimeExports.jsx(c.Qt.Loading,{}):x===t&&(p=s.jsxRuntimeExports.jsx(c.Qt.Check,{}));const g=u!=null&&!i&&x!==t&&e!==0,h=()=>{g&&(async()=>(a(!0),await u(e,t),a(!1)))()},f=()=>{var R;x!=null&&((R=o.onChange)==null||R.call(o,x))},E=()=>e===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):u==null?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):x===t?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",m," with this label"]});return s.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...o,children:[g&&s.jsxRuntimeExports.jsx(c.Icon,{onClick:f,tooltip:s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",m," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:s.jsxRuntimeExports.jsx(c.Qt.Sync,{})}),s.jsxRuntimeExports.jsx(c.Icon,{onClick:h,disabled:!g,tooltip:s.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},Ee="channel",Gl=Object.freeze(Object.defineProperty({__proto__:null,Canvas:j.Canvas,axisStateZ:j.axisStateZ,newTickFactory:j.newTickFactory,tickFactoryProps:j.tickFactoryProps,tickType:j.tickType},Symbol.toStringTag,{value:"Module"})),Wl=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:j.AcquireChannelControl,AuthoritySource:j.AuthoritySource,Chip:j.Chip,Controller:j.Controller$1,Indicator:j.Indicator,Legend:j.Legend,REGISTRY:j.REGISTRY$3,STATUSES:j.STATUSES,SetChannelValue:j.SetChannelValue,StateProvider:j.StateProvider,acquireChannelControl:j.acquireChannelControl,acquireChannelControlPropsZ:j.acquireChannelControlPropsZ,authoritySource:j.authoritySource,authoritySourceProps:j.authoritySourceProps,chipStateZ:j.chipStateZ,controllerStateZ:j.controllerStateZ,indicatorStateZ:j.indicatorStateZ,legendStateZ:j.legendStateZ,setChannelValue:j.setChannelValue,setChannelValuePropsZ:j.setChannelValuePropsZ,stateProviderStateZ:j.stateProviderStateZ,statusZ:j.statusZ,sugaredStateZ:j.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var je;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(je||(je={}));function Kl({color:e,dimensions:t,lineWidth:n}){return d.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Ql({color:e,radius:t}){return d.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Xl={[je.Dots]:"#91919a",[je.Lines]:"#eee",[je.Cross]:"#e2e2e2"},Jl={[je.Dots]:1,[je.Lines]:1,[je.Cross]:6},ei=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Bs({id:e,variant:t=je.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:a,style:u,className:x}){const m=d.useRef(null),{transform:p,patternId:g}=j.useStore(ei,j.shallow$1),h=a||Xl[t],f=r||Jl[t],E=t===je.Dots,R=t===je.Cross,k=Array.isArray(n)?n:[n,n],T=[k[0]*p[2]||1,k[1]*p[2]||1],M=f*p[2],$=R?[M,M]:T,P=E?[M/i,M/i]:[$[0]/i,$[1]/i];return d.createElement("svg",{className:j.cc(["react-flow__background",x]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:m,"data-testid":"rf__background"},d.createElement("pattern",{id:g+e,x:p[0]%T[0],y:p[1]%T[1],width:T[0],height:T[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`},E?d.createElement(Ql,{color:h,radius:M/i}):d.createElement(Kl,{dimensions:$,color:h,lineWidth:o})),d.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`}))}Bs.displayName="Background";var ti=d.memo(Bs);const si={region:l.Eo.ZERO,dpr:1,os:C.w.getOS()},ni={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ri=c.wrap$1(j.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:r,...o})=>{const[{path:i},{bootstrapped:a,dpr:u},x]=c.use$3({aetherKey:n,type:j.Canvas$1.TYPE,schema:j.canvasStateZ,initialState:si}),m=d.useRef({...ni}),p=d.useCallback(f=>{m.current.bootstrapped&&x(()=>({bootstrapped:!0,region:f,dpr:window.devicePixelRatio,os:C.w.getOS({default:"Windows"})}))},[x]),g=c.useResize(p,{debounce:t});d.useEffect(()=>{const f=()=>{window.devicePixelRatio!==u&&x(E=>({...E,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",f,{once:!0})},[u]),d.useEffect(()=>{window.addEventListener("focus",()=>x(f=>({...f}))),window.addEventListener("blur",()=>x(f=>({...f})))},[x]);const h=d.useCallback(f=>{if(g(f),f==null)return;f.className.includes("gl")?m.current.gl=f:f.className.includes("upper2d")?m.current.upper2d=f:m.current.lower2d=f;const{gl:E,lower2d:R,upper2d:k,bootstrapped:T}=m.current;if(E==null||R==null||k==null||T)return;m.current.bootstrapped=!0;const M=E.transferControlToOffscreen(),$=k.transferControlToOffscreen(),P=R.transferControlToOffscreen();x({glCanvas:M,upper2dCanvas:$,lower2dCanvas:P,bootstrap:!0,bootstrapped:!1,region:l.Eo.construct(E),dpr:window.devicePixelRatio,os:C.w.getOS({default:"Windows"})},[M,$,P])},[x]);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),r),...o,children:[s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),s.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:a&&e})]})}),gt=(e,t)=>c.useResize(d.useCallback((n,r)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k$2.XY.translate(l.q.scale(l.Eo.topLeft(o),-1)).box(n),r)},[e]),t),oi=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ri,useRegion:gt},Symbol.toStringTag,{value:"Module"})),As=d.createContext(null),Se=e=>{const t=d.useContext(As);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Os=e=>{const t=Se("Viewport"),{addViewportHandler:n}=t;d.useEffect(()=>n(e),[n,e])},He=(e,t)=>{const{setGridEntry:n,removeGridEntry:r}=Se(t),{key:o}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),n(e)},([u],[x])=>C._.equal(u,x),[e]),d.useEffect(()=>()=>r(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},zs=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:r=l.q.ZERO,children:o,hold:i=!1,onHold:a,visible:u,...x})=>{const[m,p]=d.useState([]),g=c.useMemoDeepEqualProps({clearOverScan:r,hold:i,visible:u}),[{path:h},{grid:f},E]=c.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:l.Eo.ZERO,viewport:l.Eo.DECIMAL,grid:{},...g}});d.useEffect(()=>E(w=>({...w,...g})),[g]);const R=d.useRef(new Map),k=d.useCallback(w=>(R.current.set(w,null),()=>R.current.delete(w)),[R]),T=d.useCallback(w=>{const{mode:y,box:_,stage:z}=w;(y==="pan"&&z!=="start"||y==="zoom"||y==="zoomReset"&&z==="start")&&E(U=>({...U,viewport:_})),R.current.forEach((U,I)=>I(w))},[E]),M=d.useCallback(w=>E(y=>({...y,container:w})),[E]),$=gt(M,{debounce:n}),P=d.useCallback(w=>E(y=>({...y,grid:{...y.grid,[w.key]:w}})),[E]),S=d.useCallback(w=>E(y=>{const{[w]:_,...z}=y.grid;return{...y,grid:z}}),[E]),v=d.useCallback(w=>{p(y=>[...y.filter(({key:_})=>_!==w.key),w])},[p,T]),B=d.useCallback(w=>p(y=>y.filter(({key:_})=>_!==w)),[v]),L=d.useMemo(()=>li(f),[f]),N=d.useCallback(w=>{E(y=>({...y,hold:w})),a==null||a(w)},[E,a]),A=d.useMemo(()=>({lines:m,setGridEntry:P,removeGridEntry:S,setLine:v,removeLine:B,setViewport:T,addViewportHandler:k,setHold:N}),[m,P,S,v,B,T,k,N]);return s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...L},ref:$,...x,children:s.jsxRuntimeExports.jsx(As.Provider,{value:A,children:s.jsxRuntimeExports.jsx(c.Composite,{path:h,children:o})})})}),li=e=>{const t=l.CSS.newGridBuilder();return j.regions("top",e).forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),t.row("plot-start","plot-end","minmax(0, 1fr)"),j.regions("bottom",e).reverse().forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),j.regions("left",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.col("plot-start","plot-end","minmax(0, 1fr)"),j.regions("right",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.build()},Vt=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,r=`${e}-axis`;return c.wrap$1(n,({aetherKey:o,children:i,location:a=t,label:u="",labelLevel:x="small",labelDirection:m=e,onLabelChange:p,color:g,labelSize:h,showGrid:f,type:E,bounds:R,className:k,tickSpacing:T,autoBounds:M,autoBoundUpdateInterval:$,onAutoBoundsChange:P,style:S,...v})=>{const B=((u==null?void 0:u.length)??0)>0,L=c.useMemoDeepEqualProps({location:a,showGrid:f,type:E,bounds:R,label:u,labelDirection:m,tickSpacing:T,autoBounds:M,autoBoundUpdateInterval:$}),[{path:N},{size:A,labelSize:w,...y},_]=c.use$3({aetherKey:o,type:n,schema:j.coreAxisStateZ,initialState:L});d.useEffect(()=>_(G=>({...G,...L})),[L]),d.useEffect(()=>{const{lower:G,upper:O}=j.parseAutoBounds(y.autoBounds);y.bounds!=null&&(G&&(R==null?void 0:R.lower)!==y.bounds.lower||O&&(R==null?void 0:R.upper)!==y.bounds.upper)&&(P==null||P(y.bounds))},[y.autoBounds,y.bounds]);const z=He({loc:a,key:`${n}-${o}`,size:A+w,order:1},`${e.toUpperCase()}Axis`),U=c.useTypography(x).toString(),I=d.useRef(0);return d.useEffect(()=>{if(e==="y"){if(u==null)return;let O=C.dimensions(u,U)[l.g.dimension(l.g.construct(m))];O>0&&(O+=9),_(te=>({...te,labelSize:O}))}else{let O=C.dimensions(u,U).height*1.3;O>0&&(O+=12);const te=I.current;j.withinSizeThreshold(te,O)||(I.current=O,_(ce=>({...ce,labelSize:O})))}},[u,m,U]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(k,l.CSS.B("axis"),l.CSS.B(r),l.CSS.loc(a)),style:{...S,...z},align:"center",justify:a!=="left"?"end":"start",direction:l.g.swap(e),...v,children:B&&s.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(m)),value:u,onChange:p,level:x})}),s.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},Ds=Vt("x"),Vs=Vt("y"),Is=l.q.xy.extend({root:l.J.corner,units:pe.z.object({x:pe.z.enum(["px","decimal"]),y:pe.z.enum(["px","decimal"])})}),ii=Is.partial({root:!0,units:!0}),ci=e=>{var n,r,o,i;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((r=e==null?void 0:e.units)==null?void 0:r.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},ai=(e,t)=>{var i,a,u,x,m,p;const n={x:e.x,y:e.y};if(t.current==null)return n;const r=l.Eo.construct(t.current),o=l.Eo.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((a=e.root)==null?void 0:a.x)==="right"&&(n.x=1-e.x):((u=e.root)==null?void 0:u.x)==="right"?n.x=1-(e.x+l.Eo.width(r))/l.Eo.width(o):n.x/=l.Eo.width(o),((x=e.units)==null?void 0:x.y)==="decimal"?((m=e.root)==null?void 0:m.y)==="bottom"&&(n.y=1-e.y):((p=e.root)==null?void 0:p.y)==="bottom"?n.y=1-(e.y+l.Eo.height(r))/l.Eo.height(o):n.y/=l.Eo.height(o),n},Zs=(e,t)=>{if(t.current==null)return null;const n=l.Eo.construct(t.current.parentElement),r=l.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.Eo.width(n)-l.Eo.width(r),o.root.x="right"):e.x<.2?o.x=e.x*l.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.Eo.height(n)-l.Eo.height(r),o.root.y="bottom"):e.y<.2?o.y=e.y*l.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},ds=l.Eo.reRoot(l.Eo.DECIMAL,l.J.TOP_LEFT),It=d.memo(({className:e,value:t,onChange:n,style:r,draggable:o=!0,...i})=>{const[a,u]=C.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),x=d.useRef(a),m=c.useSyncedRef(o===!1),p=d.useRef(null);a!==null&&(r={...r,...ci(a)});const g=d.useCallback(f=>{var P;if(((P=p.current)==null?void 0:P.parentElement)==null)return x.current;const E=l.Eo.construct(p.current.parentElement),R=l.k$2.XY.scale(E).scale(ds),k=R.box(l.Eo.construct(p.current)),T=l.k$2.XY.clamp(l.Eo.construct(l.Eo.topLeft(ds),{width:1-l.Eo.width(k),height:1-l.Eo.height(k)})),M=l.q.translate(l.q.construct(x.current),l.Eo.signedDims(R.box(f))),$=T.pos(M);return Zs($,p)},[]),h=pt({onStart:d.useCallback(()=>{x.current=ai(x.current,p)},[]),onMove:d.useCallback(f=>{if(m.current)return;const E=g(f);E!==null&&u(E)},[]),onEnd:d.useCallback(f=>{if(m.current)return;const E=g(f);E!==null&&(x.current=E)},[])});return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:h,draggable:o,ref:p,...i,onDrag:et,onDragEnd:et,empty:!0})});It.displayName="Legend.Container";const Zt=(e,t,n)=>e.sort((r,o)=>r.label.localeCompare(o.label)).map(({key:r,color:o,label:i})=>s.jsxRuntimeExports.jsxs(D.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[s.jsxRuntimeExports.jsx(Bt.Swatch,{value:o,onChange:a=>t==null?void 0:t({key:r,color:a,label:i}),onVisibleChange:n,draggable:!1,size:"small"}),s.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:i,onChange:a=>t==null?void 0:t({key:r,color:o,label:a}),noWrap:!0})]},r)),Ft=({data:e=[],onEntryChange:t,position:n,onPositionChange:r,...o})=>{const[i,a]=d.useState(!1);return e.length===0?null:s.jsxRuntimeExports.jsx(It,{...o,draggable:!i,value:n,onChange:r,children:Zt(e,t,a)})},ui=Object.freeze(Object.defineProperty({__proto__:null,Container:It,Simple:Ft,calcStickyPos:Zs,completeStickyXYz:Is,legendSwatches:Zt,stickyXYz:ii},Symbol.toStringTag,{value:"Module"})),Fs=({className:e,style:t,onLineChange:n,...r})=>{const{lines:o}=Se("Legend");return Se("Legend"),s.jsxRuntimeExports.jsx(Ft,{data:o,onEntryChange:n,...r})},xi=({onLineChange:e})=>{const{lines:t}=Se("Legend"),n=c.useUniqueKey(),r=He({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...r,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Zt(t,e)})},qs=({variant:e="floating",...t})=>e==="floating"?s.jsxRuntimeExports.jsx(Fs,{...t}):s.jsxRuntimeExports.jsx(xi,{...t}),Hs=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=c.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),r=c.useMemoDeepEqualProps(t);return d.useLayoutEffect(()=>n(r),[r]),null}),di=Object.freeze(Object.defineProperty({__proto__:null,Line:Hs},Symbol.toStringTag,{value:"Module"})),qt=c.wrap$1("Line",({aetherKey:e,color:t,label:n="",...r})=>{const{setLine:o,removeLine:i}=Se("Line");return d.useEffect(()=>(o({key:e,color:t,label:n}),()=>i(e)),[n,t]),s.jsxRuntimeExports.jsx(Hs,{aetherKey:e,color:t,label:n,...r})}),Ys=({level:e="h2",...t})=>{const n=c.useUniqueKey(),r=c.useTypography(e),o=He({key:n,size:(r.lineHeight+2)*r.baseSize,loc:"top",order:10},"Title");return s.jsxRuntimeExports.jsx(D.Space,{justify:"center",align:"center",style:o,children:s.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Us=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),n=d.useRef(null),r=d.useCallback(i=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const u=l.Eo.topLeft(a);t({position:l.q.translation(u,l.q.construct(i))})},[t]),o=d.useCallback(()=>t({position:null}),[t]);return d.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement;if(i!=null)return i.addEventListener("mousemove",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",r),i.removeEventListener("mouseleave",o)}},[r]),s.jsxRuntimeExports.jsx("span",{ref:n})}),pi=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Us},Symbol.toStringTag,{value:"Module"})),mi={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Ht=d.forwardRef(({className:e,mode:t,maskBox:n,children:r,style:o,...i},a)=>s.jsxRuntimeExports.jsxs("div",{ref:a,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:mi[t],...o},...i,children:[s.jsxRuntimeExports.jsx("div",{style:{...l.Eo.css(n),display:l.Eo.areaIsZero(n)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),r]}));Ht.displayName="ZoomPanMask";const ji=[{key:"start",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Left,{})},{key:"center",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Center,{})},{key:"end",icon:s.jsxRuntimeExports.jsx(c.Qt.TextAlign.Right,{})}],gi=({key:e,entry:t,onClick:n,selected:r})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:n,children:t.icon},e),Yt=({children:e=gi,...t})=>s.jsxRuntimeExports.jsx(de.Button,{...t,allowMultiple:!1,data:ji,children:e}),fi=new Set([C.g.UUID,C.g.JSON]),hi=C.g.ALL.filter(e=>e!==C.g.UNKNOWN).map(e=>({key:e.toString(),name:fi.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),Ei=[{key:"name",name:"Name"}],Si=e=>s.jsxRuntimeExports.jsx(de.DropdownButton,{...e,data:hi,columns:Ei,entryRenderKey:"name"}),Ri=[{key:"x",icon:s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{})},{key:"y",icon:s.jsxRuntimeExports.jsx(c.Qt.Arrow.Up,{})}],yi=({key:e,entry:t,onClick:n,selected:r})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:n,children:t.icon},e),Ci=({children:e=yi,...t})=>s.jsxRuntimeExports.jsx(de.Button,{...t,allowMultiple:!1,data:Ri,children:e}),Gs=e=>s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:s.jsxRuntimeExports.jsx(c.Qt.Close,{"aria-label":"clear"})}),be=({onChange:e,value:t,entryRenderKey:n="key",columns:r,data:o,emptyContent:i,inputProps:a,allowNone:u=!0,searcher:x,className:m,variant:p="button",hideColumnHeader:g=!1,disabled:h,omit:f,children:E,dropdownVariant:R="connected",placeholder:k=ft,inputPlaceholder:T=k,triggerTooltip:M,dropdownZIndex:$,filter:P,actions:S,...v})=>{const{visible:B,open:L,close:N,toggle:A}=c.use$2(),[w,y]=d.useState(null),_=x!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return y(null);if((w==null?void 0:w.key)===t)return;let O=null;if(_)try{[O]=await x.retrieve([t])}finally{O??(O=null)}else o!=null&&(O=o.find(te=>te.key===t)??null);y(O)},[x,t,o]);const z=d.useCallback((O,te)=>{Array.isArray(O)||(y(O==null?null:te.entries[0]),N(),e(O,te))},[e,u]),U=d.useMemo(()=>_?c.Search:$e.Filter,[_]),I=s.jsxRuntimeExports.jsx(U,{searcher:x,filter:P,children:({onChange:O})=>s.jsxRuntimeExports.jsx(bi,{autoFocus:R==="modal",variant:p,onChange:O,onFocus:L,selected:w,entryRenderKey:n,visible:B,allowNone:u,className:m,disabled:h,placeholder:T,children:S})}),G=s.jsxRuntimeExports.jsx(c.Button,{tooltip:M,variant:"outlined",onClick:A,disabled:h,children:w!=null?Ws(n,w):k});return s.jsxRuntimeExports.jsx(de.Core,{close:N,zIndex:$,open:L,data:o,omit:f,emptyContent:i,allowMultiple:!1,visible:B,value:t,hideColumnHeader:g,onChange:z,allowNone:u,columns:r,listItem:E,variant:R,trigger:R!=="modal"?I:G,extraDialogContent:R==="modal"?I:void 0,keepMounted:!1,...v})},ft="Select",Ws=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),bi=({entryRenderKey:e,selected:t,visible:n,onChange:r,onFocus:o,allowNone:i=!0,placeholder:a=ft,className:u,disabled:x,...m})=>{const{clear:p}=c.useSelectionUtils(),[g,h]=d.useState("");d.useEffect(()=>{if(!n){if(C.w$1(t==null?void 0:t.key))return h("");t!=null&&h(Ws(e,t))}},[t,n,e]);const f=T=>{r(T),h(T)},E=()=>{g===""&&r(""),h(""),o==null||o()},R=T=>{n||(T.preventDefault(),o==null||o())},k=()=>{h(""),p==null||p()};return s.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),u),value:g,onChange:f,onFocus:E,onKeyDown:c.matchCallback([["Enter"]],T=>{T.preventDefault(),!n&&(o==null||o())}),endContent:s.jsxRuntimeExports.jsx(Cs.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:R,placeholder:a,disabled:x,...m,children:i&&s.jsxRuntimeExports.jsx(Gs,{onClick:k,disabled:x})})},Ze=({children:e="",size:t="medium",color:n,icon:r,onClose:o,className:i,onDragStart:a,...u})=>{const x=l.cssString(n);r==null&&n!=null&&(r=s.jsxRuntimeExports.jsx(c.Qt.Circle,{fill:x}));const m=o==null?void 0:s.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:"small",className:l.CSS.BE("tag","close"),onClick:p=>{p.stopPropagation(),o()},children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})});return s.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:r,endIcon:m,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:C.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:a,...u,children:e})},vi=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ze},Symbol.toStringTag,{value:"Module"})),_e=({onChange:e,value:t,className:n,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:a,searcher:u,renderTag:x=c.componentRenderProp(Ks),placeholder:m,onTagDragStart:p,allowMultiple:g,allowNone:h,replaceOnSingle:f,onTagDragEnd:E,style:R,addPlaceholder:k="Add",children:T,dropdownVariant:M="connected",actions:$,...P})=>{const{visible:S,open:v,close:B}=c.use$2(),[L,N]=d.useState([]),[A,w]=d.useState(!1),y=u!=null;c.useAsyncEffect(async()=>{w(!0),c.selectValueIsZero(t)&&N([]);const G=L.map(ce=>ce.key),O=C.A(t);if(C.F.unorderedPrimitiveArrays(G,O)===C.F.EQUAL)return;let te=[];if(y)try{te=await u.retrieve(O)}finally{w(!1)}else r!=null&&(te=r.filter(ce=>O.includes(ce.key)));N(te)},[u,y,t,r]);const _=d.useCallback((G,O)=>{G!=null&&(N(O.entries),e(C.A(G),O))},[e]),z=d.useMemo(()=>y?c.Search:$e.Filter,[y]);let U,I;if(M==="connected")I=s.jsxRuntimeExports.jsx(z,{searcher:u,children:({onChange:G,value:O})=>s.jsxRuntimeExports.jsx(wi,{value:O,selectedKeys:t,className:n,onChange:G,loading:A,selected:L,onFocus:v,entryRenderKey:i,visible:S,renderTag:x,placeholder:m,onTagDragStart:p,onTagDragEnd:E,style:R,children:$})});else{const G=C.A(t);I=s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",grow:!0,style:R,size:"small",children:[G.map(O=>{const te=L.find(ce=>ce.key===O);return x({key:O,entryKey:O,entryRenderKey:i,loading:A,entry:te,onClose:()=>{const ce=G.filter(We=>We!==O);e(ce,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:ce=>p==null?void 0:p(ce,O),onDragEnd:ce=>E==null?void 0:E(ce,O)})}),G.length>0?s.jsxRuntimeExports.jsx(c.Icon,{onClick:v,children:s.jsxRuntimeExports.jsx(c.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):s.jsxRuntimeExports.jsx(c.Button,{onClick:v,shade:7,startIcon:s.jsxRuntimeExports.jsx(c.Qt.Add,{}),variant:"text",children:k})]}),U=s.jsxRuntimeExports.jsx(z,{searcher:u,children:O=>s.jsxRuntimeExports.jsx(c.Text$1,{autoFocus:!0,placeholder:"Search",...O,children:$})})}return s.jsxRuntimeExports.jsx(de.Core,{close:B,open:v,data:r,emptyContent:a,visible:S,value:t,onChange:_,allowNone:h,replaceOnSingle:f,columns:o,allowMultiple:!0,listItem:T,trigger:I,extraDialogContent:U,variant:M,...P})},wi=({selectedKeys:e,loading:t,selected:n,onChange:r,onFocus:o,visible:i,entryRenderKey:a,renderTag:u,placeholder:x=ft,onTagDragStart:m,onTagDragEnd:p,value:g,className:h,children:f,...E})=>{const{onSelect:R,clear:k}=c.useSelectionUtils(),T=d.useRef(null);d.useLayoutEffect(()=>{var S;i&&((S=T.current)==null||S.focus())},[i,n]);const M=()=>{i||r(""),o==null||o()},$=()=>{i||o==null||o()},P=()=>{i||r("")};return s.jsxRuntimeExports.jsxs(c.Text$1,{ref:T,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),h),onBlur:P,placeholder:x,value:g,onChange:r,onFocus:M,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:$,variant:"button",...E,children:[s.jsxRuntimeExports.jsx(D.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:C.A(e).map(S=>{const v=n.find(B=>B.key===S);return u({key:S,entryKey:S,entryRenderKey:a,loading:t,entry:v,onClose:()=>R==null?void 0:R(S),onDragStart:B=>m==null?void 0:m(B,S),onDragEnd:B=>p==null?void 0:p(B,S)})})}),f,s.jsxRuntimeExports.jsx(Gs,{onClick:k})]})},Ks=({entryKey:e,entryRenderKey:t,entry:n,loading:r,...o})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),d.createElement(Ze,{size:"small",variant:"outlined",className:l.CSS(n==null&&!r&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},C.Q(i))},Pi=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:de.BaseButton,Button:de.Button,DEFAULT_PLACEHOLDER:ft,DataType:Si,Direction:Ci,DropdownButton:de.DropdownButton,Multiple:_e,MultipleTag:Ks,Single:be,TextAlignment:Yt,defaultButton:de.defaultButton},Symbol.toStringTag,{value:"Module"})),Xe=6,ki=2,ps=5,Li=e=>l.Eo.width(e)<ps&&l.Eo.height(e)<ps,Ti=["zoom","pan","select","zoomReset"],Ie=[...Ti,"click"],Mi=pe.z.enum(Ie),Qs=["zoom","select"],Je={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Xs={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Js={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Ut={zoom:Je,pan:Xs,select:Js,zoomReset:Je,click:Je},$i=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,r])=>n==="defaultMode"?[n,r]:[n,r.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},Ni=l.Eo.construct(0,0,1,1,l.J.TOP_LEFT),_i={width:30,height:50},en=({onChange:e,triggers:t,initial:n=Ni,threshold:r=_i,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[a,u]=d.useState(l.Eo.ZERO),[x,m]=d.useState(i),[p,g]=c.useStateRef(n),h=d.useRef(l.q.ZERO),f=d.useRef(null),E=l._$1.construct(r);d.useEffect(()=>g(()=>l.Eo.truncate(n,Xe)),[n]),d.useEffect(()=>m(i),[i]);const[R,k,T,M]=c.useMemoCompare(()=>{const L={...Ut[i],...t},N=c.flattenConfig(L),A=$i(L);return[L,N,A,c.flattenConfig(A)]},c.compareModeConfigs,[t]),$=d.useCallback(({box:L,triggers:N,stage:A,cursor:w})=>{if(f.current==null)return;const y=c.determineMode(R,N),_=l.Eo.construct(f.current);if(y==null)return;if(y==="zoomReset")return u(l.Eo.ZERO),e==null||e({box:l.Eo.DECIMAL,mode:y,stage:A,cursor:w}),g(l.Eo.DECIMAL);const z=Li(L);if(A==="end"){if(z){y==="zoom"&&u(l.Eo.ZERO),e==null||e({box:p.current,mode:"click",stage:A,cursor:w});return}return g(I=>{if(y==="pan"){const O=ms(L,I,_);return O===null||l.Eo.equals(O,I)?I:(e==null||e({box:O,mode:y,stage:A,cursor:w}),O)}const G=P(L,I,_);return G===null?I:(e==null||e({box:G,mode:y,stage:A,cursor:w}),y==="zoom"?(u(l.Eo.ZERO),G):l.Eo.truncate(I,Xe))})}if(Qs.includes(y))return z?void 0:u(l.k$2.XY.scale(_).clamp(_).translate({x:-l.Eo.left(_),y:-l.Eo.top(_)}).box(js(E,L,_)));if(u(I=>l.Eo.areaIsZero(I)?I:l.Eo.ZERO),l.q.distance(w,h.current)<ki)return;h.current=w;const U=ms(L,p.current,_);e==null||e({box:U,mode:y,stage:A,cursor:w})},[u,m,e,R,r.height,r.width,g,f]);d.useImperativeHandle(o,()=>({reset:()=>{u(l.Eo.ZERO),g(l.Eo.DECIMAL),e==null||e({box:l.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const P=d.useCallback((L,N,A)=>l.Eo.truncate(Lt(N,A).box(js(E,L,A)),Xe),[r]),S=c.useHeldRef({triggers:[["Control"]]}),v=c.useHeldRef({triggers:[["Alt"]]});d.useEffect(()=>{const L=N=>{if(f.current==null)return;let A=1;N.deltaY<0?A-=.035:A+=.035;const w=l.Eo.construct(f.current),y=l.q.construct(N);if(!l.Eo.contains(w,y)||N.target!==f.current)return;const z=Lt(p.current,l.Eo.construct(f.current)).pos(l.q.construct(N));let I=l.k$2.XY.magnify({x:S.current.held?1:A,y:v.current.held?1:A}).box(p.current);I=l.Eo.translate(I,{x:S.current.held?0:z.x*(1-A),y:v.current.held?0:z.y*(1-A)}),g(I),e==null||e({stage:"end",box:I,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[g,e]),bs.useDrag({bound:f,onDrag:$,triggers:k,loose:!0});const B=d.useCallback(({triggers:L,stage:N})=>{if(N==="end")return m(i);const A=c.determineMode(T,L);A!=null&&m(A)},[T,i,e]);return c.use$1({triggers:M,callback:B,region:f}),{maskBox:a,ref:f,mode:x}},Lt=(e,t)=>l.k$2.XY.scale(t).clamp(t).scale(e),ms=(e,t,n)=>{let r=l.Eo.signedDims(Lt(t,n).box(e));return r={signedWidth:-r.signedWidth,signedHeight:-r.signedHeight},l.Eo.truncate(l.k$2.XY.translate(l.q.construct(r)).box(t),Xe)},js=(e,t,n)=>l.Eo.height(t)<=e.height?l.Eo.construct(l.Eo.left(t),l.Eo.top(n),l.Eo.width(t),l.Eo.height(n)):l.Eo.width(t)<=e.width?l.Eo.construct(l.Eo.left(n),l.Eo.top(t),l.Eo.width(n),l.Eo.height(t)):t,Bi=({mode:e,triggers:t})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",children:[s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),s.jsxRuntimeExports.jsx(fl.Text,{trigger:t[0],level:"small"})]}),Ai={zoom:s.jsxRuntimeExports.jsx(c.Qt.Zoom,{}),pan:s.jsxRuntimeExports.jsx(c.Qt.Pan,{}),select:s.jsxRuntimeExports.jsx(c.Qt.Selection,{}),zoomReset:s.jsxRuntimeExports.jsx(c.Qt.Expand,{}),click:s.jsxRuntimeExports.jsx(c.Qt.Bolt,{})},Oi=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const r=Object.entries(e).filter(([o])=>!t.includes(o)&&Ie.includes(o)).map(([o,i])=>({key:o,icon:Ai[o],tooltip:s.jsxRuntimeExports.jsx(Bi,{mode:o,triggers:i})})).sort((o,i)=>Ie.indexOf(o.key)-Ie.indexOf(i.key));return s.jsxRuntimeExports.jsx(de.Button,{...n,data:r,entryRenderKey:"icon",children:({title:o,entry:i,...a})=>d.createElement(c.Icon,{...a,key:i.key,variant:a.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},zi=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Ut,MASK_MODES:Qs,MODES:Ie,Mask:Ht,PAN_DEFAULT_TRIGGERS:Xs,SELECT_DEFAULT_TRIGGERS:Js,SelectMode:Oi,ZOOM_DEFAULT_TRIGGERS:Je,modeZ:Mi,use:en},Symbol.toStringTag,{value:"Module"})),tn=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Gt=d.forwardRef(({children:e,initial:t=l.Eo.DECIMAL,onChange:n,...r},o)=>{const{setViewport:i}=Se("Viewport");d.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const a=d.useCallback(x=>{i(x),n==null||n(x)},[n,i]),u=en({onChange:a,initial:t,ref:o,...r});return s.jsxRuntimeExports.jsx(Ht,{className:l.CSS.BE("line-plot","viewport"),...u,children:e})});Gt.displayName="Viewport";const Di=Object.freeze(Object.defineProperty({__proto__:null,Floating:Fs,Legend:qs,Line:qt,LinePlot:zs,Title:Ys,Tooltip:pi,Viewport:Gt,XAxis:Ds,YAxis:Vs,axisFactory:Vt,selectViewportEl:tn,useContext:Se,useGridEntry:He,useViewport:Os},Symbol.toStringTag,{value:"Module"})),Vi=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),sn=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:r,setHold:o}=Se("Range.Provider"),[,{hovered:i,count:a},u]=c.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),x=He({key:e,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),m=c.useContextMenu(),p=c.useSyncedRef(m.visible),g=d.useCallback(h=>{const f=R=>{u(k=>({...k,cursor:{x:R.clientX,y:R.clientY}}))},E=h.currentTarget;E.addEventListener("mousemove",f),E.addEventListener("mouseleave",()=>{E.removeEventListener("mousemove",f),p.current||u(R=>({...R,cursor:null}))},{once:!0})},[u]);return s.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...x,cursor:i!=null?"pointer":"default"},...m,menu:()=>t==null||i==null?null:t(i),children:s.jsxRuntimeExports.jsx(D.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(r({box:l.Eo.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:g})})}),Ii=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Vi,Provider:sn},Symbol.toStringTag,{value:"Module"})),nn={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Zi=c.flattenConfig(nn),rn=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=d.useRef(null),r=c.useHeldRef({triggers:Zi,loose:!0}),o=d.useCallback(({mode:u,cursor:x})=>{if(u==="click"){const m=c.determineMode(nn,r.current.triggers,{loose:!0});if(["one","two"].includes(m))return t(p=>({...p,[m]:x}));t(m==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??x,two:p.one!==null?x:p.two}))}},[t,r]);Os(o);const i=d.useCallback(u=>t(x=>({...x,hover:l.q.construct(u)})),[t]),a=d.useCallback(()=>{t(u=>({...u,hover:null}))},[t]);return d.useEffect(()=>{if(n.current===null)return;const u=n.current.parentElement;if(u!=null)return u.addEventListener("mousemove",i),u.addEventListener("mouseleave",a),()=>{u.removeEventListener("mousemove",i),u.removeEventListener("mouseleave",a)}},[o]),s.jsxRuntimeExports.jsx("span",{ref:n})}),Fi=Object.freeze(Object.defineProperty({__proto__:null,Measure:rn},Symbol.toStringTag,{value:"Module"})),Wt=c.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:r,onPositionChange:o,units:i="",color:a,lineWidth:u,lineDash:x})=>{const[m,p]=C.usePurePassthrough({value:t,onChange:r,initial:""}),[,{position:g,pixelPosition:h},f]=c.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:u,lineDash:x}});d.useEffect(()=>{if(g==null)return;if(n==null)return o==null?void 0:o(g);const P=l.G.construct(g+.01,g-.01);n!=null&&!l.G.contains(P,n)&&(o==null||o(Math.trunc(g*100)/100))},[g]);const E=d.useRef(h);h!==E.current&&(E.current=h);const R=d.useRef(h);d.useEffect(()=>{f(P=>({...P,position:n,color:a,lineWidth:u,lineDash:x}))},[n,a,u,x]);const k=pt({onStart:d.useCallback(()=>{f(P=>({...P,dragging:!0})),R.current=E.current},[]),onMove:P=>{f(S=>({...S,pixelPosition:(R.current??0)+l.Eo.signedHeight(P)}))},onEnd:d.useCallback(()=>{f(P=>({...P,dragging:!1})),R.current=h},[])}),T=d.useRef(null);if(g==null||h==null)return null;const M=tn(T==null?void 0:T.current),$=s.jsxRuntimeExports.jsxs("div",{ref:T,className:l.CSS.B("rule"),style:{top:`calc(${h}px - 0.5rem)`},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:k,draggable:!0}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[s.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:m,onChange:p}),s.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${g.toFixed(2)} ${i}`})]})]});return M==null?$:At.createPortal($,M)}),qi=Object.freeze(Object.defineProperty({__proto__:null,Rule:Wt},Symbol.toStringTag,{value:"Module"})),on=c.canDropOfType(Ee),Hi=({lines:e,axes:t,showTitle:n=!0,title:r="",onTitleChange:o,showLegend:i=!0,legendPosition:a,onLegendPositionChange:u,titleLevel:x="h4",onLineChange:m,onRuleChange:p,onAxisChannelDrop:g,onAxisChange:h,rules:f,enableTooltip:E=!0,enableMeasure:R=!1,initialViewport:k=l.Eo.DECIMAL,legendVariant:T,onViewportChange:M,viewportTriggers:$,annotationProvider:P,...S})=>{var A;const v=t.filter(({location:w})=>l.J.isY(w)),B=d.useRef(),L=c.usePrevious(e.length),N=c.usePrevious(S.hold);return(L===0&&e.length!==0||N===!0&&S.hold===!1)&&((A=B.current)==null||A.reset()),s.jsxRuntimeExports.jsxs(zs,{...S,children:[v.map((w,y)=>{const _=e.filter(I=>I.axes.x===w.key),z=t.filter(({location:I})=>l.J.isX(I)),U=f==null?void 0:f.filter(I=>[...z.map(({key:G})=>G),w.key].includes(I.axis));return s.jsxRuntimeExports.jsx(Yi,{axis:w,index:y,lines:_,yAxes:z,rules:U,onAxisChannelDrop:g,onAxisChange:h,annotationProvider:P},w.key)}),i&&s.jsxRuntimeExports.jsx(qs,{onLineChange:m,position:a,onPositionChange:u,variant:T}),n&&s.jsxRuntimeExports.jsx(Ys,{value:r,onChange:o,level:x}),s.jsxRuntimeExports.jsxs(Gt,{initial:k,onChange:M,triggers:$,ref:B,children:[E&&s.jsxRuntimeExports.jsx(Us,{}),R&&s.jsxRuntimeExports.jsx(rn,{})]})]})},Yi=({yAxes:e,lines:t,index:n,rules:r,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:a,axis:{location:u,key:x,showGrid:m,...p},annotationProvider:g})=>{const h=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:on,onDrop:d.useCallback(({items:R})=>{const k=c.filterByType(Ee,R);return i==null||i(x,k.map(({key:T})=>T)),k},[x,i])}),f=r==null?void 0:r.filter(R=>R.axis===x),E=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Ds,{...p,...h,location:u,showGrid:m??n===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Ee)(E))),onAutoBoundsChange:R=>a==null?void 0:a({key:x,bounds:R}),children:[e.map((R,k)=>{const T=t.filter($=>$.axes.y===R.key),M=r==null?void 0:r.filter($=>$.axis===R.key);return s.jsxRuntimeExports.jsx(Gi,{axis:{...R,showGrid:m??(n===0&&k===0)},lines:T,rules:M,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:a},R.key)}),f==null?void 0:f.map(R=>d.createElement(Wt,{aetherKey:R.key,...R,key:R.key,onLabelChange:k=>o==null?void 0:o({key:R.key,label:k}),onPositionChange:k=>o==null?void 0:o({key:R.key,position:k})})),s.jsxRuntimeExports.jsx(sn,{...g})]})},Ui=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Gi=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:r,onAxisChange:o,axis:{key:i,location:a,...u}})=>{const x=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:on,onDrop:d.useCallback(({items:p})=>{const g=c.filterByType(Ee,p);return r==null||r(i,g.map(({key:h})=>h)),g},[i,r])}),m=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Vs,{...u,...x,location:a,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(Ee)(m))),onAutoBoundsChange:p=>o==null?void 0:o({key:i,bounds:p}),children:[e.map(p=>s.jsxRuntimeExports.jsx(Wi,{line:p},Ui(p))),t==null?void 0:t.map(p=>d.createElement(Wt,{aetherKey:p.key,...p,key:p.key,onLabelChange:g=>n==null?void 0:n({key:p.key,label:g}),onPositionChange:g=>n==null?void 0:n({key:p.key,position:g})}))]})},Wi=({line:e})=>e.variant==="static"?s.jsxRuntimeExports.jsx(Qi,{line:e}):s.jsxRuntimeExports.jsx(Ki,{line:e}),Ki=({line:{key:e,timeSpan:t,channels:{x:n,y:r},...o}})=>{const i=Number(t.valueOf())*3,a=j.streamChannelData({timeSpan:t,channel:r,keepFor:i}),u=n!=null&&n!==0,x=j.streamChannelData({timeSpan:t,channel:u?n:r,useIndexOfChannel:!u,keepFor:i});return s.jsxRuntimeExports.jsx(qt,{aetherKey:e,y:a,x,...o})},Qi=({line:{timeRange:e,key:t,channels:{x:n,y:r},...o}})=>{const i=j.channelData({timeRange:e,channel:r}),a=n!=null&&n!==0,u=j.channelData({timeRange:e,channel:a?n:r,useIndexOfChannel:!a});return s.jsxRuntimeExports.jsx(qt,{aetherKey:t,y:i,x:u,...o})},gs=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],tt=({items:e},t)=>{const n=c.filterByType(Ee,e);return n.length>0&&!n.every(r=>t.includes(r.key))},ln=["name","alias"],cn=e=>{const t=mt();return d.useMemo(()=>e.length===0?gs:gs.filter(n=>e.includes(n.key)),[e,t])},Xi=({columns:e=ln,onChange:t,className:n,value:r,searchOptions:o,...i})=>{const a=ge(),u=mt(),x=cn(e),m=Dt(),p=c.useMemoDeepEqualProps(o),g=d.useMemo(()=>a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...p}),[a,m,p]),h=a!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:E,...R}=c.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:d.useCallback(P=>tt(P,C.A(r)),[r]),onDrop:d.useCallback(({items:P})=>{const S=c.filterByType(Ee,P);if(S.length===0)return[];const v=C.n([...C.A(r),...S.map(B=>B.key)]);return t(v,{clickedIndex:null,clicked:null,entries:[]}),S},[t,r])}),k=c.useDraggingState(),T=d.useCallback(({dropped:P})=>{t(C.A(r).filter(S=>!P.some(v=>v.key===S)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),M=d.useCallback((P,S)=>f([{key:S,type:Ee}],T),[f,T]),$=d.useCallback(P=>u[P.key]??P.name,[u]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(n,l.CSS.dropRegion(tt(k,C.A(r)))),value:r,onTagDragStart:M,onTagDragEnd:E,searcher:g,onChange:t,columns:x,emptyContent:h,entryRenderKey:$,...R,...i})},Ce=({columns:e=ln,onChange:t,value:n,className:r,data:o,searchOptions:i,...a})=>{const u=ge(),x=mt(),m=cn(e),p=Dt(),g=c.useMemoDeepEqualProps(i),h=d.useMemo(()=>{if(!(o!=null&&o.length>0))return u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...g})},[u,p,o==null?void 0:o.length,g]),f=u!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),E=d.useId(),R=d.useMemo(()=>({key:E,type:"Channel.SelectMultiple"}),[E]),{startDrag:k,onDragEnd:T,...M}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:d.useCallback(v=>tt(v,C.o(n)),[n]),onDrop:d.useCallback(({items:v})=>{const B=c.filterByType(Ee,v);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[R,t])}),$=c.useDraggingState(),P=d.useCallback(()=>n!=null&&k([{type:Ee,key:n}]),[k,n]),S=d.useCallback(v=>x[v.key]??v.name,[x]);return s.jsxRuntimeExports.jsx(be,{data:o,className:l.CSS(r,l.CSS.dropRegion(tt($,C.o(n)))),value:n,onDragStart:P,onDragEnd:T,onChange:t,searcher:h,columns:m,emptyContent:f,entryRenderKey:S,...M,...a})},Ji=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Ul,AliasProvider:_s,LinePlot:Hi,SelectMultiple:Xi,SelectSingle:Ce,useActiveRange:Dt,useAlias:Ns,useAliases:mt,useContext:$s,useName:jt},Symbol.toStringTag,{value:"Module"})),ve=({path:e,optional:t=!1,onChange:n})=>{const r=we(),{get:o,bind:i,set:a,setStatus:u}=r,[x,m]=d.useState(o(e,{optional:t}));d.useEffect(()=>(m(o(e,{optional:t})),i({path:e,onChange:m,listenToChildren:!1})),[e,n,i,o]);const p=d.useCallback(f=>{n==null||n(f,{...r,path:e}),a(e,f)},[e,a,n]),g=d.useCallback(f=>u(e,f),[e,u]);if(x==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let h;return r.mode==="preview"&&(h="preview"),{onChange:p,setStatus:g,variant:h,...x}},an=(e,t=!1,n)=>{const{get:r,bind:o}=we(n),[,i]=d.useState(0);return d.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),r(e,{optional:t})??null},ec=(e,t=!1,n)=>{var a;const{get:r,bind:o}=we(n),[,i]=d.useState(0);return d.useEffect(()=>(i(u=>u+1),o({path:e,onChange:()=>i(u=>u+1)})),[e,o]),((a=r(e,{optional:t}))==null?void 0:a.value)??null},tc=e=>{var t,n;return((n=(t=an(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},sc=({path:e,ctx:t,onChange:n})=>{const r=we(t);d.useEffect(()=>r.bind({path:e,onChange:o=>n(o,r),listenToChildren:!1}),[e,r])},nc=({path:e,optional:t=!1})=>{const{bind:n,get:r}=we(),[o,i]=d.useState(r(e,{optional:t}));if(d.useEffect(()=>(i(r(e,{optional:t})),n({path:e,onChange:a=>i({...a,value:C.U(a.value)}),listenToChildren:!0})),[e,n,r]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},un=(e,t)=>({add:(n,r)=>{const o=C.U(e.get(t).value);o.splice(r,0,...C.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,r)=>{const o=C.U(e.get(t).value);o.push(...C.A(n)),r!=null&&o.sort(r),e.set(t,o,{validateChildren:!1})},remove:n=>{const r=e.get(t).value,o=new Set(C.A(n));e.set(t,r.filter((i,a)=>!o.has(a)))},keepOnly:n=>{const r=e.get(t).value,o=new Set(C.A(n));e.set(t,r.filter((i,a)=>o.has(a)))},set:n=>e.set(t,C.executeSetter(n,e.get(t).value)),sort:n=>{const r=C.U(e.get(t).value);r.sort(n),e.set(t,r)}}),rc=({path:e,updateOnChildren:t=!1,ctx:n})=>{const r=we(n),{bind:o,get:i}=r,[a,u]=d.useState(i(e).value);return d.useEffect(()=>(u(i(e).value),o({path:e,onChange:x=>{u(C.U(x.value))},listenToChildren:t})),[e,o,i,u]),d.useMemo(()=>({value:a,...un(r,e)}),[a,r,e])},Kt=d.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),we=e=>{const t=d.useContext(Kt);return e??t},fs=e=>({key:e,variant:"success",message:""}),oc=e=>e.code===pe.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",xn=({values:e,sync:t=!1,schema:n,mode:r="normal",onChange:o})=>{const i=d.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),a=c.useSyncedRef(n),u=c.useSyncedRef(o),x=d.useCallback(({path:S,onChange:v,listenToChildren:B=!1})=>{var w;const{parentListeners:L,listeners:N}=i.current,A=B?L:N;return A.has(S)||A.set(S,new Set),(w=A.get(S))==null||w.add(v),()=>{var y;return(y=A.get(S))==null?void 0:y.delete(v)}},[]),m=d.useCallback((S,{optional:v}={optional:!1})=>{const{state:B,statuses:L,touched:N}=i.current,A=C._.get(B,S,{optional:v});if(A==null)return null;const w={value:A,status:L.get(S)??fs(S),touched:N.has(S),required:!1};if(a.current==null)return w;const y=a.current,_=C.N.getFieldSchema(y,S,{optional:!0});return _==null||(w.required=!_.isOptional()),w},[]),p=d.useCallback(S=>{const{state:v,statuses:B,touched:L,listeners:N,parentListeners:A}=i.current;C._.remove(v,S),B.delete(S),L.delete(S),N.delete(S),A.delete(S)},[]),g=d.useCallback(S=>{const{statuses:v,touched:B}=i.current;i.current.state=S,f(""),v.clear(),B.clear()},[]),h=d.useCallback(S=>{var L;const{listeners:v}=i.current,B=m(S,{optional:!0});B!=null&&((L=v.get(S))==null||L.forEach(N=>N(B)))},[]),f=d.useCallback(S=>{const{listeners:v,parentListeners:B}=i.current,L=v.get(S);if(S==""&&([...v.keys()].forEach(w=>{var _;const y=m(w,{optional:!0});y!=null&&((_=v.get(w))==null||_.forEach(z=>{z(y)}))}),[...B.keys()].forEach(w=>{var _;const y=m(w,{optional:!0});y!=null&&((_=B.get(w))==null||_.forEach(z=>{z(y)}))})),L!=null){const N=m(S,{optional:!0});N!=null&&L.forEach(A=>{A(N)})}B.forEach((N,A)=>{if(C._.pathsMatch(S,A)){const y=m(A,{optional:!0});y!=null&&N.forEach(_=>{_(y)})}})},[]),E=d.useCallback((S,v="",B=!0)=>{const{statuses:L,listeners:N,touched:A}=i.current;if(S.success){const z=[...L.keys()];return L.clear(),z.forEach(U=>h(U)),!0}let w=!0;const y=new Set(S.error.issues.map(z=>z.path.join(".")));let _=(z,U)=>z===U;return B&&(_=(z,U)=>C._.pathsMatch(z,U)),S.error.issues.forEach(z=>{var te;const{message:U}=z,I=z.path.join(".");if(!_(I,v))return;const G=oc(z);G!=="warning"&&(w=!1),L.set(I,{key:I,variant:G,message:U}),A.add(I);let O=m(I,{optional:!0});O==null&&(O={value:void 0,status:L.get(I)??fs(I),touched:!1,required:!1}),(te=N.get(I))==null||te.forEach(ce=>ce(O))}),L.forEach((z,U)=>{y.has(U)||(L.delete(U),h(U))}),w},[]),R=d.useCallback((S,v)=>{if(a.current==null)return!0;const{state:B}=i.current,L=a.current.safeParse(B);return E(L,S,v)},[E]),k=d.useCallback(async(S,v)=>{if(a.current==null)return!0;const{state:B}=i.current,L=await a.current.safeParseAsync(B);return E(L,S,v)},[E]),T=d.useCallback((S,v,B={})=>{const L=C._.get(i.current.state,S,{optional:!0}),{validateChildren:N=!0}=B,{state:A,touched:w}=i.current;w.add(S),S.length===0?i.current.state=v:C._.set(A,S,v),f(S),(async()=>{var _;let y;try{y=R(S,N)}catch{y=await k(S,N)}(_=u.current)==null||_.call(u,{values:i.current.state,path:S,prev:L,valid:y})})()},[]),M=d.useCallback(S=>C._.has(i.current.state,S),[]),$=d.useCallback((S,v)=>{i.current.statuses.set(S,v),i.current.touched.add(S),h(S)},[]),P=d.useCallback(()=>{const{statuses:S}=i.current;S.clear(),S.forEach((v,B)=>h(B))},[]);return d.useEffect(()=>{if(!t)return;const{listeners:S}=i.current;i.current.state=e,S.forEach((v,B)=>{const L=m(B,{optional:!0});L!=null&&v.forEach(N=>N(L))})},[t,e]),d.useMemo(()=>({bind:x,set:T,get:m,mode:r,validate:R,validateAsync:k,value:()=>i.current.state,has:M,remove:p,setStatus:$,clearStatuses:P,reset:g}),[x,T,m,R,k,M,p,$,P,g,r])},lc=e=>s.jsxRuntimeExports.jsx(Kt.Provider,{value:e,children:e.children}),ic=c.componentRenderProp(c.Text$1),se=({path:e,children:t=ic,label:n,padHelpText:r=!0,visible:o=!0,hideIfNull:i=!1,optional:a,onChange:u,className:x,...m})=>{const p=ve({path:e,optional:a??i,onChange:u}),g=we();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n==null&&(n=l._.capitalize(C._.element(e,-1))),o=typeof o=="function"?o(p,g):o,!o)return null;const h=p.status.message,{onChange:f,value:E}=p,R={onChange:f,value:E};return p.variant!=null&&(R.variant=p.variant),s.jsxRuntimeExports.jsx(me.Item,{padHelpText:r,helpText:h,helpTextVariant:p.status.variant,label:n,required:p.required,className:l.CSS(x,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(p.status.variant)),...m,children:t(R)})},Le=e=>({fieldKey:t,fieldProps:n,inputProps:r})=>{const o=({inputProps:i,path:a,fieldKey:u=t,...x})=>s.jsxRuntimeExports.jsx(se,{...n,...x,path:u?`${a}.${u}`:a,children:m=>s.jsxRuntimeExports.jsx(e,{...m,...r,...i})});return o.displayName=e.displayName,o},dn=Le(c.Numeric),ht=dn({}),pn=Le(c.Text$1),mn=pn({}),jn=Le(c.Switch$1),Qt=jn({}),cc=Le(be),ac=Le(_e),uc=Le(de.DropdownButton),Xt=({key:e,open:t,onChange:n})=>{const r=c.useMemoPrimitiveArray(e);c.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,r])},xc=({fetchInitialValue:e,...t})=>{const[n,r]=d.useState(void 0);return c.useAsyncEffect(async()=>{r(await e())},[e]),Xt({...t,onChange:r}),n},dc=Object.freeze(Object.defineProperty({__proto__:null,useListener:Xt,useState:xc},Symbol.toStringTag,{value:"Module"})),pc=({key:e,name:t,queryFn:n,values:r,openObservable:o,applyChanges:i,applyObservable:a,...u})=>{const x=ge(),m=c.useAggregator(),p=c.useMemoPrimitiveArray(e),g=xn({values:r,...u,sync:!1,onChange:E=>{x!=null&&(async()=>{try{await(i==null?void 0:i({...E,client:x}))}catch(R){m({variant:"error",message:`Failed to save ${t}`,description:R.message})}})()}});c.useAsyncEffect(async()=>{if(x!=null)try{const E=await n({client:x});g.set("",E)}catch(E){m({variant:"error",message:`Failed to retrieve ${t}`,description:E.message})}},[p,x==null?void 0:x.key]);const h=d.useCallback(async()=>{if(x!=null)return await(o==null?void 0:o(x))},[p,x==null?void 0:x.key]),f=d.useCallback(E=>a==null?void 0:a({changes:E,ctx:g}),[p,a]);return Xt({key:p,open:h,onChange:f}),g},mc=Object.freeze(Object.defineProperty({__proto__:null,Context:Kt,Field:se,Form:lc,NumericField:ht,SwitchField:Qt,TextField:mn,buildDropdownButtonSelectField:uc,buildNumericField:dn,buildSelectMultiField:ac,buildSelectSingleField:cc,buildSwitchField:jn,buildTextField:pn,fieldArrayUtils:un,fieldBuilder:Le,use:xn,useChildFieldValues:nc,useContext:we,useField:ve,useFieldArray:rc,useFieldListener:sc,useFieldState:an,useFieldValid:tc,useFieldValue:ec,useSynced:pc},Symbol.toStringTag,{value:"Module"})),jc=[{key:"name",name:"Name"},{key:"location",name:"Location"}],gc=({searchOptions:e,...t})=>{const n=ge();let r=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(r=n.hardware.devices.newSearcherWithOptions(e)),s.jsxRuntimeExports.jsx(be,{columns:jc,searcher:r,entryRenderKey:"name",...t})},fc=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:gc},Symbol.toStringTag,{value:"Module"})),Me="label",Jt=[{key:"color",name:"Color",render:({entry:e})=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],st=({items:e},t)=>{const n=c.filterByType(Me,e);return n.length>0&&!n.every(r=>t.includes(r.key))},hc=({entry:e,loading:t,entryKey:n,entryRenderKey:r,...o})=>s.jsxRuntimeExports.jsx(Ze,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Ec=c.componentRenderProp(hc),Sc=({onChange:e,className:t,value:n,...r})=>{const o=ge(),i=o!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...x}=c.useDragAndDrop({type:"Label.SelectMultiple",canDrop:d.useCallback(h=>st(h,C.A(n)),[n]),onDrop:d.useCallback(({items:h})=>{const f=c.filterByType(Me,h);if(f.length===0)return[];const E=C.n([...C.A(n),...f.map(R=>R.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),m=c.useDraggingState(),p=d.useCallback(({dropped:h})=>{e(C.A(n).filter(f=>!h.some(E=>E.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),g=d.useCallback((h,f)=>a([{key:f,type:Me}],p),[a,p]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(st(m,C.A(n)))),value:n,onTagDragStart:g,onTagDragEnd:u,searcher:o==null?void 0:o.labels,onChange:e,columns:Jt,emptyContent:i,renderTag:Ec,addPlaceholder:"Label",...x,...r})},gn=({value:e,onChange:t})=>{const n=ge(),r=n!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=d.useId(),i=d.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),a=c.useDragAndDrop({type:"Label.SelectSingle",canDrop:d.useCallback(m=>st(m,C.o(e)),[e]),onDrop:d.useCallback(({items:m})=>{const p=c.filterByType(Me,m);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),u=c.useDraggingState(),x=d.useCallback(()=>e!=null&&a.startDrag([{type:Me,key:e}]),[a.startDrag,e]);return{emptyContent:r,dragging:u,...a,onDragStart:x,searcher:n==null?void 0:n.labels}},Rc=({onChange:e,value:t,className:n,data:r,...o})=>{const{dragging:i,...a}=gn({value:t,onChange:e});return s.jsxRuntimeExports.jsx(be,{data:r,className:l.CSS(n,l.CSS.dropRegion(st(i,C.o(t)))),value:t,onChange:e,columns:Jt,entryRenderKey:"name",...a,...o})},yc=({data:e,value:t,onChange:n,...r})=>{const{dragging:o,...i}=gn({value:t,onChange:n});return s.jsxRuntimeExports.jsx(be,{data:e,value:t,onChange:n,columns:Jt,entryRenderKey:"name",...i,...r})},Cc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Me,SelectButton:yc,SelectMultiple:Sc,SelectSingle:Rc},Symbol.toStringTag,{value:"Module"})),fn=({children:e,centered:t,visible:n,enabled:r=!0,close:o,style:i,...a})=>{const u=d.useRef(null),x=d.useRef(n);c.useClickOutside({ref:u,exclude:p=>c.findParent(p.target,h=>h.getAttribute("role")==="dialog")!=null,onClickOutside:o});const m=d.useCallback(p=>{var h;if(!x.current||p.stage!=="start")return;const g=(h=u.current)==null?void 0:h.querySelectorAll(`.${l.CSS.visible(!0)}`);g&&g.length>0||o()},[o]);return c.use$1({triggers:[["Escape"]],callback:m,loose:!0}),s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(n),r&&l.CSS.M("enabled-modal")),empty:!0,align:"center",children:s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","dialog"),t&&l.CSS.M("centered")),role:"dialog",empty:!0,ref:u,...a,style:{zIndex:r?11:void 0,...i},children:s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("modal","content")),empty:!0,children:e})})})},bc=({root:e,...t})=>At.createPortal(s.jsxRuntimeExports.jsx(fn,{...t}),c.getRootElement(e)),vc=Object.freeze(Object.defineProperty({__proto__:null,Dialog:fn,Modal:bc},Symbol.toStringTag,{value:"Module"})),Et=new Error("Tab not found"),wc=new Error("Invalid Mosaic"),nt=(e,t,n="center",r)=>{var g;if(e=Re(e),r===void 0)return Tt(e,t);const o=Mt(e,r);if(n==="center")return(g=o.tabs)==null||g.push(t),o.selected=t.tabKey,e;const i=o.key*2,a=o.key*2+1,u=n==="top"||n==="left"?i:a;if(Mt(e,u).key!==o.key)return nt(e,t,"center",u);if(o.tabs==null||o.tabs.length===0)return nt(e,t,"center",r);const[x,m,p]=$c(n);if(o.direction=p,o[x]={key:0,tabs:[t],selected:t.tabKey},o[m]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw wc;return o.first.key=i,o.last.key=a,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Pc=(e,t,n)=>{var i;e=Re(e);const[r,o]=Pe(e,t);if(r==null||o==null)throw Et;return o.tabs=(i=o.tabs)==null?void 0:i.map(a=>a.tabKey===t?n(a):a),e},Tt=(e,t)=>(e=Re(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Tt(e.first,t):e.last!=null&&(e.last=Tt(e.last,t)),e)),rt=e=>{e=Re(e);const t=[];if(e.tabs!=null&&(e.selected=ne.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,r]=rt(e.first);e.first=n,t.push(...r)}if(e.last!=null){const[n,r]=rt(e.last);e.last=n,t.push(...r)}return[e,t]},es=(e,t)=>{var o;e=Re(e);const[,n]=Pe(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),n.selected=ne.resetSelection(n.selected,n.tabs),e=Mc(e);const r=n.selected??ot(e);return[e,r]},ot=e=>e.selected!=null?e.selected:e.first!=null?ot(e.first):e.last!=null?ot(e.last):null,hn=(e,t)=>{e=Re(e);const[n,r]=Pe(e,t);if(n==null||r==null)throw Et;return r.selected=t,e},En=(e,t,n,r)=>{e=Re(e);const[o,i]=Pe(e,t);if(o==null||i==null)throw Et;const[a,u]=es(e,t);return[nt(a,o,n,r),u]},Fe=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Fe(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Fe(e.last,t);if(n!=null)return n}},Sn=(e,t,n)=>{const r=lt(e,t);if(r==null)throw new Error("Node not found");return r.size=n,e},kc=(e,t,n)=>{e=Re(e);const r=Fe(e,t);if(r==null)throw new Error("Tab not found");if(r.tabs==null||r.tabs.length===0)throw new Error("Node has no tabs");const o=r.tabs.findIndex(p=>p.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const i=r.tabs[o];r.tabs=r.tabs.filter(p=>p.tabKey!==t);const a=r.key*2,x={key:r.key*2+1,tabs:[i],selected:i.tabKey},m={key:a,tabs:r.tabs,selected:r.selected};return m.selected=ne.resetSelection(m.selected,m.tabs),r.direction=n,r.first=m,r.last=x,r.tabs=void 0,r.selected=void 0,e},Lc=(e,t)=>{const n=Fe(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Rn=(e,t,n)=>{e=Re(e);const[,r]=Pe(e,t);if((r==null?void 0:r.tabs)==null)throw Et;return r.tabs=ne.rename(t,n,(r==null?void 0:r.tabs)??[]),e},Tc=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Mt=(e,t)=>{const n=lt(e,t);if(n!=null)return n;const r=Math.floor(t/2);return r===0?e:Mt(e,r)},Mc=e=>{let t=!0;for(;t;)[e,t]=$t(e);return e.first==null&&e.last==null&&(e.key=1),e},$t=e=>{if(e.first==null||e.last==null)return[e,!1];if(Es(e.first))return[hs(e.last,!0),!0];if(Es(e.last))return[hs(e.first,!1),!0];let[t,n]=[!1,!1];return[e.first,t]=$t(e.first),[e.last,n]=$t(e.last),[e,t||n]},hs=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Es=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Pe=(e,t)=>{if(e.tabs!=null){const a=e.tabs.find(u=>u.tabKey===t);if(a!=null)return[a,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,r]=Pe(e.first,t);if(n!=null&&r!=null)return[n,r];const[o,i]=Pe(e.last,t);return[o,i]},lt=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=lt(e.first,t);return n??lt(e.last,t)},$c=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},Re=e=>C._.copy(e),it=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&it(e.first,t,n),e.last!=null&&it(e.last,t,n),n),Nt=(e,t)=>{t(e),e.first!=null&&Nt(e.first,t),e.last!=null&&Nt(e.last,t)};class yn{constructor(t={}){he(this,"parent");he(this,"stub");he(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,r])=>this.el.setAttribute(n,r))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Nc=({node:e})=>{const t=d.createRef(),n=d.useRef(e);return d.useEffect(()=>{const r=t.current;if(r==null)return;const o=r.parentNode;if(o!=null)return e.mount(o,r),()=>{t.current!=null&&e.unmount(t.current)}},[]),d.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const r=t.current;if(r==null)return;const o=r.parentNode;o!=null&&e.mount(o,r)},[e]),s.jsxRuntimeExports.jsx("div",{ref:t})},Cn=({node:e,children:t})=>At.createPortal(t,e.el),_c=Object.freeze(Object.defineProperty({__proto__:null,In:Cn,Node:yn,Out:Nc},Symbol.toStringTag,{value:"Module"})),ct=d.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:r,direction:o,first:i,last:a,key:u,size:x},emptyContent:m,...p}=n,g=d.useCallback(([E])=>t(u,E),[t]),{props:h}=Ot({direction:o,onResize:g,count:2,initialSizes:x!=null?[x]:void 0});let f;return r!==void 0?f=s.jsxRuntimeExports.jsx(bn,{emptyContent:m,...n}):i!=null&&a!=null?f=s.jsxRuntimeExports.jsxs(dt,{id:`mosaic-${u}`,align:"stretch",className:l.CSS.BE("mosaic","resize"),...h,children:[s.jsxRuntimeExports.jsx(ct,{...p,root:i,onResize:t},i.key),s.jsxRuntimeExports.jsx(ct,{...p,root:a,onResize:t},a.key)]}):(f=null,console.warn("Mosaic tree is malformed")),u===1?s.jsxRuntimeExports.jsx(c.Provider$2,{children:f}):f});ct.displayName="Mosaic";const at="pluto-mosaic-tab-drop",ts="pluto-mosaic-tab-create",Bc=(e,t,n)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&n)return!0;const o=c.filterByType(at,t).map(u=>u.key),i=e.filter(u=>!o.includes(u.tabKey)).length>0;return c.filterByType(ts,t).length>0||o.length>0&&(i||e.length===0)},bn=d.memo(({root:e,onDrop:t,onCreate:n,activeTab:r,children:o,onFileDrop:i,...a})=>{const{key:u,tabs:x}=e,[m,p]=d.useState(null),g=i!=null,h=d.useCallback(({items:S})=>Bc(x,S,g),[x,g]),f=d.useCallback(({items:S,event:v})=>{if(v==null)return[];p(null);const B=c.filterByType(c.FILE_TYPE,S).length>0,L=x.length===0?"center":Rs(Ss(v));if(B)return i==null||i(u,L,v),S;const N=c.filterByType(at,S);if(N.length>0){const w=N.map(({key:y})=>y)[0];t(u,w,L)}const A=c.filterByType(ts,S);if(A.length>0){const w=A.map(({key:y})=>y);n==null||n(u,L,w)}return N},[t,x.length]),E=d.useCallback(({event:S})=>{if(S==null)return;const v=x.length===0?"center":Rs(Ss(S));p(v)},[x.length]),{startDrag:R,...k}=c.useDragAndDrop({type:"Mosaic",canDrop:h,onDrop:f,onDragOver:E}),T=h(c.useDraggingState()),M=d.useCallback(()=>p(null),[]),$=d.useCallback((S,{tabKey:v})=>{R([{key:v,type:at,elementID:S.currentTarget.id}])},[R]),P=d.useCallback(()=>n==null?void 0:n(u,"center"),[u]);return s.jsxRuntimeExports.jsxs("div",{id:`mosaic-${u}`,className:l.CSS.BE("mosaic","leaf"),children:[s.jsxRuntimeExports.jsxs(ne.Tabs,{id:`tab-${u}`,tabs:x,onDragLeave:M,selected:e.selected,selectedAltColor:r===e.selected,onDragStart:$,onCreate:P,...a,...k,children:[e.selected!=null&&o(x.find(S=>S.tabKey===e.selected)),T&&s.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),m!=null&&s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Ac[m]})]})});bn.displayName="MosaicTabLeaf";const Ac={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},Ss=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;return r<24?{px:.5,py:.5}:{px:n/t.width,py:r/t.height}},Oc=e=>e,zc=e=>1-e,Rs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,r]=[Oc(e),zc(e)];if(t>n&&t>r)return"bottom";if(t<n&&t<r)return"top";if(t>n&&t<r)return"left";if(t<n&&t>r)return"right";throw new Error("[bug] - invalid insert position")},Dc=({root:e,onSelect:t,children:n})=>{const r=d.useRef(new Map),o=new Set,i=it(e,a=>{var u;return(u=a.tabs)==null?void 0:u.map(x=>{let m=r.current.get(x.tabKey);return x==null?null:(m==null&&(m=new yn({style:"width: 100%; height: 100%; position: relative;"}),m.el.addEventListener("click",()=>t==null?void 0:t(x.tabKey)),r.current.set(x.tabKey,m)),o.add(x.tabKey),s.jsxRuntimeExports.jsx(Cn,{node:m,children:n({...x,visible:x.tabKey===a.selected})},x.tabKey))})}).flat().filter(a=>a!=null);return r.current.forEach((a,u)=>!o.has(u)&&r.current.delete(u)),[r,i]},Vc=pe.z.object({key:pe.z.number(),tabs:pe.z.array(ne.tabZ).optional(),selected:pe.z.string().optional(),direction:l.g.direction.optional(),size:pe.z.number().optional()}),_t=Vc.extend({first:pe.z.lazy(()=>_t).optional(),last:pe.z.lazy(()=>_t).optional()}),Ic=({allowRename:e=!1,initialTree:t})=>{const[n,r]=d.useState(t);return d.useEffect(()=>r(rt(t)[0]),[t]),{root:n,onDrop:(m,p,g)=>r(h=>En(h,p,g,m)[0]),onClose:m=>r(p=>es(p,m)[0]),onSelect:m=>r(p=>hn(p,m)),onResize:(m,p)=>r(g=>Sn(g,m,p)),onRename:e?(m,p)=>r(g=>Rn(g,m,p)):void 0}},Zc=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:ts,HAUL_DROP_TYPE:at,Mosaic:ct,autoSelectTabs:rt,canSplit:Lc,findSelected:ot,findTabNode:Fe,forEachNode:Nt,insertTab:nt,isEmpty:Tc,mapNodes:it,moveTab:En,nodeZ:_t,removeTab:es,renameTab:Rn,resizeNode:Sn,selectTab:hn,split:kc,updateTab:Pc,use:Ic,usePortal:Dc},Symbol.toStringTag,{value:"Module"})),Fc=({location:e="left",size:t="9rem",className:n,style:r,...o})=>{const i=l.J.construct(e),a=l.J.direction(i),u=l.g.swap(a);return s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(u),l.CSS.loc(i),n),direction:u,style:{[l.g.dimension(a)]:t,...r},align:"center",empty:!0,...o})},Ye=e=>({bordered:t=!1,className:n,...r})=>s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),n),align:"center",...r}),vn=Ye("start");vn.displayName="NavbarStart";const wn=Ye("end");wn.displayName="NavbarEnd";const Pn=Ye("center");Pn.displayName="NavbarCenter";const kn=Ye("");kn.displayName="NavbarContent";const Ln=Ye("absolute-center");Ln.displayName="NavbarAbsoluteCenter";const Be=Fc;Be.Start=vn;Be.Center=Pn;Be.End=wn;Be.AbsoluteCenter=Ln;Be.Content=kn;const ss=({aetherKey:e})=>{const[,{region:t},n]=c.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:l.Eo.ZERO,enabled:!0}}),r=c.useSyncedRef(t),o=d.useCallback(a=>{l.Eo.equals(a,r.current)||n(u=>({...u,region:a}))},[n]);return{setEnabled:d.useCallback(a=>n(u=>({...u,enabled:a})),[n]),erase:o}},qc=c.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=ss({aetherKey:e}),r=c.useResize(n);return s.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),Hc=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qc,use:ss},Symbol.toStringTag,{value:"Module"})),Yc=({items:e,initialKey:t})=>{const[n,r]=d.useState(t),o=a=>r(a===n?void 0:a),i=e.find(a=>a.key===n);return{onSelect:o,activeItem:i}},Uc=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:r,location:o="left",collapseThreshold:i=.65,className:a,onResize:u,...x})=>{const m=l.J.direction(o),p=d.useCallback(()=>t!=null&&(r==null?void 0:r(t.key)),[r,t==null?void 0:t.key]),{erase:g,setEnabled:h}=ss({aetherKey:e}),f=d.useCallback((T,M)=>{u==null||u(T,M),g(M)},[u,g]);if(d.useLayoutEffect(()=>{h(t!=null)},[t,h]),t==null)return null;const{content:E,key:R,...k}=t;return s.jsxRuntimeExports.jsx(ks,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(m),a),collapseThreshold:i,onCollapse:p,location:o,onResize:f,...k,...x,children:t.content},R)}),Gc=Object.freeze(Object.defineProperty({__proto__:null,Bar:Be,Drawer:Uc,useDrawer:Yc},Symbol.toStringTag,{value:"Module"})),Wc=({variant:e,className:t,children:n,...r})=>s.jsxRuntimeExports.jsx(D.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:n}),Kc=Object.freeze(Object.defineProperty({__proto__:null,Note:Wc},Symbol.toStringTag,{value:"Module"})),vt={Close:s.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:s.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:s.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),s.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Qc=({disabled:e=[],className:t,focused:n=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:a,...u})=>s.jsxRuntimeExports.jsxs(D.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!n&&l.CSS.BM("macos-controls","blurred"),t),...u,children:[s.jsxRuntimeExports.jsx(wt,{onClick:a,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:vt.Close}),s.jsxRuntimeExports.jsx(wt,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:vt.Minimize}),s.jsxRuntimeExports.jsx(wt,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:vt.Maximize})]}),wt=({className:e,disabled:t,color:n,...r})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...r}),Pt=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:r,onFullscreen:o,focused:i,...a})=>s.jsxRuntimeExports.jsxs(D.Pack,{...a,children:[s.jsxRuntimeExports.jsx(kt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:s.jsxRuntimeExports.jsx(c.Qt.Subtract,{})}),s.jsxRuntimeExports.jsx(kt,{className:l.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:s.jsxRuntimeExports.jsx(c.Qt.Box,{})}),s.jsxRuntimeExports.jsx(kt,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:s.jsxRuntimeExports.jsx(c.Qt.Close,{})})]}),kt=({disabled:e=!1,className:t,...n})=>e?null:s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...n}),Tn=e=>C.w.getOS(e),Xc={MacOS:Qc,Windows:Pt,Linux:Pt,Docker:Pt},Jc="Windows",ea=({forceOS:e,visibleIfOS:t,...n})=>{const r=Tn({force:e,default:Jc}),o=Xc[r];return t!=null&&t!==r?null:s.jsxRuntimeExports.jsx(o,{...n})},ta=Object.freeze(Object.defineProperty({__proto__:null,Controls:ea,use:Tn},Symbol.toStringTag,{value:"Module"})),sa=(e,t)=>{const n=r=>s.jsxRuntimeExports.jsx(e,{...t,...r});return n.displayName=e.displayName,n},na=Object.freeze(Object.defineProperty({__proto__:null,createComponent:sa},Symbol.toStringTag,{value:"Module"}));d.createContext({instrumentation:C.B.NOOP});const ra=c.wrap$1(j.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const r=c.useMemoDeepEqualProps(n),[{path:o},,i]=c.use$3({aetherKey:e,type:j.Provider$2.TYPE,schema:j.providerStateZ$1,initialState:r});return d.useEffect(()=>{i(r)},[r,i]),s.jsxRuntimeExports.jsx(c.Composite,{path:o,children:t})}),oa="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Mn=c.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=c.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ$2,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:e})}),la=Object.freeze(Object.defineProperty({__proto__:null,Provider:Mn},Symbol.toStringTag,{value:"Module"})),ia=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===C.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},$n=c.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:r,...o})=>{const i=c.useMemoDeepEqualProps({source:t,sink:n}),[,{status:a},u]=c.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:C.m.now()}}});d.useEffect(()=>{u(f=>({...f,...i}))},[i,u]);const x=d.useCallback(()=>u(f=>({...f,triggered:!f.triggered})),[u]),{message:m,chipColor:p,buttonStyle:g,disabled:h}=ia(a);return s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),r),disabled:h,onClick:x,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:m}),style:g,...o,children:s.jsxRuntimeExports.jsx(c.Qt.Circle,{color:p})})}),Nn=d.createContext({needsControlOf:[]}),_n=()=>d.useContext(Nn),ca=c.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...r})=>{const o=c.useMemoDeepEqualProps(r),[{path:i},{status:a,needsControlOf:u},x]=c.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:o});return d.useEffect(()=>{a!=null&&(n==null||n(a))},[a,n]),d.useEffect(()=>{x(m=>({...m,...o}))},[o,x]),d.useEffect(()=>()=>n==null?void 0:n("released"),[]),s.jsxRuntimeExports.jsxs(Nn.Provider,{value:{needsControlOf:u},children:[s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),Bn=c.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var x;const r=c.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:i},a]=c.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...r,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:C.m.now()}},schema:j.indicatorStateZ});d.useEffect(()=>{a(m=>({...m,...r}))},[r,a]);let u;return((x=i.data)==null?void 0:x.color)!=null?u=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?u=o:u="var(--pluto-gray-l8)",s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(u),flexGrow:1}})]})}),aa=c.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=_n(),[,{states:r},o]=c.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:n}});d.useEffect(()=>{o(u=>({...u,needsControlOf:n}))},[n]);const a=C.n(r.map(u=>u.subject.key)).map(u=>{const x=r.find(m=>m.subject.key===u);if(x==null)throw new C.Ce("Legend subject not found");return{key:x.subject.key,label:x.subject.name,color:x.subjectColor}});return s.jsxRuntimeExports.jsx(Ft,{data:a,...t})}),An=c.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=c.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:t})}),ua=Object.freeze(Object.defineProperty({__proto__:null,Chip:$n,Controller:ca,Indicator:Bn,Legend:aa,StateProvider:An,useContext:_n},Symbol.toStringTag,{value:"Module"})),On=e=>{const t=({disabled:n=!1,...r})=>n?r.children:s.jsxRuntimeExports.jsx(e,{...r});return t.displayName=e.displayName,t},xa=On(Mn),da=On(c.Provider$3),pa=({children:e,connParams:t,workerEnabled:n=!0,workerURL:r,theming:o,tooltip:i,triggers:a,alamos:u,haul:x,channelAlias:m,telem:p})=>s.jsxRuntimeExports.jsx(c.Provider$1,{...a,children:s.jsxRuntimeExports.jsx(c.Config,{...i,children:s.jsxRuntimeExports.jsx(c.Provider$2,{...x,children:s.jsxRuntimeExports.jsx(c.Provider$4,{url:r??oa,enabled:n,children:s.jsxRuntimeExports.jsx(da,{workerKey:"vis",children:s.jsxRuntimeExports.jsx(ra,{...u,children:s.jsxRuntimeExports.jsx(c.Aggregator,{children:s.jsxRuntimeExports.jsx(Ms,{connParams:t,children:s.jsxRuntimeExports.jsx(_s,{...m,children:s.jsxRuntimeExports.jsx(xa,{...p,children:s.jsxRuntimeExports.jsx(c.Provider,{...o,children:s.jsxRuntimeExports.jsx(An,{children:e})})})})})})})})})})})}),ma=Object.freeze(Object.defineProperty({__proto__:null,Provider:pa},Symbol.toStringTag,{value:"Module"})),ja=({value:e})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),ga=Object.freeze(Object.defineProperty({__proto__:null,Progress:ja},Symbol.toStringTag,{value:"Module"})),qe="range",ns=[{key:"name",name:"Name"}],ut=({items:e},t)=>{const n=c.filterByType(qe,e);return n.length>0&&!n.every(r=>t.includes(r.key))},fa=({onChange:e,className:t,value:n,...r})=>{const o=ge(),i=o!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:a,onDragEnd:u,...x}=c.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:d.useCallback(h=>ut(h,C.A(n)),[n]),onDrop:d.useCallback(({items:h})=>{const f=c.filterByType(qe,h);if(f.length===0)return[];const E=C.n([...C.A(n),...f.map(R=>R.key)]);return e(E,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),m=c.useDraggingState(),p=d.useCallback(({dropped:h})=>{e(C.A(n).filter(f=>!h.some(E=>E.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),g=d.useCallback((h,f)=>a([{key:f,type:qe}],p),[a,p]);return s.jsxRuntimeExports.jsx(_e,{className:l.CSS(t,l.CSS.dropRegion(ut(m,C.A(n)))),value:n,onTagDragStart:g,onTagDragEnd:u,searcher:o==null?void 0:o.ranges,onChange:e,columns:ns,emptyContent:i,entryRenderKey:"name",...x,...r})},zn=({value:e,onChange:t})=>{const n=ge(),r=n!=null?void 0:s.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=d.useId(),i=d.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:a,...u}=c.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:d.useCallback(p=>ut(p,C.o(e)),[e]),onDrop:d.useCallback(({items:p})=>{const g=c.filterByType(qe,p);return g.length===0?[]:(t(g[0].key,{clickedIndex:null,clicked:null,entries:[]}),g)},[i,t])}),x=c.useDraggingState(),m=d.useCallback(()=>e!=null&&a([{type:qe,key:e}]),[a,e]);return{emptyContent:r,dragging:x,...u,onDragStart:m,searcher:n==null?void 0:n.ranges}},ha=({onChange:e,value:t,className:n,data:r,...o})=>{const{dragging:i,...a}=zn({value:t,onChange:e});return s.jsxRuntimeExports.jsx(be,{data:r,className:l.CSS(n,l.CSS.dropRegion(ut(i,C.o(t)))),value:t,onChange:e,columns:ns,entryRenderKey:"name",...a,...o})},Ea=({data:e,value:t,onChange:n,...r})=>{const{dragging:o,...i}=zn({value:t,onChange:n});return s.jsxRuntimeExports.jsx(be,{data:e,value:t,onChange:n,columns:ns,entryRenderKey:"name",...i,...r})},Sa=[{key:"color",name:"Color",width:50,render:e=>s.jsxRuntimeExports.jsx(c.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Ra=e=>{const t=ge();return s.jsxRuntimeExports.jsx(_e,{...e,searcher:t==null?void 0:t.labels,columns:Sa,renderTag:n=>n.entry==null?s.jsxRuntimeExports.jsx(Ze,{color:"gray",children:n.entryKey}):s.jsxRuntimeExports.jsx(Ze,{color:n.entry.color,children:n.entry.name})})},ya=({timeRange:e,level:t="p",shade:n=7,showSpan:r=!1,...o})=>{const i=new C.m(e.start),a=i.isToday?"time":"dateTime",u=new C.m(e.end),x=u.equals(C.m.MAX),m=u.span(i)<C.y.DAY?"time":"dateTime",p=i.span(u);return s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...o,children:[i.isToday&&s.jsxRuntimeExports.jsx(c.Text,{level:t,shade:n,weight:450,children:"Today"}),s.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:a,shade:n,weight:450,children:i}),s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),x?s.jsxRuntimeExports.jsx(c.Text,{level:t,children:"Now"}):s.jsxRuntimeExports.jsx(c.DateTime,{level:t,displayTZ:"local",format:m,shade:n,weight:450,children:u}),!p.isZero&&r&&s.jsxRuntimeExports.jsxs(c.Text,{level:t,shade:n,weight:450,children:["(",i.span(u).truncate(C.y.MILLISECOND).toString(),")"]})]})},Ca=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Ea,SelectLabels:Ra,SelectMultiple:fa,SelectSingle:ha,TimeRangeChip:ya},Symbol.toStringTag,{value:"Module"})),ba=({steps:e,value:t,onChange:n,...r})=>{const o=e.findIndex(i=>i.key===t);return s.jsxRuntimeExports.jsx(D.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...r,children:e.map((i,a)=>s.jsxRuntimeExports.jsxs(d.Fragment,{children:[s.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:a>o,children:[a+1,". ",i.title]},i.key),a!==e.length-1&&s.jsxRuntimeExports.jsx(c.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},va=Object.freeze(Object.defineProperty({__proto__:null,Steps:ba},Symbol.toStringTag,{value:"Module"})),wa=(e,t="x")=>{if(e.length===0)return[];const n=l.J.construct(t),r=l.J.swap(n);return e.sort((o,i)=>l.Eo.loc(o.box,n)-l.Eo.loc(i.box,n)),e.forEach((o,i)=>{if(i===0)return;const u=e[i-1].handles.find(f=>f.orientation===r),x=o.handles.find(f=>f.orientation===n);if(u==null||x==null)return;const m=u.absolutePosition,p=x.absolutePosition,g=l.q.set(l.q.translation(p,m),t,0),h=l.q.translate(l.Eo.topLeft(o.box),g);o.box=l.Eo.construct(h,l.Eo.dims(o.box))}),e},rs=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},xe=(e,t)=>{const n=rs(t),r=e.getNodes().find(o=>o.id===t);if(r==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.Eo.construct(r.position,l.q.scale(l.Eo.dims(l.Eo.construct(n)),1/e.getZoom()))},Pa=(e,t)=>St.fromFlow(e,t);class Dn{constructor(t,n){he(this,"node_",null);he(this,"position");he(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.Eo.topLeft(this.node.box),this.position)}}class St{constructor(t,n,r){he(this,"key");he(this,"box");he(this,"handles");this.key=t,this.box=n,this.handles=r,r.forEach(o=>o.node=this)}static fromFlow(t,n){const r=xe(n,t),o=rs(t),i=o.getElementsByClassName("react-flow__handle"),a=l.Eo.construct(o),u=Array.from(i).map(x=>{const m=l.Eo.center(l.Eo.construct(x)),p=l.q.translation(l.Eo.topLeft(a),m),g=x.className.match(/react-flow__handle-(\w+)/);if(g==null)throw new Error("[schematic] - cannot find handle orientation");const h=l.J.construct(g[0]);return new Dn(p,h)});return new St(t,r,u)}}const ka=({fromX:e,fromY:t,toX:n,toY:r,fromPosition:o,toPosition:i,fromNode:a,connectionLineStyle:u,connectionStatus:x})=>{const m=document.querySelector(".react-flow__handle-connecting"),p=m==null?void 0:m.className.match(/react-flow__handle-(\w+)/);if(p!=null){const E=l.J.outer.safeParse(p[1]);E.success&&(i=E.data)}const g=j.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(n,r),sourceOrientation:o,targetOrientation:i,sourceBox:xe(j.useReactFlow(),(a==null?void 0:a.id)??""),targetBox:xe(j.useReactFlow(),(a==null?void 0:a.id)??"")}),h=j.useReactFlow(),f=j.segmentsToPoints(l.q.construct(e,t),g,h.getZoom(),!1);return s.jsxRuntimeExports.jsx(j.BaseEdge,{path:Vn(f),style:{...u,stroke:l.cssString(x==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},La=({id:e,source:t,target:n,sourcePosition:r,targetHandleId:o,targetPosition:i,style:a,segments:u=[],onSegmentsChange:x,color:m="var(--pluto-gray-l9)",selected:p=!1,...g})=>{const h=l.q.construct(g.sourceX,g.sourceY),f=d.useRef(h),E=l.q.equals(h,f.current),R=l.q.construct(g.targetX,g.targetY),k=d.useRef(R),T=l.q.equals(R,k.current),M=j.useReactFlow(),[$,P,S]=c.useCombinedStateAndRef(()=>u.length>0?u:j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),v=d.useRef(i),B=d.useRef(r),L=c.useDebouncedCallback(x,100,[x]);if(!E||!T){let y=$;const _=l.q.translation(f.current,h),z=l.q.translation(R,k.current);l.q.equals(_,l.q.scale(z,-1),.001)?(f.current=h,k.current=R):(E?T||(y=j.moveTargetNode({delta:z,segments:y}),v.current!==i&&(v.current=i,y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),j.checkIntegrity({sourcePos:h,targetPos:R,next:y,prev:$})||(y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),k.current=R):(y=j.moveSourceNode({delta:_,segments:y}),B.current!==r&&(B.current=r,y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),j.checkIntegrity({sourcePos:h,targetPos:R,next:y,prev:$})||(y=j.buildNew({sourcePos:h,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:xe(M,t),targetBox:xe(M,n)})),f.current=h),L(y),P(y))}const N=d.useRef(null),A=pt({onStart:d.useCallback((y,_,z)=>{N.current={index:Number(z.currentTarget.id.split("-")[1]),segments:[...S.current]}},[]),onMove:d.useCallback(y=>{if(N.current==null)return;const _=j.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.Eo.dim(y,l.g.swap(N.current.segments[N.current.index].direction),!0)/M.getZoom()});P(_)},[]),onEnd:d.useCallback(()=>x(S.current),[x])}),w=j.segmentsToPoints(h,$,M.getZoom(),!0);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(j.BaseEdge,{path:Vn(w),style:{...a,stroke:l.cssString(m)},...g}),p&&Ta(w).map((y,_)=>{const z=$[_].direction,U=l.g.swap(z),I={[l.g.dimension(z)]:"18px",[l.g.dimension(U)]:"4px"},G={[z]:y[z]-9,[U]:y[U]-2};return s.jsxRuntimeExports.jsxs(d.Fragment,{children:[s.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...I,...G,rx:"2px",ry:"2px"}),s.jsxRuntimeExports.jsx("foreignObject",{x:y.x-9,y:y.y-9,width:"18px",height:"18px",children:s.jsxRuntimeExports.jsx("div",{id:`handle-${_}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(z)),draggable:!0,onDragStart:A})})]},_)})]})},Vn=e=>{let t="";const r=e.length+-1;for(let o=0;o<r;o++){const i=e[o%e.length],a=e[(o+1)%e.length],u=Math.min(6/Math.hypot(a.x-i.x,a.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-u)+a.x*u},${i.y*(1-u)+a.y*u}`),o===r-1?t+=`L${a.x},${a.y}`:o<r-1&&(t+=`L${i.x*u+a.x*(1-u)},${i.y*u+a.y*(1-u)}`)}return t},Ta=e=>e.slice(1).map((t,n)=>{const r=e[n];return l.q.construct((t.x+r.x)/2,(t.y+r.y)/2)}),Ma=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:r={position:l.q.ZERO,zoom:1}})=>{const[o,i]=d.useState(n),[a,u]=d.useState(e),[x,m]=d.useState(t),[p,g]=d.useState(r),[h,f]=d.useState(!1);return{viewport:p,onViewportChange:g,edges:x,nodes:a,onNodesChange:u,onEdgesChange:m,editable:o,onEditableChange:i,fitViewOnResize:h,setFitViewOnResize:f}},$a=e=>e.source!==e.target,Na={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},_a={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},In={maxZoom:1,minZoom:.5},Ba={hideAttribution:!0},Zn=d.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Ue=()=>d.useContext(Zn),Fn=d.memo(({children:e})=>{const{registerNodeRenderer:t}=Ue();return d.useEffect(()=>t(e),[t,e]),null});Fn.displayName="NodeRenderer";const Aa=["Backspace","Delete"],Oa=c.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:r,nodes:o,edges:i,onEditableChange:a,editable:u,viewport:x,triggers:m,onViewportChange:p,fitViewOnResize:g,setFitViewOnResize:h,visible:f,...E})=>{const R=c.useMemoDeepEqualProps({visible:f}),[{path:k},,T]=c.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:x.position,region:l.Eo.ZERO,zoom:x.zoom,...R}});d.useEffect(()=>T(F=>({...F,...R})),[R]);const M=c.use().colors.gray.l9.hex,$=c.useMemoCompare(()=>m??Ut.zoom,c.compareModeConfigs,[m]),{fitView:P}=j.useReactFlow(),S=c.useDebouncedCallback(P,50,[P]),v=gt(d.useCallback(F=>{g&&S({maxZoom:1}),T(Q=>({...Q,region:F}))},[T,S,g])),B=d.useRef(null),L=d.useCallback(F=>{const Q=B.current;Q!=null&&Q.x===F.x&&Q.y===F.y&&Q.zoom===F.zoom||(B.current=F,!(isNaN(F.x)||isNaN(F.y)||isNaN(F.zoom))&&(T(ue=>({...ue,position:F,zoom:F.zoom})),p(j.translateViewportBackward(F))))},[T,p]);j.useOnViewportChange({onStart:L,onChange:L,onEnd:L});const[N,A]=d.useState(()=>()=>null),w=d.useCallback(F=>A(()=>F),[]),y=d.useMemo(()=>({custom:({id:F,xPos:Q,yPos:ue,selected:ze})=>N({symbolKey:F,position:{x:Q,y:ue},selected:ze})}),[N]),_=d.useRef(i),z=d.useMemo(()=>(_.current=i,j.translateEdgesForward(i)),[i]),U=d.useRef(o),I=d.useMemo(()=>(U.current=o,j.translateNodesForward(o)),[o]),G=d.useCallback(F=>n(j.nodeConverter(U.current,Q=>j.applyNodeChanges(F,Q))),[n]),O=d.useCallback(F=>r(j.edgeConverter(_.current,Q=>j.applyEdgeChanges(F,Q),M)),[r,M]),te=d.useCallback((F,Q)=>r(j.edgeConverter(_.current,ue=>j.updateEdge(F,Q,ue),M)),[]),ce=d.useCallback(F=>{r(j.edgeConverter(_.current,Q=>j.addEdge(F,Q),M))},[r,M]),We=d.useCallback((F,Q)=>{const ue=[..._.current],ze=ue.findIndex(dl=>dl.key===F);ze!==-1&&(ue[ze]={...ue[ze],segments:Q},_.current=ue,r(ue))},[r]),ll=u?Na:_a,il=d.useMemo(()=>({default:F=>s.jsxRuntimeExports.jsx(La,{...F,segments:F.data.segments,color:F.data.color,onSegmentsChange:d.useCallback(Q=>We(F.id,Q),[F.id])},F.id)}),[We]),is=d.useRef(null);c.use$1({triggers:$.zoomReset,callback:d.useCallback(({stage:F,cursor:Q})=>{const ue=is.current;ue==null||F!=="start"||!l.Eo.contains(ue,Q)||P()},[P])});const cs=c.purgeMouse($.select)[0]??null,as=c.purgeMouse($.pan)[0]??null,cl=c.purgeMouse($.zoom)[0]??null,al={selectionOnDrag:cs==null,panOnDrag:as==null,selectionKeyCode:cs,panActivationKeyCode:as,zoomActivationKeyCode:cl},ul=c.useCombinedRefs(is,v),xl=d.useMemo(()=>({editable:u,onEditableChange:a,registerNodeRenderer:w,fitViewOnResize:g,setFitViewOnResize:h}),[u,a,w,g]);return s.jsxRuntimeExports.jsx(Zn.Provider,{value:xl,children:s.jsxRuntimeExports.jsx(c.Composite,{path:k,children:f&&s.jsxRuntimeExports.jsx(j.ReactFlow,{...al,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(u)),nodes:I,edges:z,nodeTypes:y,edgeTypes:il,ref:ul,fitView:!0,onNodesChange:G,onEdgesChange:O,onConnect:ce,onEdgeUpdate:te,defaultViewport:j.translateViewportForward(x),connectionLineComponent:ka,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:$a,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:In,selectionMode:j.SelectionMode.Partial,proOptions:Ba,deleteKeyCode:Aa,...E,style:{[l.CSS.var("diagram-zoom")]:x.zoom,...E.style},...ll,children:t})})})}),za=()=>{const{editable:e}=Ue();return e?s.jsxRuntimeExports.jsx(ti,{}):null},Da=({children:e,...t})=>s.jsxRuntimeExports.jsx(D.Pack,{direction:"y",borderShade:4,className:l.CSS.BE("diagram","controls"),...t,children:e}),Va=({onClick:e,...t})=>{const{editable:n,onEditableChange:r}=Ue();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>r(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:n?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?s.jsxRuntimeExports.jsx(c.Qt.EditOff,{}):s.jsxRuntimeExports.jsx(c.Qt.Edit,{})})},Ia=({onClick:e,...t})=>{const{fitView:n}=j.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=Ue();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{n(In),e==null||e(i)},value:r,onChange:i=>o(i),rightClickToggle:!0,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:s.jsxRuntimeExports.jsx(c.Qt.Expand,{})})},Za=e=>s.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:s.jsxRuntimeExports.jsx(Oa,{...e})}),Fa=Object.freeze(Object.defineProperty({__proto__:null,Background:za,Controls:Da,Diagram:Za,FitViewControl:Ia,HandleLayout:Dn,NodeLayout:St,NodeRenderer:Fn,ToggleEditControl:Va,alignNodes:wa,edgeConverter:j.edgeConverter,edgeZ:j.edgeZ,nodeConverter:j.nodeConverter,nodeZ:j.nodeZ,rfEdgeDataZ:j.rfEdgeDataZ,selectNode:rs,selectNodeBox:xe,selectNodeLayout:Pa,translateEdgesBackward:j.translateEdgesBackward,translateEdgesForward:j.translateEdgesForward,translateNodesBackward:j.translateNodesBackward,translateNodesForward:j.translateNodesForward,translateViewportBackward:j.translateViewportBackward,translateViewportForward:j.translateViewportForward,use:Ma,useContext:Ue,viewportZ:j.viewportZ},Symbol.toStringTag,{value:"Module"})),qa=c.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:r=!0,emptyContent:o=s.jsxRuntimeExports.jsx(c.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:a,...u})=>{const x=c.useMemoDeepEqualProps({font:t,color:i,telem:a,visible:r}),[,{scrolling:m,empty:p},g]=c.use$3({aetherKey:e,type:j.Log.TYPE,schema:j.logState,initialState:{empty:!0,region:l.Eo.ZERO,scrolling:!1,wheelPos:0,...x}});d.useEffect(()=>{g(f=>({...f,...x}))},[x,g]);const h=gt(d.useCallback(f=>g(E=>({...E,region:f})),[g]));return s.jsxRuntimeExports.jsx("div",{ref:h,className:l.CSS(l.CSS.B("log"),n),onWheel:f=>{g(E=>({...E,wheelPos:E.wheelPos-f.deltaY,scrolling:E.scrolling?E.scrolling:f.deltaY<0}))},...u,children:p?o:s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("log","live"),m&&l.CSS.M("active")),variant:"outlined",onClick:()=>g(f=>({...f,scrolling:!f.scrolling})),tooltip:m?"Resume Scrolling":"Pause Scrolling",children:s.jsxRuntimeExports.jsx(c.Qt.Dynamic,{})})})}),Ha=Object.freeze(Object.defineProperty({__proto__:null,Log:qa},Symbol.toStringTag,{value:"Module"})),Ya=({value:e,showOuter:t=!0,showInner:n,onChange:r})=>{const{outer:o}=e,i=a=>()=>r({...e,...a});return t?s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(ye,{selected:o==="top",onClick:i({outer:"top"})}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(ye,{selected:o==="left",onClick:i({outer:"left"})}),s.jsxRuntimeExports.jsx(ys,{showInner:n,value:e,onChange:r}),s.jsxRuntimeExports.jsx(ye,{selected:o==="right",onClick:i({outer:"right"})})]}),s.jsxRuntimeExports.jsx(ye,{selected:o==="bottom",onClick:i({outer:"bottom"})})]}):s.jsxRuntimeExports.jsx(ys,{className:l.CSS.B("orientation-control"),value:e,onChange:r})},ys=({value:e,onChange:t,className:n,showInner:r=!0,...o})=>{const{inner:i}=e,a=x=>()=>t({...e,...x});let u={};return r||(u={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),s.jsxRuntimeExports.jsxs(D.Space,{className:l.CSS(n,l.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,className:l.CSS(l.CSS.dir("y")),selected:i==="top",onClick:a({inner:"top"})}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"center",justify:"center",children:[s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,selected:i==="left",onClick:a({inner:"left"})}),s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,selected:i==="right",onClick:a({inner:"right"})})]}),s.jsxRuntimeExports.jsx(ye,{style:u,disabled:!r,className:l.CSS(l.CSS.dir("y")),selected:i==="bottom",onClick:a({inner:"bottom"})})]})},ye=({selected:e,className:t,...n})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...n,children:s.jsxRuntimeExports.jsx("div",{className:"symbol"})}),fe=({className:e,direction:t,...n})=>s.jsxRuntimeExports.jsx(D.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Ae=({showOuter:e,showInner:t,...n})=>s.jsxRuntimeExports.jsx(se,{label:"Orientation",padHelpText:!1,...n,children:({value:r,onChange:o})=>{var i;return s.jsxRuntimeExports.jsx(Ya,{value:{inner:r.orientation??"top",outer:((i=r.label)==null?void 0:i.orientation)??"top"},showInner:t,showOuter:e,onChange:a=>o({...r,orientation:a.inner,label:{...r.label,orientation:a.outer}})})}}),Ge=({path:e,omit:t=[]})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsx(se,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:n=>s.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...n})}),s.jsxRuntimeExports.jsx(ht,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:e+".maxInlineSize",hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,visible:!t.includes("level"),path:e+".level",label:"Label Size",padHelpText:!1,children:n=>s.jsxRuntimeExports.jsx(de.SelectLevel,{...n})}),s.jsxRuntimeExports.jsx(se,{visible:!t.includes("align"),path:e+".align",label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>s.jsxRuntimeExports.jsx(Yt,{...n})})]}),ke=e=>s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:r,...o})=>s.jsxRuntimeExports.jsx(Bt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...o,bordered:!0})}),Ua=e=>s.jsxRuntimeExports.jsx(se,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>s.jsxRuntimeExports.jsx(c.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),ae=({omit:e})=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{omit:e,path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",grow:!0,children:[s.jsxRuntimeExports.jsx(ke,{path:"color",optional:!0}),s.jsxRuntimeExports.jsx(se,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>s.jsxRuntimeExports.jsx(c.Switch$1,{...t})}),s.jsxRuntimeExports.jsx(Ua,{path:"scale"})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]}),Ga=({path:e})=>{var m,p;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),o=j.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),a=j.setChannelValuePropsZ.parse(o.segments.setter.props),u=g=>{g=g??0;const h=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:g}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:h})},x=g=>{g=g??0;const h=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:g}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=j.authoritySource({channel:g}),E=j.acquireChannelControl({channel:g,authority:255});n({...t,sink:h,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:E,source:f},indicator:{statusSource:f}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:x})}),s.jsxRuntimeExports.jsx(Qt,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},os=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],re=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Ga,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},De={y:2,x:.25},Ve={lower:0,upper:2e3},qn=({includeBorderRadius:e=!1})=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(ke,{path:"backgroundColor",label:"Background Color"}),s.jsxRuntimeExports.jsx(se,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"%",...n})}),s.jsxRuntimeExports.jsx(se,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"%",...n})}),e&&s.jsxRuntimeExports.jsx(se,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t,dragScale:De,bounds:Ve,endContent:"px",...n})}),s.jsxRuntimeExports.jsx(se,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:De,bounds:Ve,endContent:"px",...n})}),s.jsxRuntimeExports.jsx(se,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:t??200,dragScale:De,bounds:Ve,endContent:"px",...n})})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showInner:!1})]}),Hn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],Wa=({path:e})=>{var g;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((g=t.telem)==null?void 0:g.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=j.stringifyNumberProps.parse(r.segments.stringifier.props),a=j.rollingAverageProps.parse(r.segments.rollingAverage.props),u=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:h??0}),stringifier:j.stringifyNumber({precision:i.precision??2}),rollingAverage:j.rollingAverage({windowSize:a.windowSize??1})},outlet:"stringifier"});n({...t,telem:f})},x=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:o.channel}),stringifier:j.stringifyNumber({precision:h}),rollingAverage:j.rollingAverage({windowSize:a.windowSize})},outlet:"stringifier"});n({...t,telem:f})},m=h=>{const f=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:j.stringifyNumber({precision:i.precision??2}),valueStream:j.streamChannelValue({channel:o.channel}),rollingAverage:j.rollingAverage({windowSize:h})},outlet:"stringifier"});n({...t,telem:f})},p=jt(o.channel);return d.useEffect(()=>{n({...t,tooltip:[p]})},[p]),s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Precision",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Averaging Window",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:a.windowSize??1,bounds:{lower:1,upper:100},onChange:m})})]})},Ka=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(Wa,{path:""});default:return s.jsxRuntimeExports.jsxs(fe,{direction:"x",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,empty:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(se,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>s.jsxRuntimeExports.jsx(c.Text$1,{...r})}),s.jsxRuntimeExports.jsx(ht,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showInner:!1})]})}},[]),t=ne.useStatic({tabs:Hn,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},Qa=({path:e})=>{var u;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=x=>{x=x??0;const m=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:x}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=jt(o.channel);return d.useEffect(()=>n({...t}),[a]),s.jsxRuntimeExports.jsx(fe,{direction:"x",align:"stretch",children:s.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})})})},Xa=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(Qa,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{})}},[]),t=ne.useStatic({tabs:Hn,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},Ja=({path:e})=>{var a;const{value:t,onChange:n}=ve({path:e}),r=j.sinkPipelinePropsZ.parse((a=t.sink)==null?void 0:a.props),o=j.setChannelValuePropsZ.parse(r.segments.setter.props),i=u=>{u=u??0;const x=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:u}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=j.authoritySource({channel:u}),p=j.acquireChannelControl({channel:u,authority:255});n({...t,sink:x,control:{...t.control,showChip:!0,chip:{sink:p,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:o.channel,onChange:i})}),s.jsxRuntimeExports.jsx(ht,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),s.jsxRuntimeExports.jsx(Qt,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},eu=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Ja,{path:""});default:return s.jsxRuntimeExports.jsx(ae,{omit:["align","maxInlineSize"]})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},tu=({path:e})=>{var m,p;const{value:t,onChange:n}=ve({path:e}),r=j.sourcePipelinePropsZ.parse((m=t.source)==null?void 0:m.props),o=j.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=j.streamChannelValuePropsZ.parse(r.segments.valueStream.props),a=j.setChannelValuePropsZ.parse(o.segments.setter.props),u=g=>{g=g??0;const h=j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:g})},outlet:"valueStream"});n({...t,source:h})},x=g=>{g=g??0;const h=j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:g})},inlet:"setter"}),f=j.authoritySource({channel:g}),E=j.acquireChannelControl({channel:g,authority:255});n({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:E,source:f},showIndicator:!0,indicator:{statusSource:f}}})};return s.jsxRuntimeExports.jsxs(fe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:u})}),s.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{value:a.channel,onChange:x})})]})},su=()=>{const e=d.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(tu,{path:""});default:return s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label"}),s.jsxRuntimeExports.jsx(mn,{path:"units",label:"Units",align:"start",padHelpText:!1}),s.jsxRuntimeExports.jsx(ke,{path:"color"})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]})}},[]),t=ne.useStatic({tabs:os,content:e});return s.jsxRuntimeExports.jsx(ne.Tabs,{...t})},nu=()=>{const e=ve({path:"autoFit",optional:!0});return s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",grow:!0,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(se,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>s.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),s.jsxRuntimeExports.jsx(se,{path:"level",label:"Text Size",padHelpText:!1,children:t=>s.jsxRuntimeExports.jsx(de.SelectLevel,{...t})}),s.jsxRuntimeExports.jsx(se,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>s.jsxRuntimeExports.jsx(Yt,{...t})})]}),s.jsxRuntimeExports.jsxs(D.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(ke,{path:"color"}),s.jsxRuntimeExports.jsx(se,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>s.jsxRuntimeExports.jsx(c.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:s.jsxRuntimeExports.jsx(c.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:s.jsxRuntimeExports.jsx(c.Qt.AutoFitWidth,{})})})})]})]}),s.jsxRuntimeExports.jsx(Ae,{path:""})]})},ru=()=>s.jsxRuntimeExports.jsxs(fe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ge,{path:"label",omit:["maxInlineSize","align"]}),s.jsxRuntimeExports.jsx(ke,{path:"color"})]}),s.jsxRuntimeExports.jsx(Ae,{path:"",showOuter:!1})]}),V=e=>s.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Oe=e=>s.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Te=e=>s.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),W=e=>s.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ou={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},lu=(e,t)=>ou[t][e],iu=(e,t=!1)=>{if(t)return e;switch(e){case j.Position.Left:return j.Position.Right;case j.Position.Right:return j.Position.Left;case j.Position.Top:return j.Position.Bottom;case j.Position.Bottom:return j.Position.Top;default:return j.Position.Top}},cu=(e,t,n,r=!1)=>r?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},q=({children:e,orientation:t})=>{let n;try{n=j.useUpdateNodeInternals()}catch{return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{})}const r=d.useRef(null),o=d.useRef(!0);return d.useEffect(()=>{if(r.current==null)return;if(o.current){o.current=!1;return}const i=r.current.closest(".react-flow__node"),a=i==null?void 0:i.getAttribute("data-id");a!=null&&(n==null||n(a))},[t]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:r,swap:o,top:i,...a})=>{const u=cu(i,r,t,n);return s.jsxRuntimeExports.jsx(j.Handle$1,{position:iu(lu(e,t),!o),...a,type:"source",onClick:x=>x.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",a.id)),style:{left:`${u.left}%`,top:`${u.top}%`}})},ie=({className:e,enabled:t=!1,triggered:n=!1,orientation:r="left",color:o,...i})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),r!=null&&l.CSS.loc(r),t&&l.CSS.M("enabled"),n&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),ee=({className:e,...t})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),au=.8,K=({dimensions:e,orientation:t="left",children:n,className:r,color:o,style:i={},scale:a=1,...u})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const m=l.cssString(o),p=c.use();return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(o).pickByContrast(p.colors.gray.l0,p.colors.gray.l10).rgbString),s.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._$1.svgViewBox(e),className:l.CSS(l.CSS.loc(t),r),fill:m,stroke:m,...u,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,a*au).width,...i},children:s.jsxRuntimeExports.jsx("g",{children:n})})},Yn=({className:e,orientation:t,scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:87},color:r,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Un=({color:e,orientation:t="left",scale:n,...r})=>s.jsxRuntimeExports.jsxs(ie,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),s.jsxRuntimeExports.jsx(V,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Gn=({orientation:e="left",color:t,scale:n,...r})=>s.jsxRuntimeExports.jsxs(ie,{...r,children:[s.jsxRuntimeExports.jsxs(q,{orientation:e,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:s.jsxRuntimeExports.jsx(V,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Wn=({className:e,color:t,orientation:n="left",normallyOpen:r=!1,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(V,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),s.jsxRuntimeExports.jsx(W,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),s.jsxRuntimeExports.jsx(Oe,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Kn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:58},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Qn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:45,height:43},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Xn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,orientation:n,className:l.CSS(l.CSS.B("angled-valve"),t),children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),s.jsxRuntimeExports.jsx(V,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),Jn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),er=({className:e,color:t,orientation:n="left",scale:r,...o})=>{const i=l.cssString(t);return s.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[s.jsxRuntimeExports.jsx(q,{orientation:n,children:s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:40,height:48},color:t,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),s.jsxRuntimeExports.jsx(V,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),s.jsxRuntimeExports.jsx(V,{d:"M33 24H2",strokeLinecap:"round"})]})]})},tr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[s.jsxRuntimeExports.jsx(q,{orientation:t,children:s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),s.jsxRuntimeExports.jsx(K,{color:n,dimensions:{width:26,height:48},orientation:t,scale:r,children:s.jsxRuntimeExports.jsx(V,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),sr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:48},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),s.jsxRuntimeExports.jsx(V,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),nr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:52,height:34},orientation:t,color:n,scale:r,children:s.jsxRuntimeExports.jsx(V,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),uu=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,xu=e=>{const{topLeft:t,topRight:n,bottomLeft:r,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${r.x}% / ${t.y}% ${n.y}% ${o.y}% ${r.y}%`},du={width:40,height:80},rr={x:50,y:10},Rt=({className:e,dimensions:t=du,borderRadius:n=rr,boxBorderRadius:r,color:o,backgroundColor:i,...a})=>{const u=uu(n),x=r==null,m=c.use();return s.jsxRuntimeExports.jsx(ee,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:r??xu(u),borderColor:l.cssString(o??m.colors.gray.l9),backgroundColor:i==null?void 0:l.cssString(i)},...a,children:s.jsxRuntimeExports.jsxs(q,{children:[s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:0,id:"1"}),x&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:-.5,top:u.topLeft.y-1,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:101,top:u.topRight.y-1,id:"3"})]}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),x&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:-.5,top:100-u.bottomLeft.y+1,id:"5"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:101,top:100-u.bottomRight.y+1,id:"6"})]}),s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},or=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),s.jsxRuntimeExports.jsx(V,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),s.jsxRuntimeExports.jsx(W,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),lr=({className:e,orientation:t="left",scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:70,height:34},orientation:t,color:r,scale:n,children:[s.jsxRuntimeExports.jsx(V,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),ir=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:87,height:42},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(n)}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),cr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(q,{children:[s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:79},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),s.jsxRuntimeExports.jsx(V,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),ar=({className:e,color:t,dimensions:n,orientation:r,units:o="psi",children:i,inlineSize:a=80,...u})=>{const x=l.cssString(t),m=c.use(),p=t==null?"var(--pluto-gray-l0)":l.cssString(new l.Color(t).pickByContrast(m.colors.gray.l0,m.colors.gray.l9)),g=2.5*((n==null?void 0:n.width)??0)/500;return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:x,height:n==null?void 0:n.height,width:"100%"},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:a},children:i}),s.jsxRuntimeExports.jsxs(q,{orientation:r,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:-2+g,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:102-g,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:x},children:s.jsxRuntimeExports.jsx(c.Text,{level:"small",color:p,children:o})})]})},ur=({enabled:e=!1,onClick:t,orientation:n="left"})=>s.jsxRuntimeExports.jsxs(ee,{orientation:n,children:[s.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),xr=({onClick:e,orientation:t="left",label:n="",color:r,size:o,level:i,onClickDelay:a})=>s.jsxRuntimeExports.jsxs(ee,{orientation:t,children:[s.jsxRuntimeExports.jsx(c.Button,{onClick:e,color:r,size:o,level:i,onClickDelay:a,children:n}),s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:0,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),dr=({className:e,orientation:t="left",text:n="",width:r,color:o,level:i,autoFit:a,align:u="center"})=>{const x=c.use(),m=l.cssString(o??x.colors.gray.l0),p={borderColor:m,textAlign:u};return l.g.construct(t)==="y"?p.height=a?"fit-content":r:p.width=a?"fit-content":r,s.jsxRuntimeExports.jsx(ee,{style:p,orientation:t,className:l.CSS(l.CSS.B("text-box"),l.CSS.loc(t),e),children:s.jsxRuntimeExports.jsx(c.Text,{color:m,level:i,children:n})})},pr=({orientation:e="left",className:t,onClick:n,children:r,value:o,units:i,color:a,onChange:u,...x})=>{const[m,p]=d.useState(o);return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...x,children:[s.jsxRuntimeExports.jsxs(q,{orientation:e,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsx(c.Numeric,{size:"small",value:m,onChange:p,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:a,style:{[l.CSS.var("pack-border-shade")]:l.cssString(a)},borderWidth:2,children:s.jsxRuntimeExports.jsx(c.Button,{variant:"outlined",size:"small",onClick:()=>u(m),color:a,children:"Set"})})]})},mr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),jr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),gr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:l.CSS(l.CSS.M("detail"),t)})]})]}),fr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(V,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),hr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{...o,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:66,height:30},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Oe,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),s.jsxRuntimeExports.jsx(V,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Er=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:50,height:33},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Sr=({className:e,color:t,orientation:n="left",enabled:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ee,{...i,orientation:n,className:l.CSS(l.CSS.B("light"),r&&l.CSS.M("enabled"),e),children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),s.jsxRuntimeExports.jsx(K,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:s.jsxRuntimeExports.jsx(Te,{cx:"32",cy:"32",r:"30"})})]}),Rr=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(q,{orientation:t,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),s.jsxRuntimeExports.jsx(Oe,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),s.jsxRuntimeExports.jsx(W,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),yr=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Cr=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(V,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),s.jsxRuntimeExports.jsx(V,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),br=({height:e=86,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:e},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),vr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),s.jsxRuntimeExports.jsx(W,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"49",x2:"43",y2:"83",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:l.CSS(l.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),wr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2,id:"4"})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(W,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(Oe,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Pr=({className:e,height:t=86,orientation:n="left",color:r,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ie,{...i,className:l.CSS(l.CSS.B("agitator")),children:[s.jsxRuntimeExports.jsx(q,{children:s.jsxRuntimeExports.jsx(b,{location:"top",left:50,top:2,id:"4",orientation:n})}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:86,height:t},color:r,orientation:n,scale:o,children:[s.jsxRuntimeExports.jsx(W,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(V,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),kr=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ie,{...o,className:l.CSS(l.CSS.B("compressor"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),s.jsxRuntimeExports.jsxs(K,{dimensions:{width:68,height:61},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Te,{cx:"35",cy:"25",r:"23"}),s.jsxRuntimeExports.jsx(V,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),s.jsxRuntimeExports.jsx(W,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),s.jsxRuntimeExports.jsx(W,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),Lr=({id:e,className:t,orientation:n="right",label:r="text",color:o="black",level:i="p",...a})=>{const u=document.querySelector(`[data-id="${e}"]`);u&&u.classList.add(n);const x=l.g.construct(n)==="y";return s.jsxRuntimeExports.jsxs(ee,{className:l.CSS(l.CSS.B("arrow"),l.CSS.loc(n),t),orientation:n,...a,children:[s.jsxRuntimeExports.jsx("div",{className:"wrapper",children:s.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:l.cssString(o)},children:s.jsxRuntimeExports.jsx("div",{className:"bg",children:s.jsxRuntimeExports.jsx(c.Text,{level:i,className:l.CSS.BE("symbol","label"),children:r})})})}),s.jsxRuntimeExports.jsxs(q,{orientation:n,children:[s.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:x,id:"1"}),s.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:x,id:"2"})]}),s.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:s.jsxRuntimeExports.jsx("defs",{children:s.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[s.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),s.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),s.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},pu=({aetherKey:e,sink:t})=>{const n=c.useMemoDeepEqualProps({sink:t}),[,,r]=c.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return d.useEffect(()=>{r(i=>({...i,...n}))},[n]),{click:d.useCallback(()=>{r(i=>({...i,trigger:i.trigger+1}))},[r])}},mu=({aetherKey:e,source:t})=>{const n=c.useMemoDeepEqualProps({source:t}),[,{enabled:r},o]=c.use$3({aetherKey:e,type:j.Light.TYPE,schema:j.lightStateZ,initialState:{enabled:!1,...n}});return d.useEffect(()=>o(i=>({...i,...n})),[n,o]),{enabled:r}},H=d.forwardRef(({label:e="",onChange:t,level:n="p",children:r,orientation:o="top",style:i,className:a,maxInlineSize:u=150,...x},m)=>s.jsxRuntimeExports.jsxs(D.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:m,className:l.CSS(l.CSS.B("symbol"),a),align:"center",justify:"center",...x,children:[e.length>0&&s.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:u},onChange:d.useCallback(p=>t({label:{label:p,level:n,orientation:o}}),[t,n]),level:n}),r]}));H.displayName="Labeled";const ju=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},i]=c.use$3({aetherKey:e,type:j.Setpoint.TYPE,schema:j.setpointStateZ,initialState:{trigger:0,value:0,...r}});return d.useEffect(()=>{i(u=>({...u,...r}))},[r,i]),{set:d.useCallback(u=>i(x=>({...x,trigger:x.trigger+1,command:u})),[i]),value:o}},oe=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:i},a]=c.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...r}});return d.useEffect(()=>{a(x=>({...x,...r}))},[r,a]),{toggle:d.useCallback(()=>a(x=>({...x,triggered:!x.triggered})),[a]),triggered:o,enabled:i}},gu=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:C.levelZ.optional()}),Tr=({aetherKey:e,box:t,telem:n,color:r,precision:o,minWidth:i,level:a="small"})=>{const u=c.useMemoDeepEqualProps({box:t,telem:n,color:r,precision:o,level:a,minWidth:i}),[,x,m]=c.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:u});return d.useLayoutEffect(()=>m(p=>({...p,...u})),[u]),{width:x.width??x.minWidth}},fu=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:gu,use:Tr},Symbol.toStringTag,{value:"Module"})),Mr=e=>l.g.construct(e)==="x"?l.J.swap(e):e,hu=e=>l.g.construct(e)==="y"?l.J.swap(e):e,X=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:r="left",chip:o,children:i,show:a=!0,...u})=>s.jsxRuntimeExports.jsxs(D.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[s.jsxRuntimeExports.jsxs(D.Space,{direction:l.g.construct(r),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[a&&e&&s.jsxRuntimeExports.jsx($n,{size:"small",...o}),a&&t&&s.jsxRuntimeExports.jsx(Bn,{...n})]}),i]}),$r=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:r,source:o,sink:i,orientation:a="left",...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:o,sink:i});return s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(X,{...r,orientation:Mr(a),children:s.jsxRuntimeExports.jsx(Un,{enabled:x,triggered:m,onClick:p,orientation:a,...u})})})}),Nr=e=>s.jsxRuntimeExports.jsx(Un,{...e}),_r=c.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:r,source:o,sink:i,orientation:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:t,source:o,sink:i});return s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...e,orientation:a,children:s.jsxRuntimeExports.jsx(Gn,{enabled:x,triggered:m,onClick:p,orientation:a,...u})})})}),Br=e=>s.jsxRuntimeExports.jsx(Gn,{...e}),Ar=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:r="left",normallyOpen:o,source:i,sink:a,control:u,...x})=>{const{enabled:m,triggered:p,toggle:g}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(X,{...u,orientation:hu(r),children:s.jsxRuntimeExports.jsx(Wn,{enabled:m,triggered:p,onClick:g,orientation:r,normallyOpen:o,...x})})})}),Or=e=>s.jsxRuntimeExports.jsx(Wn,{...e}),zr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...t,orientation:o,children:s.jsxRuntimeExports.jsx(Yn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Dr=e=>s.jsxRuntimeExports.jsx(Yn,{...e}),Vr=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:r,orientation:o="left",source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:Mr(o),children:s.jsxRuntimeExports.jsx(Xn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Ir=e=>s.jsxRuntimeExports.jsx(Xn,{...e}),Zr=c.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Jn,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Fr=e=>s.jsxRuntimeExports.jsx(Jn,{...e}),qr=({backgroundColor:e,label:t,onChange:n,orientation:r,color:o,dimensions:i,borderRadius:a})=>s.jsxRuntimeExports.jsx(H,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(Rt,{onResize:u=>n({dimensions:u}),orientation:r,color:o,dimensions:i,borderRadius:a,backgroundColor:e})}),Hr=e=>s.jsxRuntimeExports.jsx(Rt,{...e,dimensions:{width:25,height:50}}),Yr=({backgroundColor:e,borderRadius:t,label:n,onChange:r,orientation:o,color:i,dimensions:a})=>s.jsxRuntimeExports.jsx(H,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(Rt,{onResize:u=>r({dimensions:u}),orientation:o,color:i,dimensions:a,boxBorderRadius:t,backgroundColor:e})}),Ur=e=>s.jsxRuntimeExports.jsx(Rt,{...e,dimensions:{width:25,height:50},borderRadius:0}),Gr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Kn,{...r})}),Wr=e=>s.jsxRuntimeExports.jsx(Kn,{...e}),Kr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(or,{...r})}),Qr=e=>s.jsxRuntimeExports.jsx(or,{...e}),Xr=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Rr,{...r})}),Jr=e=>s.jsxRuntimeExports.jsx(Rr,{...e}),eo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(er,{...r})}),to=e=>s.jsxRuntimeExports.jsx(er,{...e}),so=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(tr,{...r})}),no=e=>s.jsxRuntimeExports.jsx(tr,{...e}),ro=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(sr,{...r})}),oo=e=>s.jsxRuntimeExports.jsx(sr,{...e}),lo=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:r,units:o,source:i,sink:a,color:u,onChange:x})=>{const{value:m,set:p}=ju({aetherKey:t,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...e,onChange:x,children:s.jsxRuntimeExports.jsx(X,{...r,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(pr,{value:m,onChange:p,units:o,color:u,orientation:n})})})}),io=e=>s.jsxRuntimeExports.jsx(pr,{value:12,onChange:()=>{},units:"mV",...e,children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),co=({label:e,aetherKey:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:n,children:s.jsxRuntimeExports.jsx(nr,{...r})}),ao=e=>s.jsxRuntimeExports.jsx(nr,{...e}),uo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(ir,{...r})}),xo=e=>s.jsxRuntimeExports.jsx(ir,{...e}),po=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Qn,{...r})}),mo=e=>s.jsxRuntimeExports.jsx(Qn,{...e}),jo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(lr,{...r})}),go=e=>s.jsxRuntimeExports.jsx(lr,{...e}),fo=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(cr,{...r})}),ho=e=>s.jsxRuntimeExports.jsx(cr,{...e}),Eo=c.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:r,className:o,textColor:i,color:a,telem:u,units:x,onChange:m,tooltip:p,inlineSize:g})=>{const h=c.useTypography(n),[f,E]=d.useState({outerBox:l.Eo.ZERO,labelBox:l.Eo.ZERO}),R=(h.lineHeight+.5)*h.baseSize+2,k=c.useResize(d.useCallback(P=>{const S=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let v={...l.Eo.ZERO};S!=null&&(v=l.Eo.construct(S),v=l.Eo.resize(v,{width:l.Eo.width(v),height:l.Eo.height(v)})),E({outerBox:P,labelBox:v})},[]),{}),{zoom:T}=j.useInitialViewport(),M=Su({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:R,position:r,zoom:T,...f}),{width:$}=Tr({aetherKey:e,color:i,level:n,box:M,telem:u,minWidth:g});return s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:p==null||p.length===0,children:[s.jsxRuntimeExports.jsx(D.Space,{direction:"y",children:p==null?void 0:p.map((P,S)=>s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:P},S))}),s.jsxRuntimeExports.jsx(H,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:k,onChange:m,...t,children:s.jsxRuntimeExports.jsx(ar,{color:a,dimensions:{height:R,width:$},inlineSize:g,units:x})})]})}),Eu=.9,Su=({labelOrientation:e,outerBox:t,labelBox:n,valueBoxHeight:r,position:o,hasLabel:i,zoom:a})=>{const u=l.q.scale(l.Eo.dims(n),1/(Eu*a));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((u.y-r)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",u.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",u.y+4)),l.Eo.construct(o.x,o.y,l.Eo.width(t),r)},So=({color:e})=>s.jsxRuntimeExports.jsx(ar,{color:e,dimensions:{width:60,height:25},units:"psi",children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Ro=c.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(ur,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),yo=e=>s.jsxRuntimeExports.jsx(ur,{...e}),Co=c.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:r,control:o,...i})=>{const{click:a}=pu({aetherKey:e,sink:r});return s.jsxRuntimeExports.jsx(X,{...o,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(xr,{...t,onClick:a,...i})})}),bo=({label:e,...t})=>s.jsxRuntimeExports.jsx(xr,{label:"Button",...t}),vo=c.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(mr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),wo=e=>s.jsxRuntimeExports.jsx(mr,{...e}),Po=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(jr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),ko=e=>s.jsxRuntimeExports.jsx(jr,{...e}),Lo=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(gr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),To=e=>s.jsxRuntimeExports.jsx(gr,{...e}),Mo=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(fr,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),$o=e=>s.jsxRuntimeExports.jsx(fr,{...e}),No=({label:e,onChange:t,aetherKey:n,...r})=>s.jsxRuntimeExports.jsx(H,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(hr,{...r})}),_o=e=>s.jsxRuntimeExports.jsx(hr,{...e}),Bo=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,source:i,sink:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:i,sink:a});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(X,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Er,{enabled:x,triggered:m,onClick:p,orientation:o,...u})})})}),Ao=e=>s.jsxRuntimeExports.jsx(Er,{...e}),Oo=c.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:r,...o})=>{const{enabled:i}=mu({aetherKey:e,source:n});return s.jsxRuntimeExports.jsx(H,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(Sr,{enabled:i,...o})})}),zo=e=>s.jsxRuntimeExports.jsx(Sr,{...e}),Do=c.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(yr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Vo=e=>s.jsxRuntimeExports.jsx(yr,{...e}),Io=c.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(Cr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Zo=e=>s.jsxRuntimeExports.jsx(Cr,{...e}),Fo=c.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(br,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),qo=e=>s.jsxRuntimeExports.jsx(br,{...e}),Ho=c.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(vr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Yo=e=>s.jsxRuntimeExports.jsx(vr,{...e}),Uo=c.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(wr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Go=e=>s.jsxRuntimeExports.jsx(wr,{...e}),Wo=c.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(Pr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Ko=e=>s.jsxRuntimeExports.jsx(Pr,{...e}),Qo=c.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:r,sink:o,onChange:i,control:a,...u})=>{const{enabled:x,triggered:m,toggle:p}=oe({aetherKey:e,source:r,sink:o});return s.jsxRuntimeExports.jsx(H,{...t,onChange:i,children:s.jsxRuntimeExports.jsx(X,{orientation:n,...a,children:s.jsxRuntimeExports.jsx(kr,{enabled:x,orientation:n,triggered:m,onClick:p,...u})})})}),Xo=e=>s.jsxRuntimeExports.jsx(kr,{...e}),Jo=e=>s.jsxRuntimeExports.jsx(dr,{...e}),el=({level:e="p",width:t=100,...n})=>s.jsxRuntimeExports.jsx(dr,{className:l.CSS.B("symbol"),level:e,width:t,...n}),tl=({label:{label:e,level:t},aetherKey:n,position:r,...o})=>s.jsxRuntimeExports.jsx(Lr,{label:e,level:t,...o,className:l.CSS.B("symbol")}),sl=({label:e,...t})=>s.jsxRuntimeExports.jsx(Lr,{label:"Off Page",...t,orientation:"right"}),Y=4,nl=2,Ru=["agitator","angledReliefValve","angledValve","offPageReference","box","burstDisc","button","cap","cavityPump","checkValve","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","light","manualValve","needleValve","orifice","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve"],yu=pe.z.enum(Ru),J={orientation:"left",scale:1},Cu={...J,source:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:0}),rollingAverage:j.rollingAverage({windowSize:1}),stringifier:j.stringifyNumber({precision:2})},outlet:"stringifier"})},bu={...J,source:j.sourcePipeline("number",{connections:[],segments:{valueStream:j.streamChannelValue({channel:0})},outlet:"valueStream"})},vu={...J,sink:j.sinkPipeline("number",{connections:[],segments:{setter:j.setChannelValue({channel:0})},inlet:"setter"})},rl={...J,source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},ol={...J,control:{show:!0},sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},le={...rl,...ol},Z=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),wu={width:125,height:200},ls={dimensions:wu},Pu=3,ku={name:"Three Way Valve",key:"threeWayValve",Form:re,Symbol:$r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Three Way Valve"),...le}),Preview:Nr,zIndex:Y},Lu={name:"Valve",key:"valve",Form:re,Symbol:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Valve"),...le}),Preview:Br,zIndex:Y},Tu={name:"Solenoid Valve",key:"solenoidValve",Form:re,Symbol:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Solenoid Valve"),normallyOpen:!1,...le}),Preview:Or,zIndex:Y},Mu={name:"Four Way Valve",key:"fourWayValve",Form:re,Symbol:zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Four Way Valve"),...le}),Preview:Dr,zIndex:Y},$u={name:"Angled Valve",key:"angledValve",Form:re,Symbol:Vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Angled Valve"),...le}),Preview:Ir,zIndex:Y},Nu={name:"Pump",key:"pump",Form:re,Symbol:Zr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Pump"),...le}),Preview:Fr,zIndex:Y},_u={name:"Screw Pump",key:"screwPump",Form:re,Symbol:vo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Screw Pump"),...le}),Preview:wo,zIndex:Y},Bu={name:"Tank",key:"tank",Form:qn,Symbol:qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Z("Tank"),borderRadius:rr,...ls,...J}),Preview:Hr,zIndex:nl},Au={name:"Box",key:"box",Form:()=>qn({includeBorderRadius:!0}),Symbol:Yr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Z("Box"),borderRadius:Pu,...ls,...J}),Preview:Ur,zIndex:nl},Ou={name:"Relief Valve",key:"reliefValve",Form:ae,Symbol:Gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Relief Valve"),...J}),Preview:Wr,zIndex:Y},zu={name:"Regulator",key:"regulator",Form:ae,Symbol:Kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Regulator"),...J}),Preview:Qr,zIndex:Y},Du={name:"Electric Regulator",key:"electricRegulator",Form:ae,Symbol:Xr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Electric Regulator"),...J}),Preview:Jr,zIndex:Y},Vu={name:"Burst Disc",key:"burstDisc",Form:ae,Symbol:eo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Burst Disc"),...J}),Preview:to,zIndex:Y},Iu={name:"Cap",key:"cap",Form:ae,Symbol:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cap"),...J}),Preview:no,zIndex:Y},Zu={name:"Manual Valve",key:"manualValve",Form:ae,Symbol:ro,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Manual Valve"),...J}),Preview:oo,zIndex:Y},Fu={name:"Filter",key:"filter",Form:ae,Symbol:co,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Filter"),...J}),Preview:ao,zIndex:Y},qu={name:"Needle Valve",key:"needleValve",Form:ae,Symbol:uo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Needle Valve"),...J}),Preview:xo,zIndex:Y},Hu={name:"Check Valve",key:"checkValve",Form:ae,Symbol:po,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Check Valve"),...J}),Preview:mo,zIndex:Y},Yu={name:"Orifice",key:"orifice",Form:ae,Symbol:jo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Orifice"),...J}),Preview:go,zIndex:Y},Uu={name:"Angled Relief Valve",key:"angledReliefValve",Form:ae,Symbol:fo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Angled Relief Valve"),...J}),Preview:ho,zIndex:Y},Gu={name:"Value",key:"value",Form:Ka,Symbol:Eo,Preview:So,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...Z("Value"),...J,telem:Cu.source}),zIndex:Y},Wu={name:"Button",key:"button",Symbol:Co,Form:eu,Preview:bo,defaultProps:e=>({color:e.colors.primary.z.rgba255,...Z("Button"),...ol,onClickDelay:0,scale:null}),zIndex:Y},Ku={name:"Switch",key:"switch",Symbol:Ro,Preview:yo,Form:re,defaultProps:()=>({...Z("Switch"),...le,scale:null}),zIndex:Y},Qu={name:"Vacuum Pump",key:"vacuumPump",Symbol:Po,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Vacuum Pump"),...le}),Preview:ko,zIndex:Y},Xu={name:"Cavity Pump",key:"cavityPump",Symbol:Lo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cavity Pump"),...le}),Preview:To,zIndex:Y},Ju={name:"Piston Pump",key:"pistonPump",Symbol:Mo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Piston Pump"),...le}),Preview:$o,zIndex:Y},ex={name:"Static Mixer",key:"staticMixer",Symbol:No,Form:ae,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Static Mixer"),...J}),Preview:_o,zIndex:Y},tx={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Bo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Rotary Mixer"),...le}),Preview:Ao,zIndex:Y},sx={name:"Light",key:"light",Symbol:Oo,Form:Xa,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Light"),...rl}),Preview:zo,zIndex:Y},nx={name:"Setpoint",key:"setpoint",Symbol:lo,Form:su,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...Z("Setpoint"),...bu,...vu}),Preview:io,zIndex:Y},rx={name:"Agitator",key:"agitator",Symbol:Do,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Agitator"),...le}),Preview:Vo,zIndex:Y},ox={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Io,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Propeller Agitator"),...le}),Preview:Zo,zIndex:Y},lx={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Fo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Flat Blade Agitator"),...le}),Preview:qo,zIndex:Y},ix={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Ho,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Paddle Agitator"),...le}),Preview:Yo,zIndex:Y},cx={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Uo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Cross Beam Agitator"),...le}),Preview:Go,zIndex:Y},ax={name:"Helical Agitator",key:"helicalAgitator",Symbol:Wo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Helical Agitator"),...le}),Preview:Ko,zIndex:Y},ux={name:"Compressor",key:"compressor",Symbol:Qo,Form:re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Z("Compressor"),...le}),Preview:Xo,zIndex:Y},xx={name:"Text Box",key:"textBox",Symbol:Jo,Form:nu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...Z("Text Box"),...J,...ls,level:"p",text:"Text Box",width:75}),Preview:el,zIndex:Y},dx={name:"Off Page Reference",key:"offPageReference",Form:ru,Symbol:tl,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...Z("Off Page Reference")}),Preview:sl,zIndex:Y},px={value:Gu,button:Wu,tank:Bu,switch:Ku,offPageReference:dx,light:sx,setpoint:nx,box:Au,textBox:xx,valve:Lu,solenoidValve:Tu,threeWayValve:ku,fourWayValve:Mu,angledValve:$u,manualValve:Zu,needleValve:qu,reliefValve:Ou,angledReliefValve:Uu,checkValve:Hu,regulator:zu,electricRegulator:Du,pump:Nu,pistonPump:Ju,screwPump:_u,cavityPump:Xu,vacuumPump:Qu,staticMixer:ex,rotaryMixer:tx,burstDisc:Vu,cap:Iu,filter:Fu,orifice:Yu,agitator:rx,propellerAgitator:ox,flatBladeAgitator:lx,paddleAgitator:ix,crossBeamAgitator:cx,helicalAgitator:ax,compressor:ux},mx=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Do,AgitatorPreview:Vo,AngledReliefValve:fo,AngledReliefValvePreview:ho,AngledValve:Vr,AngledValvePreview:Ir,Box:Yr,BoxPreview:Ur,BurstDisc:eo,BurstDiscPreview:to,Button:Co,ButtonPreview:bo,Cap:so,CapPreview:no,CavityPump:Lo,CavityPumpPreview:To,CheckValve:po,CheckValvePreview:mo,Compressor:Qo,CompressorPreview:Xo,CrossBeamAgitator:Uo,CrossBeamAgitatorPreview:Go,ElectricRegulator:Xr,ElectricRegulatorPreview:Jr,Filter:co,FilterPreview:ao,FlatBladeAgitator:Fo,FlatBladeAgitatorPreview:qo,FourWayValve:zr,FourWayValvePreview:Dr,HelicalAgitator:Wo,HelicalAgitatorPreview:Ko,Light:Oo,LightPreview:zo,ManualValve:ro,ManualValvePreview:oo,NeedleValve:uo,NeedleValvePreview:xo,OffPageReference:tl,OffPageReferencePreview:sl,Orifice:jo,OrificePreview:go,PaddleAgitator:Ho,PaddleAgitatorPreview:Yo,PistonPump:Mo,PistonPumpPreview:$o,PropellerAgitator:Io,PropellerAgitatorPreview:Zo,Pump:Zr,PumpPreview:Fr,Regulator:Kr,RegulatorPreview:Qr,ReliefValve:Gr,ReliefValvePreview:Wr,RotaryMixer:Bo,RotaryMixerPreview:Ao,SYMBOLS:px,ScrewPump:vo,ScrewPumpPreview:wo,Setpoint:lo,SetpointPreview:io,SolenoidValve:Ar,SolenoidValvePreview:Or,StaticMixer:No,StaticMixerPreview:_o,Switch:Ro,SwitchPreview:yo,Tank:qr,TankPreview:Hr,TextBox:Jo,TextBoxPreview:el,ThreeWayValve:$r,ThreeWayValvePreview:Nr,VacuumPump:Po,VacuumPumpPreview:ko,Value:Eo,ValuePreview:So,Valve:_r,ValvePreview:Br,typeZ:yu},Symbol.toStringTag,{value:"Module"}));exports.Aether=c.main;exports.Dialog=c.use$4;exports.Divider=c.Divider$1;exports.Dropdown=c.Dropdown;exports.Haul=c.Haul;exports.Worker=c.Context$1;exports.compareArrayDeps=c.compareArrayDeps;exports.componentRenderProp=c.componentRenderProp;exports.isRenderProp=c.isRenderProp;exports.useAsyncEffect=c.useAsyncEffect;exports.useClickOutside=c.useClickOutside;exports.useCombinedRefs=c.useCombinedRefs;exports.useCombinedStateAndRef=c.useCombinedStateAndRef;exports.useDebouncedCallback=c.useDebouncedCallback;exports.useEffectCompare=c.useEffectCompare;exports.useMemoCompare=c.useMemoCompare;exports.useMemoDeepEqualProps=c.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=c.useMemoPrimitiveArray;exports.usePrevious=c.usePrevious;exports.useResize=c.useResize;exports.useStateRef=c.useStateRef;exports.useSyncedRef=c.useSyncedRef;exports.useTransforms=c.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ke.external;exports.DataType=C.g;exports.Density=C.b;exports.MultiSeries=C.Ct;exports.Rate=C.P;exports.Series=C.V;exports.TimeRange=C.E;exports.TimeSpan=C.y;exports.TimeStamp=C.m;exports.state=C.state;exports.Generic=D.Generic;exports.Align=jl.external;exports.Icon=ne.Icon;exports.Tabs=ne.external;exports.Button=gl.external;exports.Caret=Cs.Animated$1;exports.telem=j.external;exports.Color=Bt.external;exports.Text=de.external;exports.Triggers=bs.external;exports.List=$e.external;exports.createFilterTransform=$e.createFilterTransform;exports.fuseFilter=$e.fuseFilter;exports.proxyMemo=$e.proxyMemo;exports.createHexOpacityVariants=vs.createHexOpacityVariants;exports.unitProperty=vs.unitProperty;exports.Input=me.external;exports.Menu=hl.external;exports.Theming=El.external;exports.Tree=Sl.external;exports.Video=Rl.Video;exports.Accordion=Vl;exports.Breadcrumb=Fl;exports.Canvas=oi;exports.Channel=Ji;exports.Control=ua;exports.Device=fc;exports.Diagram=Fa;exports.Eraser=Hc;exports.Form=mc;exports.Label=Cc;exports.Legend=ui;exports.Line=di;exports.LinePlot=Di;exports.Log=Ha;exports.Measure=Fi;exports.Modal=vc;exports.Mosaic=Zc;exports.Nav=Gc;exports.Note=Kc;exports.OS=ta;exports.Observe=dc;exports.Override=na;exports.Pluto=ma;exports.Portal=_c;exports.Progress=ga;exports.Range=Ii;exports.Ranger=Ca;exports.Resize=$l;exports.Rule=qi;exports.Schematic=mx;exports.Select=Pi;exports.Status=bl;exports.Steps=va;exports.Synnax=Yl;exports.Tag=vi;exports.Telem=la;exports.Tooltip=vl;exports.Value=fu;exports.Viewport=zi;exports.axis=Gl;exports.control=Wl;
1
+ "use strict";var 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&&ee;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
+ * @license React
3
+ * use-sync-external-store-shim.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var 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
+ * @license React
11
+ * use-sync-external-store-shim.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var 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
+ * @license React
19
+ * use-sync-external-store-shim/with-selector.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var 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
+ * @license React
27
+ * use-sync-external-store-shim/with-selector.development.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var 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;